Uses a location to provide status and progress updates as a route is traversed (by a moving vehicle, for example). RouteTracker can give the time or distance to the next maneuver, notify if the location is off-route, and regenerate a new route if necessary. Basic workflow:
Create a new RouteTracker instance.
Enable rerouting with RouteTracker.enableRerouting(ReroutingParameters) (if supported by the underlying route service).
Use RouteTracker.trackLocation(Location) to track the location of the device.
Subscribe to RouteTracker.trackingStatusChanged to get the TrackingStatus as the location changes.
If there are multiple stops, call RouteTracker.switchToNextDestination() each time DestinationStatus.Reached status is returned. Before calling RouteTracker.switchToNextDestination() make sure that TrackingStatus.remainingDestinationCount 1, a value of 1 means the last destination is being approached.
Creates a Route Tracker using a specific route from a route result with an option to specify treating coincident stops as a single destination. An exception is thrown if the Route is not found or if it lacks Route.stops and Route.directionManeuvers.
Indicates if multiple stops in a row at the same location should treated as one stop. When true, if there are multiple stops, in a row, at the same network location the new voice guidance event will fire a single time and calling RouteTracker.switchToNextDestination() will skip over the other coincident stops, setting the state to the next relevant direction maneuver. If the value is false each stop will be treated as a unique destination. The default value for this property is true. If your route does not have coincident stops the value of this property will have no effect.
Enables automatic rerouting when the tracker detects an off-route status. Re-routing only occurs when the current location is off-route, but on or near the transportation network edges. For example if an off-route state is detected but the tracked location is in a parking lot, away from any transportation network edges, re-routing will not occur, and will occur only once a subsequent tracked location is on or near the transportation network edges.
Sets a callback which returns the speech engine ready status. Set the speech engine activity status using this lambda to avoid speech event conflicts. This logic is used by RouteTracker before new RouteTracker.newVoiceGuidance is raised to check if the speech engine is busy. If it is busy it will postpone raising the voice guidance event until next RouteTracker.trackLocation will be called. Here is an example of how it can be used with a text-to-speech engine:
Starts tracking progress to the next destination in the Route. Use RouteTracker.switchToNextDestination() when the tracker reports a DestinationStatus.Reached status. Before calling RouteTracker.switchToNextDestination() make sure that TrackingStatus.remainingDestinationCount 1 (a value of 1 means navigation is proceeding to last destination). This method can also be called after DestinationStatus.Approaching is raised in cases where the location cannot get near enough to the destination point for DestinationStatus.Reached to be raised (such as the center of a park or shopping center, for example). RouteTracker.trackLocation(Location) needs to be called at least once before calling this method otherwise an error will be thrown. RouteTracker.trackLocation(Location) is needed for getting TrackingStatus and for handling visitFirstStopOnStart.
Provides route tracking status relative to the provided location. The location generally comes from a GPS but may also be a simulated or manually entered location. It must have valid values for X and Y coordinates, speed (in meters per second), course (in degrees), and a timestamp. Events fired for RouteTracker when completed.