Skip to main content

Interface: SymbolPaint

Defined in: spec/types.ts:223

Properties​

iconAllowOverlap?​

optional iconAllowOverlap?: boolean

Defined in: spec/types.ts:287

Whether an image stays drawn when it collides with another. MapLibre hides colliding symbols by default, which is right for labels but drops markers of neighbouring places — set true to keep every one.

Default​

false

iconAnchor?​

optional iconAnchor?: "center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right"

Defined in: spec/types.ts:268

Which part of the image sits on the feature's coordinate. A pin (PinImage) points with its bottom tip, so it takes 'bottom'; MapLibre's default, 'center', would leave it floating half its height above the place it marks.

Default​

'center'

iconColor?​

optional iconColor?: string

Defined in: spec/types.ts:229


iconImage?​

optional iconImage?: string

Defined in: spec/types.ts:257

Image drawn at each feature: the id of a ImageSpec in spec.images, or the name of an icon in the basemap's sprite.


iconOffset?​

optional iconOffset?: [number, number]

Defined in: spec/types.ts:279

Offset of the image from its anchor, in pixels [x, y].


iconOpacity?​

optional iconOpacity?: number

Defined in: spec/types.ts:230


iconSize?​

optional iconSize?: number

Defined in: spec/types.ts:259

Scale factor applied to the image.

Default​

1

textColor?​

optional textColor?: string

Defined in: spec/types.ts:225


textField?​

optional textField?: string | SymbolExpression

Defined in: spec/types.ts:237

The label's text. A {property} token, a literal, or a SymbolExpression when the label has to be computed per feature (formatting a count, picking between properties).


textFont?​

optional textFont?: string[]

Defined in: spec/types.ts:252

Fontstack the glyphs are requested from. Defaults to ['Noto Sans Regular'], which OpenFreeMap and most OpenMapTiles-derived basemaps serve — MapLibre's own default (Open Sans Regular, Arial Unicode MS Regular) is served by neither, and a missing fontstack 404s the glyph request and rasterizes no text at all.

Default​

['Noto Sans Regular']

textHaloColor?​

optional textHaloColor?: string

Defined in: spec/types.ts:227


textHaloWidth?​

optional textHaloWidth?: number

Defined in: spec/types.ts:228


textOpacity?​

optional textOpacity?: number

Defined in: spec/types.ts:226


textSize?​

optional textSize?: number | SymbolExpression

Defined in: spec/types.ts:242

Label size in pixels, or a SymbolExpression to drive it from a feature property (['step', ['get', 'count'], 11, 100, 14]).