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

Destroy Map? #360

Open
DaveZMB opened this issue Mar 3, 2021 · 0 comments
Open

Destroy Map? #360

DaveZMB opened this issue Mar 3, 2021 · 0 comments

Comments

@DaveZMB
Copy link

DaveZMB commented Mar 3, 2021

Issue #12 asked for the ability to destroy a map dynamically and was marked "won't fix".

But your map creates a jQuery(window).resize event listener every time the map is switched and it can't be removed without removing all query resize event listeners. https://github.com/10bestdesign/jqvmap/blob/master/src/JQVMap.js#L31

I'm using your map (thank you!) to allow users to switch between maps by clicking on some buttons on my page, and things start to slow down to a crawl after switching the map a few times.

As far as I can tell that resize event listener is the only thing that isn't getting properly destroyed when you replace the map container so it'd be really nice to either make that anonymous function call a named function so we can stop it or to have an actual destroy function that just cleans everything up.

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