A flyweight implementation for highlighting 2D surface objects in Cesium.
This class provides highlighting for ground-clamped geometries (polygons, polylines, rectangles)
Supported Geometry Types:
Entity
GroundPrimitive
Highlighting Modes:
// Basic usageconst viewer = new Viewer('cesiumContainer');const surfaceHighlight = new SurfaceHighlight(viewer);// Highlight an entity with default red fillconst entity = viewer.entities.add(new Entity({ polygon: { hierarchy: Cartesian3.fromDegreesArray([-75, 35, -74, 35, -74, 36, -75, 36]), material: Color.BLUE }}));surfaceHighlight.show(entity); Copy
// Basic usageconst viewer = new Viewer('cesiumContainer');const surfaceHighlight = new SurfaceHighlight(viewer);// Highlight an entity with default red fillconst entity = viewer.entities.add(new Entity({ polygon: { hierarchy: Cartesian3.fromDegreesArray([-75, 35, -74, 35, -74, 36, -75, 36]), material: Color.BLUE }}));surfaceHighlight.show(entity);
Creates a new SurfaceHighlight instance.
SurfaceHighlight
A viewer to create highlight entity in
Private
Gets the highlight color.
Sets the highlight color.
Gets the currently highlighted object
Gets the highlight entity
Removes all geometry properties from the highlight entity
Compares two Highlight.Options objects for equality
Updates the highlight entity from an Entity object
Optional
Updates the highlight entity from a GroundPrimitive
Clean up the instances
Clears the current highlight
Highlights a picked object by updating the reusable entity
The object to be highlighted.
Optional style for the highlight.
Highlight.Options
A flyweight implementation for highlighting 2D surface objects in Cesium.
This class provides highlighting for ground-clamped geometries (polygons, polylines, rectangles)
Supported Geometry Types:
Entitywith polygon, polyline, or rectangle graphicsGroundPrimitiveinstancesHighlighting Modes:
Example