Popup
API Reference (beta) for <Popup />
Property | Type | Description |
---|---|---|
lnglat optional | LngLat | { lng: number, lat: number } | { lon: number, lat: number } | [number, number] | - |
class optional | string | - |
open optional bindable | boolean | - |
children optional | Snippet<[]> | HTML content of the popup |
onopen optional | Listener() | - |
onclose optional | Listener() | - |
closeButton optional | boolean | If `true`, a close button will appear in the top right corner of the popup. |
closeOnClick optional | boolean | If `true`, the popup will closed when the map is clicked. |
closeOnMove optional | boolean | If `true`, the popup will closed when the map moves. |
focusAfterOpen optional | boolean | If `true`, the popup will try to focus the first focusable element inside the popup. |
anchor optional | "center" | "top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | A string indicating the part of the Popup that should
be positioned closest to the coordinate set via .
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'`. |
offset optional | Offset | A pixel offset applied to the popup's location |
maxWidth optional | string | 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 |
subpixelPositioning optional | boolean | If `true`, rounding is disabled for placement of the popup, allowing for
subpixel positioning and smoother movement when the popup is translated. |