Skip To Content ArcGIS for Developers Sign In Dashboard

RouteTracker QML Type

Tracks the vehicle location along the route, checking status and reporting progress. More...

Import Statement: import Esri.ArcGISRuntime 100.6
Since: Esri.ArcGISRuntime 100.6





Detailed Description

Instances of this class represent methods for processing navigation. The usual (generic) workflow can look like this:

  1. Create Route Tracker and set routeResult and set routeIndex.
  2. Enable rerouting enableRerouting.
  3. Subscribe trackLocation to Location Provider (GPS, simulation, etc. Usual tracking happens each 1 second).
  4. Subscribe Map to updating location after trackLocation (Use display location).
  5. Call switchToNextDestination after obtaining Enums.DestinationStatusReached status. Before calling switchToNextDestination make sure that TrackingStatus.remainingDestinationCount > 1, a value of 1 means we are proceeding to last destination and there are no other destinations to switch to.

See also Cancelable.

Property Documentation

enableReroutingStatus : Enums.TaskStatus

Returns the current status of the enableRerouting method (read-only).

See also Enums.TaskStatus.

generateVoiceGuidance : VoiceGuidance

Returns the voice guidance notification (read-only).

Latest voice guidance will be based on last location that was passed to trackLocation. Can be used to repeat latest voice guidance, where distances will be based on current location.

The latest voice guidance is based on last location that was passed to trackLocation. Can be used to repeat latest voice guidance, where distances will be based on current location.

newVoiceGuidanceResult : VoiceGuidance

Return VoiceGuidance when newVoiceGuidanceResultChanged signal emits (read-only).

rerouteCompletedResult : TrackingStatus

Return TrackingStatus when rerouteCompletedResultChanged signal emits (read-only).

rerouteFailedError : Error

Return error when rerouteFailedErrorChanged signal emits (read-only).

reroutingEnabled : bool

Returns whether rerouting is enabled (read-only).

routeIndex : int

The index of route that will be used for tracking.

This property can be set only during instantiation.

routeResult : RouteResult

The route result that will be used for tracking.

The property should be set before any other operations. By default route number is 0.

switchToNextDestinationStatus : Enums.TaskStatus

Returns the current status of the switchToNextDestination method (read-only).

See also Enums.TaskStatus.

trackLocationStatus : Enums.TaskStatus

Returns the current status of the trackLocation method (read-only).

See also Enums.TaskStatus.

trackingStatus : TrackingStatus

Returns current tracking status (read-only).

trackingStatusResult : TrackingStatus

Return TrackingStatus when trackingStatusResultChanged signal emits (read-only).

voiceGuidanceUnitSystem : Enums.UnitSystem

The unit system used for generating voice guidance.

Default value is Enums.UnitSystemMetric.

See also Enums.UnitSystem.

Signal Documentation


Emitted when the enableReroutingStatus property changes.


Emitted when the newVoiceGuidanceResult property changes.


Emitted when the rerouteCompletedResult property changes.


Emitted when the rerouteFailedError property changes.


Emitted when background rerouting started.


Emitted when the reroutingEnabled property changes.


Emitted when the routeIndex property changes.


Emitted when the routeResult property changes.


Emitted when the switchToNextDestination property changes.


Emitted when the trackLocationStatus property changes.


Emitted when the trackingStatusResult property changes.


Emitted when the voiceGuidanceUnitSystem property changes.

Method Documentation

void cancelRerouting()

Cancels rerouting task of route tracker.

If rerouting is started this method will interrupt rerouting background process.

bool cancelTask(string taskId)

See also Cancelable.

string disableRerouting()

Disables rerouting functionality of route tracker.

string enableRerouting(RouteTask routeTask, RouteParameters routeParameters, ReroutingStrategy strategy, bool visitFirstStopOnStart)

Enables rerouting functionality of route tracker.

  • routeTask - The RouteTask that will be used for rerouting in background thread.
  • routeParameters - The The RouteParameters that will be used for rerouting in background thread.
  • strategy - The Enums.ReroutingStrategy that determines how route tracker should behave during reroute process (to next waypoint by default).
  • visitFirstStopOnStart - A flag that forces route tracker to navigate to first stop of route.

Tracker will start route calculation automatically when it is necessary (in general when vehicle is off route). Rerouting will not start if current GPS location is off Transportation Network (for example on parking lot) despite the off route status.

The enableReroutingStatusChanged signal will emit when the operation is complete.

string switchToNextDestination()

Switches route tracker to the next destination.

Call switchToNextDestination after obtaining Enums.DestinationStatus {Enums.DestinationStatusReached} status. Before calling switchToNextDestination, make sure that TrackingStatus.remainingDestinationCount > 1. A value of 1 means that the RouteTracker is already proceeding to the final destination and there are no other destinations to switch to. This method also can be useful after Enums.DestinationStatusApproaching when the vehicle cannot get to Enums.DestinationStatusReached, such as when near some private place.

The switchToNextDestinationStatusChanged signal is emitted when this operation is complete.

string trackLocation(Position location)

Tracks location and updates route tracking result.

Location must have valid values for XY, speed (in meters per second), course (in degrees) and timestamp. Events fired for RouteTracker and TrackingStatus returned when completed.

Method should be called each time a new position is received from the location source (usually once per second).

The trackLocationStatusChanged signal will emit when the operation is complete.

Feedback on this topic?