-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Provide a setter and getter method for map.interactive #5232
Comments
Thanks @indus, I agree that it makes sense to have a getter/setter for this option. |
Sounds like #4029 will take care of it. |
#4029 is still open as of today, is there a way to dynamically disable/enable all interactivity on the map? |
@bruno-vaz I ended up creating an absolutely positioned div with a higher z-index on the map. If I wanted to disable interactivity, I'd just show the element. I connected it to an overloaded property on the map instance that when toggled (bit flag variable), it would use a defined setter to set the aforementioned element's visibility. |
Motivation
At the moment the property "interactive" of map can only be set at the beginning and you can't turn it on and of during the lifetime of the map instance. I want to disable map interactivity during "flyto" activity to be sure that the map is at the correct spot at the "moveend" event. Userinterction during the flight would stop the animation and result in a "moveend" at a different location.
Design Alternatives
"Do nothing" is an option because it is possible to disable all Interaction-Handlers on "movestart" and re-enable them on "moveend" (but it is cumbersome to do, especially if you have to keep track of what was turned on before to come to the same setting afterwards). Could look like:
Design
Provide a method "setInteractivity(true/false)" (and a corresponding getter-method as well) to toggle the interactivity of the map. This value would be used to override the enabled/disabled state of all the handlers without changing it.
Mock-Up
for my case:
Concepts
other Map-Options have getter and setter methods as well
Implementation
All InteractionHandlers check for the global interactivity property on their corresponding map and drop events if it is set to false
The text was updated successfully, but these errors were encountered: