Optionally include SRS id in serialized BBOX by constructing a HTTP protocol with srsInBBOX true. r=elemoine (closes #3006).

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11015 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2011-01-06 21:39:14 +00:00
parent 6ccbdf330c
commit 8dd58e484a
2 changed files with 36 additions and 10 deletions

View File

@@ -79,6 +79,15 @@ OpenLayers.Protocol.HTTP = OpenLayers.Class(OpenLayers.Protocol, {
*/
wildcarded: false,
/**
* APIProperty: srsInBBOX
* {Boolean} Include the SRS identifier in BBOX query string parameter.
* Default is false. If true and the layer has a projection object set,
* any BBOX filter will be serialized with a fifth item identifying the
* projection. E.g. bbox=-1000,-1000,1000,1000,EPSG:900913
*/
srsInBBOX: false,
/**
* Constructor: OpenLayers.Protocol.HTTP
* A class for giving layers generic HTTP protocol.
@@ -200,6 +209,9 @@ OpenLayers.Protocol.HTTP = OpenLayers.Class(OpenLayers.Protocol, {
switch(filter.type) {
case OpenLayers.Filter.Spatial.BBOX:
params.bbox = filter.value.toArray();
if (this.srsInBBOX && filter.projection) {
params.bbox.push(filter.projection.getCode());
}
break;
case OpenLayers.Filter.Spatial.DWITHIN:
params.tolerance = filter.distance;