Skip to content

GuidanceMgr

Note

All React Native methods are async functions.

Overview
Description A native module containing methods for obtaining navigational information such as location and road info.
Supported on React Native Since Version 10.14
Type Native Module

Methods

Method Name Return Type Description
getCurrentRoad() Road Gets information about the current road.
getTurnInstruction (boolean) TurnInstruction Gets the upcoming turn instruction.
getLaneAssist() LaneAssistInfo Gets the current lane assist information.
getCurrentPosition() PositionInfo Obtains a variety of data pertaining to CoPilot's current or last known position including.
getETA() string Obtains the current Estimated Time of Arrival for the first destination of the trip.
getDistanceToDestination() double Gets the distance from CoPilot's current position (map-snapped) to its destination.

Hooks and Callbacks

Hooks and Callbacks related to Guidance can be found below.

GuidanceListener
onArrivedAtStop
onOverSpeedLimitEvent
onCrossedCountryBorder
onETAChanged
onEstimatedTravelTimeUpdated
onDistanceToDestinationUpdated
onPositionUpdate
onTurnInstructionEvent
onTrafficInfoProcessedForCurrentRoute

GuidanceMgr.getCurrentRoad

Overview
Description Gets information about the current road.
Supported on React Native Since Version 10.14
Type Method

Syntax

JSONObject getCurrentRoad()

Parameters

None

Return Value

A Road JSON object containing information about the current road.

Sample Code

const GuidanceMgr = NativeModules.GuidanceMgr;
var currentRoad = await GuidanceMgr.getCurrentRoad();

GuidanceMgr.getTurnInstruction

Overview
Description Gets information about the upcoming turn instruction.
Supported on React Native Since Version 10.14
Type Method

Syntax

JSONObject getTurnInstruction()

Parameters

None

Return Value

A TurnInstruction JSON object that contains the information about the upcoming turn.

Sample Code

const GuidanceMgr = NativeModules.GuidanceMgr;
var currentTurnInstruction = await GuidanceMgr.getTurnInstruction();

GuidanceMgr.getLaneAssist

Overview
Description Returns a JSON object representing the current lane assist information.
Supported on React Native Since Version 10.14
Type Method

Syntax

JSONObject getLaneAssist()

Parameters

None

Return Value

A LaneAssistInfo JSON object with the current lane assist information.

Sample Code

const GuidanceMgr = NativeModules.GuidanceMgr;
var laneAssist = await GuidanceMgr.getLaneAssist();

GuidanceMgr.getCurrentPosition

Overview
Description Provides information relating to CoPilot’s current or last known location. This will include coordinates as well as other location information detailing the quality of the GPS fix and the number of satellites contributing to the current GPS fix.

Note: The last known position will be returned when the current location cannot be determined. This could potentially be from a previous run of the application, depending when this API is used.

Supported on React Native Since Version 10.14
Type Method

Syntax

JSONObject getCurrentPosition()

Return Value

A PositionInfo JSON object populated with data pertaining to CoPilot's current or last known position.

Sample Code

const GuidanceMgr = NativeModules.GuidanceMgr;
var position = await GuidanceMgr.getCurrentPosition();

GuidanceMgr.getETA

Overview
Description Provides details of the current estimated time of arrival (ETA) for the first destination of the trip that CoPilot is navigating. If CoPilot has not yet started or does not have a destination entered, an exception will be thrown.
Supported on React Native Since Version 10.14
Type Method

Syntax

String getETA()

Parameters

None

Return Value

A string indicating the estimated time of arrival.

Sample Code

const GuidanceMgr = NativeModules.GuidanceMgr;
var eta = await GuidanceMgr.getETA();

GuidanceMgr.getDistanceToDestination

Overview
Description Provides the distance from the current location to the destination that has been entered into CoPilot. This will be returned in miles or kilometers depending on the settings. If CoPilot has not been started, an error will be returned.
Supported on Android Since Version 10.14
Type Method

Syntax

double getDistanceToDestination()

Parameters

None

Return Value

The distance remaining to the destination. This distance will be in miles if CoPilot is set to use imperial measurements or meters if CoPilot is set to use metric measurements.

Sample Code

const GuidanceMgr = NativeModules.GuidanceMgr;
var distance = await GuidanceMgr.getDistanceToDestination();

Last update: February 12, 2020