Objective c 地图套件范围变焦

Objective c 地图套件范围变焦,objective-c,xcode,mapkit,Objective C,Xcode,Mapkit,有没有一种方法可以根据您拥有的注释范围查看地图?这样就不会遗漏任何别针 //Map mapView = [[MKMapView alloc] initWithFrame:CGRectMake(0, 0, 299, 406)]; [mapView setMapType:MKMapTypeStandard]; [mapView setZoomEnabled:YES]; [mapView setScrollEnabled:YES]; MKCoordinateRegion region = { {0.0

有没有一种方法可以根据您拥有的注释范围查看地图?这样就不会遗漏任何别针

//Map
mapView = [[MKMapView alloc] initWithFrame:CGRectMake(0, 0, 299, 406)];
[mapView setMapType:MKMapTypeStandard];
[mapView setZoomEnabled:YES];
[mapView setScrollEnabled:YES];
MKCoordinateRegion region = { {0.0, 0.0 }, { 0.0, 0.0 } }; 
region.center.latitude = [latitudeNumber doubleValue];
region.center.longitude = [longitudeNumber doubleValue];
region.span.longitudeDelta = 0.01f;
region.span.latitudeDelta = 0.01f;
[mapView setRegion:region animated:YES]; 
[mapView setDelegate:self];
[self.view addSubview:mapView];
谢谢

请看这篇文章:

根据要添加的注释数量,您可能需要调整链接答案中的代码,以循环遍历所有注释,以找到lat/long的最小/最大值