ASMapLauncher地圖應(yīng)用輔助
ASMapLauncher 是一個用 Swift 寫成的 iOS 庫,幫助使用各類地圖 App 進(jìn)行導(dǎo)航。
首先,啟動 ASMapLauncher,檢查將要選擇的地圖應(yīng)用程序是否已安裝在設(shè)備上。
mapLauncher = ASMapLauncher() var isInstalled = mapLauncher.isMapAppInstalled(ASMapApp.ASMapAppGoogleMaps)
然后,啟動被選擇的地圖應(yīng)用程序。
if isInstalled {
var destination: CLLocation! = CLLocation(latitude: 41.0053215, longitude: 29.0121795)
var fromMapPoint: ASMapPoint! = ASMapPoint(location: CLLocation(latitude: currenctCoordinate.latitude, longitude: currenctCoordinate.longitude), name: "", address: "")
var toMapPoint: ASMapPoint! = ASMapPoint(location: CLLocation(latitude: destination.coordinate.latitude, longitude: destination.coordinate.longitude), name: "", address: "")
mapLauncher.launchMapApp(ASMapApp.ASMapAppGoogleMaps, fromDirections: fromMapPoint, toDirection: toMapPoint)
}
目前支持下列地圖應(yīng)用:
-
- Apple Maps
-
- Google Maps
-
- Yandex Navigator
-
- Citymapper
-
- Navigon
-
- The Transit App
-
- Waze
評論
圖片
表情
