-
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 "renderstable" event #2471
Add "renderstable" event #2471
Conversation
|
@mourner Sorry about that! Fixed now. |
For the |
I have modified my approach, adding a single new event:
|
Last time we discussed this, the consensus was that this event should be called |
Hmm, actually, I think I might be misremembering our conversation. |
Next Stems
|
Yeah, so I'm reversing my earlier proposal of having "render" in the event name somewhere. Two reasons:
I'm not sure "iff With map.on('dataend', renderSidebar);
map.on('moveend', function () {
if (map.isFullyLoaded()) {
renderSidebar();
}
}); What else can cause |
A thought on naming: conceptually, this could be considered a family of three events:
We don't necessarily have to have symmetry in the three names, but it would be nice if that fell out naturally. |
Do these events correlate with my proposal of |
I am closing this PR because it has been inactive for a long time. The branch isn't going anywhere so please keep working on this feature and re-open the PR when it is ready! Let me know if you have any questions. |
Any updates on this feature? I need to upload a map with HTTPS and I need to know when to actually start my data upload. |
This pull request isn't quite ready. I am publishing now to get some 👀 on the proposal and implementation.
Mapbox GL JS downloads many resources (glyphs, sprites, tiles, and styles) over the network. Giving our developers the right primitives to understand the state of these resources and respond to changes in that state is a hard problem.
To that end, this PR adds the
data
anddataend
events:data
event a resource has been loaded, changed, or removed.dataend
event all resources for the current viewport have been loaded. Fired at most once per frame.This PR also renames
Map#loaded
toisDataStable
, to disambiguate the concept of "data stable" (all resources for the current viewport have been loaded) from "loaded" (all resources for the FIRST viewport have been loaded).We could do more to simplify the existing events infrastructure. Once this pull request is merged, we should consider deprecating some granular
*.add
,*.remove
,*.load
, and*.change
events.fixes #1715
cc @ansis @jfirebaugh @mourner @tmcw @scothis