I developed an application, which uses the map view, which has multiple annotations at the same location, but it is not dropping the pins which I provided the order for the annotations. I added annotations from the array, but it is not showing the same order. I need the first object [annotation] to be the top on the location. when user taps on the annotation, it should show the first object as callout. Any suggestions to do the same.
Thanks I have already tried this approach, but no luck..
- (void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views {
for (MKAnnotationView *view in views) {
if ([[view annotation] isKindOfClass:[Annotation class]]) {
Annotation *customAnnotation = (Annotation*) [view annotation];
if ([customAnnotation markerID]==0)
[[view superview] bringSubviewToFront:view];
else {
[[view superview] sendSubviewToBack:view];
}
}
}
}