---
title: annotationForMapFeature
framework: mapkitjs
role: symbol
role_heading: Interface Property
path: mapkitjs/mapconstructoroptions/annotationformapfeature
---

# annotationForMapFeature

The method MapKit JS calls when the framework creates a map feature annotation.

## Declaration

```data
annotationForMapFeature?: (
    mapFeatureAnnotation: MapFeatureAnnotation,
) => Annotation | undefined;
```

## Discussion

Discussion You can choose to return the annotation the method provides with modified properties, or provide a new annotation to represent the map feature. If an annotation doesn’t return, MapKit JS uses the default annotation.
