2011-12-16 64 views

回答

1

這裏是解決方案:

- (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; 
} 
相關問題