Use of MBTiles in offline iOS app

痴心易碎 提交于 2019-12-20 02:39:10

问题


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?


回答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




回答2:


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!