1
votes

I have an MKMapView with several annotations on it, and one very important one that's on the center of the map. When the map is zoomed out a little, all the annotations appear clustered together and I've written code to ensure that the main annotation is always on top visually. However, annotation selection doesn't seem to conform to this z order - there are several instances where I try and select the main annotation but a minor annotation behind it ends up getting selected and coming to the front.

Is there any standard way to deal with this problem? Any suggestions welcome.

1

1 Answers

0
votes

MKMapView add annotations to its internal list, then display these annotation views by its own logic. You can retrieve the list of annotations by MKMapView's property "annotations". However there is no method to change the order of annotation views currently.

I also encounter the same problem. My solution is to track the touch event by myself, and then detect which annotation view is touched instead of mapView:didSelectAnnotationView: delegate.