A template that provides a navigation bar and map buttons allowing users to interact with your app.


@interface CPMapTemplate : CPTemplate


After the system calls your app delegate’s application:didConnectCarInterfaceController:toWindow: method, create a CPMapTemplate object, and set it as the root template for your interface controller by calling setRootTemplate:animated:.

The map template appears as an overlay on top of the base view. The template is the control layer, providing a navigation bar and map buttons that users interact with through the CarPlay screen.

When the user begins to interact with your app through the CarPlay screen, the system displays the navigation bar, hiding it after a brief period of inactivity. You can change this behavior by setting the automaticallyHidesNavigationBar and hidesButtonsWithNavigationBar properties.

The navigation bar includes up to two leading and two trailing buttons. You can change the buttons, including their title and icon image, by setting the leadingNavigationBarButtons and trailingNavigationBarButtons properties on your template.

Also, you can display additional map buttons by providing an array of CPMapButton objects to mapButtons. Use these buttons to provide users access to actions such as entering panning mode or zooming in and out on the map.


Configuring Map Templates


A Boolean value that indicates whether the template should automatically hide the navigation bar.


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


The background color the map template uses when displaying guidance.

Handling Map Template Events


The object that serves as the delegate of the map template.


The protocol an object implements to handle events from a map template.

Managing Map Buttons


An array of map buttons displayed on the trailing bottom corner of the map template.


A button representing an action that a map template displays on the CarPlay screen.

Displaying Trip Previews

- showTripPreviews:textConfiguration:

Displays the preview for one or more trips and allows route selection.

- hideTripPreviews

Hides the display of trip previews.

- showRouteChoicesPreviewForTrip:textConfiguration:

Displays the route choices for a single trip.


A configuration object that lets you change the button titles displayed on a trip preview.

Navigating a Trip

- startNavigationSessionForTrip:

Begins navigational guidance for a trip.

Providing Trip Estimates

- updateTravelEstimates:forTrip:

Updates travel estimates, such as arrival time and remaining time and distance for a trip.

- updateTravelEstimates:forTrip:withTimeRemainingColor:

Updates travel estimates, such as arrival time and remaining time and distance for a trip, with the specified time-remaining color.


The color the system uses when displaying the time remaining for a trip.


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


The set of display styles for trip estimates.

Displaying a Navigation Alert

- presentNavigationAlert:animated:

Displays a navigation alert on the map template.

- dismissNavigationAlertAnimated:completion:

Tells the map template to dismiss the visable navigation alert.


The visible navigation alert.


An alert that displays map- or navigation-related information to the user.

Panning the Map

- showPanningInterfaceAnimated:

Shows the panning interface over the map.

- dismissPanningInterfaceAnimated:

Dismisses the panning interface.


A Boolean value that indicates whether the map template is displaying the panning interface.


Inherits From

See Also

User Interface Basics


A controller that manages the templates that provide the user interface for your app on the CarPlay screen.


A template that displays a hierarchical list of items.


A template that displays a grid of items.


An abstract base class for interface templates.


Light and dark representations of an image.