Skip to content

gi-nx


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

ParameterTypeDescription
htmlstringHTML content for the popup (will be sanitized)
lngLatLngLatLikeLngLatLike position for the popup [longitude, latitude]
optionsPopupOptionsPopupOptions from Mapbox GL (closeButton, closeOnClick, etc.)
openOverBottomBarContentbooleanWhether 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 }
]);