@magiclane/maps-sdk
    Preparing search index...

    Class NavigationServiceAbstract

    Navigation service class

    Index

    Constructors

    Accessors

    • get simulationMaxSpeedMultiplier(): number

      Get the maximum simulation speed multiplier.

      Returns number

      The maximum simulation speed multiplier

      An exception if it fails.

    • get simulationMinSpeedMultiplier(): number

      Get the minimum simulation speed multiplier.

      Returns number

      The minimum simulation speed multiplier

      An exception if it fails.

    Methods

    • Cancel the active navigation. This method cancels the active navigation. If a route calculation is in progress then the provided callback will be triggered first with GemError.cancel.

      Parameters

      • taskHandler: TaskHandler

        Navigation listener used to identify the navigation session.

      Returns void

      An exception if it fails.

    • Get better route time-distance until it forks the navigation route.

      Parameters

      • taskHandler: { taskHandler?: TaskHandler }

        Navigation listener used to identify the navigation session.

      Returns TimeDistance

      TimeDistance object containing the time in seconds and distance in meters to the next fork

      An exception if it fails.

    • Get the current navigation instruction.

      Parameters

      • taskHandler: { taskHandler?: TaskHandler }

        Navigation listener used to identify the navigation session.

      Returns NavigationInstruction

      NavigationInstruction object

      An exception if it fails.

    • Get the current route used for navigation.

      Parameters

      • taskHandler: { taskHandler?: TaskHandler } = {}

        Navigation listener used to identify the navigation session.

      Returns Route

      Target route for the navigation session

      An exception if it fails.

    • Check if there is an active navigation in progress.

      Parameters

      • taskHandler: { taskHandler?: TaskHandler } = {}

        Navigation listener used to identify the navigation session.

      Returns boolean

      True if there is an active navigation in progress, false otherwise.

      An exception if it fails.

    • Check if there is an active simulation in progress.

      Parameters

      • taskHandler: { taskHandler?: TaskHandler } = {}

        Navigation listener used to identify the simulation instance.

      Returns boolean

      True if there is an active simulation in progress, false otherwise.

      An exception if it fails.

    • Check if there is an active trip (navigation or simulation) in progress.

      Parameters

      • taskHandler: { taskHandler?: TaskHandler } = {}

        Navigation listener used to identify the navigation session.

      Returns boolean

      True if there is an active trip in progress, false otherwise.

      An exception if it fails.

    • Cancel the active navigation. Set a roadblock on the current route having the length specified in meters starting from the current GPS position.

      Parameters

      • length: number

        The length specified in meters.

      • options: { startDistance?: number; taskHandler?: TaskHandler }

        Object containing additional options

        • OptionalstartDistance?: number

          The distance from start where the roadblock begins, defaults to -1 meaning the current navigation position.

        • OptionaltaskHandler?: TaskHandler

          Navigation listener used to identify the navigation session.

      Returns void

      An exception if it fails.

    • Skip next intermediate destination on the navigation route. The route will be recalculated and an onRouteUpdated notification will be emitted

      Parameters

      • taskHandler: { taskHandler?: TaskHandler } = {}

        Navigation listener used to identify the navigation session.

      Returns GemError

      GemError.success on success, GemError.notFound if there are no more intermediate waypoints on the route

      An exception if it fails.

    • Start a new navigation

      Parameters

      • route: Route

        Route to use for the navigation.

      • OptionalonNavigationInstructionUpdate: (eventType: NavigationEventType, instruction?: NavigationInstruction) => void

        Callback for navigation-specific events.

      • options: {
            onBetterRouteDetected?: (
                route: Route,
                travelTime: number,
                delay: number,
                timeGain: number,
            ) => void;
            onBetterRouteInvalidated?: () => void;
            onBetterRouteRejected?: (reason: GemError) => void;
            onDestinationReached?: (landmark: Landmark) => void;
            onError?: (error: GemError) => void;
            onNavigationInstruction?: (
                instruction: NavigationInstruction,
                events: Set<NavigationInstructionUpdateEvents>,
            ) => void;
            onNavigationStarted?: () => void;
            onNotifyStatusChange?: (status: NavigationStatus) => void;
            onRouteUpdated?: (route: Route) => void;
            onSkipNextIntermediateDestinationDetected?: () => void;
            onTextToSpeechInstruction?: (textInstruction: string) => void;
            onWaypointReached?: (landmark: Landmark) => void;
        } = {}

        Object containing navigation callbacks

        • OptionalonBetterRouteDetected?: (route: Route, travelTime: number, delay: number, timeGain: number) => void

          Callback called when a better route is detected.

        • OptionalonBetterRouteInvalidated?: () => void

          Callback called when a better route becomes invalid.

        • OptionalonBetterRouteRejected?: (reason: GemError) => void

          Callback called when a better route is rejected.

        • OptionalonDestinationReached?: (landmark: Landmark) => void

          Callback called when the destination has been reached.

        • OptionalonError?: (error: GemError) => void

          Callback called when an error occurs.

        • OptionalonNavigationInstruction?: (
              instruction: NavigationInstruction,
              events: Set<NavigationInstructionUpdateEvents>,
          ) => void

          Callback called when the navigation instruction is updated.

        • OptionalonNavigationStarted?: () => void

          Callback called when navigation starts.

        • OptionalonNotifyStatusChange?: (status: NavigationStatus) => void

          Callback to notify UI if the navigation status has changed.

        • OptionalonRouteUpdated?: (route: Route) => void

          Callback called when route was updated.

        • OptionalonSkipNextIntermediateDestinationDetected?: () => void

          Callback called when skip intention is detected.

        • OptionalonTextToSpeechInstruction?: (textInstruction: string) => void

          Callback called when a sound needs to be played.

        • OptionalonWaypointReached?: (landmark: Landmark) => void

          Callback called when a waypoint on the route has been reached.

      Returns TaskHandler | null

      TaskHandler for the navigation session or null if failed

      An exception if it fails.

    • Start a new simulation

      Parameters

      • route: Route

        Route to use for the simulation.

      • OptionalonNavigationInstructionUpdate: (eventType: NavigationEventType, instruction?: NavigationInstruction) => void

        Callback for navigation-specific events.

      • options: {
            onBetterRouteDetected?: (
                route: Route,
                travelTime: number,
                delay: number,
                timeGain: number,
            ) => void;
            onBetterRouteInvalidated?: () => void;
            onBetterRouteRejected?: (reason: GemError) => void;
            onDestinationReached?: (landmark: Landmark) => void;
            onError?: (error: GemError) => void;
            onNavigationInstruction?: (
                instruction: NavigationInstruction,
                events: Set<NavigationInstructionUpdateEvents>,
            ) => void;
            onNavigationStarted?: () => void;
            onNotifyStatusChange?: (status: NavigationStatus) => void;
            onRouteUpdated?: (route: Route) => void;
            onSkipNextIntermediateDestinationDetected?: () => void;
            onTextToSpeechInstruction?: (textInstruction: string) => void;
            onWaypointReached?: (landmark: Landmark) => void;
            speedMultiplier?: number;
        } = {}

        Object containing simulation callbacks and options

        • OptionalonBetterRouteDetected?: (route: Route, travelTime: number, delay: number, timeGain: number) => void

          Callback called when a better route is detected.

        • OptionalonBetterRouteInvalidated?: () => void

          Callback called when a better route becomes invalid.

        • OptionalonBetterRouteRejected?: (reason: GemError) => void

          Callback called when a better route is rejected.

        • OptionalonDestinationReached?: (landmark: Landmark) => void

          Callback called when the destination has been reached.

        • OptionalonError?: (error: GemError) => void

          Callback called when an error occurs.

        • OptionalonNavigationInstruction?: (
              instruction: NavigationInstruction,
              events: Set<NavigationInstructionUpdateEvents>,
          ) => void

          Callback called when the navigation instruction is updated.

        • OptionalonNavigationStarted?: () => void

          Callback called when simulation starts.

        • OptionalonNotifyStatusChange?: (status: NavigationStatus) => void

          Callback to notify UI if the navigation status has changed.

        • OptionalonRouteUpdated?: (route: Route) => void

          Callback called when route was updated.

        • OptionalonSkipNextIntermediateDestinationDetected?: () => void

          Callback called when skip intention is detected.

        • OptionalonTextToSpeechInstruction?: (textInstruction: string) => void

          Callback called when a sound needs to be played.

        • OptionalonWaypointReached?: (landmark: Landmark) => void

          Callback called when a waypoint on the route has been reached.

        • OptionalspeedMultiplier?: number

          Speed multiplier for the simulation.

      Returns TaskHandler | null

      TaskHandler for the simulation session or null if failed

      An exception if it fails.