TypeScript API
Maptemplateconfig

Interface: MapTemplateConfig

Hierarchy

Table of contents

Properties

Methods

Properties

actions

Optional actions: Action<ActionType>[]

Sets the ActionStrip for this template. Unless set with this method, the template will not have an action strip. The Action buttons in Map Based Template are automatically adjusted based on the screen size. On narrow width screen, icon Actions show by default. If no icon specify, showing title Actions instead. On wider width screen, title Actions show by default. If no title specify, showing icon Actions instead.

Limit

This template allows up to 4 Actions in its ActionStrip. Of the 4 allowed Actions, it can either be a title Action as set via setTitle, or a icon Action as set via setIcon. Android

Defined in

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


automaticallyHidesNavigationBar

Optional automaticallyHidesNavigationBar: boolean

A Boolean value that indicates whether the navigation bar hides automatically. iOS

Defined in

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


component

component: ComponentType<any>

Your component to render inside CarPlay/Android Auto Example component: MyComponent

Defined in

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


guidanceBackgroundColor

Optional guidanceBackgroundColor: string

The background color the map template uses when displaying guidance. iOS

Defined in

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


header

Optional header: Header

A component that holds onto data associated with a template's header. Android

Defined in

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


hidesButtonsWithNavigationBar

Optional hidesButtonsWithNavigationBar: boolean

A Boolean value that tells the system to hide the map buttons when hiding the navigation bar. iOS

Defined in

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


id

Optional id: string

Give the template your own ID. Must be unique.

Inherited from

TemplateConfig.id

Defined in

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


items

Optional items: ListItem[]

Sets an ItemList to show in a list view along with the map.

  • To show a marker corresponding to a point of interest represented by a row, set the Place instance via setMetadata. The host will display the PlaceMarker in both the map and the list view as the row becomes visible.
  • Images of type IMAGE_TYPE_LARGE are not allowed in this template.
  • Rows are not allowed to have both an image and a place marker.

Limit

The number of items in the ItemList should be smaller or equal than the limit provided by CONTENT_LIMIT_TYPE_PLACE_LIST. The host will ignore any items over that limit. The list itself cannot be selectable as set via setOnSelectedListener. Each Row can add up to 2 lines of texts via addText and cannot contain a Toggle. Android

Defined in

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


leadingNavigationBarButtons

Optional leadingNavigationBarButtons: BarButton[]

An array of bar buttons to display on the leading side of the navigation bar.

The navigation bar displays up to two buttons in the leading space. When including more than two buttons in the array, the system displays only the first two buttons. iOS

Inherited from

TemplateConfig.leadingNavigationBarButtons

Defined in

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


mapButtons

Optional mapButtons: MapButton[]

An array of map buttons displayed on the trailing bottom corner of the map template. If the array contains more than three buttons, the map template displays only the first three buttons, ignoring the remaining buttons. iOS Android

Defined in

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


pane

Optional pane: Pane

Sets the Pane for this template. getImage for pane will not be shown in MapTemplate. Unless set with this method, the template will not show a pane.

Limit

The number of items in the Pane should be smaller or equal than the limit provided by CONTENT_LIMIT_TYPE_PANE. The host via addText and cannot contain either a Toggle or a OnClickListener. Up to 2 Actions are allowed in the Pane. Each action's title color can be customized with ForegroundCarColorSpan instances. Any other span is not supported. If none of the header Action, the header title or the action strip have been set on the template, the header is hidden.

Defined in

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


tabImage

Optional tabImage: ImageSourcePropType

Image source for tab

Inherited from

TemplateConfig.tabImage

Defined in

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


tabSystemImageName

Optional tabSystemImageName: string

Name of system image for tab

Inherited from

TemplateConfig.tabSystemImageName

Defined in

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


tabSystemItem

Optional tabSystemItem: number

UITabBarSystemItem

Inherited from

TemplateConfig.tabSystemItem

Defined in

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


tabTitle

Optional tabTitle: string

Set tab title

Inherited from

TemplateConfig.tabTitle

Defined in

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


trailingNavigationBarButtons

Optional trailingNavigationBarButtons: BarButton[]

An array of bar buttons to display on the trailing side of the navigation bar.

The navigation bar displays up to two buttons in the trailing space. When including more than two buttons in the array, the system displays only the first two buttons. iOS

Inherited from

TemplateConfig.trailingNavigationBarButtons

Defined in

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


tripEstimateStyle

Optional tripEstimateStyle: "dark" | "light"

The style that the map template uses when displaying trip estimates during active nagivation.

Default

dark
@namespace iOS

Defined in

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

Methods

onAlertActionPressed

onAlertActionPressed(e): void

Fired when Alert Action button is pressed

Parameters

NameTypeDescription
eObjectEvent
e.primary?boolean-
e.secondary?boolean-

Returns

void

Defined in

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


onBarButtonPressed

onBarButtonPressed(e): void

Fired when bar button is pressed

Parameters

NameTypeDescription
eBarButtonEventEvent

Returns

void

Inherited from

TemplateConfig.onBarButtonPressed

Defined in

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


onDidAppear

onDidAppear(e): void

Fired after template appears

Parameters

NameTypeDescription
eBaseEventEvent

Returns

void

Inherited from

TemplateConfig.onDidAppear

Defined in

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


onDidCancelNavigation

onDidCancelNavigation(): void

Returns

void

Defined in

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


onDidDisappear

onDidDisappear(e): void

Fired after template disappears

Parameters

NameTypeDescription
eBaseEventEvent

Returns

void

Inherited from

TemplateConfig.onDidDisappear

Defined in

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


onMapButtonPressed

onMapButtonPressed(e): void

Parameters

NameType
eObject
e.idstring
e.templatestring

Returns

void

Defined in

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


onPanBeganWithDirection

onPanBeganWithDirection(e): void

Parameters

NameType
eObject
e.directionstring

Returns

void

Defined in

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


onPanEndedWithDirection

onPanEndedWithDirection(e): void

Parameters

NameType
eObject
e.directionstring

Returns

void

Defined in

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


onPanWithDirection

onPanWithDirection(e): void

Parameters

NameType
eObject
e.directionstring

Returns

void

Defined in

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


onSelectedPreviewForTrip

onSelectedPreviewForTrip(e): void

Parameters

NameType
eObject
e.routeIndexnumber
e.tripIdstring

Returns

void

Defined in

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


onStartedTrip

onStartedTrip(e): void

Parameters

NameType
eObject
e.routeIndexnumber
e.tripIdstring

Returns

void

Defined in

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


onWillAppear

onWillAppear(e): void

Fired before template appears

Parameters

NameTypeDescription
eBaseEventEvent

Returns

void

Inherited from

TemplateConfig.onWillAppear

Defined in

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


onWillDisappear

onWillDisappear(e): void

Fired before template disappears

Parameters

NameTypeDescription
eBaseEventEvent

Returns

void

Inherited from

TemplateConfig.onWillDisappear

Defined in

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