diff --git a/lib/OpenLayers/Format/WFST/v1_0_0.js b/lib/OpenLayers/Format/WFST/v1_0_0.js index dfb40c3107..a4b1bf3d0d 100644 --- a/lib/OpenLayers/Format/WFST/v1_0_0.js +++ b/lib/OpenLayers/Format/WFST/v1_0_0.js @@ -20,6 +20,14 @@ OpenLayers.Format.WFST.v1_0_0 = OpenLayers.Class( * {String} WFS version number. */ version: "1.0.0", + + /** + * APIProperty: srsNameInQuery + * {Boolean} If true the reference system is passed in Query requests + * via the "srsName" attribute to the "wfs:Query" element, this + * property defaults to false as it isn't WFS 1.0.0 compliant. + */ + srsNameInQuery: false, /** * Property: schemaLocations @@ -97,7 +105,8 @@ OpenLayers.Format.WFST.v1_0_0 = OpenLayers.Class( featureNS: this.featureNS, featurePrefix: this.featurePrefix, featureType: this.featureType, - srsName: this.srsName + srsName: this.srsName, + srsNameInQuery: this.srsNameInQuery }, options); var node = this.createElementNSPlus("wfs:Query", { attributes: { @@ -105,6 +114,9 @@ OpenLayers.Format.WFST.v1_0_0 = OpenLayers.Class( options.featureType } }); + if(options.srsNameInQuery && options.srsName) { + node.setAttribute("srsName", options.srsName); + } if(options.featureNS) { node.setAttribute("xmlns:" + options.featurePrefix, options.featureNS); } diff --git a/tests/Format/WFST/v1_0_0.html b/tests/Format/WFST/v1_0_0.html index a3f176e77a..6f807fd93f 100644 --- a/tests/Format/WFST/v1_0_0.html +++ b/tests/Format/WFST/v1_0_0.html @@ -41,6 +41,13 @@ value: new OpenLayers.Bounds (1,2,3,4) }) } + }, { + id: "query1", + writer: "wfs:Query", + arg: { + srsNameInQuery: true, + srsName: "EPSG:900913" + } }, { id: "getfeature0", writer: "wfs:GetFeature", @@ -94,6 +101,10 @@ --> +