<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CarPlay",
  "identifier" : "/documentation/CarPlay/CPMapPanelButtonConfiguration/init(primaryAction:secondaryButton:travelEstimates:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "CarPlay"
    ],
    "preciseIdentifier" : "c:objc(cs)CPMapPanelButtonConfiguration(im)initWithPrimaryAction:secondaryButton:travelEstimates:"
  },
  "title" : "init(primaryAction:secondaryButton:travelEstimates:)"
}
-->

# init(primaryAction:secondaryButton:travelEstimates:)

Initializes the map panel button configuration with the specified action buttons and travel estimates.

```
init(primaryAction: CPTextButton, secondaryButton: CPButton?, travelEstimates: CPTravelEstimates)
```

## Parameters

`primaryAction`

The text button for the primary action.

`secondaryButton`

An optional button you can use to handle a secondary action. The configuration object stores a copy
of the provided button in the [`secondaryButton`](/documentation/CarPlay/CPMapPanelButtonConfiguration/secondaryButton) property.

`travelEstimates`

The travel estimates to display with the buttons. The configuration object stores a copy of the
provided travel estimates.

## Return Value

A new map panel button configuration object.

---

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)