I already have a map stored using the MBTiles format that I want to use in an app I am making. It is vital that the app will run with no signal/connection on the mobile device.
Mapbox previously had an example of how to use MBTiles together with RMMBTilesSource so that the mapping data could all be stored locally. This has now been deprecated, see https://github.com/mapbox/mapbox-ios-example.
I also enquired with Mapbox as to whether they were going to replace this example with another that was similar. In short, I was told that every device must populate its own cache from a direct request to Mapbox, so is not what I'm looking for.
Does anyone know an alternative platform (or alternative implementation) that would allow me to embed and read a locally stored MBTiles file source?
We'll be re-adding MBTiles support back to the SDK 2.x series. Watch this space: https://github.com/mapbox/mapbox-gl-native/issues/584
MBTiles can be displayed in the Mapbox Maps iOS SDK by hosting a web server within your app and pointing the map to localhost
. I've posted my solution here:
https://gist.github.com/namannik/3b7c8b69c2d0768d0c2b48d2ed5ff71c
来源:https://stackoverflow.com/questions/32333036/use-of-mbtiles-in-offline-ios-app