Skip to content

Commit 4c33f16

Browse files
committed
issue planetfederal#216 - provide featuretype Namespace param for WFS DescribeFeatureType GET
1 parent 9b3954e commit 4c33f16

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

src/script/widgets/VectorStylesDialog.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,20 +385,29 @@ gxp.VectorStylesDialog = Ext.extend(gxp.StylesDialog, {
385385
this.wfsLayer.owsURL = layer.protocol.url.replace('?', '');
386386
this.wfsLayer.owsType = 'WFS';
387387
this.wfsLayer.typeName = layer.protocol.featureType;
388+
this.wfsLayer.featureNS = layer.protocol.featureNS;
388389
}
389390

390391
// Attribute types: either from WFS or local features
391392
var self = this;
392393
if (this.wfsLayer) {
394+
var baseParams = {
395+
"SERVICE": "WFS",
396+
"VERSION": "1.1.0",
397+
"REQUEST": "DescribeFeatureType",
398+
"TYPENAME": this.wfsLayer.typeName
399+
};
400+
401+
// NS for feature type available use it: we cannot rely on default NSs
402+
if (this.wfsLayer.featureNS) {
403+
baseParams["TYPENAME"] = "ns1:" + this.wfsLayer.typeName;
404+
baseParams["NAMESPACE"] = "xmlns(ns1=" + this.wfsLayer.featureNS + ")";
405+
}
406+
393407
// WFS Layer: use DescribeFeatureType to get attribute-names/types
394408
this.attributeStore = new GeoExt.data.AttributeStore({
395409
url: this.wfsLayer.owsURL,
396-
baseParams: {
397-
"SERVICE": "WFS",
398-
"VERSION": "1.1.0",
399-
"REQUEST": "DescribeFeatureType",
400-
"TYPENAME": this.wfsLayer.typeName
401-
},
410+
baseParams: baseParams,
402411
// method: "GET",
403412
// disableCaching: false,
404413
autoLoad: true,

0 commit comments

Comments
 (0)