(Revised answer based on comment :)
If you want the bounding box coordinates for this circle overlay, use the overlay boundingMapRect
property:
//"theCircle" is the MKCircle overlay object CLLocationCoordinate2D topLeftCoord = MKCoordinateForMapPoint(theCircle.boundingMapRect.origin); MKMapPoint bottomRightMapPoint = MKMapPointMake ( MKMapRectGetMaxX(theCircle.boundingMapRect), MKMapRectGetMaxY(theCircle.boundingMapRect)); CLLocationCoordinate2D bottomRightCoord = MKCoordinateForMapPoint(bottomRightMapPoint);
(Original answer :)
First, when you call setRegion
on a map, the map view almost always changes the requested region to match the map view. This setting is based on the shape of the map view and whether it can correctly display the requested range at one of the fixed zoom levels.
For example, if your map view is not square, and you request an interval of 10 miles in both directions, at least one of the spans will definitely be adjusted. Even if you ask for the range that you set based on the aspect ratio of the view, it can still be adjusted if the tile with this zoom level is not displayed on the map (or, possibly, if you did not take the Earth of curvature).
Further, latitudeDelta
and longitudeDelta
determine the entire height and width of the area (rather than the distance from the central coordinate).
Thus, your test in the screenshot cannot be compared with span deltas. In the screenshot, you calculate the distance from the central coordinate to the minimum latitude and longitude (lower left corner), but the delta deltas go all the way from right to left and from bottom to top. (Because of this, you might think that the distance from the center to the corner should be less than the delta - no more. It is shorter, but the delta also increased to more than 10 due to the reasons described above).
Finally, to get the angular coordinates (bottom left and top right), this is probably a more accurate way to do this:
CLLocationCoordinate2D bottomLeftCoord = [myMapView convertPoint:CGPointMake(0, myMapView.frame.size.height) toCoordinateFromView:myMapView]; CLLocationCoordinate2D topRightCoord = [myMapView convertPoint:CGPointMake(myMapView.frame.size.width, 0) toCoordinateFromView:myMapView];