calloutContentForAnnotation(annotation)
Returns custom content for the callout bubble.
Declaration
calloutContentForAnnotation?(annotation: Annotation): HTMLElement;Parameters
- annotation:
The annotation for the callout.
Return Value
The method returns a DOM element, MapKit JS adds as a subelement of the callout bubble.
Discussion
You can use this method to provide custom content inside the callout bubble without replacing the whole element, as in calloutElementForAnnotation(annotation).
When MapKit JS creates a callout for a selected annotation and the annotation’s callout delegate has no calloutElementForAnnotation(annotation) method, the framework calls calloutContentForAnnotation(annotation) method instead — if it’s defined — on the delegate with the annotation as a parameter.