Show / Hide Table of Contents

Class RouteTracker

Uses a location to provide status and progress updates as a route is traversed (by a moving vehicle, for example).

Inheritance
System.Object
RouteTracker
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Esri.ArcGISRuntime.Navigation
Assembly: Esri.ArcGISRuntime.dll
Syntax
public sealed class RouteTracker
Remarks

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:

  1. Create a new RouteTracker instance.
  2. Enable rerouting via EnableReroutingAsync(ReroutingParameters, CancellationToken) (if supported by the underlying route service).
  3. Use TrackLocationAsync(Location, CancellationToken) to track the location of the device.
  4. Subscribe to TrackingStatusChanged event to get the TrackingStatus as the location changes. For example, this can be used to show DisplayLocation in the GeoView.
  5. Subscribe to NewVoiceGuidance to get the VoiceGuidance whenever new instructions are available.
  6. If there are multiple stops, call SwitchToNextDestinationAsync(CancellationToken) each time Reached status is returned. Before calling SwitchToNextDestinationAsync(CancellationToken) make sure that RemainingDestinationCount > 1 (a value of 1 means the last destination is being approached).

Constructors

Name Description
RouteTracker(RouteResult, Int32, Boolean)

Initializes a new instance of the RouteTracker class using a specific route from a route result with an option to specify treating coincident stops as a single destination.

Properties

Name Description
IsReroutingEnabled

Gets a value indicating whether routes are automatically regenerated when tracking status is off-route.

SkipCoincidentStops

Gets a value indicating whether multiple stops in a row at the same location should be treated as one stop.

TrackingStatus

Gets the latest TrackingStatus for the current location on the route.

VoiceGuidanceUnitSystem

Gets or sets the unit system in voice guidance commands.

Methods

Name Description
CancelRerouting()

Cancels a running reroute task.

DisableRerouting()

Disable automatic rerouting.

EnableReroutingAsync(ReroutingParameters, CancellationToken)

Enables automatic rerouting when the tracker detects an off-route status.

GenerateVoiceGuidance()

Gets the current VoiceGuidance object.

SwitchToNextDestinationAsync(CancellationToken)

Starts tracking progress to the next destination in the Route.

TrackLocationAsync(Location, CancellationToken)

Provides route tracking status relative to the provided location.

Events

Name Description
NewVoiceGuidance

Occurs when new VoiceGuidance instruction is generated by the voice guidance engine.

RerouteCompleted

Occurs when re-routing is completed.

RerouteStarted

Occurs when re-routing is started.

TrackingStatusChanged

Occurs when the TrackingStatus is updated.

Applies to

TargetVersions
.NET Standard 2.0100.6 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.0 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.6 - 200.7
Xamarin.Android100.6 - 100.15
Xamarin.iOS100.6 - 100.15
UWP100.6 - 200.7

Relevant samples

Navigate route: Use a routing service to navigate between points.
In This Article
Back to top Copyright © 2022 Esri.