public interface NavigationProgressListener
Modifier and Type | Method and Description |
---|---|
void |
onDestinationReached(boolean isFinalDestination,
RouteLeg routeLegCompleted)
Called when the user reaches one of the destinations on their route.
|
void |
onInaccurateObservationReceived(Location location)
Called when a location update is received while in a state where it cannot be adequately
determined whether the user is on- or off-route, due to a recent history of location updates
with poor accuracy.
|
void |
onLocationObservationReceived(LocationObservation locationObservation)
Called when the user's progress along the route has been updated.
|
void |
onUpcomingManeuverUpdated(Maneuver upcomingManeuver) |
void onLocationObservationReceived(LocationObservation locationObservation)
LocationProviderAdapter
used by the NavigationManager
.
Note that a LocationObservation
contains both the location's raw GPS coordinates, the "snapped" (adjusted)
location coordinates, as well as a few other utility values -- such as the distance to the next upcoming manuever,
as well as the remaining distance to travel on the current route-leg -- see
LocationObservation.getDistanceToUpcomingManeuver()
and LocationObservation.getRemainingLegDistance()
.
locationObservation
- the location observation containing both a "raw" GPS location, the "snapped" location, etc.void onUpcomingManeuverUpdated(Maneuver upcomingManeuver)
void onDestinationReached(boolean isFinalDestination, RouteLeg routeLegCompleted)
isFinalDestination
is true, then routeLegCompleted
is the last route leg completed.
If the client wishes to show a dialog to the user when they've reached an intermediate destination
(e.g. "Continue Navigation? Or Pause?"), then they can simply check if isFinalDestination
is false,
and call NavigationManager.pauseNavigation()
to pause the session. Then, when the user wishes to resume
navigating, simply call NavigationManager.resumeNavigation()
.
void onInaccurateObservationReceived(Location location)