微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ASMapLauncher 地图应用辅助

程序名称:ASMapLauncher

ASMapLauncher 介绍

ASMapLauncher 是一个用 Swift 写成的 iOS 库,帮助使用各类地图 App 进行导航。

首先,启动 ASMapLauncher,检查将要选择的地图应用程序是否已安装在设备上。

mapLauncher = ASMapLauncher()
var isInstalled = mapLauncher.isMapAppInstalled(ASMapApp.ASMapAppGoogleMaps)

然后,启动被选择的地图应用程序。

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)
}

目前支持下列地图应用:

  • - Apple Maps

  • - Google Maps

  • - Yandex Navigator

  • - Citymapper

  • - Navigon

  • - The Transit App

  • - Waze

ASMapLauncher 官网

https://github.com/abdullahselek/ASMapLauncher

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐