Remove events in the latest leaflet build #112

merged 3 commits into from Apr 3, 2013


None yet
2 participants

koppelbakje commented Mar 25, 2013

Since Leaflet/Leaflet@a1acaff there are two more conditions added in the last if-statement removeEventListener function. When the contextId is undefined the events won't be removed. It should be solved by passing the marker its context to the off calls in the removeHooks.

removeHooks: function () {;

        if (this._map) {
            if (this._marker) {
      'click', this._onClick, this);
                    .off('click', this._onClick, this)
                delete this._marker;

  'click', this._onClick, this);
            delete this._mouseMarker;

  'mousemove', this._onMouseMove, this);

EDIT: besides Draw.Marker the similar problem also existed in Draw.PolyLine, EditToolbar.Delete and EditToolbar.Edit

This comment has been minimized.

Show comment Hide comment

jacobtoye Apr 3, 2013


Nice, thanks!


jacobtoye commented Apr 3, 2013

Nice, thanks!

jacobtoye added a commit that referenced this pull request Apr 3, 2013

Merge pull request #112 from koppelbakje/upstream/master
Remove events in the latest leaflet build

@jacobtoye jacobtoye merged commit a39cdfb into Leaflet:master Apr 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment