flutter-maplibre-gl
flutter-maplibre-gl copied to clipboard
How to prevent caching of offline region?
I have noticed that regions are being cached even if I set the following:
setOffline(false);
setOfflineTileCountLimit(0);
I am testing this by first opening the map with an active Internet connection, browsing a region on a high zoom level, closing the app, turning off the Internet connection and opening the map again and go to the region previously browsed. I notice that i can still zoom in and see details.
I want to disable caching of offline region such that regions do not loadup if the user is not connected to the Internet or have the regions explicitly downloaded through downloadOfflineRegion
I have also noticed that there is no way to clear cached regions. For example, the function getListOfRegions
only returns regions downloaded using downloadOfflineRegion. So there is no way to get the region id and then delete it using deleteOfflineRegion.
How to achieve this?
This is a sort of replica of this issue https://github.com/m0nac0/flutter-maplibre-gl/issues/198, we currently have no cache control in the flutter layer. The setOfflineTileCountLimit
only works for offline region stored data.
The feature will come when we'll have time to implement it (or if anyone do it themself, please create a pull request)