Popups

Popups are small containers that can be opened and closed on the map. There are three main types of popups available. The base Popup, as well as Anchored, and FramedCloud.

The base Popup places a rectangular container at the specified coordinates on the map.

The Popup constructor take up to 6 parameters to create a new popup.

ParameterType/ValuesDescription
idstringA unique identifier for the popup
lonlatALKMaps.LonLatThe location on the map where the popup will be shown.
contentSizeALKMaps.SizeThe size of the popup in pixels.
contentHTMLstringAn HTML string representing the content of the popup.
closeBoxbooleanIndicates whether the popup should be dismissable via a close icon.
closeBoxCallbackfunction(Optional) Callback function that is called when the user dismisses the popup using the close icon.

Anchored

The Anchored Popup places a rectangular container at the specified coordinates on the map.

The Anchored popup constructor takes the same parameters as Popup with the addition of an anchor parameter.

The anchor parameter takes an object which exposes a size and offset properly. This object will generally be an ALKMaps.Icon. If you are not using an icon to mark your location, the anchor parameter can be set to null.

FramedCloud

The FramedCloud Popup places a rectangular container at the specified coordinates on the map.

The FramedCloud popup constructor takes the same parameters as Popup with the addition of an anchor parameter.

The anchor parameter takes an object which exposes a size and offset properly. This object will generally be an ALKMaps.Icon. If you are not using an icon to mark your location, the anchor parameter can be set to null.

SimplePopup

The arrow of a SimplePopup is always pointing down. The close box does not have a circle. The SimplePopup constructor takes id, lonlat, contentSize, contentHTML, offset, closeBox and closeBoxCallback as parameters.

Last updated November 5, 2019.