Skip to content

Commit

Permalink
Merge pull request Leaflet#806 from chrisbrainerd/mouse-marker-error-fix
Browse files Browse the repository at this point in the history
Mouse marker error fix
  • Loading branch information
ddproxy authored Jan 20, 2018
2 parents d7bb075 + 840e0b6 commit 1f34452
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/draw/handler/Draw.Marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ L.Draw.Marker = L.Draw.Feature.extend({
L.Draw.Feature.prototype.removeHooks.call(this);

if (this._map) {
this._map
.off('click', this._onClick, this)
.off('click', this._onTouch, this)
if (this._marker) {
this._marker.off('click', this._onClick, this);
this._map
.off('click', this._onClick, this)
.off('click', this._onTouch, this)
.removeLayer(this._marker);
delete this._marker;
}
Expand Down

0 comments on commit 1f34452

Please sign in to comment.