Popup class

An information window anchored at a specified position on a map.

Extends

Constructors

Popup(PopupOptions)

Constructs a Popup object and initializes it with the specified options.

Properties

attach

Attaches the popup to the HTML document in a hidden state.

close

Closes the popup on the map. The popup remains attached to the HTML document.

isOpen

Returns true if the popup is currently open, otherwise false.

open

Opens the popup.

remove

Closes the popup on the map and removes it from the HTML document.

Methods

getOptions()

Returns the options for the popup.

getPopupContainer()

Returns popup container element.

getPopupOptions()

Returns the options for the popup.

setOptions(PopupOptions)

Sets the options for the popup.

setPopupOptions(PopupOptions)

Sets the options for the popup.

Constructor Details

Popup(PopupOptions)

Constructs a Popup object and initializes it with the specified options.

new Popup(options?: PopupOptions)

Parameters

options
PopupOptions

The options for the popup.

Property Details

attach

Attaches the popup to the HTML document in a hidden state.

attach: (map: Map) => void

Property Value

(map: Map) => void

close

Closes the popup on the map. The popup remains attached to the HTML document.

close: () => void

Property Value

() => void

isOpen

Returns true if the popup is currently open, otherwise false.

isOpen: () => boolean

Property Value

() => boolean

open

Opens the popup.

open: (map?: Map) => void

Property Value

(map?: Map) => void

remove

Closes the popup on the map and removes it from the HTML document.

remove: () => void

Property Value

() => void

Method Details

getOptions()

Returns the options for the popup.

function getOptions(): PopupOptions

Returns

getPopupContainer()

Returns popup container element.

function getPopupContainer(): HTMLElement

Returns

HTMLElement

getPopupOptions()

Warning

This API is now deprecated.

Use getOptions() instead.

Returns the options for the popup.

function getPopupOptions(): PopupOptions

Returns

setOptions(PopupOptions)

Sets the options for the popup.

function setOptions(options?: PopupOptions)

Parameters

options
PopupOptions

The options for the popup.

setPopupOptions(PopupOptions)

Warning

This API is now deprecated.

Use setOptions(...) instead.

Sets the options for the popup.

function setPopupOptions(options?: PopupOptions)

Parameters

options
PopupOptions

The options for the popup.