Skip to content

PopupOptions

PopupOptions = object

Defined in: src/ui/popup.ts:41

The Popup options object

Properties

anchor?

optional anchor: PositionAnchor

Defined in: src/ui/popup.ts:70

A string indicating the part of the Popup that should be positioned closest to the coordinate set via Popup#setLngLat. Options are 'center', 'top', 'bottom', 'left', 'right', 'top-left', 'top-right', 'bottom-left', and 'bottom-right'. If unset the anchor will be dynamically set to ensure the popup falls within the map container with a preference for 'bottom'.


className?

optional className: string

Defined in: src/ui/popup.ts:78

Space-separated CSS class names to add to popup container


closeButton?

optional closeButton: boolean

Defined in: src/ui/popup.ts:46

If true, a close button will appear in the top right corner of the popup.

Default Value

true

closeOnClick?

optional closeOnClick: boolean

Defined in: src/ui/popup.ts:51

If true, the popup will closed when the map is clicked.

Default Value

true

closeOnMove?

optional closeOnMove: boolean

Defined in: src/ui/popup.ts:56

If true, the popup will closed when the map moves.

Default Value

false

focusAfterOpen?

optional focusAfterOpen: boolean

Defined in: src/ui/popup.ts:61

If true, the popup will try to focus the first focusable element inside the popup.

Default Value

true

locationOccludedOpacity?

optional locationOccludedOpacity: number | string

Defined in: src/ui/popup.ts:97

Optional opacity when the location is behind the globe. Note that if a number is provided, it will be converted to a string.

Default Value

undefined

maxWidth?

optional maxWidth: string

Defined in: src/ui/popup.ts:85

A string that sets the CSS property of the popup's maximum width, eg '300px'. To ensure the popup resizes to fit its content, set this property to 'none'. Available values can be found here: https://developer.mozilla.org/en-US/docs/Web/CSS/max-width

Default Value

'240px'

offset?

optional offset: Offset

Defined in: src/ui/popup.ts:74

A pixel offset applied to the popup's location


subpixelPositioning?

optional subpixelPositioning: boolean

Defined in: src/ui/popup.ts:91

If true, rounding is disabled for placement of the popup, allowing for subpixel positioning and smoother movement when the popup is translated.

Default Value

false