Cesium Utils - v0.3.8
    Preparing search index...

    Class SurfaceHighlight

    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 with polygon, polyline, or rectangle graphics
    • GroundPrimitive instances

    Highlighting Modes:

    • Fill mode (default): Creates a filled geometry using the original shape
    • Outline mode: Creates a polyline outline of the original geometry
    // Basic usage
    const viewer = new Viewer('cesiumContainer');
    const surfaceHighlight = new SurfaceHighlight(viewer);

    // Highlight an entity with default red fill
    const entity = viewer.entities.add(new Entity({
    polygon: {
    hierarchy: Cartesian3.fromDegreesArray([-75, 35, -74, 35, -74, 36, -75, 36]),
    material: Color.BLUE
    }
    }));
    surfaceHighlight.show(entity);

    Implements

    Index

    Constructors

    Properties

    _color: Color = Color.RED
    _currentObject: Entity | GroundPrimitive | undefined
    _currentOptions: Highlight.Options | undefined
    _entities: EntityCollection
    _entity: Entity

    Accessors

    • get currentObject(): Entity | GroundPrimitive | undefined

      Gets the currently highlighted object

      Returns Entity | GroundPrimitive | undefined

    Methods