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.isStyleLoaded() still returns true immediately after calling GeoJSONSource.setData() following a failed request #1025

Closed
vanilla-lake opened this issue Feb 25, 2022 · 0 comments

Comments

@vanilla-lake
Copy link
Contributor

maplibre-gl-js version: 2.1.6

Steps to Trigger Behavior

  1. Create a Map with a GeoJSON source.
  2. Wait for Map's load event to fire.
  3. Call setData() on the GeoJSON source, passing a URL to a nonexistent GeoJSON file.
  4. Wait for Map's error event to fire.
  5. Call setData() on the GeoJSON source, this time passing a URL to a valid GeoJSON file.
  6. Call Map.isStyleLoaded() immediately after the call to GeoJSONSource.setData().

Link to Demonstration

https://jsbin.com/yepihuc/3/edit?html,console,output

Expected Behavior

In step 6, Map.isStyleLoaded() should return false, as the GeoJSON file should still be loading.

Actual Behavior

In step 6, Map.isStyleLoaded() returns true.

HarelM pushed a commit that referenced this issue Feb 25, 2022
…#1025) (#1026)

* Fix SourceCache.loaded() always returning true following a load error

* Update changelog

* Add backticks in changelog entry
HarelM pushed a commit that referenced this issue Mar 10, 2022
…rs while the source still has pending loads (#1038)

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

No branches or pull requests

1 participant