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

Edit interactions remain selected after programatically disabling active state #183

Open
paul121 opened this issue Sep 27, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@paul121
Copy link
Member

paul121 commented Sep 27, 2022

Right now the edit controls are not fully responsive to the OL interaction's "active" state: https://openlayers.org/en/latest/apidoc/module-ol_interaction_Interaction-Interaction.html#getActive

To see this, open a map with edit controls, and click on a tool to start drawing a polygon. Set the drawInteraction to inactive, and see that the drawing control is deactivated, but remains selected:

window.farmOS.map.instances[0].edit.drawInteraction.setActive(false)

Right now you can deactivate any of the interactions by calling edit.disableAll():

disableAll() {

but I'm curious if our edit control could be refactored to use the Interactions concept of "active" state. The Interaction objects do seem to fire a change:active event that could be used to update state within our edit control: https://openlayers.org/en/latest/apidoc/module-ol_interaction_Interaction-Interaction.html

@symbioquine
Copy link
Collaborator

I agree we should probably honor changes to the interactions' active properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants