3

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?

Welly
  • 305
  • 6
  • 21

2 Answers2

1

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

incanus
  • 5,100
  • 1
  • 13
  • 20
  • any idea of your expected timescale for this implementation @incanus ? – Welly Sep 03 '15 at 13:31
  • 1
    Was this ever actually answered? Reading through that thread, it seems like there is still no solution to what should be a fairly simple process of utilizing mbtiles offline in a MapBox iOS app w/ Swift. – Andrew Nov 12 '17 at 00:42
  • It seems that adding this capability is no longer a priority for Mapbox. – Alan Kinnaman Dec 31 '17 at 23:17
0

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

Alan Kinnaman
  • 877
  • 12
  • 20