Making it so the setFilter method on the filter strategy allows notification to listeners of feature add/remove events. p=vog,me r=me (closes #3216)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11804 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2011-03-30 20:19:24 +00:00
parent b14822c569
commit 5fc138f69b
2 changed files with 37 additions and 16 deletions

View File

@@ -138,17 +138,19 @@ OpenLayers.Strategy.Filter = OpenLayers.Class(OpenLayers.Strategy, {
// cache now contains features to remove from layer
if (this.cache.length > 0) {
this.caching = true;
this.layer.removeFeatures(this.cache.slice(), {silent: true});
this.layer.removeFeatures(this.cache.slice());
this.caching = false;
}
// now look through previous cache for features to add to layer
if (previousCache.length > 0) {
var event = {features: previousCache};
this.handleAdd(event);
// event has features to add to layer
this.caching = true;
this.layer.addFeatures(event.features, {silent: true});
this.caching = false;
if (event.features.length > 0) {
// event has features to add to layer
this.caching = true;
this.layer.addFeatures(event.features);
this.caching = false;
}
}
},