From 4c33f16c3c2f0317afbea94a4399843a785f9e01 Mon Sep 17 00:00:00 2001 From: Just van den Broecke Date: Tue, 17 Jun 2014 18:52:18 +0200 Subject: [PATCH] issue #216 - provide featuretype Namespace param for WFS DescribeFeatureType GET --- src/script/widgets/VectorStylesDialog.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/script/widgets/VectorStylesDialog.js b/src/script/widgets/VectorStylesDialog.js index 104364b9..121023c2 100644 --- a/src/script/widgets/VectorStylesDialog.js +++ b/src/script/widgets/VectorStylesDialog.js @@ -385,20 +385,29 @@ gxp.VectorStylesDialog = Ext.extend(gxp.StylesDialog, { this.wfsLayer.owsURL = layer.protocol.url.replace('?', ''); this.wfsLayer.owsType = 'WFS'; this.wfsLayer.typeName = layer.protocol.featureType; + this.wfsLayer.featureNS = layer.protocol.featureNS; } // Attribute types: either from WFS or local features var self = this; if (this.wfsLayer) { + var baseParams = { + "SERVICE": "WFS", + "VERSION": "1.1.0", + "REQUEST": "DescribeFeatureType", + "TYPENAME": this.wfsLayer.typeName + }; + + // NS for feature type available use it: we cannot rely on default NSs + if (this.wfsLayer.featureNS) { + baseParams["TYPENAME"] = "ns1:" + this.wfsLayer.typeName; + baseParams["NAMESPACE"] = "xmlns(ns1=" + this.wfsLayer.featureNS + ")"; + } + // WFS Layer: use DescribeFeatureType to get attribute-names/types this.attributeStore = new GeoExt.data.AttributeStore({ url: this.wfsLayer.owsURL, - baseParams: { - "SERVICE": "WFS", - "VERSION": "1.1.0", - "REQUEST": "DescribeFeatureType", - "TYPENAME": this.wfsLayer.typeName - }, + baseParams: baseParams, // method: "GET", // disableCaching: false, autoLoad: true,