---
title: "AnnotationOptions | Geosplats sdk"
description: "Documentation for MapTiler GeoSplats SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Interface AnnotationOptions

Options for creating an Annotation in a SplatModel instance.

interface AnnotationOptions {  
    [color](#color)?: [Color](https://docs.maptiler.com/geosplats-sdk/api/types/Color/);  
    [data](#data)?: unknown;  
    [icon](#icon)?: string;  
    [label](#label)?: string;  
    [popup](#popup)?: string;  
    [popupPlacement](#popupplacement)?: [AnnotationPopupPlacement](https://docs.maptiler.com/geosplats-sdk/api/types/AnnotationPopupPlacement/)\[\];  
    [popupWidth](#popupwidth)?: number;  
    [pos](#pos): [AnnotationPosition](https://docs.maptiler.com/geosplats-sdk/api/types/AnnotationPosition/);  
}

##### Index

### Properties[](#properties)

[color?](#color) [data?](#data) [icon?](#icon) [label?](#label) [popup?](#popup) [popupPlacement?](#popupplacement) [popupWidth?](#popupwidth) [pos](#pos)

## Properties[](#properties-1)

### `Optional`color[](#color)

color?: [Color](https://docs.maptiler.com/geosplats-sdk/api/types/Color/)

Color of the annotation label body. Defaults to MapTiler blue. Can be changed later with `SplatAnnotation.setColor()`.

### `Optional`data[](#data)

data?: unknown

Custom data of any kind to attach to the annotation, e.g. the ID of the database row it was created from. It is never read by the SDK, and can be retrieved and replaced later on with `SplatAnnotation.getData()` and `SplatAnnotation.setData()` - e.g. from within the annotation's event listeners.

### `Optional`icon[](#icon)

icon?: string

Single emoji shown by itself when the annotation is collapsed (active); also always prepended to the label text when the annotation is expanded.

### `Optional`label[](#label)

label?: string

Short string to display in the annotation label.

### `Optional`popup[](#popup)

popup?: string

HTML string of a modal popup that opens when one clicks the annotation label.

### `Optional`popupPlacement[](#popupplacement)

popupPlacement?: [AnnotationPopupPlacement](https://docs.maptiler.com/geosplats-sdk/api/types/AnnotationPopupPlacement/)\[\]

The sides of the annotation on which the popup may open, in order of preference: the first side with enough room on the map is used. For example, `["top", "bottom", "left", "right"]` opens the popup above the annotation, below it if there's no room above, and only then to its left or right. Must hold 1 to 4 entries, each side at most once - anything else makes `addAnnotation` throw. Defaults to `["right", "left", "top", "bottom"]`.

### `Optional`popupWidth[](#popupwidth)

popupWidth?: number

Width of the popup in CSS pixels, replacing the default of 300 (or 240 on touch devices and small screens). It is still capped to fit on the map. Must be a positive number - anything else makes `addAnnotation` throw.

### pos[](#pos)

pos: [AnnotationPosition](https://docs.maptiler.com/geosplats-sdk/api/types/AnnotationPosition/)

3D position of the annotation, relative to the SplatModel's bounding box or at a geographic location - see [AnnotationPosition](https://docs.maptiler.com/geosplats-sdk/api/types/AnnotationPosition/).
