Contents

CPMapPanel

An overlay for a custom map interface that shows navigation-related instructions or information over a portion of the map.

Declaration

class CPMapPanel

Overview

When you want to display information on top of your custom map interface, create a CPMapPanel object and fill it with the information to display. For example, you might use this panel to display a list of waypoints, nearby points of interest, route information, or other content. When you show this panel from a CPMapTemplate object, CarPlay layers the panel on top of your custom map, covering only a portion of it. Map panels support a navigation-style interface structure, allowing you to create a hierarchical structure for navigating your panel content. To add a new level of hierarchy, push a new panel using the map template methods. To remove a panel, pop it off the top of the navigation stack using the map template methods.

Create an instance of this panel when you want to add navigation-related details to your map interface. The panel displays content you provide using the CPMapPanelSection and CPMapPanelButtonConfiguration types. When you’re ready to display the panel over your map, call the showPanel(_:completion:) or pushPanel(_:completion:) method of your CPMapTemplate object. If your panel’s showsCloseButton property is true, the driver can dismiss the panel at any time; otherwise, hide or dismiss the panel programmatically using your map template’s hidePanel(completion:) or popPanel(completion:) method.

To monitor the appearance and disappearance of the panel, assign a delegate object to your map panel. The delegate object adopts the CPMapPanel.Delegate protocol and receives callbacks when your panel’s visibility changes. If you change the configured sections or their contents after you display the panel, CarPlay updates your interface accordingly.

Topics

Protocols

Initializers

Instance Properties