Skip to main content

popup

Popup is a window in which you can display arbitrary HTML-code. Popup associated with a particular location on the map.

DG.Popup

Used to open popups in certain places of the map. Use Map.openPopup to open popups while making sure that only one popup is open at one time (recommended for usability), or use Map.addLayer to open as many as you want.

Usage example

If you want to just bind a popup to marker click and then open it, it's really easy:

marker.bindPopup(popupContent).openPopup();

Path overlays like polylines also have a bindPopup method. Here's a more complicated way to open a popup on a map:

var popup = DG.popup()
.setLatLng(latlng)
.setContent('<p>Hello world!<br />This is a nice popup.</p>')
.openOn(map);

Creation

FactoryDescription

Options

OptionTypeDefaultDescription

Events

Events inherited from Layer

EventDataDescription

Popup events inherited from Layer

EventDataDescription

Methods

MethodReturnsDescription

Popup methods inherited from Layer

Methods inherited from Layer

Methods inherited from Evented