Unregister for feature events when removing features

This commit is contained in:
Tim Schaub
2013-11-11 16:16:30 -07:00
parent 382b2707df
commit 61741669f6

View File

@@ -441,6 +441,10 @@ ol.layer.Vector.prototype.removeFeatures = function(features) {
if (!goog.isNull(geometry)) {
ol.extent.extend(extent, geometry.getBounds());
}
goog.events.unlisten(feature, ol.FeatureEventType.CHANGE,
this.handleFeatureChange_, false, this);
goog.events.unlisten(feature, ol.FeatureEventType.INTENTCHANGE,
this.handleIntentChange_, false, this);
}
this.dispatchEvent(new ol.layer.VectorEvent(ol.layer.VectorEventType.REMOVE,
features, [extent]));