Search code examples
androidandroid-studionavigationskmaps

OnDestinationReached not called in SKMAPS Navigation Listener


I am trying to implement the navigation functionality using SKMaps but i am stuck in the problem of not being able to call onDestinationReached method of navigation listener.

    // 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;
}

Solution

  • The onDestinationReached callback should be triggered once you are close to your destination (depending on the road you're on and if you are inside city limits or not, "close" will be between 60 and 300 meters).

    Is the callback successfully triggered inside the demo project? Have you modified in any way the audio/text advices config file?