【发布时间】:2019-02-21 17:27:26
【问题描述】:
我正在尝试在 Xcode 10.1 版上安装 MapBox SDK
到目前为止,我所做的是: 创建了 pod 文件
pod 'MapboxNavigation', '~> 0.29.0'
然后我将MGLMapboxAccessToken和NSLocationWhenInUseUsageDescription设置为文档中指定的正确凭据
然后我更新了要启用的“音频、AirPlay 和画中画”和“位置更新”
我导入了库
import MapboxDirections
import MapboxCoreNavigation
import MapboxNavigation
然后我添加了这段代码来制作路线
let origin = Waypoint(coordinate: CLLocationCoordinate2D(latitude: 38.9131752, longitude: -77.0324047), name: "Mapbox")
let destination = Waypoint(coordinate: CLLocationCoordinate2D(latitude: 38.8977, longitude: -77.0365), name: "White House")
let options = NavigationRouteOptions(waypoints: [origin, destination])
Directions.shared.calculate(options) { (waypoints, routes, error) in
guard let route = routes?.first else { return }
let viewController = NavigationViewController(for: route)
present(viewController, animated: true, completion: nil)
}
我的问题是有很多错误和警告我可以做些什么来摆脱它们?
我尝试使用“修复”将代码更改为推荐的设置,但这只会导致更多错误
任何帮助将不胜感激
【问题讨论】: