the WFS 1.0 standard does not support specifying the SRS name (srsName) in GetFeature requests, but GeoServer has specific support for this, this patch introduces a boolean option (add srsNameInQuery) to force the addition of srsName, initial patch from fvanderbiest, r=bartvde (closes #2228)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9838 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -20,6 +20,14 @@ OpenLayers.Format.WFST.v1_0_0 = OpenLayers.Class(
|
|||||||
* {String} WFS version number.
|
* {String} WFS version number.
|
||||||
*/
|
*/
|
||||||
version: "1.0.0",
|
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
|
* Property: schemaLocations
|
||||||
@@ -97,7 +105,8 @@ OpenLayers.Format.WFST.v1_0_0 = OpenLayers.Class(
|
|||||||
featureNS: this.featureNS,
|
featureNS: this.featureNS,
|
||||||
featurePrefix: this.featurePrefix,
|
featurePrefix: this.featurePrefix,
|
||||||
featureType: this.featureType,
|
featureType: this.featureType,
|
||||||
srsName: this.srsName
|
srsName: this.srsName,
|
||||||
|
srsNameInQuery: this.srsNameInQuery
|
||||||
}, options);
|
}, options);
|
||||||
var node = this.createElementNSPlus("wfs:Query", {
|
var node = this.createElementNSPlus("wfs:Query", {
|
||||||
attributes: {
|
attributes: {
|
||||||
@@ -105,6 +114,9 @@ OpenLayers.Format.WFST.v1_0_0 = OpenLayers.Class(
|
|||||||
options.featureType
|
options.featureType
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if(options.srsNameInQuery && options.srsName) {
|
||||||
|
node.setAttribute("srsName", options.srsName);
|
||||||
|
}
|
||||||
if(options.featureNS) {
|
if(options.featureNS) {
|
||||||
node.setAttribute("xmlns:" + options.featurePrefix, options.featureNS);
|
node.setAttribute("xmlns:" + options.featurePrefix, options.featureNS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,13 @@
|
|||||||
value: new OpenLayers.Bounds (1,2,3,4)
|
value: new OpenLayers.Bounds (1,2,3,4)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
id: "query1",
|
||||||
|
writer: "wfs:Query",
|
||||||
|
arg: {
|
||||||
|
srsNameInQuery: true,
|
||||||
|
srsName: "EPSG:900913"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
id: "getfeature0",
|
id: "getfeature0",
|
||||||
writer: "wfs:GetFeature",
|
writer: "wfs:GetFeature",
|
||||||
@@ -94,6 +101,10 @@
|
|||||||
</ogc:Filter>
|
</ogc:Filter>
|
||||||
</wfs:Query>
|
</wfs:Query>
|
||||||
--></div>
|
--></div>
|
||||||
|
<div id="query1"><!--
|
||||||
|
<wfs:Query xmlns:wfs="http://www.opengis.net/wfs" typeName="topp:states" srsName="EPSG:900913" xmlns:topp="http://www.openplans.org/topp">
|
||||||
|
</wfs:Query>
|
||||||
|
--></div>
|
||||||
<div id="getfeature0"><!--
|
<div id="getfeature0"><!--
|
||||||
<wfs:GetFeature service="WFS" version="1.0.0" xmlns:topp="http://www.openplans.org/topp"
|
<wfs:GetFeature service="WFS" version="1.0.0" xmlns:topp="http://www.openplans.org/topp"
|
||||||
xmlns:wfs="http://www.opengis.net/wfs"
|
xmlns:wfs="http://www.opengis.net/wfs"
|
||||||
|
|||||||
Reference in New Issue
Block a user