<!--
{
  "availability" : [
    "MapKit JS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKitJS",
  "identifier" : "/documentation/MapKitJS/AnnotationCalloutDelegate/calloutElementForAnnotation",
  "metadataVersion" : "0.1.0",
  "role" : "Interface Method",
  "symbol" : {
    "kind" : "Interface Method",
    "modules" : [
      "MapKit JS"
    ],
    "preciseIdentifier" : "structm/mapkit.AnnotationCalloutDelegate/calloutElementForAnnotation"
  },
  "title" : "calloutElementForAnnotation(annotation)"
}
-->

# calloutElementForAnnotation(annotation)

Returns an element representing a custom callout.

```
calloutElementForAnnotation?(annotation: Annotation): HTMLElement;
```

## Parameters

`annotation`

The annotation for the callout.

## Return Value

This method returns a DOM element to use as the callout element in place of the standard callout bubble. This callout element populates with the information to display, including the information from the annotation.

## Discussion

If you don’t prevent the callout from appearing, MapKit JS calls this method on the annotation’s callout delegate (if the delegate is an object and its [`calloutElementForAnnotation(annotation)`](/documentation/MapKitJS/AnnotationCalloutDelegate/calloutElementForAnnotation) property is a function) with the annotation as a parameter.

---

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)