<!--
{
  "availability" : [
    "MapKit JS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKitJS",
  "identifier" : "/documentation/MapKitJS/Annotation/AnnotationConstructor",
  "metadataVersion" : "0.1.0",
  "role" : "Constructor",
  "symbol" : {
    "kind" : "Constructor",
    "modules" : [
      "MapKit JS"
    ],
    "preciseIdentifier" : "instctr/mapkit.Annotation/AnnotationConstructor"
  },
  "title" : "new Annotation(location, factory, options)"
}
-->

# new Annotation(location, factory, options)

Creates a new annotation given its location and initialization options.

```
constructor(
    location: CoordinateData | Place | SearchAutocompleteResult,
    factory: (
        location?: Coordinate,
        options?: AnnotationConstructorOptions,
    ) => HTMLElement,
    options?: AnnotationConstructorOptions,
);
```

## Parameters

`location`

The coordinate where the annotation appears.

`factory`

A factory function that returns a DOM element that represents the annotation.

`options`

A hash of properties MapKit JS uses to initialize the annotation.

## Return Value

A [`Annotation`](/documentation/MapKitJS/Annotation) instance.

## Discussion

The `factory` function returns a DOM element to represent the annotation. It can be a single element or a containing element with subelements. MapKit JS calls this function with the following two arguments:

- `coordinate` ([`Coordinate`](/documentation/MapKitJS/Coordinate)) — The annotation’s coordinate.
- `options` ([`AnnotationConstructorOptions`](/documentation/MapKitJS/AnnotationConstructorOptions)) — You can use options you pass to the annotation constructor to add context to the custom annotation.

The `options` include `title` and `subtitle`, which appear in a callout if they’re present.

---

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)