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];

谢谢!

4

1 回答 1

1

请参阅这篇文章: 定位 MKMapView 以一次显示多个注释

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

于 2012-05-05T23:56:24.573 回答