Skip to content

mouseDown event never unregistered causes javascript errors #170

@kragoth

Description

@kragoth

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions