SDK JS
    Preparing search index...

    The headless slice API returned by createSliceController.

    const slice = createSliceController({ map, layers: [buildings] });
    const off = slice.onChange((state) => console.log(state.active, state.headingDeg));
    slice.dispatch({ type: 'place', position: { lng: -71.06, lat: 42.36, height: 0 }, headingDeg: 90 });
    slice.dispatch({ type: 'setTilt', tiltDeg: 30 });
    slice.clipping.addLayer(pointCloud); // cut another dataset with the same plane set
    interface SliceController {
        clipping: ClippingController;
        state: SliceState;
        dispatch(action: SliceAction): void;
        dispose(): void;
        onChange(cb: (state: SliceState) => void): () => void;
    }
    Index

    Properties

    The driven ClippingController (add/remove layers through it at runtime).

    state: SliceState

    The current SliceState (immutable snapshot).

    Methods

    • Apply a SliceAction — the single mutation path. Updates the scene clipping + plane visual and notifies subscribers.

      Parameters

      Returns void

    • Remove the plane visual, clear clipping, release layers.

      Returns void

    • Subscribe to state changes.

      Parameters

      Returns () => void

      An unsubscribe function.