Construct a LineMeasurement.
Application or Cesium viewer reference.
Optional
options: object = {}See class doc for all fields.
Reference to the parent Cesium Viewer or app.
Unique identifier for this measurement instance.
Label associated with this measurement (unit and prefix are forwarded).
Finish callback (settable by onFinish()
).
Line color for visualization (read-only here).
Current (live) 3D distance between endpoints, in meters.
Completion/finished flag for lifecycle control.
Show/hide the measurement visuals (label, line, points).
Measurement unit for calculations and display.
Calculates the (geometric) center of all measurement points.
Array [x, y, z] or undefined if no points.
Calculates the Euclidean 3D distance (meters) between the two endpoints.
Cancel and destroy the measurement.
True if successfully destroyed, false if already gone.
Remove and destroy all derived geometry, label and drawing.
Set a callback to fire when measurement is finished. Chainable.
Finalizes and locks the measurement, displaying the final value/label. Ensures minimum two points. (Does not destroy, only finishes.)
True if finished/locked, false if not enough points.
Update the label with the current distance and midpoint position. Call whenever points change.
LineMeasurement – Concrete measurement tool for interactively measuring 3D distances (lines) in Cesium scenes.
Extends Measurement and uses LineDrawing for interactive drawing of a 2-point line. Automatically computes and displays the distance as a label, and updates the label as points move. Supports configuration for unit, color, and rendering state. Handles destruction and UI visibility.
Param: app
The Cesium Viewer or host application reference.
Param: options
Param: options.cartesians
Initial points of the measurement line.
Param: options.pointColor
Color for point markers.
Param: options.lineColor
Color for the line.
Param: options.unit
Measurement unit.
Param: options.render
If true, will draw geometry on instantiation.
Param: options.parentId
(Optional) Parent measurement/group id.
Example