How do you use the .off() event method in leaflet.js?
You need to pass the function to on
and off
by reference:
function doStuff() { ... }map.on('click', doStuff);...map.off('click', doStuff);
You need to pass the function to on
and off
by reference:
function doStuff() { ... }map.on('click', doStuff);...map.off('click', doStuff);