public class DefaultNavigationProgressListener extends java.lang.Object implements NavigationProgressListener
NavigationProgressListener.DestinationAcceptanceHandler
Constructor and Description |
---|
DefaultNavigationProgressListener() |
Modifier and Type | Method and Description |
---|---|
void |
onDestinationReached(Destination destination,
boolean isFinalDestination,
RouteLeg routeLegCompleted,
NavigationProgressListener.DestinationAcceptanceHandler destinationAcceptanceHandler)
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) |
public void onLocationObservationReceived(LocationObservation locationObservation)
NavigationProgressListener
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()
.
onLocationObservationReceived
in interface NavigationProgressListener
locationObservation
- the location observation containing both a "raw" GPS location, the "snapped" location, etc.public void onUpcomingManeuverUpdated(Maneuver upcomingManeuver)
onUpcomingManeuverUpdated
in interface NavigationProgressListener
public void onDestinationReached(Destination destination, boolean isFinalDestination, RouteLeg routeLegCompleted, NavigationProgressListener.DestinationAcceptanceHandler destinationAcceptanceHandler)
NavigationProgressListener
isFinalDestination
is true, then routeLegCompleted
is the last route leg completed.
onDestinationReached
in interface NavigationProgressListener
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?")public void onInaccurateObservationReceived(Location location)
NavigationProgressListener
onInaccurateObservationReceived
in interface NavigationProgressListener