RouteTracker QML Type
Uses a location to provide status and progress updates as a route is traversed (by a moving vehicle, for example). More...
Import Statement: | import Esri.ArcGISRuntime 100.10 |
Since: | Esri.ArcGISRuntime 100.6 |
Inherits: |
Properties
- enableReroutingStatus : Enums.TaskStatus
- generateVoiceGuidance : VoiceGuidance
- newVoiceGuidanceResult : VoiceGuidance
- rerouteCompletedResult : TrackingStatus
- rerouteFailedError : Error
- reroutingEnabled : bool
- routeIndex : int
- routeResult : RouteResult
- skipCoincidentStops : int
- switchToNextDestinationStatus : Enums.TaskStatus
- trackLocationStatus : Enums.TaskStatus
- trackingStatus : TrackingStatus
- trackingStatusResult : TrackingStatus
- voiceGuidanceUnitSystem : Enums.UnitSystem
Signals
- enableReroutingStatusChanged()
- newVoiceGuidanceResultChanged()
- rerouteCompletedResultChanged()
- rerouteFailedErrorChanged()
- rerouteStarted()
- reroutingEnabledChanged()
- routeIndexChanged()
- routeResultChanged()
- switchToNextDestinationStatusChanged()
- trackLocationStatusChanged()
- trackingStatusResultChanged()
- voiceGuidanceUnitSystemChanged()
Methods
- void cancelRerouting()
- bool cancelTask(string taskId)
- string disableRerouting()
- string enableRerouting(RouteTask routeTask, RouteParameters routeParameters, ReroutingStrategy strategy, bool visitFirstStopOnStart)
- string switchToNextDestination()
- string trackLocation(Position location)
- string trackRuntimeLocation(Location location)
Detailed Description
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 enableRerouting (if supported by the underlying route service).
- Subscribe trackLocation to a Location Provider (GPS, simulator, etc.) to track the location of the device.
- Subscribe Map to updating location after trackLocation or trackRuntimeLocation to get the TrackingStatus as the location updates.
- If there are multiple stops, call switchToNextDestination each time Enums.DestinationStatusReached is returned. Before switching to the next destination, make sure TrackingStatus::remainingDestinationCount > 1, a value of 1 means the last destination is being approached.
See also Cancelable.
Property Documentation
Returns the current status of the enableRerouting method (read-only).
See also Enums.TaskStatus.
generateVoiceGuidance : VoiceGuidance |
Returns the voice guidance notification (read-only).
The most recent voice guidance based on the last trackLocation. It can be used to repeat last/latest voice guidance.
newVoiceGuidanceResult : VoiceGuidance |
Return VoiceGuidance when newVoiceGuidanceResultChanged signal emits (read-only).
rerouteCompletedResult : TrackingStatus |
Return TrackingStatus when rerouteCompletedResultChanged signal emits (read-only).
rerouteFailedError : Error |
Return error when rerouteFailedErrorChanged signal emits (read-only).
Returns whether routes are automatically regenerated when tracking status is off-route (read-only).
The index of Route in RouteResult to track.
The specified Route must contain Stops and Directions. This property can be set only during instantiation.
routeResult : RouteResult |
The route result that will be used for tracking. It must contain at least one route.
The property should be set before any other operations. By default route number is 0.
Returns if multiple stops in a row at the same location should treated as one stop. When true
, if there are multiple stops in a row, at the same network location, the new voice guidance event will fire a single time. Calling switchToNextDestination will skip over the other coincident stops, setting the state to the next relevant direction maneuver. If the value is false
, each stop will be treated as a unique destination. The default value for this property is true
. If your route does not have coincident stops, the value of this property will have no effect.
This property can be set only during instantiation.
This property was introduced in Esri.ArcGISRuntime 100.9.
Returns the current status of the switchToNextDestination method (read-only).
See also Enums.TaskStatus.
Returns the current status of the trackLocation method (read-only).
See also Enums.TaskStatus.
trackingStatus : TrackingStatus |
Returns the tracking status for the current location on the route (read-only).
trackingStatusResult : TrackingStatus |
Return TrackingStatus when trackingStatusResultChanged signal emits (read-only).
The unit system used in voice guidance commands.
Default value is Enums.UnitSystemMetric.
See also Enums.UnitSystem.
Signal Documentation
Emitted when the enableReroutingStatus property changes.
Note: The corresponding handler is onEnableReroutingStatusChanged
.
Emitted when the newVoiceGuidanceResult property changes.
Note: The corresponding handler is onNewVoiceGuidanceResultChanged
.
Emitted when the rerouteCompletedResult property changes.
Note: The corresponding handler is onRerouteCompletedResultChanged
.
Emitted when the rerouteFailedError property changes.
Note: The corresponding handler is onRerouteFailedErrorChanged
.
Emitted when background rerouting started.
Note: The corresponding handler is onRerouteStarted
.
Emitted when the reroutingEnabled property changes.
Note: The corresponding handler is onReroutingEnabledChanged
.
Emitted when the routeIndex property changes.
Note: The corresponding handler is onRouteIndexChanged
.
Emitted when the routeResult property changes.
Note: The corresponding handler is onRouteResultChanged
.
Emitted when the switchToNextDestination property changes.
Note: The corresponding handler is onSwitchToNextDestinationStatusChanged
.
Emitted when the trackLocationStatus property changes.
Note: The corresponding handler is onTrackLocationStatusChanged
.
Emitted when the trackingStatusResult property changes.
Note: The corresponding handler is onTrackingStatusResultChanged
.
Emitted when the voiceGuidanceUnitSystem property changes.
Note: The corresponding handler is onVoiceGuidanceUnitSystemChanged
.
Method Documentation
Cancels a running reroute task.
If rerouting is started this method will interrupt the rerouting background process.
Cancel the task with the ID taskId.
Returns false
if the task cannot be cancelled or there is no task with the specified id taskId.
See also Cancelable.
Disables automatic rerouting.
When disabled, the tracker will not automatically recalculate a route when the tracking status is off-route.
string enableRerouting(RouteTask routeTask, RouteParameters routeParameters, ReroutingStrategy strategy, bool visitFirstStopOnStart) |
Enables rerouting functionality of route tracker.
- routeTask - The RouteTask capable of solving routes on the same network used by the original route. This is usually the same RouteTask that was used to create the route being tracked. It will be used for rerouting in background thread.
- routeParameters - The RouteParameters that will be used for rerouting in background thread. The RouteParameters will be used for rerouting in background thread. The following properties will be ignored:
- strategy - A Enums.ReroutingStrategy that determines how route tracker should deal with remaining stops/waypoints during reroute process (reroute to next waypoint by default).
- visitFirstStopOnStart - A flag that forces route tracker to navigate to first stop of route.
Rerouting is initiated automatically when the tracking status is off-route. In order to be considered off-route, the location must be on the transportation network as well as off the current route. If a tracked location is in a parking lot, for example, it is not considered off-route and rerouting will not occur. If the next location is on the network but not on the route, automatic rerouting will begin.
The enableReroutingStatusChanged signal will emit when the operation is complete.
Starts tracking progress to the next destination in the Route.
Use switchToNextDestination when the tracker reports a Enums.DestinationStatusReached status. Before calling switchToNextDestination make sure that TrackingStatus.remainingDestinationCount > 1
. A value of 1
means navigation is proceeding to last destination. This method can also be called after Enums.DestinationStatusApproaching in cases where the location cannot get near enough to the destination point for Enums.DestinationStatusReached (such as the center of a park or shopping center, for example).
The switchToNextDestinationStatusChanged signal is emitted when this operation is complete.
RouteTracker::trackLocation needs to be called at least once before calling this method; otherwise an error will be emitted. RouteTracker::trackLocation is needed for getting TrackingStatus and for handling visitFirstStopOnStart
.
string trackLocation(Position location) |
Provides route tracking status relative to the provided location.
The location generally comes from a GPS but may also be a simulated or manually entered location. It must have valid values for X and Y coordinates, speed (in meters per second), course (in degrees), and a timestamp. Events fired for RouteTracker and TrackingStatus returned when completed.
Method should be called each time a new position is received from the location source (usually once per second).
The trackLocationStatusChanged signal will emit when the operation is complete.
string trackRuntimeLocation(Location location) |
Provides route tracking status relative to the provided location.
The location generally comes from a GPS but may also be a simulated or manually entered Location. It must have valid values for X and Y coordinates, velocity (in meters per second), heading (in degrees), and a timestamp. When a new location is tracked the trackingStatusResultChanged signal will be emmited.
This method should be called each time a new position is received from the location source (usually once per second).
The trackLocationStatusChanged signal will emit when the operation is complete.
This method was introduced in Esri.ArcGISRuntime 100.8.