Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

event still called after control is removed from map #44

Open
puggimer opened this issue Dec 28, 2018 · 0 comments
Open

event still called after control is removed from map #44

puggimer opened this issue Dec 28, 2018 · 0 comments

Comments

@puggimer
Copy link

When the layer is removed, it still has an event listener on the map (for 'zoomend' ). If this is triggered, it causes an exception because it is no attached to a map so values it depends on are null.

Simple fix - turn off the 'zoomend' event in the onRemove function (the onRemove should turn off all the events that onAdd turns on)

.off('zoomend', this._onZoomEnd, this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant