How do you use the .off() event method in leaflet.js? How do you use the .off() event method in leaflet.js? javascript javascript

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);