2012-05-05 10 views
0

あなたが持っているアノテーションの範囲に基づいて地図を表示する方法はありますか?だから、ピンを残さないでください。MapKit range zoom

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

ありがとう!

答えて

1

この記事を参照してください: Positioning MKMapView to show multiple annotations at once

あなたが追加しているどのように多くの注釈によっては、最小/最大値を見つけるためにあなたの注釈のすべてをループにリンクの答えで見つけたコードを微調整する必要があります緯度/経度の