Posts

Post not yet marked as solved
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.
Posted
by Telkitty.
Last updated
.