You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
When the style in cache expires, it must reload it from the web
Actual behavior
the style is never fetched from the server because of conditions (mutated) which cancel the online fetch after the offline fetch.
In style_impl.cpp, the loadURL() method creates a request against an URL. It first fetch the style data from the cache and then launch an online request.
Because we mutated the style by adding layers for our own usage, the load URL falls into the condition "mutated" and then reset the request -> the online data is never received.
I don't understand why when we mutate the map we can not parse new data as it might be a complete different URL.
The faulty timeline:
load Style A
---> load sytle json from cache
---> parse the data
------> set style as loaded
------> call the observer callback onStyleLoaded (Style is loaded, we add our custom layer => mutated = true, loaded = true)
load Style B
---> load style json from cache. Style data are expired.
---> cancel the online fetch with styleRequest.reset() as map is mutated. ==> WHY ?????!
That's it.
The second condition (mutated && loaded) seems also faulty as it can have been through the offline fetch, map is loaded, mutated then the online fetch comes du to slow internet connection. In this case we won't use the updated data to display the map (which will be in cache...).
The text was updated successfully, but these errors were encountered:
This is expected behavior; see #5665. We did recently adjust the behavior to ensure that an updated style makes it into the cache, such that it will take effect if the map view is re-created or the app relaunched (#11270). Future plans are discussed at the tail end of mapbox/mapbox-gl-js#4225.
Hi,
Glad to see that you made the same findings as I did, thanks for the references.
Choosing not to update the map style freshly fetched from the servers might not fit our use case, but I understand the modifications on maps are not all tracked to be reapplied in this case.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Platform: all
Mapbox SDK version: ios 3.7.5
Steps to trigger behavior
Expected behavior
When the style in cache expires, it must reload it from the web
Actual behavior
the style is never fetched from the server because of conditions (mutated) which cancel the online fetch after the offline fetch.
In style_impl.cpp, the loadURL() method creates a request against an URL. It first fetch the style data from the cache and then launch an online request.
Because we mutated the style by adding layers for our own usage, the load URL falls into the condition "mutated" and then reset the request -> the online data is never received.
I don't understand why when we mutate the map we can not parse new data as it might be a complete different URL.
The faulty timeline:
load Style A
---> load sytle json from cache
---> parse the data
------> set style as loaded
------> call the observer callback onStyleLoaded (Style is loaded, we add our custom layer => mutated = true, loaded = true)
load Style B
---> load style json from cache. Style data are expired.
---> cancel the online fetch with styleRequest.reset() as map is mutated. ==> WHY ?????!
That's it.
The second condition (mutated && loaded) seems also faulty as it can have been through the offline fetch, map is loaded, mutated then the online fetch comes du to slow internet connection. In this case we won't use the updated data to display the map (which will be in cache...).
The text was updated successfully, but these errors were encountered: