3D-City Model
    Preparing search index...

    ParticleSystemLayer – Specialized Layer subclass for managing live Cesium particle systems, such as wind or fluid visualizations.

    Extends Layer, adding support for dynamic direction, force (wind speed), event-driven updates, and real-time rescaling. Handles all spatial transforms and interactive updates to its underlying Cesium.ParticleSystem via content-based properties.

    The main application/controller with a .viewer property (Cesium Viewer).

    Unique identifier for this layer.

    UUID or layer id of the target entity (e.g., for wind targets).

    Human-readable name for UI/legend.

    Tag array for filtering/grouping.

    Particle system Cesium primitive, assigned directly.

    Initial visible state.

    Optional parent/group for organizational use.

    Initial wind/particle direction vector.

    Particle force constant (e.g., wind speed).

    Name of external event to listen for changes to wind/direction/force.

    Position of particle emitter.

    Start/end scale factors for particles.

    startEventListener() - Attach window event listeners for direction/force/distance updates.

    stopEventListener() - Detach all event listeners.

    const particles = new ParticleSystemLayer(app, {
    id: "wind",
    name: "Wind field",
    eventName: "weather-updated",
    direction: new Cesium.Cartesian3(1,0,0),
    position: new Cesium.Cartesian3(0,0,0),
    scale: [1,2],
    });
    particles.startEventListener();
    particles.direction = new Cesium.Cartesian3(0,1,0);
    particles.forceFactor = 2.0;

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _clippingPolygons: any
    _content: any
    _customShader: CustomShader
    _direction: any
    _distance: any
    _dynamicScreenSpaceError: boolean
    _dynamicScreenSpaceErrorDensity: number
    _dynamicScreenSpaceErrorFactor: number
    _dynamicScreenSpaceErrorHeightFalloff: number
    _maximumScreenSpaceError: number
    _opaque: boolean
    _parent: null | Layer
    _position: undefined | Cartesian3
    _scale: undefined | number[]
    _show: boolean
    _style: any
    _targetId: any
    deletable: boolean

    Is the layer removable?

    distanceHandle: undefined | void
    eventName: any

    The wind/force update event's name.

    forceFactor: any

    Current force (e.g., wind speed/multiplier).

    handle: undefined | void
    id: string

    Unique ID for this layer.

    imageryIndex: null | number
    name: string

    Display/UI name.

    onShowChange: (arg0: boolean) => void
    originalShader: CustomShader
    originalTranslucencyMode: any
    origScale: any
    resolved: boolean
    styleManager: any
    tags: string[]

    Layer grouping/filter tags.

    transform: undefined | Matrix4
    type: null | string

    Layer type (matches Layer.LayerTypes string values).

    url: string

    Configuration/source URL.

    viewer: any
    LayerTypes: {
        B3DM: string;
        BASELAYER: string;
        COLLECTION: string;
        FEATURE: string;
        GEOJSON: string;
        GEOJSON3D: string;
        GLTF: string;
        IMAGERY: string;
        MESH: string;
        PARTICLE_SYSTEM: string;
        POINTS: string;
        TERRAIN: string;
    } = ...

    Static enumeration of supported layer types (for easy type checking).

    Accessors

    • get boundingSphere(): undefined | BoundingSphere

      Returns the bounding sphere of the layer, for spatial queries and UI zoom-to-fit. The implementation is type-dependent:

      • For tile/mesh/point clouds: directly returns content.boundingSphere.
      • For (Geo)JSON: computes bounding sphere from all polygon and polyline points.
      • For imagery: computes from imagery rectangle.
      • For terrain/default: returns undefined.

      Returns undefined | BoundingSphere

      The bounding sphere, or undefined if not computable.

    • get clippingPolygons(): any

      Get or set clipping polygons for this layer (used in 3D terrain/model clipping). Setter will propagate to the underlying Cesium content.

      Returns any

    • set clippingPolygons(value: any): void

      Parameters

      • value: any

      Returns void

    • set color(c: Color): void

      Set the global color for all grouped features (handled externally). For mesh types, this may be handled elsewhere.

      Parameters

      • c: Color

      Returns void

    • get customShader(): null | CustomShader

      Returns null | CustomShader

      • Current assigned CustomShader, if any.
    • set customShader(cs: null | CustomShader): void

      Assigns a new custom shader to this layer (or disables if falsy). For non-GEOJSON layer types, handles full reconstruction (with translucency mode handling). For GEOJSON and GEOJSON3D, directly updates polygon or polyline material alpha.

      Parameters

      • cs: null | CustomShader

        Shader instance or null to disable.

      Returns void

    • get dynamicScreenSpaceError(): boolean

      Returns boolean

    • set dynamicScreenSpaceError(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get dynamicScreenSpaceErrorDensity(): number

      Returns number

    • set dynamicScreenSpaceErrorDensity(value: number): void

      Parameters

      • value: number

      Returns void

    • get dynamicScreenSpaceErrorFactor(): number

      Returns number

    • set dynamicScreenSpaceErrorFactor(value: number): void

      Parameters

      • value: number

      Returns void

    • get dynamicScreenSpaceErrorHeightFalloff(): number

      Returns number

    • set dynamicScreenSpaceErrorHeightFalloff(value: number): void

      Parameters

      • value: number

      Returns void

    • get maximumScreenSpaceError(): number

      Returns number

    • set maximumScreenSpaceError(value: number): void

      Parameters

      • value: number

      Returns void

    • get opaque(): boolean

      Whether this layer is currently set as opaque. Triggers shader/mode update when changed.

      Returns boolean

    • set opaque(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get parent(): null | Layer

      Returns null | Layer

      • Current parent assigned, or null.
    • set parent(p: null | Layer): void

      Sets or gets the parent collection/group layer (if present). Use to build hierarchies or nested layer collections.

      Parameters

      • p: null | Layer

        Parent layer to assign.

      Returns void

    • get show(): boolean

      Returns boolean

      • Returns current "show" state.
    • set show(v: boolean): void

      Show or hide this Layer. Deeply propagates the visible state to underlying Cesium content. If the layer is of type FEATURE, it also updates the style manager’s feature visibility and hideIDs. Triggers the onShowChange callback.

      Parameters

      • v: boolean

        True to show, false to hide.

      Returns void

    • get style(): any

      Returns any

    • set style(s: any): void

      Sets or retrieves styling for the layer (e.g. for GeoJSON/tiles/features). For mesh types, style setting is usually not allowed.

      Parameters

      • s: any

        Style object.

      Returns void

    Methods

    • Iterator protocol implementation for Layer. For Layer collections/objects, allows use in for...of loops. Always returns the Layer instance itself (not a collection).

      Returns Layer

    • Sets the content of this Layer, and assigns this layer as its parent. Will throw if content is not a Layer.

      Parameters

      • content: Layer

        The Layer to add as content.

      Returns void

      If content is not a valid Layer.

    • Returns the current "content" object assigned to this layer.

      Returns any

      The Cesium or sublayer content object.

    • Returns this Layer if its type matches the given type, else null. Typically used for gathering/iterating matching content.

      Parameters

      • type: string

        Type string to check.

      Returns null | Layer

    • Returns this layer's ID if any of its tags are in the provided tags array.

      Parameters

      • tags: string[]

        Tags to check against.

      Returns null | string

      ID if a tag matches, else null.

    • Returns this layer's ID if its type matches the given type, else null.

      Parameters

      • type: string

        Type string to check.

      Returns null | string

      ID if match, else null.

    • Checks if a given object is a valid Layer: Must be truthy, have an 'id' property, and be an actual Layer instance.

      Parameters

      • layer: any

        The object to check.

      Returns boolean

      True if the object is a valid Layer instance.

    • Removes the Cesium primitive/entity/etc. for this layer from the scene and severs parent links. Handles resource de-allocation by layer type (removes primitive, data source, imagery, or terrain).

      Returns void

    • Removes a layer (and its content), unlinks its parent, and disables its content link. Used for structured layer collections.

      Parameters

      • layer: Layer

        The layer instance to remove.

      Returns void

    • Starts event listeners for real-time wind/force updates and external distance scale changes.

      • Updates direction and forceFactor on main event.
      • Updates distance and triggers scale update on id_distance event.

      Returns void

    • Shows the layer unless its ID or its content's UUID is present in the excludeIds array, otherwise hides it. Useful for toggling all layers except given ones.

      Parameters

      • show: boolean
      • excludeIds: string[]

      Returns void

    • Shows/hides the Layer if its ID is in layerIds (or if layerIds unspecified). Batch operation interface for toggling by ID sets.

      Parameters

      • show: boolean

        Target visible state.

      • layerIds: string | string[]

        ID or array of IDs to show/hide.

      Returns void