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

# CPMapButton

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

```
@MainActor class CPMapButton
```

## Topics

### Creating a Map Button

[`-  initWithHandler:`](/documentation/CarPlay/CPMapButton/init(handler:))

Creates a new map button.

### Providing Button Images

[`image`](/documentation/CarPlay/CPMapButton/image)

The image to display on the button.

[`focusedImage`](/documentation/CarPlay/CPMapButton/focusedImage)

The image to display when focus is on the button.

### Controlling the Button

[`enabled`](/documentation/CarPlay/CPMapButton/isEnabled)

A Boolean value that enables and disables the map button.

[`hidden`](/documentation/CarPlay/CPMapButton/isHidden)

A Boolean value that hides and shows the map button.

## Relationships

### Conforms To

[`CVarArg`](/documentation/Swift/CVarArg)

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

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

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)