aratcliffe / Leaflet.contextmenu

A context menu for Leaflet.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove DOM nodes and DOM event listeners on map "unload" event.

kulmegil opened this issue · comments

We have many maps in our app. Every time user selects new entire Leaflet map is rebuild.
It has been reported that if contextmenu is visible when user switches map it'll be visible on new map instance. While this was clearly our bug since we weren't clearing up DOM from map container, still....

Wouldn't it be proper if plugin cleans up it's own event listeners (especially DOM listeners) and remove DOM nodes when map is destroyed (unload event)?