RouteTrackerLocationDataSource class final
A location data source that uses a route tracker and a generic location data source to output locations snapped to a route.
Setting the RouteTrackerLocationDataSource 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 RouteTrackerLocationDataSource 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 RouteTrackerLocationDataSource 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 RouteTrackerLocationDataSource'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 LocationDataSource.onLocationChanged event to the RouteTracker.trackLocation. The TrackingStatus.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 ArcGISMapViewController.locationDisplay class.
- Inheritance
-
- Object
- LocationDataSource
- RouteTrackerLocationDataSource
Constructors
- RouteTrackerLocationDataSource({required RouteTracker routeTracker, LocationDataSource? locationDataSource})
-
Creates a RouteTrackerLocationDataSource object.
factory
Properties
- error → ArcGISException?
-
An error that describes a problem encountered while starting or running
the LocationDataSource.
no setterinherited
- exception → Exception?
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
onErrorChanged
→ Stream<
ArcGISException?> -
Indicates that the LocationDataSource.error property has changed.
no setterinherited
-
onExceptionChanged
→ Stream<
Exception?> -
no setterinherited
-
onHeadingChanged
→ Stream<
double> -
Set the heading changed callback function for the location data source.
no setterinherited
-
onLocationChanged
→ Stream<
ArcGISLocation> -
Set the location changed callback function for the location data source.
no setterinherited
-
onStatusChanged
→ Stream<
LocationDataSourceStatus> -
Set the status changed callback function for the location data source.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → LocationDataSourceStatus
-
The current status of the location data source.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
start(
) → Future< void> -
Starts the location data source asynchronously and prepares to begin
receiving location updates.
inherited
-
stop(
) → Future< void> -
Stops the location data source asynchronously.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateHeading(
double heading) → void -
Updates the current heading angle, in degrees clockwise, relative to
north.
inherited
-
updateLocation(
ArcGISLocation location) → void -
Updates the position of the current location.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited