When a user zoom at the ma开发者_如何学Pythonximum level that Mapkit permits I want to show all the pins. How to do that?
By listening to the longitudeDelta of the maps span in the regionDidChange method. Minimum longitudeDelta seems to be 0.000858 by testing and logging it.
- (void)mapView:(MKMapView *)aMapView regionDidChangeAnimated:(BOOL)animated{
NSLog(@"Deltalong: %f", aMapView.region.span.longitudeDelta);
if (aMapView.region.span.longitudeDelta <= 0.000858){
//add your annotations
}
}
精彩评论