<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 13.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CarPlay",
  "identifier" : "/documentation/CarPlay/CPMapTemplateDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "CarPlay"
    ],
    "preciseIdentifier" : "c:objc(pl)CPMapTemplateDelegate"
  },
  "title" : "CPMapTemplateDelegate"
}
-->

# CPMapTemplateDelegate

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

```
@MainActor protocol CPMapTemplateDelegate : NSObjectProtocol
```

## Topics

### Setting the Display Style

[`-  mapTemplate:displayStyleForManeuver:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplate(_:displayStyleFor:))

Asks the delegate for the maneuver’s display style.

[`CPManeuverDisplayStyle`](/documentation/CarPlay/CPManeuverDisplayStyle)

A display style that determines the visual layout for a maneuver.

### Handling Navigation Events

[`-  mapTemplate:selectedPreviewForTrip:usingRouteChoice:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplate(_:selectedPreviewFor:using:))

Tells the delegate that the user selected a trip and route choice to preview.

[`-  mapTemplate:startedTrip:usingRouteChoice:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplate(_:startedTrip:using:))

Tells the delegate that the user selected a trip and route choice to navigate.

[`-  mapTemplateDidCancelNavigation:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplateDidCancelNavigation(_:))

Tells the delegate that the system canceled the navigation.

[`-  mapTemplateShouldProvideNavigationMetadata:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplateShouldProvideNavigationMetadata(_:))

Asks the delegate whether the template should provide navigation metadata

### Displaying Notifications

[`-  mapTemplate:shouldShowNotificationForManeuver:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplate(_:shouldShowNotificationFor:)-4mnm1)

Asks the delegate whether the system should display the maneuver as a notification when the app is in the background.

[`-  mapTemplate:shouldUpdateNotificationForManeuver:withTravelEstimates:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplate(_:shouldUpdateNotificationFor:with:))

Asks the delegate whether the system should display the maneuver with updated travel estimates as a notification when the app is in the background.

[`-  mapTemplate:shouldShowNotificationForNavigationAlert:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplate(_:shouldShowNotificationFor:)-5lu8a)

Asks the delegate whether the system should display the navigation alert as a notification when the app is in the background.

### Handling Navigation Alerts

[`-  mapTemplate:willShowNavigationAlert:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplate(_:willShow:))

Tells the delegate that the system will show the navigation alert.

[`-  mapTemplate:didShowNavigationAlert:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplate(_:didShow:))

Tells the delegate that the system showed the navigation alert.

[`-  mapTemplate:willDismissNavigationAlert:dismissalContext:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplate(_:willDismiss:dismissalContext:))

Tells the delegate that the system is preparing to dismiss the navigation alert.

[`-  mapTemplate:didDismissNavigationAlert:dismissalContext:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplate(_:didDismiss:dismissalContext:))

Tells the delegate that the system dismissed the navigation alert.

[`DismissalContext`](/documentation/CarPlay/CPNavigationAlert/DismissalContext)

A set of reasons for dismissing a navigation alert.

### Panning the Map

[`-  mapTemplateDidShowPanningInterface:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplateDidShowPanningInterface(_:))

Tells the delegate that the panning interface is visible on the map.

[`-  mapTemplateWillDismissPanningInterface:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplateWillDismissPanningInterface(_:))

Tells the delegate that the panning interface will disappear from the map.

[`-  mapTemplateDidDismissPanningInterface:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplateDidDismissPanningInterface(_:))

Tells the delegate that the panning interface is no longer visible on the map.

[`-  mapTemplateDidBeginPanGesture:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplateDidBeginPanGesture(_:))

Tells the delegate that the pan gesture has started.

[`-  mapTemplate:panBeganWithDirection:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplate(_:panBeganWith:))

Tells the delegate that the user is starting to pan the map.

[`-  mapTemplate:panWithDirection:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplate(_:panWith:))

Tells the delegate that the user is panning in a certain direction on the map.

[`-  mapTemplate:panEndedWithDirection:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplate(_:panEndedWith:))

Tells the delegate that the user stopped panning the map.

[`PanDirection`](/documentation/CarPlay/CPMapTemplate/PanDirection)

The directions a user can pan (or move) a map displayed on the CarPlay screen.

[`-  mapTemplate:didEndPanGestureWithVelocity:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplate(_:didEndPanGestureWithVelocity:))

Tells the delegate that the pan gesture ended with the specified velocity.

[`-  mapTemplate:didUpdatePanGestureWithTranslation:velocity:`](/documentation/CarPlay/CPMapTemplateDelegate/mapTemplate(_:didUpdatePanGestureWithTranslation:velocity:))

Tells the delegate that the pan gesture changed.

## Relationships

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)