我正在尝试使用SKMaps实现导航功能,但我陷入无法调用导航侦听器的onDestinationReached方法的问题。
// 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;
}
最佳答案
一旦您接近目的地,就应该触发onDestinationReached回调(取决于您所处的道路,并且无论您是否在城市限制范围内,“关闭”距离都将在60至300米之间)。
演示项目中是否成功触发了回调?您是否以任何方式修改了音频/文本建议配置文件?