Removing the simpleFilterSerializer method on OpenLayers.Protocol in favor of a format for serializing filters for use with query strings. r=sbrunner (closes #3163)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11758 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -90,6 +90,17 @@ OpenLayers.Protocol.Script = OpenLayers.Class(OpenLayers.Protocol, {
|
||||
*/
|
||||
pendingRequests: null,
|
||||
|
||||
/**
|
||||
* APIProperty: srsInBBOX
|
||||
* {Boolean} Include the SRS identifier in BBOX query string parameter.
|
||||
* Setting this property has no effect if a custom filterToParams method
|
||||
* is provided. 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.Script
|
||||
* A class for giving layers generic Script protocol.
|
||||
@@ -113,10 +124,13 @@ OpenLayers.Protocol.Script = OpenLayers.Class(OpenLayers.Protocol, {
|
||||
this.format = new OpenLayers.Format.GeoJSON();
|
||||
}
|
||||
|
||||
if (!this.filterToParams && OpenLayers.Protocol.simpleFilterSerializer) {
|
||||
this.filterToParams = OpenLayers.Function.bind(
|
||||
OpenLayers.Protocol.simpleFilterSerializer, this
|
||||
);
|
||||
if (!this.filterToParams && OpenLayers.Format.QueryStringFilter) {
|
||||
var format = new OpenLayers.Format.QueryStringFilter({
|
||||
srsInBBOX: this.srsInBBOX
|
||||
});
|
||||
this.filterToParams = function(filter, params) {
|
||||
return format.write(filter, params);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user