From 85ddded15c8878743941fa87e783a5954fd91f33 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 3 Aug 2015 22:44:22 -0600 Subject: [PATCH] Only remove the vertex feature if it exists When deleting a vertex shared by multiple features, we iterate through drag segments and only need to remove the vertex feature once. --- src/ol/interaction/modifyinteraction.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ol/interaction/modifyinteraction.js b/src/ol/interaction/modifyinteraction.js index 91009a09a3..d030c4874f 100644 --- a/src/ol/interaction/modifyinteraction.js +++ b/src/ol/interaction/modifyinteraction.js @@ -888,8 +888,10 @@ ol.interaction.Modify.prototype.removeVertex_ = function() { newSegmentData); this.updateSegmentIndices_(geometry, index, segmentData.depth, -1); - this.overlay_.getSource().removeFeature(this.vertexFeature_); - this.vertexFeature_ = null; + if (!goog.isNull(this.vertexFeature_)) { + this.overlay_.getSource().removeFeature(this.vertexFeature_); + this.vertexFeature_ = null; + } } } }