Skip to content

Commit

Permalink
Remove temp layers from the map
Browse files Browse the repository at this point in the history
  • Loading branch information
Falke-Design committed Nov 23, 2024
1 parent d7ea514 commit 16a466e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/js/Edit/L.PM.Edit.CircleMarker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -158,6 +158,7 @@ Edit.CircleMarker = Edit.extend({

// cleanup old ones first
if (this._helperLayers) {
this._helperLayers.removeFrom(map);
this._helperLayers.clearLayers();
}

Expand Down
1 change: 1 addition & 0 deletions src/js/Edit/L.PM.Edit.Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Edit.Line = Edit.extend({

// cleanup old ones first
if (this._markerGroup) {
this._markerGroup.removeFrom(map);
this._markerGroup.clearLayers();
}

Expand Down

0 comments on commit 16a466e

Please sign in to comment.