cancelNavigation static method

void cancelNavigation([
  1. TaskHandler? taskHandler
])

Active navigation session cancellation.

Stops the currently active navigation or simulation session. If a route calculation is in progress when this method is called, the calculation will be cancelled and any registered onRouteCalculationCompleted or onError callback will be triggered with GemError.cancel.

Parameters

  • taskHandler: Optional handler for the specific navigation session to cancel. If omitted, the currently active session (navigation or simulation) will be cancelled.

See also:

Implementation

static void cancelNavigation([final TaskHandler? taskHandler]) {
  if (taskHandler != null) {
    taskHandler as TaskHandlerImpl;

    staticMethod('NavigationService', 'stopNavigation', args: taskHandler.id);
  } else {
    staticMethod('NavigationService', 'stopNavigation');
  }
}