terra-draw
terra-draw copied to clipboard
[Feature Request] Mode change event
Is your feature request related to a problem? Please describe. I have a generic, reusable MapLibre component that provides a plugin API. It also integrates draw functionality, which exposes the draw library (currently Mapbox Draw, soon to be Terra Draw) via that API. The main component needs to know when the draw mode changes, so as to highlight the button for the current mode. In addition to those buttons, any plugin can also change the mode directly, so it would be ideal to have an event that is published when the mode changes.
Describe your proposed idea for the solution to this problem A simple mode change event that can be subscribed to via the on() function.
Describe alternatives you've considered I'm currently monkey-patching the setMode() function to be able to monitor for mode changes. This is not ideal.