Hello,
I am working on a ThinkGeo Android project where I use several types of base maps:
- OpenStreetMapAsyncLayer
- WMS layers
- WMTS layers
All of them are displayed inside a LayerOverlay , and all of them use a FileRasterTileCache .
What I need is a reliable way to switch the map into offline-only mode , meaning:
- the map must use only the tiles already stored in the cache
- no network requests should be made at all
- tiles that are missing in the cache should simply appear blank or show the “NoDataTileImage”
- then be able to switch back to normal online mode later
I initially expected something like a property (e.g. “CacheOnly”, “OfflineOnly”, “DisableNetwork”), but LayerOverlay and the tile-based layers do not expose anything like this.
I also could not find any built-in way to intercept or block tile downloads at the overlay level.
Since all these layers rely on the internal tile request pipeline, I would like to know:
What is the official ThinkGeo-supported way to run a LayerOverlay (OSM, WMS, WMTS) in cache-only / offline mode?
Specifically:
- How can I prevent OpenStreetMapAsyncLayer from downloading tiles and force it to read only from FileRasterTileCache?
- How can I apply the same offline behavior to WMSLayer and WMTSLayer?
- Is there an API I missed that allows LayerOverlay to operate strictly from cache without performing any HTTP requests?
- If not, what is ThinkGeo’s recommended approach to implement offline-only mode for these tile layers?
I found discussions about PreCaching APIs, but that only addresses how to fill the cache in advance—it does not disable online requests.
Thanks a lot for your help.
BR