我正在尝试使用 SKMaps 实现导航功能,但我陷入了无法调用导航侦听器的 onDestinationReach 方法的问题。
// get navigation settings object
SKNavigationSettings navigationSettings = new SKNavigationSettings();
// set the desired navigation settings
navigationSettings.setNavigationType(SKNavigationSettings.SKNavigationType.SIMULATION);
navigationSettings.setPositionerVerticalAlignment(-0.25f);
navigationSettings.setShowRealGPSPositions(false);
// get the navigation manager object
navigationManager = SKNavigationManager.getInstance();
navigationManager.setMapView(mapView);
// set listener for navigation events
navigationManager.setNavigationListener(this);
// start navigating using the settings
navigationManager.startNavigation(navigationSettings);
navigationInProgress = true;
}
一旦您接近目的地,就会触发 onDestinationReach 回调(取决于您所在的道路以及您是否在城市范围内,"关闭"将在 60 到 300 米之间)。
回调是否在演示项目中成功触发?您是否以任何方式修改了音频/文本建议配置文件?