import MapKit
func launchAppleMaps() {
let currentLocation: MKMapItem = MKMapItem.forCurrentLocation()
let toCoor:CLLocationCoordinate2D = CLLocationCoordinate2D(latitude: 23.119229410848003, longitude: 113.33045341883421)
let toMKPlacemark: MKPlacemark = MKPlacemark.init(coordinate: toCoor, addressDictionary: nil)
let toLocation: MKMapItem = MKMapItem.init(placemark: toMKPlacemark)
toLocation.name = "去的地方";
let options: [String : Any] = [
MKLaunchOptionsDirectionsModeKey: MKLaunchOptionsDirectionsModeDriving,
MKLaunchOptionsMapTypeKey: MKMapType.standard.rawValue,
MKLaunchOptionsShowsTrafficKey: true
]
MKMapItem .openMaps(with: [currentLocation,toLocation], launchOptions: options)
}