首页 > 代码库 > MKMapView放大缩小事件

MKMapView放大缩小事件

MKMapView放大缩小事件

by 伍雪颖

- (IBAction)mapZoomIn:(id)sender {
    MKCoordinateRegion region = _mapView.region;
    region.span.latitudeDelta=region.span.latitudeDelta * 0.4;
    region.span.longitudeDelta=region.span.longitudeDelta * 0.4;
    [_mapView setRegion:region animated:YES];
}
- (IBAction)mapZoomOut:(id)sender {
    MKCoordinateRegion region = _mapView.region;
    region.span.latitudeDelta=region.span.latitudeDelta * 1.3;
    region.span.longitudeDelta=region.span.longitudeDelta * 1.3;
    [_mapView setRegion:region animated:YES];
}