diff --git a/src/ui/popup.js b/src/ui/popup.js index 8acb87e2192..5ae72d54ae0 100644 --- a/src/ui/popup.js +++ b/src/ui/popup.js @@ -104,6 +104,15 @@ export default class Popup extends Evented { * * @param {Map} map The Mapbox GL JS map to add the popup to. * @returns {Popup} `this` + * @example + * new mapboxgl.Popup() + * .setLngLat([0, 0]) + * .setHTML("

Null Island

") + * .addTo(map); + * @see [Display a popup](https://docs.mapbox.com/mapbox-gl-js/example/popup/) + * @see [Display a popup on hover](https://docs.mapbox.com/mapbox-gl-js/example/popup-on-hover/) + * @see [Display a popup on click](https://docs.mapbox.com/mapbox-gl-js/example/popup-on-click/) + * @see [Show polygon information on click](https://docs.mapbox.com/mapbox-gl-js/example/polygon-popup-on-click/) */ addTo(map: Map) { if (this._map) this.remove();