SDK JS
    Preparing search index...

    Interface ClippingController

    The scene-wide clipping facade returned by createClippingController. All registered layers receive every plane-set change; layers added later immediately receive the current set.

    import { createClippingController, planeFromHeadingTilt } from '@bitruvius/sdk-maplibre';

    const clipping = createClippingController({ layers: [buildings] });
    clipping.setPlanes({ planes: [planeFromHeadingTilt({ lng: -71.06, lat: 42.36 }, 90)] });
    clipping.addLayer(pointCloud); // immediately cut by the same plane
    const off = clipping.onChange((planes) => console.log(planes ? 'clipped' : 'clear'));
    interface ClippingController {
        enabled: boolean;
        planes: ClippingPlanesOptions | null;
        addLayer(layer: ClippableLayer): void;
        dispose(): void;
        onChange(cb: (planes: ClippingPlanesOptions | null) => void): () => void;
        removeLayer(layer: ClippableLayer): void;
        setEnabled(on: boolean): void;
        setPlanes(planes: ClippingPlanesOptions | null): void;
    }
    Index

    Properties

    enabled: boolean

    Whether the (retained) plane set is currently applied.

    planes: ClippingPlanesOptions | null

    The current plane set (null when clipping is off).

    Methods

    • Clear clipping on all registered layers and release them; the controller becomes inert.

      Returns void

    • Unregister a layer; its clipping is cleared (setClippingPlanes(null)).

      Parameters

      Returns void

    • Master toggle — preserves the plane set (like a visibility switch on the slice).

      Parameters

      • on: boolean

        false pushes the set disabled; true restores it.

      Returns void

    • Replace the scene's plane set (fans out to every registered layer).

      Parameters

      Returns void