Home > @magiclane/maps-sdk > NavigationService

NavigationService class

Navigation service class

Signature:

export declare abstract class NavigationService 

Properties

Property

Modifiers

Type

Description

simulationMaxSpeedMultiplier

static

readonly

number

Get the maximum simulation speed multiplier.

simulationMinSpeedMultiplier

static

readonly

number

Get the minimum simulation speed multiplier.

transferStatistics

static

readonly

any

Get navigation transfer statistics.

Methods

Method

Modifiers

Description

cancelNavigation(taskHandler)

static

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.

getBetterRouteTimeDistanceToFork({ taskHandler, }, input)

static

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

getDataSource(navigationListener)

static

Get the navigation data source for a navigation session.

getIntermediateWaypointDropParameters()

static

Get intermediate waypoint drop parameters.

getNavigationInstruction({ taskHandler, }, input)

static

Get the current navigation instruction.

getNavigationParameters()

static

Get navigation parameters. Possible parameters: - tts_announce_min_traffic_delay: large integer - the minimum traffic delay in seconds for which there should be a TTS announce

getNavigationRoute({ taskHandler }, input)

static

Get the current route used for navigation.

isNavigationActive({ taskHandler }, input)

static

Check if there is an active navigation in progress.

isSimulationActive({ taskHandler }, input)

static

Check if there is an active simulation in progress.

isTripActive({ taskHandler }, input)

static

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

setNavigationRoadBlock(length, { startDistance, taskHandler }, input)

static

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

skipNextIntermediateDestination({ taskHandler, }, input)

static

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

startNavigation(route, onNavigationInstructionUpdate, { onNavigationInstruction, onNavigationStarted, onTextToSpeechInstruction, onWaypointReached, onDestinationReached, onRouteUpdated, onBetterRouteDetected, onBetterRouteRejected, onBetterRouteInvalidated, onSkipNextIntermediateDestinationDetected, onTurnAround, onError, onNotifyStatusChange, onRouteCalculationStarted, onRouteCalculationCompleted, }, input)

static

Start a new navigation

startSimulation(route, onNavigationInstructionUpdate, { onNavigationInstruction, onNavigationStarted, onTextToSpeechInstruction, onWaypointReached, onDestinationReached, onRouteUpdated, onBetterRouteDetected, onBetterRouteRejected, onBetterRouteInvalidated, onSkipNextIntermediateDestinationDetected, onTurnAround, onError, onNotifyStatusChange, onRouteCalculationStarted, onRouteCalculationCompleted, speedMultiplier, }, input)

static

Start a new simulation

updateNavigationSound(navigationListener)

static

Update navigation sound instruction. Requests the navigation service to immediately generate and deliver an updated text-to-speech instruction to the onTextToSpeechInstruction callback.