Search code examples
iphoneobjective-cios5mkmapviewmkannotationview

Is there a way to open multiple callouts on many MKPointAnnotations on a MKMapView?


I was wondering if it is possible to to that or if it is not what are the alternatives? I need some information that need to be shown on the map and I'm having trouble with it... MKPointAnnotation gives a good interface but I haven't been able to open more than 1 callout at once. Thanks!


Solution

  • I found the solution:

    You need to read this first:

    http://developer.apple.com/library/ios/#DOCUMENTATION/UserExperience/Conceptual/LocationAwarenessPG/AnnotatingMaps/AnnotatingMaps.html

    and then there's an example on it here:

    http://shawnsbits.com/blog/2011/04/12/custom-map-pins-for-mapkit/

    The key is to load your array of annotations with the customized images in the viewDidLoad and then in mapView:viewForAnnotation: create a new MKAnnotationView and load the image into it by casting the annotation to the customized annotation that is being passed to it.

    I hope this helps. Sorry if it looks kinda confusing!