Cesium Utils - v0.2.6
    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: undefined | Entity | GroundPrimitive
    _currentOptions: undefined | Options
    _entities: EntityCollection
    _entity: Entity

    Accessors

    • get currentObject(): undefined | Entity | GroundPrimitive

      Gets the currently highlighted object

      Returns undefined | Entity | GroundPrimitive

    Methods

    • Highlights a picked object by updating the reusable entity

      Parameters

      • object: Entity | GroundPrimitive

        The object to be highlighted.

      • Optionaloptions: Options

        Optional style for the highlight.

      Returns undefined | Entity