making Protocol.WFS work with just featureType and featurePrefix configured. r=bartvde (closes #3368)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@12129 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2011-06-29 09:53:37 +00:00
parent 058008864e
commit eb7cc04254
12 changed files with 148 additions and 12 deletions

View File

@@ -148,15 +148,16 @@ OpenLayers.Format.WFST.v1_1_0 = OpenLayers.Class(
featureType: this.featureType,
srsName: this.srsName
}, options);
var prefix = options.featurePrefix;
var node = this.createElementNSPlus("wfs:Query", {
attributes: {
typeName: (options.featureNS ? options.featurePrefix + ":" : "") +
typeName: (prefix ? prefix + ":" : "") +
options.featureType,
srsName: options.srsName
}
});
if(options.featureNS) {
node.setAttribute("xmlns:" + options.featurePrefix, options.featureNS);
node.setAttribute("xmlns:" + prefix, options.featureNS);
}
if(options.propertyNames) {
for(var i=0,len = options.propertyNames.length; i<len; i++) {