UI
The UI API lets you interact with the Qatium UI.
sendMessage()
Section titled “sendMessage()”Sends a message from the plugin to its UI panel. Use onMessage in the Panel SDK to receive it on the panel side.
Method signature
Section titled “Method signature”sendMessage<T>(message: T): voidParameters
Section titled “Parameters”message: T: an arbitrary message to be sent to the UI. Check the documentation of structuredClone to verify what can be sent.
Example
Section titled “Example”Send a message to the UI panel
const numOfValves = sdk.network.getValves().lengthsdk.ui.sendMessage(numOfValves)isMapView()
Section titled “isMapView()”Returns true if map view mode is active, or false if it isn’t.
Method signature
Section titled “Method signature”isMapView(): booleanisSynopticView()
Section titled “isSynopticView()”Returns true if synoptic view mode is active, or false if it isn’t.
Method signature
Section titled “Method signature”isSynopticView(): booleanisPanelOpen()
Section titled “isPanelOpen()”Returns true if the plugin’s panel is open, or false if it isn’t.
Method signature
Section titled “Method signature”isPanelOpen(): booleanopenPanel()
Section titled “openPanel()”Opens the plugin’s panel.
Method signature
Section titled “Method signature”openPanel(): voidclosePanel()
Section titled “closePanel()”Closes the plugin’s panel.
Method signature
Section titled “Method signature”closePanel(): voidisPluginVisible()
Section titled “isPluginVisible()”Returns true if the plugin’s custom visuals (highlights, map overlays and styles) are visible, or false if they aren’t.
Method signature
Section titled “Method signature”isPluginVisible(): booleanisNetworkLevelVisible()
Section titled “isNetworkLevelVisible()”Returns true if the given network level is visible in the map, or false if it isn’t.
Method signature
Section titled “Method signature”isNetworkLevelVisible(level: "arterial" | "distribution"): booleanisMapLayerVisible()
Section titled “isMapLayerVisible()”Returns true if the layer for the AssetType, and optionally its group, is visible in the map. Use sdk.map.showMapLayer() and sdk.map.hideMapLayer() to change it.
Method signature
Section titled “Method signature”isMapLayerVisible( type: AssetType, layer?: ValveGroup | JunctionGroup | PipeGroup): booleanExample
Section titled “Example”const areCustomerPointsVisible = sdk.ui.isMapLayerVisible("Junction", "customerPoint")getLanguage()
Section titled “getLanguage()”Returns the ISO 639 code of the language active in the Qatium UI. Currently supports English, Spanish, Portuguese, French and Catalan.
Method signature
Section titled “Method signature”getLanguage(): "es" | "en" | "pt" | "fr" | "ca"