Create a new PolylineMeasurement.
Cesium Viewer or host application.
Optional
options: object = {}See class doc for parameters.
Reference to the parent Cesium Viewer or app.
Unique identifier for this measurement instance.
Label associated with this measurement (unit and prefix are forwarded).
Polyline color.
Finish callback (settable by onFinish()
).
Point marker color.
Measurement points, as an array or CallbackProperty.
Per-segment color (propagated to all LineMeasurements).
Total length of all polyline segments (sum of per-segment distances).
Completion/finished flag for lifecycle control.
Determines full visibility of measurement objects.
Determine if the label should be shown (at least 3 points, or 3 committed if rendered).
Measurement unit for calculations and display.
Build or rebuild the internal segment LineMeasurements from the current polyline vertices. Removes and destroys old segments.
Calculates the (geometric) center of all measurement points.
Array [x, y, z] or undefined if no points.
Cancel and destroy all resources related to the measurement.
Destroy all associated entities, drawings, and labels.
Set a callback to fire when measurement is finished. Chainable.
Finalize measurement: only allowed if there are at least 2 segments. Sums up final segment measurement.
True if finalized, false otherwise.
Update main label dynamically (center + full polyline length).
PolylineMeasurement – Interactive tool for measuring the total length of a user-defined polyline in Cesium 3D scenes.
Extends Measurement and leverages PolylineDrawing for interactive placement and editing. Provides:
Param: app
Cesium Viewer or application context.
Param: options
Param: options.cartesians
Initial points of the polyline.
Param: options.maxPoints
(Optional) Maximum number of vertices allowed.
Param: options.pointColor
Color of polyline points.
Param: options.lineColor
Color of the polyline.
Param: options.unit
Measurement unit for segment and total distances.
Param: options.render
Should geometry be drawn immediately.
Example