2013-10-27 28 views
0

我是新來的ios和工作地圖視圖我已經在地圖視圖(註釋)上使用lat,long。地圖視圖顯示的位置,但需要捏捏以獲得確切的位置。(使用兩個fingures縮放)我使用下面的代碼,但它不顯示確切位置的確切位置我需要使用縮放然後顯示確切的位置,但我想顯示它而不觸及地圖視圖?地圖視圖不顯示確切的位置需要縮小

zoomLocation.latitude = latmpa.doubleValue; 
zoomLocation.longitude = logmpa.doubleValue; 
annotationPoint = [[MKPointAnnotation alloc] init]; 
annotationPoint.coordinate = zoomLocation; 
annotationPoint.title = @"masjid...."; 
[mapView selectAnnotation:annotationPoint animated:YES]; 

[mapView addAnnotation:annotationPoint]; 

mapView.centerCoordinate = annotationPoint.coordinate; 

回答

0

你需要制定出你想要的區域地圖,在看,然後使用[mapView setRegion:newRegion animated:YES]ref

MKCoordinateRegion由您已經制作的CLLocationCoordinate2DMKCoordinateSpan組成。這裏是一個例子,使一個跨度

MKCoordinateSpan span; 
span.latitudeDelta = 1.5; 
span.longitudeDelta = 1.0; 
MKCoordinateRegion newRegion; 
newRegion.center = zoomLocation; 
newRegion.span = span; 
[mapView setRegion:newRegion animated:YES]; 
+0

非常感謝你,你救了我的一天!!!!!! – user2902101

相關問題