Optional ReadonlyattributionOverride the displayed attribution (default: the service's own copyrightText).
Optional ReadonlyauthRequest authorizer for tile + metadata requests (secured ArcGIS ImageServer).
Pass an ESRI authorizer (e.g. getEsriAuthorizer()), or configure one globally
with configureEsriAuth() and omit this. Public terrain needs neither.
Optional ReadonlycacheOptional 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.
Optional ReadonlycameraMinimum 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 this call owns the
terrain; released on remove(). Pass false to disable, or a number to
change the margin. Not applied with setAsTerrain: false.
Optional ReadonlyencodingDEM re-encoding (default 'terrarium').
Optional ReadonlyexaggerationTerrain vertical exaggeration, unitless multiplier (default 1).
Optional ReadonlygestureSuppress MapLibre's terrain gesture-end camera snap-back while this call owns
the terrain (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 on remove(). Pass false to
keep stock behavior. Not applied with setAsTerrain: false (the caller owns
the terrain attach — call the utility directly if wanted).
Optional ReadonlyidSource id (default 'esri-terrain').
ReadonlymaplibreglThe caller's maplibre-gl namespace — injected so this package never imports maplibre-gl.
Optional ReadonlynodataHow to fill pixels no layer covers; see NodataPolicy. Defaults to zero-fill (sea level).
Optional ReadonlyonCalled 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.
Optional ReadonlyoutputProtocol 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.
Optional ReadonlypoolDecode worker pool size (default ~hardwareConcurrency−1, capped at 4).
Optional ReadonlyrequestStatic fetch options for tile + metadata requests (e.g. auth headers).
Optional ReadonlyschemeProtocol scheme registered via addProtocol (default 'esri-dem').
Optional ReadonlysetWhen false, only add the source — don't call setTerrain (default true).
Optional ReadonlyspawnOverride worker creation (CDN/CSP escape hatch).
Optional ReadonlytileTerrain LOD tuning for horizon/behind-camera continuity at high pitch
(maps to MapLibre setSourceTileLodParams; see TileLodParams).
Defaults to a modest continuity-favoring setting (DEFAULT_TILE_LOD);
pass false to keep MapLibre's defaults. (Complement with the
maxTileCacheZoomLevels map-constructor option for gap-free pan-back — that
one can only be set when you create the map.)
ReadonlyurlEsri elevation ImageServer URL (global Terrain3D or any custom hosted DEM).
Optional Readonlyusefalse decodes on the main thread instead of a worker pool (default worker pool).
Optional Readonlywasmturbo-lerc wasm init (bytes/url) forwarded to the decode workers — for the
cross-origin CDN fallback; see @bitruvius/geo-core's BitruviusConfig.wasmBaseUrl.
Options for addEsriTerrain.