Class RouteTrackerLocationDataSource
Represents a location data source that uses a RouteTracker and a generic LocationDataSource to output locations snapped to a route.
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
Target | Versions |
---|---|
.NET Standard 2.0 | 100.10 - 200.6 |
.NET | 100.13 - 200.6 |
.NET Windows | 100.13 - 200.6 |
.NET Android | 200.0 - 200.6 |
.NET iOS | 200.0 - 200.6 |
.NET Framework | 100.10 - 200.6 |
Xamarin.Android | 100.10 - 100.15 |
Xamarin.iOS | 100.10 - 100.15 |
UWP | 100.10 - 200.6 |