adding annotations to offline map (tilemil)

475 views Asked by At

I'm using tilemil to create offline map for my iPhone app. I've added annotation to map through GEOJSON, and everything works great, but i have one question: how can i create and hook up annotations that is created in offline map with app annotations. Because annotations that is created in offline map showing as dots in my app.

Example:

what i have:

enter image description here

what i want:

enter image description here

should i just parse GeoJSON and add annotations with data this way, or there's some better approaches to do this? Thanks!

1

There are 1 answers

0
incanus On BEST ANSWER
  1. If you have implemented the points in TileMill, then their imagery will be "baked into" the map raster tile imagery. You can still have callouts for these if you also add interactivity to the map in TileMill so that tapping the points can retrieve data. A good example of doing this for regions instead of points is in the third tab of this sample project, as shown in the screenshot:

    https://github.com/mapbox/mapbox-ios-example

  2. Another option, as you've mentioned, is to just parse the GeoJSON client-side using NSJSONSerialization and then adding the points in Cocoa as RMAnnotation objects.

  3. A third option is to add the markers in the mapbox.com editor interface and save them with your map, then you can retrieve them as simplestyle data automatically as in the Weekend Picks sample project that you've included a screenshot of. The GeoJSON can be automatically retrieved, parsed, and added as annotations in the project by the iOS SDK.