SDK JS
    Preparing search index...

    Interface CreateEsriTerrainOptions

    Options for createEsriTerrain.

    interface CreateEsriTerrainOptions {
        attribution?: string;
        auth?: RequestAuthorizer;
        cache?: false | { maxEntries: number };
        cameraFloor?: number | false;
        encoding?: DemEncoding;
        exaggeration?: number;
        gestureSnapFix?: boolean;
        id?: string;
        maplibregl: MapLibreNamespace;
        nodata?: NodataPolicy;
        onError?: (error: unknown) => void;
        output?: DemTileOutput;
        poolSize?: number;
        requestInit?: RequestInit;
        scheme?: string;
        spawn?: () => Worker;
        tileLod?: false | TileLodParams;
        useWorker?: boolean;
        wasmInit?: WasmHostInit;
    }
    Index

    Properties

    attribution?: string

    Override the displayed attribution (default: the stacked services' own copyrightText).

    auth?: RequestAuthorizer

    Request authorizer for tile + metadata requests across the whole stack (secured ArcGIS ImageServers). Superseded by a global configureEsriAuth().

    cache?: false | { maxEntries: number }

    Optional in-memory decoded-tile cache, keyed by entry count (default off). Budget note: on the bitmap path an entry holds the raw RGBA grid — ~(tileSize+1)²·4 bytes (~264 KB at 256 px), larger than the old compressed-PNG entries. Size maxEntries accordingly.

    cameraFloor?: number | false

    Minimum camera height above the rendered terrain, metres (default 2): the camera can never end a camera update under the DEM. Enforced on every gesture/animation via acquireCameraFloor while the stack has terrain attached; released when the stack empties or the controller is removed. Pass false to disable, or a number to change the margin.

    encoding?: DemEncoding

    DEM re-encoding (default 'terrarium').

    exaggeration?: number

    Terrain vertical exaggeration, unitless multiplier (default 1).

    gestureSnapFix?: boolean

    Suppress MapLibre's terrain gesture-end camera snap-back while the stack has terrain attached (default true). On gesture end MapLibre reconciles the frozen gesture elevation against a fresh DEM sample; at a tilt that slides the centre by Δe·tan(pitch), which reads as the view jumping backward. The fix is applied automatically via preventTerrainGestureSnap and released when the stack empties or the controller is removed. Pass false to keep stock behavior.

    id?: string

    Source id prefix (default 'esri-terrain'); a sequence suffix is appended per rebuild.

    maplibregl: MapLibreNamespace

    The caller's maplibre-gl namespace — injected so this package never imports maplibre-gl.

    nodata?: NodataPolicy

    How to fill pixels no layer covers; see NodataPolicy. Defaults to zero-fill (sea level).

    onError?: (error: unknown) => void

    Called if terrain decode degrades — today: the decode worker pool could not be spawned (cross-origin CDN bundle, or a CSP without worker-src blob:) and DEM tiles fall back to the main thread. Terrain still renders, much more slowly; without a handler this is only a one-time console.warn.

    output?: DemTileOutput

    Protocol payload format (default 'bitmap'): hand MapLibre a ready ImageBitmap — skipping both our PNG encode and MapLibre's main-thread PNG decode — with automatic per-realm fallback to 'png' where createImageBitmap is unavailable. Pass 'png' to force the fallback.

    poolSize?: number

    Decode worker pool size (default ~hardwareConcurrency−1, capped at 4).

    requestInit?: RequestInit

    Static fetch options for tile + metadata requests (e.g. auth headers).

    scheme?: string

    Protocol scheme registered via addProtocol (default 'esri-dem').

    spawn?: () => Worker

    Override worker creation (CDN/CSP escape hatch).

    tileLod?: false | TileLodParams

    Terrain LOD tuning for horizon/behind-camera continuity at high pitch (re-applied on every stack change; see TileLodParams). Defaults to a modest continuity setting (DEFAULT_TILE_LOD); pass false to keep MapLibre's defaults. Complement with the maxTileCacheZoomLevels map-constructor option for gap-free pan-back.

    useWorker?: boolean

    false decodes on the main thread instead of a worker pool (default worker pool).

    wasmInit?: WasmHostInit

    turbo-lerc wasm init (bytes/url) forwarded to the decode workers — for the cross-origin CDN fallback; see @bitruvius/geo-core's BitruviusConfig.wasmBaseUrl.