我正在尝试制作一个被动导航系统“自由驾驶模式”,我到处查看,包括文档,但不知道如何使用“PassiveLocationManager”(https://docs.mapbox.com/ios/navigation ) /概述/免费驾驶/)。
'无法将'CLLocationManager'类型的值转换为预期的参数类型'NavigationLocationManager?''
请参阅下面的代码...
struct NavView: UIViewRepresentable {
func makeCoordinator() -> Coordinator {
return Coordinator(self)
}
private let nav: MGLMapView = MGLMapView(frame: .zero, styleURL: MGLStyle.streetsStyleURL)
func makeUIView(context: UIViewRepresentableContext<NavView>) -> MGLMapView {
nav.delegate = context.coordinator
nav.layer.cornerRadius = 25
nav.locationManager = PassiveLocationManager(dataSource: PassiveLocationDataSource(directions: Directions.shared, systemLocationManager: CLLocationManager()))
return nav
}
func updateUIView(_ uiView: MGLMapView, context: UIViewRepresentableContext<NavView>) {
//
}
}