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
Make the map re-render with fresh tiles (data) on value change
Expected Behavior
Expect the map to re-render with new tiles (fresh data).
Our use case is that we have a WebSocket that notifies the app that it needs fetch new data for the tiles since the color/data of the current "zones" has changed. Say it went from red to yellow.
I have looked through the docs but do not see a method to do something like:
maplibreCache.invalidate()
This would then trigger new fetch requests for new tiles and discard cached data.
Currently, I am just changing the key i have attached to <MapLibreGL.MapView key=${rerender.key}`/> and the map does re-render but very inconsistently and this feels hacky at best. I have attached a video of the current behavior.
What would the right way to do this?
Actual Behavior
Map seems to keep previous data and renders partially cached data
Screenshots (if applicable)
RPReplay_Final1731327140.1.mp4
Environment
Platform: iOS & Android
OS version: iOS 18
Device type: iPhone 15 Pro Max
Emulator or Simulator: no
Development OS: macOS Sonoma
"@maplibre/maplibre-react-native": "9.1.0",
react-native Version: 0.74.2
Additional context
I think Mapbox has something like:
mapRef.current?.clearData();
The text was updated successfully, but these errors were encountered:
Hey @KiwiKilian! Will try that and report back, thank you for answering. I thought that the offlineManager would only work if you actively managed packs etc.
Steps to Trigger Behavior
Expected Behavior
Expect the map to re-render with new tiles (fresh data).
Our use case is that we have a WebSocket that notifies the app that it needs fetch new data for the tiles since the color/data of the current "zones" has changed. Say it went from red to yellow.
I have looked through the docs but do not see a method to do something like:
This would then trigger new fetch requests for new tiles and discard cached data.
Currently, I am just changing the key i have attached to
<MapLibreGL.MapView key=
${rerender.key}`/> and the map does re-render but very inconsistently and this feels hacky at best. I have attached a video of the current behavior.What would the right way to do this?
Actual Behavior
Map seems to keep previous data and renders partially cached data
Screenshots (if applicable)
RPReplay_Final1731327140.1.mp4
Environment
react-native
Version: 0.74.2Additional context
I think Mapbox has something like:
The text was updated successfully, but these errors were encountered: