Get MapKit view border coordinates
how can I get the MapKit view bounds开发者_如何学C coordinates for example I need to get the north-east bound coords and the south-west bound coords.
Thanks.
MKCoordinateRegion region = mapView.region;
minLat = region.center.latitude - (region.span.latitudeDelta / 2.0);
maxLat = region.center.latitude + (region.span.latitudeDelta / 2.0);
minLong = region.center.longitude - (region.span.longitudeDelta / 2.0);
maxLong = region.center.longitude + (region.span.longitudeDelta / 2.0);
Northeast coords are (maxLat, maxLong) and southwest coords are (minLat, minLong).
精彩评论