when using BBOX or Fixed strategies, pass on the filter used in the request to the loadstart event. This is mostly important in the case of BBOX, since there is no other way to get the filter used in the request. An example use case is doing a hitCount request using the same filter to find out the true number of features matched on the server-side

This commit is contained in:
Bart van den Eijnden
2012-11-07 11:43:18 +01:00
parent c420fc6aad
commit a4df9a871b
5 changed files with 17 additions and 6 deletions

View File

@@ -217,10 +217,11 @@ OpenLayers.Strategy.BBOX = OpenLayers.Class(OpenLayers.Strategy, {
this.layer.protocol.abort(this.response);
this.layer.events.triggerEvent("loadend");
}
this.layer.events.triggerEvent("loadstart");
var filter = this.createFilter();
this.layer.events.triggerEvent("loadstart", {filter: filter});
this.response = this.layer.protocol.read(
OpenLayers.Util.applyDefaults({
filter: this.createFilter(),
filter: filter,
callback: this.merge,
scope: this
}, options));