cancelRoute static method
Cancels an ongoing route calculation.
Requests cancellation of the route calculation associated with the given TaskHandler. The calculateRoute callback will be invoked with GemError.cancel after cancellation completes. Safe to call multiple times on the same handler (subsequent calls have no effect).
Has no effect if the calculation has already completed (either successfully or with an error) or if the handler is invalid. Does not cancel navigation started on a previously calculated route—use NavigationService.cancelNavigation for that purpose.
Parameters
taskHandler: The TaskHandler returned by calculateRoute identifying the calculation to cancel.
See also:
- calculateRoute - Initiates route calculation that returns the handler.
- isCalculationRunning - Checks if cancellation is still needed.
- NavigationService.cancelNavigation - Cancels active navigation.
Implementation
static void cancelRoute(final TaskHandler taskHandler) {
taskHandler as TaskHandlerImpl;
staticMethod('RoutingService', 'cancelRoute', args: taskHandler.id);
}