in iOS 5.0, I first place annotations on the map and also set the centre offset to CGPointMake(0,-annotationView.frame.size.height/2); right after setting the custom image for the annotation in the mapView:viewForAnnotation: method… after this the pins still appear at the original position which would be the case when the centre offset was not applied.
However, when I pinch or zoom the map, the annotation jumps to the correct position as would be the case with the centerOffset being set and then behaves correctly..
What could be the reason and solution for this?
Any help would be much appreciated.
Baffled!!
I was finally able to solve it by subclassing the
MKAnnotationViewand in theinitWithAnnotation:reuseIdentifier:constructor method, synchronously get the annotationView image and then set thecenterOffsettoCGPointMake(0.0, -img.size.height/2);If there are too many annotations, this will slow down the display of annotations, so would need to handle that differently.