Description
Hey everyone!
I have been working on offline map support (https://docs.mapbox.com/help/troubleshooting/mobile-offline/) for a while now and wanted to let you know it's on a public branch for testing at the moment.
You can find it here; https://github.com/mapbox/mapbox-unity-sdk/tree/offlineMaps
And usage goes something like this;
var region = new OfflineRegion(
MapName,
_minLatLng,
_maxLatLng,
_minZoom,
_maxZoom,
elevationTilesetId,
imageryTilesetId,
vectorTilesetId);
var response = MapboxAccess.Instance.OfflineManager.CreateOfflineMap(region.Name, region);
This will download and cache all tiles in this region in given zoom range. I just pushed it today so there might be bugs and issues of course.
Just to be clear, this doesn't mean you can ship data with your application or anything. This is just a variation of regular ambient cache. Regular ambient cache time out, recycle out etc. Offline maps adds a flag to tiles so they won't time out like regular ambient cache tiles. So it ensures those tiles will be in the cache.
In example, let's say you're building a hiking app where people go off grid frequently to hike. You can let them predownload and cache their hiking area in advance, at their home when they have connectivity for example. SDK will ensure cached tiles will not be removed/recycled/deleted so when they go hiking and don't have connection, their tile data will still be in the cache.
This feature also comes with a lot of changes in Sqlite management so please let me know if you notice any bugs and/or performance issues regarding data in general.