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

"Map#is*Loaded" methods #3691

Closed
lucaswoj opened this issue Nov 23, 2016 · 4 comments · Fixed by #4321
Closed

"Map#is*Loaded" methods #3691

lucaswoj opened this issue Nov 23, 2016 · 4 comments · Fixed by #4321

Comments

@lucaswoj
Copy link
Contributor

lucaswoj commented Nov 23, 2016

There is a need for a public API that determines whether or not a source is loaded in throttling calls to GeoJSONSource#setData. I often find myself using map.style.sourceCache[sourceId].loaded() for this purpose. It would be nice to provide a public API instead: Map#isSourceLoaded(sourceId: string): boolean


  • add Map#isSourceLoaded(sourceId)
  • add Map#isStyleLoaded()
  • add Map#isTilesLoaded() / Map#isTileLoaded(coord) / ...
  • rename Map#loaded -> Map#isLoaded / Map#isEverythingLoaded / ...
@sarahkleins
Copy link
Contributor

Hey @lucaswoj! Going to start working on a few gl-js starter tasks next week. This one seems like a good place to start :)

@sarahkleins sarahkleins self-assigned this Dec 2, 2016
@lucaswoj
Copy link
Contributor Author

lucaswoj commented Dec 3, 2016

So happy to hear you'll be working on this @sarahkleins. Looking forward to working with you to 🚢 this feature! Let me know if there's anything I can do to help.

@lucaswoj lucaswoj changed the title "Map#isSourceLoaded" method "Map#is*Loaded" methods Jan 17, 2017
@lucaswoj
Copy link
Contributor Author

Expanding the scope of this ticket to include

  • adding Map#isSourceLoaded(sourceId)
  • adding Map#isStyleLoaded()
  • adding Map#isTilesLoaded() / Map#isTileLoaded(coord) / ...
  • renaming Map#loaded -> Map#isLoaded / Map#isEverythingLoaded / ...

@mollymerp
Copy link
Contributor

This will tie in nicely w the refactoring of our events system #3970 😂

stepankuzmin added a commit to stepankuzmin/mapbox-gl-js that referenced this issue Jan 21, 2017
stepankuzmin added a commit to stepankuzmin/mapbox-gl-js that referenced this issue Jan 21, 2017
stepankuzmin added a commit to stepankuzmin/mapbox-gl-js that referenced this issue Jan 23, 2017
anandthakker pushed a commit that referenced this issue Jan 23, 2017
* add Map#isSourceLoaded #3691

* fix the case then Map is constructed without a style and throw an error instead of firing event #3691

* fire an error on checking if non-existant source is loaded #3691
@mollymerp mollymerp mentioned this issue Feb 23, 2017
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants