Show / Hide Table of Contents

Class RouteTrackerLocationDataSource

Represents a location data source that uses a RouteTracker and a generic LocationDataSource to output locations snapped to a route.

Inheritance
System.Object
LocationDataSource
RouteTrackerLocationDataSource
LocationDataSource.CreateDefault()
LocationDataSource.StartAsync()
LocationDataSource.StopAsync()
LocationDataSource.UpdateHeading(Double)
LocationDataSource.UpdateLocation(Location)
LocationDataSource.Status
LocationDataSource.Error
LocationDataSource.LocationChanged
LocationDataSource.HeadingChanged
LocationDataSource.StatusChanged
LocationDataSource.ErrorChanged
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.Location
Assembly: Esri.ArcGISRuntime.dll
Syntax
public sealed class RouteTrackerLocationDataSource : LocationDataSource
Remarks

Setting the route tracker location data source is optional when desiring to have the location display symbol navigate along a route. Using this object provides the benefit of having the current location snapped to the route polyline during navigation. If the route tracker location data source is not used, you may notice that the actual GPS location tends to wander off the route polyline due to the accuracy provided by the GPS unit.

No distance tolerance needs to be specified to enable the snapping effect of having the location display symbol follow along the route polyline. An internal algorithm is used by the route tracker location data source to determine if location is 'on route' or 'off route'. If the location is seen as 'on route' then snapping will occur, otherwise the output location will be the original input GPS location. If it is determined that the tracking along the route is no longer needed the route tracker location data source's stop method can be called or the LocationDisplay can be reset to a different data source.

To provide some insight on how the RouteTrackerLocationDataSource works, the data source will pass the locations from the LocationChanged event to the TrackLocationAsync(Location, CancellationToken). The DisplayLocation will then be returned in this data source's LocationChanged event.

To control the orientation of the location display symbol as it navigates along a route refer to the LocationDisplay class.

Constructors

Name Description
RouteTrackerLocationDataSource(RouteTracker)

Initializes a new instance of the RouteTrackerLocationDataSource class using the given RouteTracker and the platform's default location data source.

RouteTrackerLocationDataSource(RouteTracker, LocationDataSource)

Initializes a new instance of the RouteTrackerLocationDataSource class using the given RouteTracker and LocationDataSource.

Properties

Name Description
LocationDataSource

Gets the original location data source.

RouteTracker

Gets the route tracker used for snapping locations to the route.

Methods

Name Description
OnStartAsync()

Called when location tracking has started

OnStopAsync()

Called when location tracking has stopped

Applies to

TargetVersions
.NET Standard 2.0100.10 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.0 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.10 - 200.7
Xamarin.Android100.10 - 100.15
Xamarin.iOS100.10 - 100.15
UWP100.10 - 200.7
In This Article
Back to top Copyright © 2022 Esri.