Create a new label entity.
App or Cesium Viewer.
Optional
options: object = {}The underlying Cesium entity.
Font family.
UUID for this label.
Prefix shown before values.
Font size (px).
Unit suffix for values.
Set or get label 3D position. Accepts either a Cesium Cartesian3 or an array [x, y, z].
Show/hide this label in the scene.
Set label content (formats numeric to 2 decimal places + prefix + unit). Accepts either a string or a number.
Label – Utility class for rendering a text label at a 3D position in a Cesium scene.
Encapsulates a Cesium entity (with a label), providing easy access to label content, number/unit formatting, show/hide, and position, as well as destruction/cleanup logic.
Param: app
Parent application or Cesium Viewer reference.
Param: options
Param: options.id
Unique label id.
Param: options.position
Label position in 3D.
Param: options.value
Initial text/numeric value.
Param: options.font
Label font family.
Param: options.size
Label font size (pixels).
Param: options.unit
Unit string to be appended to numeric values.
Param: options.prefix
Prefix string for label text.
Param: options.show
Initial visibility.
Method
destroy() - Removes the label entity from the scene and disables reference.
Example