我被卡住了...如果你开车/骑自行车/徒步旅行,你有什么方法可以选择屏幕吗?我得到这个图像
但我想要这个。
这是我的方法
/*
* Open navigation and start to navigate
*/
@IBAction func navigationStart(sender: AnyObject) {
let lat1 : NSString = self.targetLatitudeString
let lng1 : NSString = self.targetLongtitudeString
let latitute:CLLocationDegrees = lat1.doubleValue
let longitute:CLLocationDegrees = lng1.doubleValue
let regionDistance:CLLocationDistance = 10000
let coordinates = CLLocationCoordinate2DMake(latitute, longitute)
let regionSpan = MKCoordinateRegionMakeWithDistance(coordinates, regionDistance, regionDistance)
let options = [
MKLaunchOptionsMapCenterKey: NSValue(MKCoordinate: regionSpan.center),
MKLaunchOptionsMapSpanKey: NSValue(MKCoordinateSpan: regionSpan.span)
]
let placemark = MKPlacemark(coordinate: coordinates, addressDictionary: nil)
let mapItem = MKMapItem(placemark: placemark)
mapItem.name = nameString
MKMapItem.openMapsWithItems([mapItem], launchOptions: options)
}
答案 0 :(得分:0)
let options = [MKLaunchOptionsDirectionsModeKey : MKLaunchOptionsDirectionsModeDriving]
这将做魔术