MapLauncher 0.1.1

MapLauncher 0.1.1

Dmytro Romanov 维护。



  • Dmitriy Romanov

MapLauncher

Version License Platform

该库允许以最简单的方式将“路线到 任何位置”功能添加到您的应用中。通过调用库中唯一的一个方法,它尝试显示一个包含所有支持的并在设备上已安装的导航应用的 ActionSheet。

目前支持:Apple Maps、Google Maps、Waze 和 Yandex。

示例

要运行示例项目,请克隆仓库,并在 Example 目录中首先运行 pod install

安装

MapLauncher 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中

pod 'MapLauncher'

使用

将以下键值对添加到您的项目 Info.plist

...
<key>LSApplicationQueriesSchemes</key>
	<array>
		<string>waze</string>
		<string>comgooglemaps</string>
		<string>yandexnavi</string>
		<string>mapsme</string>
	</array>
...

在您需要实现所需功能的位置导入库

import MapLauncher

并以以下方式调用 ActionSheet

...
// Desired destination coordinates
let placeLocation = CLLocationCoordinate2D(latitude: 50.4536, longitude: 30.5164)

// Presenting navigation apps ActionSheet
MapLauncher().present(destination: placeLocation, on: self)
...

作者

Дмитрий Романов,[email protected]

许可

MapLauncher 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。