2012-02-09 77 views

回答

1

鑑於中心座標,並從中心到邊緣米的距離,你可以使用MKCoordinateRegionMakeWithDistance函數來創建區域:

CLLocationCoordinate2D centerCoord = CLLocationCoordinate2DMake(lat, lng); 

CLLocationDistance centerToBorderMeters = 5000; 

MKCoordinateRegion rgn = MKCoordinateRegionMakeWithDistance 
          (centerCoord, 
          centerToBorderMeters * 2, //vertical span 
          centerToBorderMeters * 2); //horizontal span 

[mapView setRegion:rgn animated:YES];