ASMapLauncher 1.0.8

ASMapLauncher 1.0.8

测试已测试
语言语言 SwiftSwift
许可 MIT
发布最后发布2020年7月
SPM支持 SPM

Abdullah Selek 维护。



  • Abdullah Selek

Build Status CocoaPods Compatible Carthage Compatible Platform License

ASMapLauncher

ASMapLauncher 是用 Swift 编写的 iOS 库,可帮助使用各种地图应用程序进行导航。

要求

ASMapLauncher 版本 最低 iOS 目标 Swift 版本
1.0.7 9.x 4.2
1.0.6 8.x 4.0
1.0.5 8.0 3.x

CocoaPods

CocoaPods 是 Cocoa 项目的依赖管理器。您可以使用以下命令安装它

$ gem install cocoapods

要在 CocoaPods 中将 ASMapLauncher 集成到 Xcode 项目中,请在 Podfile 中指定它

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
	pod 'ASMapLauncher', '1.0.7'
end

然后,运行以下命令

$ pod install

Carthage

Carthage 是一个去中心化的依赖管理器,可以构建您的依赖项并提供二进制框架。

您可以使用以下命令使用 Homebrew 安装 Carthage

brew update
brew install carthage

要在 Carthage 中将 ASMapLauncher 集成到 Xcode 项目中,请将此库指定在 Cartfile 中

github "abdullahselek/ASMapLauncher" ~> 1.0.7

运行carthage update以构建框架,并将生成的ASMapLauncher.framework拖入您的Xcode项目中。

用法

首先初始化ASMapLauncher,并检查设备上已安装的所选地图应用程序。

let mapLauncher = ASMapLauncher()
let isInstalled = mapLauncher.isMapAppInstalled(.here)

然后,启动所选地图应用程序。

if isInstalled {
	let destination: CLLocation! = CLLocation(latitude: 41.0053215, longitude: 29.0121795)
	let fromMapPoint: MapPoint! = MapPoint(location: CLLocation(latitude: currenctCoordinate.latitude,
	longitude: currenctCoordinate.longitude),
										   name: "", 
										   address: "")
    let toMapPoint: MapPoint! = MapPoint(location: CLLocation(latitude: destination.coordinate.latitude, longitude: destination.coordinate.longitude), 
                                         name: "", 
                                         address: "")
    mapLauncher.launchMapApp(.here, 
                             fromDirections: fromMapPoint, 
                             toDirection: toMapPoint)
}

支持的地图应用程序

- Apple Maps
- HERE Maps
- Google Maps
- Yandex Navigator
- Citymapper
- Navigon
- The Transit App
- Waze
- Moovit

MIT许可证

Copyright (c) 2015 Abdullah Selek

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.