Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think you can use standard MapKit functions: <a href="http://developer.apple.com/library/ios/documentation/MapKit/Reference/MapKitFunctionsReference/Reference/reference.html#//apple_ref/c/func/MKCoordinateRegionMakeWithDistance" rel="nofollow noreferrer">MKCoordinateRegionMakeWithDistance</a>, this will return a <a href="http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MapKitDataTypesReference/Reference/reference.html#//apple_ref/doc/c_ref/MKCoordinateRegion" rel="nofollow noreferrer">MKCoordinateRegion</a>, which is really just a center point (lat, lon) and the spans in the latitudal and longitudal direction in degrees. Add/subtract half of the span from the latitude and longitude respectively and you have the values you're looking for.</p> <pre class="lang-c prettyprint-override"><code>CLLocationCoordinate2D centerCoord = CLLocationCoordinate2DMake(41.145495, −73.994901); MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(centerCoord, 2000, 2000); double latMin = region.center.latitude - .5 * startRegion.span.latitudeDelta; double latMax = region.center.latitude + .5 * startRegion.span.latitudeDelta; double lonMin = region.center.longitude - .5 * startRegion.span.longitudeDelta; double lonMax = region.center.longitude + .5 * startRegion.span.longitudeDelta; </code></pre> <p>By the way: this is only representative for the longitude for small spans, in the order of a couple of kilometers. To <a href="http://developer.apple.com/library/ios/documentation/MapKit/Reference/MapKitFunctionsReference/Reference/reference.html#//apple_ref/c/func/MKCoordinateSpanMake" rel="nofollow noreferrer">quote Apple</a>:</p> <blockquote> <p><em><strong>latitudeDelta</em></strong><br> The amount of north-to-south distance (measured in degrees) to use for the span. Unlike longitudinal distances, which vary based on the latitude, one degree of latitude is approximately 111 kilometers (69 miles) at all times.</p> <p><em><strong>longitudeDelta</em></strong><br> The amount of east-to-west distance (measured in degrees) to use for the span. The number of kilometers spanned by a longitude range varies based on the current latitude. For example, one degree of longitude spans a distance of approximately 111 kilometers (69 miles) at the equator but shrinks to 0 kilometers at the poles.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload