Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Mode change event #434

Open
neodescis opened this issue Jan 21, 2025 · 0 comments
Open

[Feature Request] Mode change event #434

neodescis opened this issue Jan 21, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@neodescis
Copy link

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.

@neodescis neodescis added the enhancement New feature or request label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant