TypeScript API
Maptemplate

Class: MapTemplate

The Map Template is a control layer that appears as an overlay over the base view and allows you to present user controls.

The control layer consists of a navigation bar and map buttons. By default, the navigation bar appears when the user interacts with the app, and disappears after a period of inactivity.

The navigation bar includes up to two leading buttons and two trailing buttons. You can customize the appearance of these buttons with icons or text.

The control layer may also include up to four map buttons. The map buttons are always shown as icons.

Navigation apps enter panning mode, zoom in or out, and perform other functions by responding to user actions on these buttons.

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new MapTemplate(config): MapTemplate

Parameters

NameType
configMapTemplateConfig

Returns

MapTemplate

Overrides

Template.constructor

Defined in

packages/react-native-carplay/src/templates/MapTemplate.ts:124 (opens in a new tab)

Properties

config

config: MapTemplateConfig

Inherited from

Template.config

Defined in

packages/react-native-carplay/src/templates/MapTemplate.ts:124 (opens in a new tab)


id

id: string

Inherited from

Template.id

Defined in

packages/react-native-carplay/src/templates/Template.ts:86 (opens in a new tab)

Accessors

eventMap

get eventMap(): Object

Returns

Object

NameType
alertActionPressedstring
didCancelNavigationstring
mapButtonPressedstring
panBeganWithDirectionstring
panEndedWithDirectionstring
panWithDirectionstring
selectedPreviewForTripstring
startedTripstring

Overrides

Template.eventMap

Defined in

packages/react-native-carplay/src/templates/MapTemplate.ts:111 (opens in a new tab)


type

get type(): string

Returns

string

Overrides

Template.type

Defined in

packages/react-native-carplay/src/templates/MapTemplate.ts:107 (opens in a new tab)

Methods

dismissNavigationAlert

dismissNavigationAlert(animated?): void

Parameters

NameTypeDefault value
animatedbooleantrue

Returns

void

Defined in

packages/react-native-carplay/src/templates/MapTemplate.ts:206 (opens in a new tab)


dismissPanningInterface

dismissPanningInterface(animated?): void

Dismisses the panning interface.

When dismissing the panning interface, the system shows the previously hidden map buttons.

Parameters

NameTypeDefault valueDescription
animatedbooleanfalseA Boolean value that determines whether to animate the dismissal of the panning interface.

Returns

void

Defined in

packages/react-native-carplay/src/templates/MapTemplate.ts:228 (opens in a new tab)


hideTripPreviews

hideTripPreviews(): void

Hides the display of trip previews.

Returns

void

Defined in

packages/react-native-carplay/src/templates/MapTemplate.ts:186 (opens in a new tab)


parseConfig

parseConfig(config): any

Parameters

NameType
configany

Returns

any

Inherited from

Template.parseConfig

Defined in

packages/react-native-carplay/src/templates/Template.ts:147 (opens in a new tab)


presentNavigationAlert

presentNavigationAlert(config, animated?): void

Parameters

NameTypeDefault value
configNavigationAlertundefined
animatedbooleantrue

Returns

void

Defined in

packages/react-native-carplay/src/templates/MapTemplate.ts:202 (opens in a new tab)


showPanningInterface

showPanningInterface(animated?): void

Shows the panning interface over the map.

Calling this method while displaying the panning interface has no effect.

While showing the panning interface, the system hides all map buttons. The system doesn't provide a button to dismiss the panning interface. Instead, you must provide a map button in the navigation bar that the user taps to dismiss the panning interface.

Parameters

NameTypeDefault valueDescription
animatedbooleanfalseA Boolean value that determines whether to animate the panning interface.

Returns

void

Defined in

packages/react-native-carplay/src/templates/MapTemplate.ts:218 (opens in a new tab)


showRouteChoicesPreviewForTrip

showRouteChoicesPreviewForTrip(trip, textConfiguration?): void

Parameters

NameType
tripTrip
textConfigurationTextConfiguration

Returns

void

Defined in

packages/react-native-carplay/src/templates/MapTemplate.ts:198 (opens in a new tab)


showTripPreviews

showTripPreviews(tripPreviews, textConfiguration?): void

Parameters

NameType
tripPreviewsTrip[]
textConfigurationTextConfiguration

Returns

void

Defined in

packages/react-native-carplay/src/templates/MapTemplate.ts:190 (opens in a new tab)


startNavigationSession

startNavigationSession(trip): Promise<NavigationSession>

Begins guidance for a trip.

Keep a reference to the navigation session to perform guidance updates.

Parameters

NameTypeDescription
tripTripTrip class instance

Returns

Promise<NavigationSession>

Defined in

packages/react-native-carplay/src/templates/MapTemplate.ts:150 (opens in a new tab)


updateConfig

updateConfig(config): void

Update MapTemplate configuration

Parameters

NameType
configMapTemplateConfig

Returns

void

Defined in

packages/react-native-carplay/src/templates/MapTemplate.ts:173 (opens in a new tab)


updateMapButtons

updateMapButtons(mapButtons): void

Parameters

NameType
mapButtonsMapButton[]

Returns

void

Defined in

packages/react-native-carplay/src/templates/MapTemplate.ts:178 (opens in a new tab)


updateTemplate

updateTemplate(config): void

Parameters

NameType
configP

Returns

void

Inherited from

Template.updateTemplate

Defined in

packages/react-native-carplay/src/templates/Template.ts:141 (opens in a new tab)


updateTravelEstimates

updateTravelEstimates(trip, travelEstimates, timeRemainingColor?): void

Parameters

NameTypeDefault value
tripTripundefined
travelEstimatesTravelEstimatesundefined
timeRemainingColorTimeRemainingColor0

Returns

void

Defined in

packages/react-native-carplay/src/templates/MapTemplate.ts:155 (opens in a new tab)