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
-
↳
MapTemplate
Table of contents
Constructors
Properties
Accessors
Methods
- dismissNavigationAlert
- dismissPanningInterface
- hideTripPreviews
- parseConfig
- presentNavigationAlert
- showPanningInterface
- showRouteChoicesPreviewForTrip
- showTripPreviews
- startNavigationSession
- updateConfig
- updateMapButtons
- updateTemplate
- updateTravelEstimates
Constructors
constructor
• new MapTemplate(config
): MapTemplate
Parameters
Name | Type |
---|---|
config | MapTemplateConfig |
Returns
Overrides
Defined in
packages/react-native-carplay/src/templates/MapTemplate.ts:124 (opens in a new tab)
Properties
config
• config: MapTemplateConfig
Inherited from
Defined in
packages/react-native-carplay/src/templates/MapTemplate.ts:124 (opens in a new tab)
id
• id: string
Inherited from
Defined in
packages/react-native-carplay/src/templates/Template.ts:86 (opens in a new tab)
Accessors
eventMap
• get
eventMap(): Object
Returns
Object
Name | Type |
---|---|
alertActionPressed | string |
didCancelNavigation | string |
mapButtonPressed | string |
panBeganWithDirection | string |
panEndedWithDirection | string |
panWithDirection | string |
selectedPreviewForTrip | string |
startedTrip | string |
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
Name | Type | Default value |
---|---|---|
animated | boolean | true |
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
Name | Type | Default value | Description |
---|---|---|---|
animated | boolean | false | A 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
Name | Type |
---|---|
config | any |
Returns
any
Inherited from
Defined in
packages/react-native-carplay/src/templates/Template.ts:147 (opens in a new tab)
presentNavigationAlert
▸ presentNavigationAlert(config
, animated?
): void
Parameters
Name | Type | Default value |
---|---|---|
config | NavigationAlert | undefined |
animated | boolean | true |
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
Name | Type | Default value | Description |
---|---|---|---|
animated | boolean | false | A 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
Name | Type |
---|---|
trip | Trip |
textConfiguration | TextConfiguration |
Returns
void
Defined in
packages/react-native-carplay/src/templates/MapTemplate.ts:198 (opens in a new tab)
showTripPreviews
▸ showTripPreviews(tripPreviews
, textConfiguration?
): void
Parameters
Name | Type |
---|---|
tripPreviews | Trip [] |
textConfiguration | TextConfiguration |
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
Name | Type | Description |
---|---|---|
trip | Trip | Trip 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
Name | Type |
---|---|
config | MapTemplateConfig |
Returns
void
Defined in
packages/react-native-carplay/src/templates/MapTemplate.ts:173 (opens in a new tab)
updateMapButtons
▸ updateMapButtons(mapButtons
): void
Parameters
Name | Type |
---|---|
mapButtons | MapButton [] |
Returns
void
Defined in
packages/react-native-carplay/src/templates/MapTemplate.ts:178 (opens in a new tab)
updateTemplate
▸ updateTemplate(config
): void
Parameters
Name | Type |
---|---|
config | P |
Returns
void
Inherited from
Defined in
packages/react-native-carplay/src/templates/Template.ts:141 (opens in a new tab)
updateTravelEstimates
▸ updateTravelEstimates(trip
, travelEstimates
, timeRemainingColor?
): void
Parameters
Name | Type | Default value |
---|---|---|
trip | Trip | undefined |
travelEstimates | TravelEstimates | undefined |
timeRemainingColor | TimeRemainingColor | 0 |
Returns
void
Defined in
packages/react-native-carplay/src/templates/MapTemplate.ts:155 (opens in a new tab)