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

MapDataEvent#isSourceLoaded always returns false #3958

Closed
mollymerp opened this issue Jan 12, 2017 · 3 comments · Fixed by #4254
Closed

MapDataEvent#isSourceLoaded always returns false #3958

mollymerp opened this issue Jan 12, 2017 · 3 comments · Fixed by #4254
Assignees
Labels

Comments

@mollymerp
Copy link
Contributor

Could this be because the data event (which triggers the sourcedata event) is fired immediately before the source.load event changes SourceCache._sourceLoaded to true ?

I thought that was the case, but a quick gut check to switch the function calls didn't change the result. But still it might need to be addressed after we figure out 👇 .

I think the root cause is that isSourceLoaded is set right when addSource is called via setEventedParent so sourceCache.loaded() is invoked only once, not every time the event fires like I believe was the intended behavior ??

@lucaswoj
Copy link
Contributor

I think the root cause is that isSourceLoaded is set right when addSource is called via setEventedParent so sourceCache.loaded() is invoked only once, not every time the event fires like I believe was the intended behavior ??

I agree with this diagnosis. Nice 🕵️‍♀️ work.

@risharde
Copy link

risharde commented May 5, 2021

I am having this issue with tilesets where data event never reports the layer as isSourceLoaded = true; Any advice on how I can achieve detecting when a tileset layer is fully loaded? I've spent days trying to find a solution and none work.

@caesarsol
Copy link

@risharde I have the same problem, did you find any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants