Constructor for a PolygonDrawing instance.
Cesium viewer or scene host.
Optional
options: {Optional
addPoint?: booleanStart with one point.
Optional
color?: anyPolygon fill and point color.
Optional
maxPoints?: number(Optional) max number of polygon vertices.
Optional
onMoveCallback?: FunctionCallback for vertex move.
Optional
points?: Cartesian3[]Initial array of Cartesian3 points.
Cesium polyline entity for polygon outline.
Cesium polygon entity for area fill.
Access the current array of point positions.
Primary polygon color (applies to both area and outline).
The color applied to the points.
Indicates if drawing is finished.
The maximum number of points.
Current vertex set (does not allow external replacement).
Show/hide all related entities (points, line, area).
Visibility of the drawing (true = points shown).
Cancel this drawing (destroys if not already finished).
True if canceled, false if already finished.
Remove all point, outline, and area entities from the Cesium viewer.
Manually trigger the finish callback.
Finalize the polygon only if it has at least 3 vertices. Handles cases for unlimited points (deletes last temp), and sets finished=true.
True if polygon is valid (3+ points), false otherwise.
PolygonDrawing – Interactive drawing class for creating filled polygons in Cesium scenes.
Extends Drawing to support:
Param: app
The Cesium Viewer or host application context.
Param: options
Param: options.points
Optional initial point array (vertices).
Param: options.maxPoints
Maximum points/vertices allowed (optional).
Param: options.color
Fill color for points/polygon.
Param: options.addPoint
Start with first point placed.
Param: options.onMoveCallback
Fired when a vertex is moved.
Example