gi-nx / addHtmlPopup
ts
function addHtmlPopup(
html: string,
lngLat: LngLatLike,
options: PopupOptions,
openOverBottomBarContent?: boolean): void;Add an HTML popup to the map at a specific location.
Parameters
| Parameter | Type | Description |
|---|---|---|
html | string | HTML content for the popup (will be sanitized) |
lngLat | LngLatLike | LngLatLike position for the popup [longitude, latitude] |
options | PopupOptions | PopupOptions from Mapbox GL (closeButton, closeOnClick, etc.) |
openOverBottomBarContent | boolean | Whether popup appears above bottom bar (default: true) |
Returns
void
void
Needs Permission
Example
typescript
rpc.invoke("addHtmlPopup", [
"<h3>Location Info</h3><p>This is a sample popup</p>",
[-122.4194, 37.7749],
{ closeButton: true, closeOnClick: false }
]);