-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add "Map#isMoving" method #2792
Comments
I think this is a solid alternate solution for #2471 |
👍 I think this would be useful for expensive operations that need to happen regularly ("keep doing this, unless the map is moving"). However, it shouldn't replace #2471 altogether. For occasional operations, it's easier to reason about what's going on via event callbacks (moveend, dataend, renderstable, etc), rather than constantly checking the map state before executing something. |
There is currently issues with Mapbox GL JS Draw in regards to adding/removing draw in a controlled fashion (mapbox/mapbox-gl-draw#572). This is in part related to that adding Draw currently depends on Even though this is more a concern for the Draw project rather than Mapbox GL JS I wonder if I guess my question boils down to: What is the earliest state the map can reach when it is reasonable to add/remove controls/sources/layers and is it possible to query for this state? |
This state is when |
@lucaswoj Currently If I understand this ticket correctly
|
Good point. This is a real hole in our API.
Not exactly.
Yes. If this isn't already allowed, we should allow it.
Yes. |
This was done in #3941 |
It is useful to know whether the map is currently moving (i.e. because of a
flyTo
call). This method would sit alongsideMap#loaded
(to be renamed toMap#isTilesLoaded
?) as a guard against expensive operations during times of rapid map changecc @peterqliu
The text was updated successfully, but these errors were encountered: