Codebase list leaflet / 1e2e1c8
fix(Map): rm moveend listener from setMaxBounds (#6958) Calling `map.setMapBounds`, adds the `"moveend"` event listener `_panInsideMaxBounds`. Previously, this did not get cleaned up via `remove`. Simon Legner authored 4 years ago Vladimir Agafonkin committed 4 years ago
2 changed file(s) with 2 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
7171
7272 it("does not throw if removed during animation", function () {
7373 var container = document.createElement('div'),
74 map = new L.Map(container).setView([0, 0], 1);
74 map = new L.Map(container).setView([0, 0], 1).setMaxBounds([[0, 1], [2, 3]]);
7575
7676 // Force creation of animation proxy,
7777 // otherwise browser checks disable it
751751 remove: function () {
752752
753753 this._initEvents(true);
754 this.off('moveend', this._panInsideMaxBounds);
754755
755756 if (this._containerId !== this._container._leaflet_id) {
756757 throw new Error('Map container is being reused by another instance');