How to use Offline Cloudmade Maps in an iPhone App

一曲冷凌霜 提交于 2019-12-29 07:13:43

问题


I’ve looked through the posts on the Cloudmade site here and I get some of it, but not all. I've posted the question below, but haven't had the help I need, so I thought I'd ask the question here.

I can see that I need to:

  • download the tiles for the required area to my Mac (but can’t see how to do this)
  • convert these to a sqlite database using the map2sqlite utility, changing the code to output the tiles to a table called “ZCACHE”, not “tiles”
  • Copy the DB to the Application Bundle
  • insert some code to copy this DB on first run, from the Application Bundle to the Documents Directory
  • Somehow get App to use this DB and not an online one – I can’t see how that’s done.

Any help would be warmly welcomed,

Chris.


回答1:


please check this tutorial, it can help - http://www.gisnotes.com/wordpress/category/sqlite3/.




回答2:


The best solution for me to have iPhone offline maps is:

1.- Generate your own maps with TileMill and then export to MBTiles format.

2.- Get the mbtiles-ios-example and use the MBTiles file you just generated. In order to compile it, you need to download Route-Me and add it to the project.

Now, there is another option (not for free): Mapbox.



来源:https://stackoverflow.com/questions/5067590/how-to-use-offline-cloudmade-maps-in-an-iphone-app

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