4

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.

Chris
  • 1,449
  • 1
  • 18
  • 39

2 Answers2

5

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.

Ruben Marin
  • 1,639
  • 14
  • 24
  • mbtiles-ios-example link is broken –  Nov 20 '12 at 15:16
  • Thanks John, I've changed it. The original owner of the mbtiles-ios-example project, Mapbox, has now removed the project from its account. They have launched a propietary service. – Ruben Marin Nov 22 '12 at 11:21
  • And what if the .mbtiles file is way too big to insert it into your project? – arniotaki Oct 06 '14 at 06:15
  • Please @arniotaki have in mind that this answer is from 2011 and could be deprecated. About the big mbtiles, I would try to split it in several files and load them on demand. – Ruben Marin Oct 07 '14 at 08:20
  • Ok, but again the size of the application would be large. Is that true? – arniotaki Oct 07 '14 at 10:05
  • The size of the resource files would be the same (mbtiles files), but you can load only the one shown on screen, so you don't fill the RAM with unused map data. – Ruben Marin Oct 07 '14 at 16:28
1

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

PavelS
  • 166
  • 3