mkmapview に多くの注釈があります。mkmapview に複数の注釈を表示するには、コードを使用しています
MKMapRect zoomRect = MKMapRectNull;
for (id <MKAnnotation> annotation in self.mapView.annotations)
{
if([[annotation description]isEqualToString:@"Location"])
{
MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate);
MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0);
if (MKMapRectIsNull(zoomRect))
{
zoomRect = pointRect;
}
else
{
zoomRect = MKMapRectUnion(zoomRect, pointRect);
}
}
}
MKCoordinateRegion region = MKCoordinateRegionForMapRect(zoomRect);
[self.mapView setRegion:region animated:YES];
注釈がマップ上にプロットされていても、特定の注釈が途切れています。