<!--
{
  "availability" : [
    "MapKit JS: 5.74.1 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKitJS",
  "identifier" : "/documentation/MapKitJS/Map/annotationForMapFeature",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "MapKit JS"
    ],
    "preciseIdentifier" : "instp/mapkit.Map/annotationForMapFeature"
  },
  "title" : "annotationForMapFeature"
}
-->

# annotationForMapFeature

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

```
get annotationForMapFeature():
    | ((
          mapFeatureAnnotation: MapFeatureAnnotation,
      ) => Annotation | undefined)
    | undefined;
set annotationForMapFeature(
    value:
        | ((
              mapFeatureAnnotation: MapFeatureAnnotation,
          ) => Annotation | undefined)
        | undefined,
);
```

## 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.

---

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)