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.
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.