iphoneiosgeolocationxamarin.iosmkcoordinatespan

MKCoordinateSpan in Meters?


I need to create a MKCoordinateSpan that is about 500 meters.

How do I calculate the values to pass into the MKCoordinateSpan constructor?

Answers in any programming (Obj-C, .Net) language are fine.


Solution

  • Another alternative is to use MapKit's MKCoordinateRegionMakeWithDistance function:

    MKCoordinateRegion rgn = MKCoordinateRegionMakeWithDistance(
        CLLocationCoordinate2DMake(someLatitude, someLongitude), 500, 500);
    

    The MKCoordinateSpan will be in rgn.span.