---
title: annotationForMapFeature
framework: mapkitjs
role: symbol
role_heading: Instance Property
path: mapkitjs/map/annotationformapfeature
---

# annotationForMapFeature

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

## Declaration

```data
get annotationForMapFeature():
    | ((
          mapFeatureAnnotation: MapFeatureAnnotation,
      ) => Annotation | undefined)
    | undefined;
set annotationForMapFeature(
    value:
        | ((
              mapFeatureAnnotation: MapFeatureAnnotation,
          ) => Annotation | undefined)
        | 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.

## See Also

### Selecting map features

- [selectableMapFeatures](mapkitjs/map/selectablemapfeatures.md)
- [selectableMapFeatureSelectionAccessory](mapkitjs/map/selectablemapfeatureselectionaccessory.md)
