Skip to content

Commit 87f852c

Browse files
committed
use addeventlistener for mapml event instead of .on() for leaflet event
1 parent 3b77141 commit 87f852c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/mapml/handlers/AnnounceMovement.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ export var AnnounceMovement = L.Handler.extend({
55
layerremove: this.totalBounds
66
});
77

8-
this._map.on('map-moveend', this.announceBounds);
8+
this._map.options.mapEl.addEventListener(
9+
'map-moveend',
10+
this.announceBounds
11+
);
912
this._map.dragging._draggable.addEventListener('dragstart', this.dragged);
1013
this._map.options.mapEl.addEventListener(
1114
'mapfocused',
@@ -18,7 +21,10 @@ export var AnnounceMovement = L.Handler.extend({
1821
layerremove: this.totalBounds
1922
});
2023

21-
this._map.off('map-moveend', this.announceBounds);
24+
this._map.options.mapEl.removeEventListener(
25+
'map-moveend',
26+
this.announceBounds
27+
);
2228
this._map.dragging._draggable.removeEventListener(
2329
'dragstart',
2430
this.dragged

0 commit comments

Comments
 (0)