Show / Hide Table of Contents

Method SwitchToNextDestinationAsync

SwitchToNextDestinationAsync(CancellationToken)

Starts tracking progress to the next destination in the Route.

Declaration
public Task SwitchToNextDestinationAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Threading.CancellationToken cancellationToken

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

Returns
Type Description
System.Threading.Tasks.Task

The task object representing the asynchronous operation.

Remarks

Use SwitchToNextDestinationAsync(CancellationToken) when the tracker reports a Reached status. Before calling SwitchToNextDestinationAsync(CancellationToken) make sure that RemainingDestinationCount > 1 (a value of 1 means navigation is proceeding to last destination). This method can also be called after Approaching is raised in cases where the location cannot get near enough to the destination point for Reached to be raised (such as the center of a park or shopping center, for example). TrackLocationAsync(Location, CancellationToken) needs to be called at least once before calling this method otherwise an error will be thrown. TrackLocationAsync(Location, CancellationToken) is needed for getting TrackingStatus and for handling visitFirstStopOnStart.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.6 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.2 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.6 - 200.7
Xamarin.Android100.6 - 100.14
Xamarin.iOS100.6 - 100.15
UWP100.6 - 200.7
Relevant samples
Navigate route: Use a routing service to navigate between points.
In This Article
Back to top Copyright © 2022 Esri.