Skip to content
We're currently creating a lot of content. Sign up to get notified when it's ready.

UI

The UI API lets you interact with the Qatium UI.

Allows the plugin to communicate with its UI panel.

sendMessage<T>(message: T): void
  • message: T: an arbitrary message to be sent to the UI. Check the documentation of structuredClone to verify what can be sent.

Send a message to the UI panel

const numOfValves = sdk.network.getValves().length
sdk.ui.sendMessage(numOfValves)

Returns true if map view mode is active, or false if it isn’t.

isMapView(): boolean

Returns true if synoptic view mode is active, or false if it isn’t.

isSynopticView(): boolean

Returns true is the plugin’s panel is open, or false if it isn’t.

isPanelOpen(): boolean

Opens the plugin’s panel.

openPanel()

Closes the plugin’s panel.

closePanel()

Returns true if the plugin’s overlay is visible, or false if it isn’t.

isPluginVisible(): boolean

Returns true if the layer for the AssetType is visible in the map.

isMapLayerVisible: (
type: AssetType,
layer?: ValveGroup | JunctionGroup | PipeGroup
): boolean

Returns a string representing the ISO 639 language code of the user’s preferred language in the browser. Currently supports Spanish, English and Portuguese.

getLanguage(): "es" | "en" | "pt"