From ae3ab95b566e2e7e3085bee9dc474f5182d39233 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Wed, 4 Dec 2013 14:59:18 +0100 Subject: [PATCH] Factor out ol.source.Vector#removeFeatureInternal_ --- src/ol/source/vectorsource.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ol/source/vectorsource.js b/src/ol/source/vectorsource.js index 4d306c1065..0503486648 100644 --- a/src/ol/source/vectorsource.js +++ b/src/ol/source/vectorsource.js @@ -179,13 +179,22 @@ ol.source.Vector.prototype.isEmpty = function() { */ ol.source.Vector.prototype.removeFeature = function(feature) { this.rBush_.remove(feature); + this.removeFeatureInternal_(feature); + this.dispatchChangeEvent(); +}; + + +/** + * @param {ol.Feature} feature Feature. + * @private + */ +ol.source.Vector.prototype.removeFeatureInternal_ = function(feature) { var featureKey = goog.getUid(feature) + ''; goog.asserts.assert(featureKey in this.featureChangeKeys_); goog.events.unlistenByKey(this.featureChangeKeys_[featureKey]); delete this.featureChangeKeys_[featureKey]; this.dispatchEvent(new ol.source.VectorEvent( ol.source.VectorEventType.REMOVEFEATURE, feature)); - this.dispatchChangeEvent(); };