我有這樣的疑問:請求mapkit註釋到服務器的位置和縮放級別
我有一個API服務器請求最近的位置(經緯度&長)和距離(公里)
我會點當用戶在地圖上做平底鍋的時候調用這個API ..所以我會計算在縮放級別函數中的距離參數..
我該如何獲得這個?
在這一刻我有這個MapKit委託方法:
- (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated
{
MKZoomScale currentZoomScale = mapView.bounds.size.width/mapView.visibleMapRect.size.width;
NSLog(@"currentZoom:%f", currentZoomScale);
[self.dataReader sendServerRequestWithCoordinate:mapView.region.center andDistance:[self getDistanceByZoomLevel:currentZoomScale];
}
- (float) getDistanceByZoomLevel:(MKZoomScale) zoomLevel {
/// ?????? ////
}