使用MKMapView控件缩小地图时遇到问题
我的代码
-(IBAction)zoomOut:(id)sender{
MKCoordinateRegion theRegion=mapView.region;
theRegion.span.longitudeDelta*=2.0;
theRegion.span.latitudeDelta*=2.0;
[mapView setRegion:theRegion animated:YES];
}
当缩小到最后一级时,程序就会自动退出.请问这是怎么回事
[解决办法]
theRegion.span.longitudeDelta*=2.0;
????theRegion.span.latitudeDelta*=2.0;
你这个每次都乘以2, 估计是缩小到最小后,这个span边界值超过 mkview里面允许的最大值了。