cancelRoute static method

void cancelRoute(
  1. TaskHandler taskHandler
)

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

See also:

Implementation

static void cancelRoute(final TaskHandler taskHandler) {
  taskHandler as TaskHandlerImpl;

  staticMethod('RoutingService', 'cancelRoute', args: taskHandler.id);
}