Skip to content

MglPopup

A popup component

See Popup.

typescript
import { MglPopup } from '@indoorequal/vue-maplibre-gl';

Props

coordinates

  • Type: LngLatLike
  • Required: false
  • Default: undefined

The geographical location of the popup's anchor. Unused when placed inside a marker.

closeButton

  • Type: boolean
  • Required: false
  • Default: true

Display a close button in the top right corner.

closeOnClick

  • Type: boolean
  • Required: false
  • Default: true

The popup will be closed when the map is clicked.

closeOnMove

  • Type: boolean
  • Required: false
  • Default: false

The popup will be closed when the map moves.

focusAfterOpen

  • Type: boolean
  • Required: false
  • Default: true

The popup will try to focus the first focusable element inside the popup.

anchor

  • Type: PositionAnchor
  • Required: false
  • Default: undefined

A string indicating the part of the Popup that should be positioned closest to the coordinate. 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

  • Type: Offset
  • Required: false
  • Default: undefined

A pixel offset applied to the popup's location

className

  • Type: string
  • Required: false
  • Default: undefined

Space-separated CSS class names to add to popup container

maxWidth

  • Type: string
  • Required: false
  • Default: "240px"

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'.

subpixelPositioning (since 7.1.0)

  • Type: boolean
  • Required: false
  • Default: false

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

text

  • Type: string
  • Required: false
  • Default: undefined

Sets the popup's content to a string of text.

Events

open

Fired when the popup is opened manually or programmatically.

close

Fired when the popup is closed manually or programmatically.

Slots

default

Slot for popup content

Source

See source.

Released under the MIT License.