Class RouteTracker
Uses a location to provide status and progress updates as a route is traversed (by a moving vehicle, for example).
Inheritance
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:
- Create a new RouteTracker instance.
- Enable rerouting via EnableReroutingAsync(ReroutingParameters, CancellationToken) (if supported by the underlying route service).
- Use TrackLocationAsync(Location, CancellationToken) to track the location of the device.
- Subscribe to TrackingStatusChanged event to get the TrackingStatus as the location changes. For example, this can be used to show DisplayLocation in the GeoView.
- Subscribe to NewVoiceGuidance to get the VoiceGuidance whenever new instructions are available.
- 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
| Target | Versions |
|---|---|
| .NET Standard 2.0 | 100.6 - 200.8 |
| .NET | 100.13 - 200.8 |
| .NET Windows | 100.13 - 200.8 |
| .NET Android | 200.0 - 200.8 |
| .NET iOS | 200.0 - 200.8 |
| .NET Framework | 100.6 - 200.8 |
| Xamarin.Android | 100.6 - 100.15 |
| Xamarin.iOS | 100.6 - 100.15 |
| UWP | 100.6 - 200.8 |