coordinate -> placemark -> mapitem -> array of mapitems -> openMapsWithItems
****
****
let currentLocation = MKMapItem.mapItemForCurrentLocation()
let markTaipei = MKPlacemark(coordinate: CLLocationCoordinate2DMake(25.0305, 121.5360), addressDictionary: nil)
let taipei = MKMapItem(placemark: markTaipei)
taipei.name = "Taipei Daan Park"
let array = NSArray(objects: currentLocation, taipei)
let parameter = NSDictionary(object: MKLaunchOptionsDirectionsModeDriving, forKey: MKLaunchOptionsDirectionsModeKey)
MKMapItem.openMapsWithItems(array, launchOptions: parameter)
No comments:
Post a Comment