1

What is the correct way to auto zoom an iOS MapKit MKMapItem generated map when it first displays using the option MKLaunchOptionsMapSpanKey:?

Specifically, how should the zoom factor be entered for MKLaunchOptionsMapSpanKey:??? (i.e. MKLaunchOptionsMapSpanKey:0.1).

Or, alternatively, is there another way programmatically to auto zoom the map when it first displays which I am not aware of?

@IBAction func getDirections(sender: AnyObject) {

        let mapItem = MKMapItem.mapItemForCurrentLocation()
        let coords = CLLocationCoordinate2DMake(latitude, longitude)
        mapItem.name = "User Location"
        let options = [MKLaunchOptionsMapSpanKey:???,MKLaunchOptionsMapCenterKey:location,       ]
        let place = MKPlacemark(coordinate: coords, addressDictionary:nil)
        mapItem.openInMapsWithLaunchOptions(options)
}
user46938
  • 59
  • 4
  • 1
    See http://stackoverflow.com/questions/28427557/openinmapswithlaunchoptions-not-working and http://stackoverflow.com/questions/28121850/how-to-open-apple-maps-with-a-location-and-zoom. But note there seems to be a bug where setting the SpanKey has no effect. –  Apr 09 '15 at 13:00
  • @Anna, is that bug logged with Apple? Are any reputable blogs reporting on it? I'd like to be able to find out when it is fixed or learn of any workarounds that come available. So far, your comment is the only place I've found on the whole Internet that mentions the bug. – stone May 28 '15 at 06:05

0 Answers0