SDK JS
    Preparing search index...

    The temp-geometry overlay a draw tool renders through. Create in onAdd, dispose in onRemove.

    import { DrawController, DrawOverlay, pickScenePosition } from '@bitruvius/sdk-maplibre';

    const overlay = new DrawOverlay(map, { line: '#ffa94d', fill: '#ffa94d' });
    const draw = new DrawController({
    map,
    pickFn: (x, y) => pickScenePosition(map, [], x, y),
    onChange: (state) => overlay.setData(state),
    });
    draw.start('polygon');
    // … on teardown: draw.dispose(); overlay.dispose();
    Index

    Constructors

    Methods

    Constructors

    • Parameters

      • map: Map$1
      • colors: DrawOverlayColors = {}
      • showVertices: boolean = true

        Draw the draped per-vertex circles (default true; a tool rendering its own 3D vertex sprites passes false so the ground track keeps just the line/fill/cursor).

      Returns DrawOverlay

    Methods

    • Remove the layers + source.

      Returns void