SDK JS
    Preparing search index...

    The drape's main-context half: it owns the atlas texture, the set of registered DrapeReceivers, and the mailbox captures are posted into. A grab arrives via submitCapture; the driver layer's prerender calls uploadIfDirty, which uploads the newest grab at most once and publishes the refreshed SharedDrape to every receiver (null while the drape is disabled, cleared, or detached). It needs a WebGL2 context and never touches the map — DrapeCoordinatorLayer hands it the context and the render-loop slot, so the coordinator does nothing until that layer is on the map.

    enableVectorDrape wires the coordinator, the driver layer, and the hidden capture map in one call; that is what an app normally wants. Construct one directly when you are producing the atlas yourself — your own renderer, an offline tile, a canvas the SDK did not draw — and want the SDK's 3D layers to sample it.

    import { DrapeCoordinator, DrapeCoordinatorLayer } from '@bitruvius/sdk-maplibre';
    const coordinator = new DrapeCoordinator();
    map.addLayer(new DrapeCoordinatorLayer(coordinator)); // its prerender drives the upload
    coordinator.register(meshLayer); // the SDK's 3D Tiles / I3S layers implement DrapeReceiver
    coordinator.submitCapture({ canvas, atlasFromMercator, seq: 1 });

    DrapeCapturePayload for what a capture must supply.

    Index

    Constructors

    Accessors

    • get isEnabled(): boolean

      Returns boolean

    Methods

    • Publish null without disabling (empty drape set / capture failure).

      Returns void

    • Driver layer onRemove (style reload / teardown) — the texture dies with the layer.

      Returns void

    • Full teardown — clears every receiver and frees the texture.

      Returns void

    • Register a receiver — it gets the CURRENT shared drape immediately (if any).

      Parameters

      Returns void

    • Master switch — off publishes null (byte-identical rendering); on re-publishes.

      Parameters

      • on: boolean

      Returns void

    • Global opacity multiplier — republishes without a re-capture.

      Parameters

      • o: number

      Returns void

    • Unregister a receiver — its drape is cleared; others are untouched.

      Parameters

      Returns void

    • Driver prerender hook: upload the newest capture (at most once per submission), then publish the refreshed SharedDrape. All UNPACK state + bindings we touch are snapshotted and restored — MapLibre's own uploads must be unaffected.

      Returns void