2013-02-21 32 views
0

我想setRegion,但是當我設置的區域,地圖凍結,我不能移動地圖......是我的代碼的MKMapView凍結時</p> <p>這裏地圖setRegion

-(void) configurarZoomDoMapaComLatitude:(double)latitude eLongitude:(double)longitude { 
_myMapView.userInteractionEnabled = YES; 
CLLocation *localizacao = [[CLLocation alloc]initWithLatitude:latitude longitude:longitude]; //regiao de ref. (usar localizacao atual) 
double miles = 0.5; // quanto menor, mais próximo 
double scalingFactor = ABS((cos(2 * M_PI * localizacao.coordinate.latitude/360.0))); 

MKCoordinateSpan span; 
span.latitudeDelta = miles/69.0; 
span.longitudeDelta = miles/(scalingFactor * 69.0); 

MKCoordinateRegion region; 
region.span = span; 
region.center = localizacao.coordinate; 
[_myMapView setRegion:region animated:YES]; 
} 
+0

如果地圖凍結,是否因爲您的應用崩潰了?如果崩潰了,應該包含崩潰日誌。 – 2013-02-21 15:17:50

+0

@nevanking不...應用程序沒有崩潰...如果我按我的應用程序中的任何按鈕,它的作品...只有地圖凍結 – Ladessa 2013-02-21 15:20:47

+1

這可能是設置該地區不是地圖的原因冷凍。嘗試創建不同的區域並設置該區域,然後檢查地圖是否仍然凍結。 – 2013-02-21 16:18:13

回答

-2

我已經解決了這個問題...我在地圖添加了一個視圖...我刪除了它,它的工作原理! Thx全部

相關問題