0
我有一個應用程序顯示地圖。我需要顯示的用戶當前位置,並能做到與在應用程序的地圖上的GPS位置
[mapView setShowsLocation:YES];
但是,當我放大或縮小地圖,它需要大量的時間,再次告訴我,藍腳。
這是正常的,或者我需要把其他東西,以保持屏幕上的藍色的所有時間???
謝謝。
我有一個應用程序顯示地圖。我需要顯示的用戶當前位置,並能做到與在應用程序的地圖上的GPS位置
[mapView setShowsLocation:YES];
但是,當我放大或縮小地圖,它需要大量的時間,再次告訴我,藍腳。
這是正常的,或者我需要把其他東西,以保持屏幕上的藍色的所有時間???
謝謝。
[self setCurrentLocation:self._mapView.userLocation.location.coordinate withZoom:1.0];
self._mapView.showsUserLocation = YES;
- (void)setCurrentLocation:(CLLocationCoordinate2D)coord withZoom:(float)zoomLevel {
MKCoordinateRegion region = self._mapView.region;
region.span.latitudeDelta = self.defaultSpanLevel.latitudeDelta*zoomLevel;
region.span.longitudeDelta = self.defaultSpanLevel.longitudeDelta*zoomLevel;
region.center = coord;
[self._mapView setRegion:region animated:YES];
}
您可以使用此視圖中會出現方法
那麼你可以使用MapView的委託方法....
區域沒有改變動畫:是{並設置地圖的區域在這裏。 ......採取 當前用戶的位置爲中心的區域..}
這將解決你的問題
}
是的,但每個解決方案的工作原理都與之前相同。我得到藍色的針,當我放大或縮小它消失,然後再...可怕的... – Akosha