Force remove vertexFeature when there’s no features left in FeaturesOverlay

This commit is contained in:
Antoine Abt
2014-02-03 15:58:24 +01:00
parent fb637aedca
commit 933ef64db1

View File

@@ -292,6 +292,13 @@ ol.interaction.Modify.prototype.removeFeature_ = function(evt) {
for (i = nodesToRemove.length - 1; i >= 0; --i) {
rBush.remove(nodesToRemove[i]);
}
// There remains only vertexFeature…
if (!goog.isNull(this.vertexFeature_) &&
this.overlay_.getFeatures().getLength() === 1 &&
this.overlay_.getFeatures().getAt(0) == this.vertexFeature_) {
this.overlay_.removeFeature(this.vertexFeature_);
this.vertexFeature_ = null;
}
};