Popups | RasterJS API | 2GIS Documentation
RasterJS API

Popups

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

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.

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);
Factory Description
Option Type Default Description

Events inherited from Layer

Event Data Description

Popup events inherited from Layer

Event Data Description
Method Returns Description

Popup methods inherited from Layer

Methods inherited from Layer

Methods inherited from Evented