Show / Hide Table of Contents

Method EnableReroutingAsync

EnableReroutingAsync(RouteTask, RouteParameters, ReroutingStrategy, Boolean, CancellationToken)

Enables automatic rerouting when the tracker detects an off-route status.

Declaration
public Task EnableReroutingAsync(RouteTask routeTask, RouteParameters routeParameters, ReroutingStrategy reroutingStrategy, bool visitFirstStopOnStart, CancellationToken cancellationToken = null)
Parameters
Type Name Description
RouteTask routeTask

A 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. The RouteTask will be used for rerouting in background thread.

RouteParameters routeParameters

A RouteParameters object that defines parameters for the rerouting RouteTask. These properties will be ignored: Stops, FindBestSequence, OutputSpatialReference, PreserveFirstStop, StartTime, ReturnDirections, ReturnStops, ReturnRoutes.

ReroutingStrategy reroutingStrategy

A rerouting strategy that determines how new routes are created (to the next waypoint by default).

System.Boolean visitFirstStopOnStart

Whether the first stop must be visited when rerouted (false by default).

CancellationToken cancellationToken

Optional token that may be used to cancel the async enabling operation.

Returns
Type Description
Task

The task object representing the asynchronous operation to enable re-routing.

Remarks

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.

See Also
SupportsRerouting
DisableRerouting()

Applies to

Platforms and versions
TargetVersions
UWP100.15

EnableReroutingAsync(ReroutingParameters, CancellationToken)

Enables automatic rerouting when the tracker detects an off-route status.

Declaration
public Task EnableReroutingAsync(ReroutingParameters parameters, CancellationToken cancellationToken = null)
Parameters
Type Name Description
ReroutingParameters parameters

A ReroutingParameters object that allows customizing background rerouting.

CancellationToken cancellationToken

Optional token that may be used to cancel the async enabling operation.

Returns
Type Description
Task

The representing the asynchronous operation to enable re-routing.

Remarks

Re-routing only occurs when the current location is off-route, but on or near the transportation network edges. For example if an off-route state is detected but the tracked location is in a parking lot, away from any transportation network edges, re-routing will not occur, and will occur only once a subsequent tracked location is on or near the transportation network edges.

See Also
SupportsRerouting
DisableRerouting()

Applies to

Platforms and versions
TargetVersions
UWP100.15
In This Article
Back to top Copyright © 2022 Esri.