Leaflet.draw icon indicating copy to clipboard operation
Leaflet.draw copied to clipboard

Fix marker dragging disabling when marker is removed beforehand

Open mlazowik opened this issue 5 years ago • 1 comments

Caused by Leaflet/Leaflet#5295

mlazowik avatar Oct 24 '18 12:10 mlazowik

Same error caused by Leaflet/Leaflet#5295

When disabling the layer in Control.layer when Edition enabled, causes error due to code removeHooks in Leaflet.draw/Edit.Marker.js

// @method removeHooks(): void
	// Remove listener hooks from this handler
	removeHooks: function () {
		var marker = this._marker;

		marker.dragging.disable();
		marker.off('dragend', this._onDragEnd, marker);
		this._toggleMarkerHighlight();
	},

marker.dragging is inexistant here

[ same with AddHooks when Control Layer is disabled ]

mho22 avatar May 28 '20 19:05 mho22