diff --git a/src/js/Edit/L.PM.Edit.CircleMarker.js b/src/js/Edit/L.PM.Edit.CircleMarker.js index 24a94074..fdb323bf 100644 --- a/src/js/Edit/L.PM.Edit.CircleMarker.js +++ b/src/js/Edit/L.PM.Edit.CircleMarker.js @@ -82,11 +82,11 @@ Edit.CircleMarker = Edit.extend({ if (this.layerDragEnabled()) { this.disableLayerDrag(); } - + if (this._helperLayers) { + this._helperLayers.clearLayers(); + this._helperLayers.removeFrom(this._map); + } if (this.options[this._editableOption]) { - if (this._helperLayers) { - this._helperLayers.clearLayers(); - } this._map.off('move', this._syncMarkers, this); this._outerMarker.off('drag', this._handleOuterMarkerSnapping, this); } else { @@ -158,6 +158,7 @@ Edit.CircleMarker = Edit.extend({ // cleanup old ones first if (this._helperLayers) { + this._helperLayers.removeFrom(map); this._helperLayers.clearLayers(); } diff --git a/src/js/Edit/L.PM.Edit.Line.js b/src/js/Edit/L.PM.Edit.Line.js index ae72ed2e..c549f05e 100644 --- a/src/js/Edit/L.PM.Edit.Line.js +++ b/src/js/Edit/L.PM.Edit.Line.js @@ -136,6 +136,7 @@ Edit.Line = Edit.extend({ // cleanup old ones first if (this._markerGroup) { + this._markerGroup.removeFrom(map); this._markerGroup.clearLayers(); }