0
northEastおよびsouthWest座標を「ビューポート」として使用できるさまざまなAPIを使用するには、検索の最大平方マイル制限があります。MKMapView - 現在表示されている平方マイルを計算する方法
現在のMKMapViewズームレベルで示されている平方マイルを計算したいと思います。ここで
northEastおよびsouthWest座標を「ビューポート」として使用できるさまざまなAPIを使用するには、検索の最大平方マイル制限があります。MKMapView - 現在表示されている平方マイルを計算する方法
現在のMKMapViewズームレベルで示されている平方マイルを計算したいと思います。ここで
は、ソリューションです:
- (float)numSquareMiles
{
CLLocationCoordinate2D northEast, southWest;
northEast = [mapView convertPoint:CGPointMake(mapView.frame.size.width, 0) toCoordinateFromView:mapView];
southWest = [mapView convertPoint:CGPointMake(0, mapView.frame.size.height) toCoordinateFromView:mapView];
float distanceLatInDegrees = northEast.latitude - southWest.latitude;
float numLatMiles = 69.172 * distanceLatInDegrees;
float distanceLonInDegrees = northEast.longitude - southWest.longitude;
float numLonMiles = 69.172 * distanceLonInDegrees;
float numSquareMiles = numLatMiles*numLonMiles;
return numSquareMiles;
}