我试图实现“场地导航”,但是当当前操作更新时,我无法让事件监听器捕获事件。
这就是我所做的:
这是我实现的:
1。带有协议功能的NavigationListener接口
class NavigationListener: NSObject,NMAVenue3dNavigationListener{
func navigationManagerDidReachDestination(_ navigationManager: NMAVenue3dNavigationManager) {
print("reach destination")
func navigationManager(_ navigationManager: NMAVenue3dNavigationManager, hasCurrentManeuver maneuver: NMAVenue3dRouteManeuver?, nextManeuver: NMAVenue3dRouteManeuver?) {
print("New Maneuver")
}
}
将侦听器添加到场所导航管理器
self.venueMapLayer.venueNavigationManager.add(listener: NavigationListener())
创建模拟的位置源并启动导航管理器
let source = NMAVenue3dSimulatedPositionSource(routeSection:section !, speed:20,畸变Enabled:false) source.updatesInterval = 0.1 NMAPositioningManager.sharedInstance()。dataSource =源 self.venueMapLayer.venueNavigationManager.start(routeSection:section !, inCombinedRoute:CombinedRoute)