public interface NavigationProgressListener
|Modifier and Type||Interface and Description|
Defines the handler passed to the host app as part of the onDestinationReached callback.
|Modifier and Type||Method and Description|
Called when the user reaches one of the destinations on their route.
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.
Called when the user's progress along the route has been updated; whether currently on- or off-route.
void onLocationObservationReceived(LocationObservation locationObservation)
Note that the
LocationObservation parameter contains the location's raw GPS coordinates,
the "snapped to route" location coordinates, as well as a few other utility values -- such as
the distance to the next upcoming manuever, and the remaining distance to travel on the current
route-leg -- see
However, when the user is not on-route, the
LocationObservation supplied will
simply provide the raw location for the value of
-- since the user is off-route and therefore the "snapped" location is no longer really applicable.
Similarly, when off-route, the other fields in the
LocationObservation will also default
to "dummy" values in this case -- for example
will be zero; as well as the distanceFromRawLocationToSnappedLocation,
the distanceToUpcomingManeuver, and the remainingLegDistance.
The value of
LocationObservation.getCurrentRouteLeg(), however, will still be valid even
when off-route -- so the host-app can still compute or update its UI with any route-related updates
while in this state, as appropriate for the given application. However, of course, if the user
remains off-route for some time, the value for the current route-leg will become stale and
perhaps no longer applicable.
locationObservation- the location observation containing the "raw" GPS location, the "snapped" location, etc -- as described above
void onUpcomingManeuverUpdated(Maneuver upcomingManeuver)
void onInaccurateObservationReceived(Location location)
void onDestinationReached(Destination destination, boolean isFinalDestination, RouteLeg routeLegCompleted, NavigationProgressListener.DestinationAcceptanceHandler destinationAcceptanceHandler)
isFinalDestinationis true, then
routeLegCompletedis the last route leg completed.
destinationAcceptanceHandler- a handler to be used by the client to indicate whether that the user has indeed arrived at one of their intermediate destinations. Passing true would advance the route leg. This callback can be used in conjunction with a dialog (e.g. "Continue Navigation? Or Pause?")