Post not yet marked as solved
Post marked as unsolved with 2 replies, 203 views
I am trying to calculate the latitudeDelta & longitudeDelta of visible map area on the phone screen. The two method used were:
spanLat = map.visibleMapRect.size.width / 111000;
spanLon = map.visibleMapRect.size.height / (111000 * cos(centreLat*3.14159/180));
And
MKMapRect mRect = map.visibleMapRect;
MKMapPoint eastMapPoint = MKMapPointMake(MKMapRectGetMinX(mRect), MKMapRectGetMidY(mRect));
MKMapPoint westMapPoint = MKMapPointMake(MKMapRectGetMaxX(mRect), MKMapRectGetMidY(mRect));
MKMapPoint northMapPoint = MKMapPointMake(MKMapRectGetMinY(mRect), MKMapRectGetMidX(mRect));
MKMapPoint southMapPoint = MKMapPointMake(MKMapRectGetMaxY(mRect), MKMapRectGetMidX(mRect));
CLLocationDistance wLength = MKMetersBetweenMapPoints(eastMapPoint, westMapPoint);
CLLocationDistance hLength = MKMetersBetweenMapPoints(northMapPoint, southMapPoint);
spanLat = wLength / 111000;
spanLon = hLength / (111000 * cos(centreLat*3.14159/180));
Neither gives me right latitudeDelta & longitudeDelta of the visible area.