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

mouseDown event never unregistered causes javascript errors #170

Open
kragoth opened this issue Sep 9, 2020 · 0 comments
Open

mouseDown event never unregistered causes javascript errors #170

kragoth opened this issue Sep 9, 2020 · 0 comments

Comments

@kragoth
Copy link

kragoth commented Sep 9, 2020

In FreeDraw.js line 302 we have:
map.on('mousedown touchstart', mouseDown);

This event handler is never cleaned up and there is no way for a user of this library to clean it up without removing all mousedown events.
The onRemove(map) function should be removing the mousedown event handler so that if the layer is removed from the map it does not result in errors.

This is important when designing an app where draw can be toggled on or off.

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