Location:

Popup Window Class

Popup Window Class

The pop-up window class encapsulates the ability to add pop-ups to the map.

ConstructorDescription

nimap.Popup(PopupOptions)

Structure popup information

 

PopupOptionsTypeDescription

closeButton

Boolean

The parameter is true and a close button will appear in the upper right corner of the popup window. The default is true

closeOnClick

Boolean

parameter is true and the popup will close when you click on the map. The default is true

className

String

Add css class names to popup containers, separated by spaces, for example: className: 'myCss custom''

offset

PointLike

Point object representing map coordinates, example: [50,50], used to set popup and geography Offset of coordinates

 

MethodReturn ValueDescription

addTo(map)

Add a pop-up to the map.

isOpen()

Boolean

true The popup window opens, false it is closed.

remove()

Remove pop-ups from the maps you have added to.

getLngLat()

LngLat

Returns to the geographic location of the pop-up anchor.

setLngLat( Boolean)

Set the geographic location of the pop-up anchor and move the pop-up to that anchor.

setText( text)

Set the text content of the popup

setHTML( html)

Set the contents of the popup to HTML provided as a string. Html A string representing the HTML content of the popup. (string)

setDOMContent( Element)

Sets the contents of the popup window with the DOM node element. Easy to customize the pop-up window.

 

EventsParametersDescription

open

Events triggered by pop-ups

close

Events triggered by pop-ups

TOP