开发者

Detect when a user zoom at the minimum elevation that mapkit allows

开发者 https://www.devze.com 2023-03-21 03:07 出处:网络
When a user zoom at the ma开发者_如何学Pythonximum level that Mapkit permits I want to show all the pins.

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
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消