Skip to content

@bendyline/molen-terrain/client ​

Molen terrain capability: heightfield sampling (kernel) and chunked LOD meshing (client).

ts
import { /* … */ } from '@bendyline/molen-terrain/client';

Classes ​

TerrainGroundCutoutController ​

Coordinates cutouts across tile and LOD boundaries. No material or source grid is mutated.

Constructors ​

Constructor ​
ts
new TerrainGroundCutoutController(): TerrainGroundCutoutController;
Returns ​

TerrainGroundCutoutController

Methods ​

dispose() ​
ts
dispose(): void;
Returns ​

void

restore() ​
ts
restore(root): void;

Restore original grids before normal tile disposal.

Parameters ​
root ​

Object3D

Returns ​

void

update() ​
ts
update(root): boolean;
Parameters ​
root ​

Object3D

Returns ​

boolean

Interfaces ​

CachingArchiveOpenerOptions ​

Properties ​

keyFor? ​
ts
optional keyFor?: (url, id, entry?) => string | undefined;

The cache key of an archive (default sha256:<hash> when listed, else the URL). Return undefined to read that archive uncached.

Parameters ​
url ​

string

id ​

string

entry? ​

TerrainArchiveEntryInfo

Returns ​

string | undefined

priority? ​
ts
optional priority?: ArchivePriority | ((url, id) => ArchivePriority);

Eviction priority of the archives opened (default 'normal'), or one per archive.

source? ​
ts
optional source?: (url) => RangeSourceLike;

The byte source for a URL (default: PMTiles' FetchSource); wrap it for retries.

Parameters ​
url ​

string

Returns ​

RangeSourceLike


ChunkGeometry ​

Properties ​

colors ​
ts
colors: Float32Array;
indices ​
ts
indices: Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>;

Immutable shared topology. Copy before mutation or transfer to another thread.

normals ​
ts
normals: Float32Array;
positions ​
ts
positions: Float32Array;
vertexCount ​
ts
vertexCount: number;

ChunkMeshOptions ​

Properties ​

localCoordinates? ​
ts
optional localCoordinates?: boolean;

Store X/Z relative to the chunk origin for large-world float precision.

neighborHeight? ​
ts
optional neighborHeight?: TerrainNeighborHeightSampler;

One-sample apron for border normals. A tile-scoped heightfield clamps its gradient stencil at its own edge, so two tiles that share a border height still disagree about its normal by a visible angle. With neighbour heights both sides evaluate the same central difference.

skirt? ​
ts
optional skirt?: boolean;

Add a skirt ring dropped below the surface to hide cracks.

step? ​
ts
optional step?: number;

LOD vertex stride: 1 = full res, 2 = half, 4 = quarter.


CreateTerrainPackageSemanticLayersOptions ​

Extends ​

Properties ​

baseUrl? ​
ts
optional baseUrl?: string | URL;
Inherited from ​

OpenTerrainPackageSemanticsOptions.baseUrl

buildingDetail? ​
ts
optional buildingDetail?: 
  | false
  | {
  maxDepth?: number;
};

Compose built-feature tiles' buildings and places from the package's features.buildingDetail sidecar, when it declares one (default on). maxDepth bounds how many levels coarser than the detail level a tile may be (default 2, i.e. 16 detail tiles per composed tile); false keeps every tile's own, generalized footprints.

buildingDetailArchive? ​
ts
optional buildingDetailArchive?: TerrainTileArchive;

Host-provided archive for features.buildingDetail (instead of opening its source).

Inherited from ​

OpenTerrainPackageSemanticsOptions.buildingDetailArchive

buildingDetailTransport? ​
ts
optional buildingDetailTransport?: TerrainArchiveTransport;

The building-detail sidecar's transport, when it differs (a lower cache priority).

Inherited from ​

OpenTerrainPackageSemanticsOptions.buildingDetailTransport

decoder ​
ts
decoder: TerrainSemanticTileDecoder;
Inherited from ​

OpenTerrainPackageSemanticsOptions.decoder

featuresArchive? ​
ts
optional featuresArchive?: TerrainTileArchive;
Inherited from ​

OpenTerrainPackageSemanticsOptions.featuresArchive

featuresLayer? ​
ts
optional featuresLayer?: TerrainPackageSemanticLayerStyle;
landcoverArchive? ​
ts
optional landcoverArchive?: TerrainTileArchive;
Inherited from ​

OpenTerrainPackageSemanticsOptions.landcoverArchive

landcoverLayer? ​
ts
optional landcoverLayer?: TerrainPackageSemanticLayerStyle;
overzoom? ​
ts
optional overzoom?: boolean;

Serve terrain levels finer than a sidecar's last level from that level's tiles, rescaled and clipped (default true). Without it the finest terrain tiles near the camera have no water, roads or buildings whenever the vector archive stops short of the terrain.

transport? ​
ts
optional transport?: TerrainArchiveTransport;

How sidecar archives the host did not provide are opened (a cache, a native reader).

Inherited from ​

OpenTerrainPackageSemanticsOptions.transport

waterLayer? ​
ts
optional waterLayer?: TerrainPackageSemanticLayerStyle;

DefaultTerrainSemanticRendererOptions ​

Extends ​

Properties ​

defaultBuildingHeight? ​
ts
optional defaultBuildingHeight?: number;
Inherited from ​

TerrainSemanticMeshOptions.defaultBuildingHeight

defaultLevelHeight? ​
ts
optional defaultLevelHeight?: number;
Inherited from ​

TerrainSemanticMeshOptions.defaultLevelHeight

forestClasses? ​
ts
optional forestClasses?: readonly string[];
Inherited from ​

TerrainSemanticMeshOptions.forestClasses

landcoverColors? ​
ts
optional landcoverColors?: Readonly<Record<string, string>>;
Inherited from ​

TerrainSemanticMeshOptions.landcoverColors

landcoverOffset? ​
ts
optional landcoverOffset?: number;
Inherited from ​

TerrainSemanticMeshOptions.landcoverOffset

materials? ​
ts
optional materials?: TerrainSemanticMeshMaterials;
Inherited from ​

TerrainSemanticMeshOptions.materials

maxTreeSlope? ​
ts
optional maxTreeSlope?: number;
Inherited from ​

TerrainSemanticMeshOptions.maxTreeSlope

maxTreesPerTile? ​
ts
optional maxTreesPerTile?: number;
Inherited from ​

TerrainSemanticMeshOptions.maxTreesPerTile

renderBuildings? ​
ts
optional renderBuildings?: boolean;
Inherited from ​

TerrainSemanticMeshOptions.renderBuildings

renderLandcover? ​
ts
optional renderLandcover?: boolean;
Inherited from ​

TerrainSemanticMeshOptions.renderLandcover

renderLandcoverSurface? ​
ts
optional renderLandcoverSurface?: boolean;
Inherited from ​

TerrainSemanticMeshOptions.renderLandcoverSurface

renderTransportation? ​
ts
optional renderTransportation?: boolean;
Inherited from ​

TerrainSemanticMeshOptions.renderTransportation

renderWater? ​
ts
optional renderWater?: boolean;
Inherited from ​

TerrainSemanticMeshOptions.renderWater

seaLevel? ​
ts
optional seaLevel?: number;

Height of the sea, for projected-Earth terrain. Water whose floor reaches within 2 m of it is the sea (or a tidal river or harbor): it draws as one flat surface 1.5 m above sea level in every tile, over shoreline and shallow-water noise in the elevation, instead of a level sampled from the bathymetry (which differs tile to tile and lets noisy ground poke through). Omit for invented worlds without a sea.

Inherited from ​

TerrainSemanticMeshOptions.seaLevel

surfaceRenderer? ​
ts
optional surfaceRenderer?: TerrainSurfaceRenderer;

Shared controller for live style changes across resident tiles.

Inherited from ​

TerrainSemanticMeshOptions.surfaceRenderer

surfaces? ​
ts
optional surfaces?: TerrainSurfaceOptions;

Static styles when no shared controller is supplied.

Inherited from ​

TerrainSemanticMeshOptions.surfaces

treeCanopyGeometry? ​
ts
optional treeCanopyGeometry?: BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>;
Inherited from ​

TerrainSemanticMeshOptions.treeCanopyGeometry

treeHeight? ​
ts
optional treeHeight?: number;
Inherited from ​

TerrainSemanticMeshOptions.treeHeight

treesPerSquareKilometer? ​
ts
optional treesPerSquareKilometer?: number;
Inherited from ​

TerrainSemanticMeshOptions.treesPerSquareKilometer

treeTrunkGeometry? ​
ts
optional treeTrunkGeometry?: BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>;
Inherited from ​

TerrainSemanticMeshOptions.treeTrunkGeometry

waterOffset? ​
ts
optional waterOffset?: number;
Inherited from ​

TerrainSemanticMeshOptions.waterOffset


ElevationStageTiming ​

Properties ​

milliseconds ​
ts
milliseconds: number;
stage ​
ts
stage: "decode" | "resample" | "mesh";

ElevationWorkerLike ​

Methods ​

addEventListener() ​
ts
addEventListener(type, listener): void;
Parameters ​
type ​

"message" | "error"

listener ​

(event) => void

Returns ​

void

postMessage() ​
ts
postMessage(message, transfer?): void;
Parameters ​
message ​

unknown

transfer? ​

Transferable[]

Returns ​

void

removeEventListener()? ​
ts
optional removeEventListener(type, listener): void;
Parameters ​
type ​

"message" | "error"

listener ​

(event) => void

Returns ​

void

terminate()? ​
ts
optional terminate(): void;
Returns ​

void


ElevationWorkerOptions ​

Properties ​

onParentFallback? ​
ts
optional onParentFallback?: (event) => void;
Parameters ​
event ​

TerrainParentFallbackEvent

Returns ​

void

onTiming? ​
ts
optional onTiming?: (timing) => void;
Parameters ​
timing ​

ElevationStageTiming

Returns ​

void

ownsWorker? ​
ts
optional ownsWorker?: boolean;
parentFallback? ​
ts
optional parentFallback?: boolean;

OpenTerrainPackageArchiveOptions ​

How a terrain package's archives are opened when the host passes no archive of its own.

Extends ​

Properties ​

entry? ​
ts
optional entry?: TerrainArchiveEntryInfo;

What the package knows about a single archive (see terrainPackageArchiveEntry).

fetch? ​
ts
optional fetch?: (input, init?) => Promise<Response>;

Fetch used for molen/archive-set@1 documents (default: global fetch).

MDN Reference

Parameters ​
input ​

URL | RequestInfo

init? ​

RequestInit

Returns ​

Promise&lt;Response&gt;

Inherited from ​

TerrainArchiveTransport.fetch

id? ​
ts
optional id?: string;

Name passed to openArchive for a single archive (default: its URL).

openArchive? ​
ts
optional openArchive?: TerrainArchiveOpener;

Open each PMTiles archive (default: the official PMTiles HTTP reader).

Inherited from ​

TerrainArchiveTransport.openArchive


OpenTerrainPackageBuildingDetail ​

The building-detail sidecar: one finer level, read only for buildings and places.

Properties ​

archive ​
ts
archive: TerrainTileArchive;
level ​
ts
level: number;
source ​
ts
source: TerrainPackageSemanticSource;

Loads tiles at level (other levels resolve to undefined).


OpenTerrainPackageElevation ​

Extended by ​

Properties ​

archive ​
ts
archive: TerrainTileArchive;
descriptor ​
ts
descriptor: TerrainDescriptor;
level ​
ts
level: number;
package ​
ts
package: TerrainPackageDescriptor;
source ​
ts
source: TerrainHeightTileSource;

OpenTerrainPackageOptions ​

Properties ​

archive? ​
ts
optional archive?: TerrainTileArchive;

Native/test archive implementation; otherwise the official PMTiles URL reader is used.

baseUrl? ​
ts
optional baseUrl?: string | URL;

Base URL of terrain-package.json, or its containing directory.

frame? ​
ts
optional frame?: TerrainPackageFrame;

Metric frame for projected packages; defaults to the bounds' center latitude.

level ​
ts
level: number;

Fixed PMTiles detail level used by this stream instance.

onParentFallback? ​
ts
optional onParentFallback?: (event) => void;
Parameters ​
event ​

TerrainParentFallbackEvent

Returns ​

void

parentFallback? ​
ts
optional parentFallback?: boolean;

Use the nearest available ancestor elevation tile when requested detail is missing.

transport? ​
ts
optional transport?: TerrainArchiveTransport;

How the package's archive is opened when archive is not given (a cache, a native reader).


OpenTerrainPackagePyramid ​

Extended by ​

Properties ​

archive ​
ts
archive: TerrainTileArchive;
descriptor ​
ts
descriptor: TerrainPyramidDescriptor;
package ​
ts
package: TerrainPackageDescriptor;
source ​
ts
source: TerrainPyramidHeightSource;

OpenTerrainPackagePyramidOptions ​

Extended by ​

Properties ​

archive? ​
ts
optional archive?: TerrainTileArchive;

Native/test archive implementation; otherwise the official PMTiles URL reader is used.

baseUrl? ​
ts
optional baseUrl?: string | URL;

Base URL of terrain-package.json, or its containing directory.

elevationWorker? ​
ts
optional elevationWorker?: ElevationWorkerLike;

Worker runs decoded-grid caching, resampling and meshing; host retains archive I/O.

frame? ​
ts
optional frame?: TerrainPackageFrame;

Metric frame for projected packages; defaults to the bounds' center latitude. Pass the viewer's latitude for a worldwide package (see TerrainPackageFrame).

onElevationTiming? ​
ts
optional onElevationTiming?: (timing) => void;
Parameters ​
timing ​

ElevationStageTiming

Returns ​

void

onParentFallback? ​
ts
optional onParentFallback?: (event) => void;
Parameters ​
event ​

TerrainParentFallbackEvent

Returns ​

void

parentFallback? ​
ts
optional parentFallback?: boolean;

Use the nearest available ancestor elevation tile when exact pyramid detail is absent.

transport? ​
ts
optional transport?: TerrainArchiveTransport;

How the package's archive is opened when archive is not given (a cache, a native reader).


OpenTerrainPackageSemantics ​

Properties ​

buildingDetail? ​
ts
optional buildingDetail?: OpenTerrainPackageBuildingDetail;
buildingDetailError? ​
ts
optional buildingDetailError?: Error;

Why the declared building-detail sidecar could not be opened. It only refines buildings, so the feature tiles carry on with their own footprints; hosts may report this.

features? ​
ts
optional features?: OpenTerrainPackageSemanticSidecar;
landcover? ​
ts
optional landcover?: OpenTerrainPackageSemanticSidecar;
package ​
ts
package: TerrainPackageDescriptor;

OpenTerrainPackageSemanticSidecar ​

Properties ​

archive ​
ts
archive: TerrainTileArchive;
maxLevel ​
ts
maxLevel: number;
minLevel ​
ts
minLevel: number;
source ​
ts
source: TerrainPackageSemanticSource;

OpenTerrainPackageSemanticsOptions ​

Extended by ​

Properties ​

baseUrl? ​
ts
optional baseUrl?: string | URL;
buildingDetailArchive? ​
ts
optional buildingDetailArchive?: TerrainTileArchive;

Host-provided archive for features.buildingDetail (instead of opening its source).

buildingDetailTransport? ​
ts
optional buildingDetailTransport?: TerrainArchiveTransport;

The building-detail sidecar's transport, when it differs (a lower cache priority).

decoder ​
ts
decoder: TerrainSemanticTileDecoder;
featuresArchive? ​
ts
optional featuresArchive?: TerrainTileArchive;
landcoverArchive? ​
ts
optional landcoverArchive?: TerrainTileArchive;
transport? ​
ts
optional transport?: TerrainArchiveTransport;

How sidecar archives the host did not provide are opened (a cache, a native reader).


TerrainArchiveEntryInfo ​

What an archive set or package lists about one archive, for transports that key its bytes.

Properties ​

bytes? ​
ts
optional bytes?: number;

Archive size in bytes.

sha256? ​
ts
optional sha256?: string;

Hex SHA-256 of the archive file.


TerrainArchiveSetArchive ​

A TerrainTileArchive over an archive set, with diagnostics.

Extends ​

Methods ​

descriptor() ​
ts
descriptor(): Promise<TerrainArchiveSetDescriptor>;

The loaded set document.

Returns ​

Promise&lt;TerrainArchiveSetDescriptor&gt;

getHeader() ​
ts
getHeader(): Promise<TerrainArchiveHeader>;
Returns ​

Promise&lt;TerrainArchiveHeader&gt;

Overrides ​

TerrainTileArchive.getHeader

getZxy() ​
ts
getZxy(
   level, 
   x, 
   y, 
   signal?
): Promise<TerrainArchiveTile | undefined>;
Parameters ​
level ​

number

x ​

number

y ​

number

signal? ​

AbortSignal

Returns ​

Promise&lt;TerrainArchiveTile | undefined&gt;

Inherited from ​

TerrainTileArchive.getZxy

openArchiveIds() ​
ts
openArchiveIds(): string[];

Ids of member archives currently open ('base' for the base archive).

Returns ​

string[]


TerrainArchiveSetArchiveOptions ​

Properties ​

baseUrl? ​
ts
optional baseUrl?: string | URL;

Resolves relative archive URLs. Defaults to the set document's URL; required when the set is passed as an object with relative archive URLs.

fetch? ​
ts
optional fetch?: (input, init?) => Promise<Response>;

Fetch used for the set document (default: global fetch).

MDN Reference

Parameters ​
input ​

URL | RequestInfo

init? ​

RequestInit

Returns ​

Promise&lt;Response&gt;

maxOpenArchives? ​
ts
optional maxOpenArchives?: number;

Member archives kept open at once (default 12).

openArchive? ​
ts
optional openArchive?: TerrainArchiveOpener;

Open one member archive by absolute URL (default: the official PMTiles HTTP reader). The set lists each member's sha256 and bytes when it knows them; a caching transport keys by them.


TerrainArchiveTransport ​

How a terrain package's archives are opened when the host passes no archive of its own.

Extended by ​

Properties ​

fetch? ​
ts
optional fetch?: (input, init?) => Promise<Response>;

Fetch used for molen/archive-set@1 documents (default: global fetch).

MDN Reference

Parameters ​
input ​

URL | RequestInfo

init? ​

RequestInit

Returns ​

Promise&lt;Response&gt;

openArchive? ​
ts
optional openArchive?: TerrainArchiveOpener;

Open each PMTiles archive (default: the official PMTiles HTTP reader).


TerrainHeightTileSource ​

Methods ​

dispose()? ​
ts
optional dispose(): void;
Returns ​

void

load() ​
ts
load(address, signal): Promise<Heightfield | undefined>;
Parameters ​
address ​

TerrainTileAddress

signal ​

AbortSignal

Returns ​

Promise&lt;Heightfield | undefined&gt;


TerrainLandcoverGenerator ​

Methods ​

dispose() ​
ts
dispose(): void;
Returns ​

void

generate() ​
ts
generate(
   tile, 
   context, 
   options
): Promise<Object3D<Object3DEventMap> | undefined>;
Parameters ​
tile ​

TerrainSemanticTile

context ​

TerrainPyramidTileLayerContext

options ​

TerrainSemanticMeshOptions

Returns ​

Promise&lt;Object3D&lt;Object3DEventMap&gt; | undefined&gt;


TerrainLandcoverWorker ​

Methods ​

addEventListener() ​
ts
addEventListener(type, listener): void;
Parameters ​
type ​

"message" | "error"

listener ​

(event) => void

Returns ​

void

postMessage() ​
ts
postMessage(message, transfer?): void;
Parameters ​
message ​

unknown

transfer? ​

Transferable[]

Returns ​

void

removeEventListener() ​
ts
removeEventListener(type, listener): void;
Parameters ​
type ​

"message" | "error"

listener ​

(event) => void

Returns ​

void

terminate() ​
ts
terminate(): void;
Returns ​

void


TerrainLineBand ​

Properties ​

color ​
ts
color: string;
dash? ​
ts
optional dash?: readonly [number, number];

Painted/repeated length and gap, in world units.

elevation? ​
ts
optional elevation?: number;

Distance above terrain, or absolute Y when elevationMode is absolute.

elevationMode? ​
ts
optional elevationMode?: "terrain" | "absolute";
offset? ​
ts
optional offset?: number;
phase? ​
ts
optional phase?: number;
width ​
ts
width: number;

TerrainLineProfile ​

Properties ​

bands ​
ts
bands: readonly TerrainLineBand[];
maxElements? ​
ts
optional maxElements?: number;

Per-object detail budget, default 20,000 band segments and repeaters.

repeaters? ​
ts
optional repeaters?: readonly TerrainLineRepeater[];
sampleSpacing? ​
ts
optional sampleSpacing?: number;

Upper bound on terrain sampling distance (world units, default 6).


TerrainLineRepeater ​

Properties ​

color ​
ts
color: string;
elevation? ​
ts
optional elevation?: number;
offset? ​
ts
optional offset?: number;
size ​
ts
size: readonly [number, number, number];

Width across the line, height, length along the line.

spacing ​
ts
spacing: number;

TerrainMvtSemanticDecoder ​

Source-format adapter implemented by a pipeline/app-specific MVT or PNG8 decoder.

Extends ​

Methods ​

decode() ​
ts
decode(data, context): TerrainSemanticTile;
Parameters ​
data ​

Uint8Array

context ​

TerrainSemanticTileDecodeContext

Returns ​

TerrainSemanticTile

Overrides ​

TerrainSemanticTileDecoder.decode


TerrainObjectOptions ​

Properties ​

cameraPos? ​
ts
optional cameraPos?: [number, number, number];

If given, chunks pick LOD by distance from this world position; else all full-res.


TerrainPackageCombinedSemanticSourceOptions ​

Properties ​

maxLevel? ​
ts
optional maxLevel?: number;
minLevel? ​
ts
optional minLevel?: number;

TerrainPackageHeightSourceOptions ​

Properties ​

maxAvailableLevel? ​
ts
optional maxAvailableLevel?: number;
minLevel? ​
ts
optional minLevel?: number;
onParentFallback? ​
ts
optional onParentFallback?: (event) => void;
Parameters ​
event ​

TerrainParentFallbackEvent

Returns ​

void

parentFallback? ​
ts
optional parentFallback?: boolean;

TerrainPackagePyramidHeightSourceOptions ​

Properties ​

maxDecodedArchiveTiles? ​
ts
optional maxDecodedArchiveTiles?: number;

Bounded LRU of decoded archive tiles shared by exact and descendant fallback requests.

onParentFallback? ​
ts
optional onParentFallback?: (event) => void;
Parameters ​
event ​

TerrainParentFallbackEvent

Returns ​

void

onTiming? ​
ts
optional onTiming?: (timing) => void;
Parameters ​
timing ​

ElevationStageTiming

Returns ​

void

parentFallback? ​
ts
optional parentFallback?: boolean;

TerrainPackagePyramidStream ​

Extends ​

Properties ​

archive ​
ts
archive: TerrainTileArchive;
Inherited from ​

OpenTerrainPackagePyramid.archive

descriptor ​
ts
descriptor: TerrainPyramidDescriptor;
Inherited from ​

OpenTerrainPackagePyramid.descriptor

package ​
ts
package: TerrainPackageDescriptor;
Inherited from ​

OpenTerrainPackagePyramid.package

source ​
ts
source: TerrainPyramidHeightSource;
Inherited from ​

OpenTerrainPackagePyramid.source

stream ​
ts
stream: TerrainPyramidStream;

TerrainPackagePyramidStreamOptions ​

Transient-failure policy shared by the fixed-grid and pyramid terrain streamers.

A tile that a source reports as absent (undefined, e.g. HTTP 404) is missing: stable, never retried on its own. Anything thrown — a dropped range request, a 503, a CORS failure, a reader that cannot read a response — is transient: retried with bounded exponential backoff and then abandoned, so a streamer distinguishes "still retrying" from "gave up" instead of turning every hiccup into a permanent hole.

Extends ​

Properties ​

admission? ​
ts
optional admission?: SceneAdmission;

Shared frame budget for construction/publication, also passed to semantic adapters.

Inherited from ​

TerrainPyramidStreamOptions.admission

archive? ​
ts
optional archive?: TerrainTileArchive;

Native/test archive implementation; otherwise the official PMTiles URL reader is used.

Inherited from ​

OpenTerrainPackagePyramidOptions.archive

baseUrl? ​
ts
optional baseUrl?: string | URL;

Base URL of terrain-package.json, or its containing directory.

Inherited from ​

OpenTerrainPackagePyramidOptions.baseUrl

createTileGroup? ​
ts
optional createTileGroup?: () => Group;

Optional renderer-owned tile group, e.g. a managed WebGPU render-command cache.

Returns ​

Group

Inherited from ​

TerrainPyramidStreamOptions.createTileGroup

elevationWorker? ​
ts
optional elevationWorker?: ElevationWorkerLike;

Worker runs decoded-grid caching, resampling and meshing; host retains archive I/O.

Inherited from ​

OpenTerrainPackagePyramidOptions.elevationWorker

frame? ​
ts
optional frame?: TerrainPackageFrame;

Metric frame for projected packages; defaults to the bounds' center latitude. Pass the viewer's latitude for a worldwide package (see TerrainPackageFrame).

Inherited from ​

OpenTerrainPackagePyramidOptions.frame

hysteresis? ​
ts
optional hysteresis?: number;
Inherited from ​

TerrainPyramidStreamOptions.hysteresis

initialView? ​
ts
optional initialView?: TerrainPyramidView;
Inherited from ​

TerrainPyramidStreamOptions.initialView

layers? ​
ts
optional layers?: TerrainPyramidTileLayer[];
Inherited from ​

TerrainPyramidStreamOptions.layers

layerTimeoutMs? ​
ts
optional layerTimeoutMs?: number;

Layer generation/GPU preparation deadline, default 120000 ms; 0 or Infinity disables.

Inherited from ​

TerrainPyramidStreamOptions.layerTimeoutMs

material? ​
ts
optional material?: Material<MaterialEventMap>;
Inherited from ​

TerrainPyramidStreamOptions.material

maxConcurrentLayerLoads? ​
ts
optional maxConcurrentLayerLoads?: number;

Independent ceiling for semantic tile decodes and mesh construction.

Inherited from ​

TerrainPyramidStreamOptions.maxConcurrentLayerLoads

maxConcurrentLoads ​
ts
maxConcurrentLoads: number;
Inherited from ​

TerrainPyramidStreamOptions.maxConcurrentLoads

maxResidentBytes? ​
ts
optional maxResidentBytes?: number;

Soft resident height/geometry byte cap; displayed coverage is never removed to meet it.

Inherited from ​

TerrainPyramidStreamOptions.maxResidentBytes

maxResidentTiles ​
ts
maxResidentTiles: number;
Inherited from ​

TerrainPyramidStreamOptions.maxResidentTiles

maxRetries? ​
ts
optional maxRetries?: number;

Retries after the first failed attempt before a tile is abandoned. Default 3; 0 disables.

Inherited from ​

TerrainPyramidStreamOptions.maxRetries

maxRetryDelayMs? ​
ts
optional maxRetryDelayMs?: number;

Ceiling for one backoff delay. Default 8000.

Inherited from ​

TerrainPyramidStreamOptions.maxRetryDelayMs

maxScreenSpaceError ​
ts
maxScreenSpaceError: number;

Maximum projected source-sample spacing before a tile refines.

Inherited from ​

TerrainPyramidStreamOptions.maxScreenSpaceError

maxSelectedTiles ​
ts
maxSelectedTiles: number;

Selection ceiling; the selector raises error and then shortens range if needed.

Inherited from ​

TerrainPyramidStreamOptions.maxSelectedTiles

maxSurfaceTileResolution? ​
ts
optional maxSurfaceTileResolution?: number;

Maximum vertices along one surface-tile edge; height sampling remains full resolution.

Inherited from ​

TerrainPyramidStreamOptions.maxSurfaceTileResolution

morphMilliseconds? ​
ts
optional morphMilliseconds?: number;

Optional refinement height morph for bare surfaces. Grounded layers retain atomic handoff.

Inherited from ​

TerrainPyramidStreamOptions.morphMilliseconds

onElevationTiming? ​
ts
optional onElevationTiming?: (timing) => void;
Parameters ​
timing ​

ElevationStageTiming

Returns ​

void

Inherited from ​

OpenTerrainPackagePyramidOptions.onElevationTiming

onError? ​
ts
optional onError?: (error, context) => void;
Parameters ​
error ​

unknown

context ​

TerrainPyramidStreamErrorContext

Returns ​

void

Inherited from ​

TerrainPyramidStreamOptions.onError

onParentFallback? ​
ts
optional onParentFallback?: (event) => void;
Parameters ​
event ​

TerrainParentFallbackEvent

Returns ​

void

Inherited from ​

OpenTerrainPackagePyramidOptions.onParentFallback

parentFallback? ​
ts
optional parentFallback?: boolean;

Use the nearest available ancestor elevation tile when exact pyramid detail is absent.

Inherited from ​

OpenTerrainPackagePyramidOptions.parentFallback

peripheralDegrees? ​
ts
optional peripheralDegrees?: number;

Degrees beyond the camera's horizontal view (and its small guard band) where ground stays selected at reduced detail, so turning the camera reveals terrain and layers that are already built rather than empty ground (default 0).

Inherited from ​

TerrainPyramidStreamOptions.peripheralDegrees

peripheralDetail? ​
ts
optional peripheralDetail?: number;

Error weight of peripheral tiles, in (0, 1] (default 0.4): they refine only while their weighted error exceeds the budget, so they stay a level or two coarser than the view.

Inherited from ​

TerrainPyramidStreamOptions.peripheralDetail

prepareObject? ​
ts
optional prepareObject?: (object, signal, parent?) => Promise<void>;

Prepare GPU resources before publication. parent is the tile group a layer object will join, so a renderer can prepare the LOD levels the camera will see first.

Parameters ​
object ​

Object3D

signal ​

AbortSignal

parent? ​

Object3D&lt;Object3DEventMap&gt;

Returns ​

Promise&lt;void&gt;

Inherited from ​

TerrainPyramidStreamOptions.prepareObject

previousTiles? ​
ts
optional previousTiles?: readonly TerrainPyramidTileAddress[];

Previous selection supplies a stable coarsening threshold while moving.

Inherited from ​

TerrainPyramidStreamOptions.previousTiles

requestTimeoutMs? ​
ts
optional requestTimeoutMs?: number;

Per-request deadline in milliseconds. Default 20000; 0 or Infinity disables it.

Inherited from ​

TerrainPyramidStreamOptions.requestTimeoutMs

retryDelayMs? ​
ts
optional retryDelayMs?: number;

First backoff delay in milliseconds; doubles per attempt. Default 400.

Inherited from ​

TerrainPyramidStreamOptions.retryDelayMs

shadowCasterHeight? ​
ts
optional shadowCasterHeight?: number;
Inherited from ​

TerrainPyramidStreamOptions.shadowCasterHeight

shadows? ​
ts
optional shadows?: boolean;

Sun shadows: every tile surface and layer mesh receives them, and layer meshes standing taller than shadowCasterHeight meters (default 1.5: buildings, trees, landmarks) cast them; flat roads and landcover do not. A layer part can opt in or out explicitly with userData.shadowCaster = true or false (inherited by its children), and out of receiving with userData.shadowReceiver = false (water does).

Inherited from ​

TerrainPyramidStreamOptions.shadows

transport? ​
ts
optional transport?: TerrainArchiveTransport;

How the package's archive is opened when archive is not given (a cache, a native reader).

Inherited from ​

OpenTerrainPackagePyramidOptions.transport

viewDistance ​
ts
viewDistance: number;

Radial world-space limit around the camera.

Inherited from ​

TerrainPyramidStreamOptions.viewDistance


TerrainPackageSemanticLayers ​

Properties ​

layers ​
ts
layers: TerrainPyramidTileLayer[];
package ​
ts
package: TerrainPackageDescriptor;
semantics ​
ts
semantics: OpenTerrainPackageSemantics;

TerrainPackageSemanticLayerStyle ​

Properties ​

id? ​
ts
optional id?: string;
maxLevel? ​
ts
optional maxLevel?: number;
mesh? ​
ts
optional mesh?: TerrainSemanticMeshOptions;
minLevel? ​
ts
optional minLevel?: number;
renderer? ​
ts
optional renderer?: TerrainSemanticTileRenderer;
visible? ​
ts
optional visible?: boolean;

TerrainPackageSemanticSource ​

Methods ​

load() ​
ts
load(address, signal): Promise<TerrainSemanticTile | undefined>;
Parameters ​
address ​

TerrainPyramidTileAddress

signal ​

AbortSignal

Returns ​

Promise&lt;TerrainSemanticTile | undefined&gt;


TerrainPackageSemanticSourceOptions ​

Properties ​

maxLevel? ​
ts
optional maxLevel?: number;
minLevel? ​
ts
optional minLevel?: number;

TerrainPackageStream ​

Extends ​

Properties ​

archive ​
ts
archive: TerrainTileArchive;
Inherited from ​

OpenTerrainPackageElevation.archive

descriptor ​
ts
descriptor: TerrainDescriptor;
Inherited from ​

OpenTerrainPackageElevation.descriptor

level ​
ts
level: number;
Inherited from ​

OpenTerrainPackageElevation.level

package ​
ts
package: TerrainPackageDescriptor;
Inherited from ​

OpenTerrainPackageElevation.package

source ​
ts
source: TerrainHeightTileSource;
Inherited from ​

OpenTerrainPackageElevation.source

stream ​
ts
stream: TerrainStream;

TerrainPackageStreamOptions ​

Transient-failure policy shared by the fixed-grid and pyramid terrain streamers.

A tile that a source reports as absent (undefined, e.g. HTTP 404) is missing: stable, never retried on its own. Anything thrown — a dropped range request, a 503, a CORS failure, a reader that cannot read a response — is transient: retried with bounded exponential backoff and then abandoned, so a streamer distinguishes "still retrying" from "gave up" instead of turning every hiccup into a permanent hole.

Extends ​

Properties ​

archive? ​
ts
optional archive?: TerrainTileArchive;
baseUrl? ​
ts
optional baseUrl?: string | URL;
cameraPos? ​
ts
optional cameraPos?: [number, number, number];
Inherited from ​

TerrainStreamOptions.cameraPos

frame? ​
ts
optional frame?: TerrainPackageFrame;

Metric frame for projected packages; defaults to the bounds' center latitude.

layers? ​
ts
optional layers?: TerrainTileLayer[];
Inherited from ​

TerrainStreamOptions.layers

level ​
ts
level: number;
loadRadius? ​
ts
optional loadRadius?: number;
Inherited from ​

TerrainStreamOptions.loadRadius

material? ​
ts
optional material?: Material<MaterialEventMap>;
Inherited from ​

TerrainStreamOptions.material

maxConcurrentLoads? ​
ts
optional maxConcurrentLoads?: number;
Inherited from ​

TerrainStreamOptions.maxConcurrentLoads

maxResidentTiles? ​
ts
optional maxResidentTiles?: number;
Inherited from ​

TerrainStreamOptions.maxResidentTiles

maxRetries? ​
ts
optional maxRetries?: number;

Retries after the first failed attempt before a tile is abandoned. Default 3; 0 disables.

Inherited from ​

TerrainStreamOptions.maxRetries

maxRetryDelayMs? ​
ts
optional maxRetryDelayMs?: number;

Ceiling for one backoff delay. Default 8000.

Inherited from ​

TerrainStreamOptions.maxRetryDelayMs

onError? ​
ts
optional onError?: (error, context) => void;
Parameters ​
error ​

unknown

context ​

TerrainStreamErrorContext

Returns ​

void

Inherited from ​

TerrainStreamOptions.onError

onParentFallback? ​
ts
optional onParentFallback?: (event) => void;
Parameters ​
event ​

TerrainParentFallbackEvent

Returns ​

void

parentFallback? ​
ts
optional parentFallback?: boolean;
requestTimeoutMs? ​
ts
optional requestTimeoutMs?: number;

Per-request deadline in milliseconds. Default 20000; 0 or Infinity disables it.

Inherited from ​

TerrainStreamOptions.requestTimeoutMs

retryDelayMs? ​
ts
optional retryDelayMs?: number;

First backoff delay in milliseconds; doubles per attempt. Default 400.

Inherited from ​

TerrainStreamOptions.retryDelayMs

transport? ​
ts
optional transport?: TerrainArchiveTransport;
unloadRadius? ​
ts
optional unloadRadius?: number;
Inherited from ​

TerrainStreamOptions.unloadRadius


TerrainParentFallbackEvent ​

Properties ​

requestedAddress ​
ts
requestedAddress: TerrainTileAddress;
requestedLevel ​
ts
requestedLevel: number;
resolvedAddress ​
ts
resolvedAddress: TerrainTileAddress;
resolvedLevel ​
ts
resolvedLevel: number;

TerrainParkedVehicle ​

One kind of parked car: the entity type id and the vehicle spec that sizes and seats it.

Properties ​

id ​
ts
id: string;
spec ​
ts
spec: VehicleSpec;

TerrainPyramidBudget ​

Extends ​

Properties ​

hysteresis? ​
ts
optional hysteresis?: number;
Inherited from ​

TerrainPyramidSelectionOptions.hysteresis

maxConcurrentLayerLoads ​
ts
maxConcurrentLayerLoads: number;
maxConcurrentLoads ​
ts
maxConcurrentLoads: number;
maxResidentBytes? ​
ts
optional maxResidentBytes?: number;

Soft cap on retained height/geometry buffers; excludes textures, source caches and GPU copies.

maxResidentTiles ​
ts
maxResidentTiles: number;
maxScreenSpaceError ​
ts
maxScreenSpaceError: number;

Maximum projected source-sample spacing before a tile refines.

Inherited from ​

TerrainPyramidSelectionOptions.maxScreenSpaceError

maxSelectedTiles ​
ts
maxSelectedTiles: number;

Selection ceiling; the selector raises error and then shortens range if needed.

Inherited from ​

TerrainPyramidSelectionOptions.maxSelectedTiles

maxSurfaceTileResolution ​
ts
maxSurfaceTileResolution: number;
peripheralDegrees? ​
ts
optional peripheralDegrees?: number;

Degrees beyond the camera's horizontal view (and its small guard band) where ground stays selected at reduced detail, so turning the camera reveals terrain and layers that are already built rather than empty ground (default 0).

Inherited from ​

TerrainPyramidSelectionOptions.peripheralDegrees

peripheralDetail? ​
ts
optional peripheralDetail?: number;

Error weight of peripheral tiles, in (0, 1] (default 0.4): they refine only while their weighted error exceeds the budget, so they stay a level or two coarser than the view.

Inherited from ​

TerrainPyramidSelectionOptions.peripheralDetail

previousTiles? ​
ts
optional previousTiles?: readonly TerrainPyramidTileAddress[];

Previous selection supplies a stable coarsening threshold while moving.

Inherited from ​

TerrainPyramidSelectionOptions.previousTiles

viewDistance ​
ts
viewDistance: number;

Radial world-space limit around the camera.

Inherited from ​

TerrainPyramidSelectionOptions.viewDistance


TerrainPyramidHeightSource ​

Methods ​

dispose()? ​
ts
optional dispose(): void;
Returns ​

void

load() ​
ts
load(address, signal): Promise<Heightfield | undefined>;
Parameters ​
address ​

TerrainPyramidTileAddress

signal ​

AbortSignal

Returns ​

Promise&lt;Heightfield | undefined&gt;

loadPrepared()? ​
ts
optional loadPrepared(
   address, 
   signal, 
   maxResolution
): Promise<
  | {
  geometry: ChunkGeometry;
  heightfield: Heightfield;
}
| undefined>;
Parameters ​
address ​

TerrainPyramidTileAddress

signal ​

AbortSignal

maxResolution ​

number

Returns ​

Promise&lt; | { geometry: ChunkGeometry; heightfield: Heightfield; } | undefined&gt;


TerrainPyramidSelection ​

Properties ​

effectiveScreenSpaceError ​
ts
effectiveScreenSpaceError: number;
effectiveViewDistance ​
ts
effectiveViewDistance: number;
tiles ​
ts
tiles: TerrainPyramidTileAddress[];

TerrainPyramidSelectionOptions ​

Extended by ​

Properties ​

hysteresis? ​
ts
optional hysteresis?: number;
maxScreenSpaceError ​
ts
maxScreenSpaceError: number;

Maximum projected source-sample spacing before a tile refines.

maxSelectedTiles ​
ts
maxSelectedTiles: number;

Selection ceiling; the selector raises error and then shortens range if needed.

peripheralDegrees? ​
ts
optional peripheralDegrees?: number;

Degrees beyond the camera's horizontal view (and its small guard band) where ground stays selected at reduced detail, so turning the camera reveals terrain and layers that are already built rather than empty ground (default 0).

peripheralDetail? ​
ts
optional peripheralDetail?: number;

Error weight of peripheral tiles, in (0, 1] (default 0.4): they refine only while their weighted error exceeds the budget, so they stay a level or two coarser than the view.

previousTiles? ​
ts
optional previousTiles?: readonly TerrainPyramidTileAddress[];

Previous selection supplies a stable coarsening threshold while moving.

viewDistance ​
ts
viewDistance: number;

Radial world-space limit around the camera.


TerrainPyramidStream ​

Properties ​

object ​
ts
readonly object: Group;

The root of every tile. Its transform does not update itself each frame (that would dirty every tile's world matrix); after moving it, call object.updateMatrix().

Methods ​

displayedTiles() ​
ts
displayedTiles(): TerrainPyramidTileAddress[];
Returns ​

TerrainPyramidTileAddress[]

dispose() ​
ts
dispose(): void;
Returns ​

void

failedTiles() ​
ts
failedTiles(): TerrainPyramidTileAddress[];

Tiles that will not load again on their own: missing plus abandoned.

Returns ​

TerrainPyramidTileAddress[]

getBudget() ​
ts
getBudget(): TerrainPyramidBudget;
Returns ​

TerrainPyramidBudget

isAreaReady() ​
ts
isAreaReady(
   x, 
   z, 
   radius
): boolean;

True when the view's terrain and enabled layers within radius of (x, z) are on screen: every selected tile there is displayed with its layers published (a layer that failed for good does not hold it back). Loads elsewhere in the view do not count, so a host can act on the ground around a point, such as landing a walker, while the rest of the view streams in.

Parameters ​
x ​

number

z ​

number

radius ​

number

Returns ​

boolean

isLayerVisible() ​
ts
isLayerVisible(id): boolean;
Parameters ​
id ​

string

Returns ​

boolean

loading() ​
ts
loading(): object;

Tiles and layers loading now, in constant time.

Returns ​

object

layers ​
ts
layers: number;
tiles ​
ts
tiles: number;
pressure() ​
ts
pressure(): TerrainPyramidStreamPressure;

Constant-time retained allocation estimates for an adaptive quality controller.

Returns ​

TerrainPyramidStreamPressure

refreshMemoryUsage() ​
ts
refreshMemoryUsage(): void;

Refresh retained allocation estimates after an adapter mutates resident layer geometry.

Returns ​

void

residentTiles() ​
ts
residentTiles(): TerrainPyramidTileAddress[];
Returns ​

TerrainPyramidTileAddress[]

retryFailed() ​
ts
retryFailed(): void;
Returns ​

void

sampleHeight() ​
ts
sampleHeight(x, z): number | undefined;
Parameters ​
x ​

number

z ​

number

Returns ​

number | undefined

setBudget() ​
ts
setBudget(budget): void;

Replan in place. Surface resolution affects newly loaded tiles, preserving resident draping.

Parameters ​
budget ​

Partial&lt;TerrainPyramidBudget&gt;

Returns ​

void

setLayerVisible() ​
ts
setLayerVisible(id, visible): void;
Parameters ​
id ​

string

visible ​

boolean

Returns ​

void

stats() ​
ts
stats(): TerrainPyramidStreamStats;

Full counters, including triangle and byte totals gathered by walking every resident tile's objects: for diagnostics, not every frame. Per-frame callers use loading().

Returns ​

TerrainPyramidStreamStats

tileFailures() ​
ts
tileFailures(): TerrainTileFailure<TerrainPyramidTileAddress>[];

Per-tile missing/retrying/abandoned detail, so a host can say which state a hole is in.

Returns ​

TerrainTileFailure&lt;TerrainPyramidTileAddress&gt;[]

update() ​
ts
update(view): void;
Parameters ​
view ​

TerrainPyramidView

Returns ​

void

updateTransitions() ​
ts
updateTransitions(nowMs?): void;
Parameters ​
nowMs? ​

number

Returns ​

void

whenIdle() ​
ts
whenIdle(): Promise<void>;
Returns ​

Promise&lt;void&gt;


TerrainPyramidStreamErrorContext ​

Properties ​

address ​
ts
address: TerrainPyramidTileAddress;
layerId? ​
ts
optional layerId?: string;

TerrainPyramidStreamOptions ​

Transient-failure policy shared by the fixed-grid and pyramid terrain streamers.

A tile that a source reports as absent (undefined, e.g. HTTP 404) is missing: stable, never retried on its own. Anything thrown — a dropped range request, a 503, a CORS failure, a reader that cannot read a response — is transient: retried with bounded exponential backoff and then abandoned, so a streamer distinguishes "still retrying" from "gave up" instead of turning every hiccup into a permanent hole.

Extends ​

Extended by ​

Properties ​

admission? ​
ts
optional admission?: SceneAdmission;

Shared frame budget for construction/publication, also passed to semantic adapters.

createTileGroup? ​
ts
optional createTileGroup?: () => Group;

Optional renderer-owned tile group, e.g. a managed WebGPU render-command cache.

Returns ​

Group

hysteresis? ​
ts
optional hysteresis?: number;
Inherited from ​

TerrainPyramidSelectionOptions.hysteresis

initialView? ​
ts
optional initialView?: TerrainPyramidView;
layers? ​
ts
optional layers?: TerrainPyramidTileLayer[];
layerTimeoutMs? ​
ts
optional layerTimeoutMs?: number;

Layer generation/GPU preparation deadline, default 120000 ms; 0 or Infinity disables.

material? ​
ts
optional material?: Material<MaterialEventMap>;
maxConcurrentLayerLoads? ​
ts
optional maxConcurrentLayerLoads?: number;

Independent ceiling for semantic tile decodes and mesh construction.

maxConcurrentLoads ​
ts
maxConcurrentLoads: number;
maxResidentBytes? ​
ts
optional maxResidentBytes?: number;

Soft resident height/geometry byte cap; displayed coverage is never removed to meet it.

maxResidentTiles ​
ts
maxResidentTiles: number;
maxRetries? ​
ts
optional maxRetries?: number;

Retries after the first failed attempt before a tile is abandoned. Default 3; 0 disables.

Inherited from ​

TerrainTileRetryOptions.maxRetries

maxRetryDelayMs? ​
ts
optional maxRetryDelayMs?: number;

Ceiling for one backoff delay. Default 8000.

Inherited from ​

TerrainTileRetryOptions.maxRetryDelayMs

maxScreenSpaceError ​
ts
maxScreenSpaceError: number;

Maximum projected source-sample spacing before a tile refines.

Inherited from ​

TerrainPyramidSelectionOptions.maxScreenSpaceError

maxSelectedTiles ​
ts
maxSelectedTiles: number;

Selection ceiling; the selector raises error and then shortens range if needed.

Inherited from ​

TerrainPyramidSelectionOptions.maxSelectedTiles

maxSurfaceTileResolution? ​
ts
optional maxSurfaceTileResolution?: number;

Maximum vertices along one surface-tile edge; height sampling remains full resolution.

morphMilliseconds? ​
ts
optional morphMilliseconds?: number;

Optional refinement height morph for bare surfaces. Grounded layers retain atomic handoff.

onError? ​
ts
optional onError?: (error, context) => void;
Parameters ​
error ​

unknown

context ​

TerrainPyramidStreamErrorContext

Returns ​

void

peripheralDegrees? ​
ts
optional peripheralDegrees?: number;

Degrees beyond the camera's horizontal view (and its small guard band) where ground stays selected at reduced detail, so turning the camera reveals terrain and layers that are already built rather than empty ground (default 0).

Inherited from ​

TerrainPyramidSelectionOptions.peripheralDegrees

peripheralDetail? ​
ts
optional peripheralDetail?: number;

Error weight of peripheral tiles, in (0, 1] (default 0.4): they refine only while their weighted error exceeds the budget, so they stay a level or two coarser than the view.

Inherited from ​

TerrainPyramidSelectionOptions.peripheralDetail

prepareObject? ​
ts
optional prepareObject?: (object, signal, parent?) => Promise<void>;

Prepare GPU resources before publication. parent is the tile group a layer object will join, so a renderer can prepare the LOD levels the camera will see first.

Parameters ​
object ​

Object3D

signal ​

AbortSignal

parent? ​

Object3D&lt;Object3DEventMap&gt;

Returns ​

Promise&lt;void&gt;

previousTiles? ​
ts
optional previousTiles?: readonly TerrainPyramidTileAddress[];

Previous selection supplies a stable coarsening threshold while moving.

Inherited from ​

TerrainPyramidSelectionOptions.previousTiles

requestTimeoutMs? ​
ts
optional requestTimeoutMs?: number;

Per-request deadline in milliseconds. Default 20000; 0 or Infinity disables it.

Inherited from ​

TerrainTileRetryOptions.requestTimeoutMs

retryDelayMs? ​
ts
optional retryDelayMs?: number;

First backoff delay in milliseconds; doubles per attempt. Default 400.

Inherited from ​

TerrainTileRetryOptions.retryDelayMs

shadowCasterHeight? ​
ts
optional shadowCasterHeight?: number;
shadows? ​
ts
optional shadows?: boolean;

Sun shadows: every tile surface and layer mesh receives them, and layer meshes standing taller than shadowCasterHeight meters (default 1.5: buildings, trees, landmarks) cast them; flat roads and landcover do not. A layer part can opt in or out explicitly with userData.shadowCaster = true or false (inherited by its children), and out of receiving with userData.shadowReceiver = false (water does).

viewDistance ​
ts
viewDistance: number;

Radial world-space limit around the camera.

Inherited from ​

TerrainPyramidSelectionOptions.viewDistance


TerrainPyramidStreamPressure ​

Properties ​

byteRatio ​
ts
byteRatio: number;

Zero when no byte cap is configured. Shared geometries count conservatively per tile.

decodedHeightBytes ​
ts
decodedHeightBytes: number;
displayedByteRatio ​
ts
displayedByteRatio: number;

Displayed bytes / cap, excluding reclaimable hidden cache; zero when no cap is set.

displayedBytes ​
ts
displayedBytes: number;

Retained height/geometry allocations belonging to currently displayed tiles.

geometryBytes ​
ts
geometryBytes: number;
maxResidentBytes ​
ts
maxResidentBytes: number | undefined;
maxResidentTiles ​
ts
maxResidentTiles: number;
overBudget ​
ts
overBudget: boolean;
residentBytes ​
ts
residentBytes: number;
residentTiles ​
ts
residentTiles: number;
tileRatio ​
ts
tileRatio: number;

TerrainPyramidStreamStats ​

Extends ​

Properties ​

decodedSamples ​
ts
decodedSamples: number;
Inherited from ​

TerrainStreamStats.decodedSamples

desired ​
ts
desired: number;
Inherited from ​

TerrainStreamStats.desired

displayed ​
ts
displayed: number;
drawCalls ​
ts
drawCalls: number;
Inherited from ​

TerrainStreamStats.drawCalls

effectiveScreenSpaceError ​
ts
effectiveScreenSpaceError: number;
effectiveViewDistance ​
ts
effectiveViewDistance: number;
evictions ​
ts
evictions: number;
Inherited from ​

TerrainStreamStats.evictions

failed ​
ts
failed: number;

Tiles that will not load again without retryFailed(): missing plus abandoned.

Inherited from ​

TerrainStreamStats.failed

failedLayers ​
ts
failedLayers: number;

Semantic layer requests that exhausted their retry budget.

Overrides ​

TerrainStreamStats.failedLayers

fallbackLeaves ​
ts
fallbackLeaves: number;
geometryBytes ​
ts
geometryBytes: number;
Inherited from ​

TerrainStreamStats.geometryBytes

instances ​
ts
instances: number;
Inherited from ​

TerrainStreamStats.instances

layerObjects ​
ts
layerObjects: number;
Inherited from ​

TerrainStreamStats.layerObjects

loading ​
ts
loading: number;
Inherited from ​

TerrainStreamStats.loading

loadingLayers ​
ts
loadingLayers: number;
Inherited from ​

TerrainStreamStats.loadingLayers

maxDisplayedLevel ​
ts
maxDisplayedLevel: number | undefined;
minDisplayedLevel ​
ts
minDisplayedLevel: number | undefined;
missing ​
ts
missing: number;

Tiles the source reported as absent (HTTP 404 / undefined). Stable, never retried.

Inherited from ​

TerrainStreamStats.missing

queued ​
ts
queued: number;
Inherited from ​

TerrainStreamStats.queued

resident ​
ts
resident: number;
Inherited from ​

TerrainStreamStats.resident

retrying ​
ts
retrying: number;

Tiles whose last attempt threw and that are still inside their retry budget.

Inherited from ​

TerrainStreamStats.retrying

retryingLayers ​
ts
retryingLayers: number;

Semantic layer requests waiting for or performing another attempt.

selected ​
ts
selected: number;
triangles ​
ts
triangles: number;
Inherited from ​

TerrainStreamStats.triangles


TerrainPyramidTileLayer ​

Per-tile content drawn over the terrain. A published object's transforms are frozen (matrixAutoUpdate = false) because tile content is static; mark a part that moves with userData.dynamicTransform = true, or call updateMatrix() after moving it.

Properties ​

category ​
ts
category: TerrainTileLayerCategory;
id ​
ts
id: string;
maxLevel? ​
ts
optional maxLevel?: number;
minLevel? ​
ts
optional minLevel?: number;

Inclusive detail-level bounds. Coarse fallback tiles outside them remain surface-only.

visible? ​
ts
optional visible?: boolean;

Methods ​

createTile() ​
ts
createTile(context): 
  | Object3D<Object3DEventMap>
  | Promise<Object3D<Object3DEventMap> | undefined>
  | undefined;
Parameters ​
context ​

TerrainPyramidTileLayerContext

Returns ​

| Object3D&lt;Object3DEventMap&gt; | Promise&lt;Object3D&lt;Object3DEventMap&gt; | undefined&gt; | undefined

disposeTile()? ​
ts
optional disposeTile(object): void;
Parameters ​
object ​

Object3D

Returns ​

void


TerrainPyramidTileLayerContext ​

Properties ​

address ​
ts
address: TerrainPyramidTileAddress;
admission? ​
ts
optional admission?: SceneAdmission;
descriptor ​
ts
descriptor: TerrainDescriptor;

Fixed-grid view of this address, useful for generic terrain mesh/decorator code.

heightfield ​
ts
heightfield: Heightfield;
origin ​
ts
origin: [number, number];

Returned objects use tile-local X/Z coordinates and world-space Y heights.

pyramid ​
ts
pyramid: TerrainPyramidDescriptor;
signal ​
ts
signal: AbortSignal;
surfaceResolution? ​
ts
optional surfaceResolution?: number;

Actual rendered grid vertices per edge, after the quality cap.

tileSize ​
ts
tileSize: number;

TerrainPyramidView ​

Properties ​

aspect? ​
ts
optional aspect?: number;

Viewport width / height. Required only when direction-aware culling is desired.

direction? ​
ts
optional direction?: [number, number, number];

Optional normalized or unnormalized camera forward vector for horizontal view culling.

position ​
ts
position: [number, number, number];
verticalFov ​
ts
verticalFov: number;

Perspective camera vertical field of view, in radians.

viewportHeight ​
ts
viewportHeight: number;

TerrainSemanticMeshMaterials ​

Properties ​

building? ​
ts
optional building?: Material<MaterialEventMap>;
landcover? ​
ts
optional landcover?: Material<MaterialEventMap>;
road? ​
ts
optional road?: Material<MaterialEventMap>;
treeCanopy? ​
ts
optional treeCanopy?: Material<MaterialEventMap>;
treeTrunk? ​
ts
optional treeTrunk?: Material<MaterialEventMap>;
water? ​
ts
optional water?: Material<MaterialEventMap>;

TerrainSemanticMeshOptions ​

Extended by ​

Properties ​

defaultBuildingHeight? ​
ts
optional defaultBuildingHeight?: number;
defaultLevelHeight? ​
ts
optional defaultLevelHeight?: number;
forestClasses? ​
ts
optional forestClasses?: readonly string[];
landcoverColors? ​
ts
optional landcoverColors?: Readonly<Record<string, string>>;
landcoverOffset? ​
ts
optional landcoverOffset?: number;
materials? ​
ts
optional materials?: TerrainSemanticMeshMaterials;
maxTreeSlope? ​
ts
optional maxTreeSlope?: number;
maxTreesPerTile? ​
ts
optional maxTreesPerTile?: number;
renderBuildings? ​
ts
optional renderBuildings?: boolean;
renderLandcover? ​
ts
optional renderLandcover?: boolean;
renderLandcoverSurface? ​
ts
optional renderLandcoverSurface?: boolean;
renderTransportation? ​
ts
optional renderTransportation?: boolean;
renderWater? ​
ts
optional renderWater?: boolean;
seaLevel? ​
ts
optional seaLevel?: number;

Height of the sea, for projected-Earth terrain. Water whose floor reaches within 2 m of it is the sea (or a tidal river or harbor): it draws as one flat surface 1.5 m above sea level in every tile, over shoreline and shallow-water noise in the elevation, instead of a level sampled from the bathymetry (which differs tile to tile and lets noisy ground poke through). Omit for invented worlds without a sea.

surfaceRenderer? ​
ts
optional surfaceRenderer?: TerrainSurfaceRenderer;

Shared controller for live style changes across resident tiles.

surfaces? ​
ts
optional surfaces?: TerrainSurfaceOptions;

Static styles when no shared controller is supplied.

treeCanopyGeometry? ​
ts
optional treeCanopyGeometry?: BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>;
treeHeight? ​
ts
optional treeHeight?: number;
treesPerSquareKilometer? ​
ts
optional treesPerSquareKilometer?: number;
treeTrunkGeometry? ​
ts
optional treeTrunkGeometry?: BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>;
waterOffset? ​
ts
optional waterOffset?: number;

TerrainSemanticPyramidLayerOptions ​

Properties ​

category ​
ts
category: TerrainTileLayerCategory;
id ​
ts
id: string;
maxLevel? ​
ts
optional maxLevel?: number;
minLevel? ​
ts
optional minLevel?: number;
renderer ​
ts
renderer: TerrainSemanticTileRenderer;
source ​
ts
source: TerrainSemanticTileSource;
visible? ​
ts
optional visible?: boolean;

TerrainSemanticTileRenderer ​

Methods ​

createTile() ​
ts
createTile(tile, context): 
  | Object3D<Object3DEventMap>
  | Promise<Object3D<Object3DEventMap> | undefined>
  | undefined;
Parameters ​
tile ​

TerrainSemanticTile

context ​

TerrainPyramidTileLayerContext

Returns ​

| Object3D&lt;Object3DEventMap&gt; | Promise&lt;Object3D&lt;Object3DEventMap&gt; | undefined&gt; | undefined

disposeTile()? ​
ts
optional disposeTile(object): void;
Parameters ​
object ​

Object3D

Returns ​

void


TerrainSemanticTileSource ​

Methods ​

dispose()? ​
ts
optional dispose(): void;
Returns ​

void

load() ​
ts
load(address, signal): Promise<TerrainSemanticTile | undefined>;
Parameters ​
address ​

TerrainPyramidTileAddress

signal ​

AbortSignal

Returns ​

Promise&lt;TerrainSemanticTile | undefined&gt;


TerrainStream ​

Properties ​

object ​
ts
readonly object: Group;

Methods ​

dispose() ​
ts
dispose(): void;
Returns ​

void

failedTiles() ​
ts
failedTiles(): TerrainTileAddress[];

Tiles that will not load again on their own: missing plus abandoned.

Returns ​

TerrainTileAddress[]

isAreaReady() ​
ts
isAreaReady(
   x, 
   z, 
   radius
): boolean;

True when every wanted chunk within radius of (x, z) is resident and none of its layers is still loading. Loads elsewhere do not count, so a host can act on the ground around a point, such as landing a walker, while the rest of the view streams in.

Parameters ​
x ​

number

z ​

number

radius ​

number

Returns ​

boolean

isLayerVisible() ​
ts
isLayerVisible(id): boolean;
Parameters ​
id ​

string

Returns ​

boolean

residentTiles() ​
ts
residentTiles(): TerrainTileAddress[];
Returns ​

TerrainTileAddress[]

retryFailed() ​
ts
retryFailed(): void;
Returns ​

void

sampleHeight() ​
ts
sampleHeight(x, z): number | undefined;
Parameters ​
x ​

number

z ​

number

Returns ​

number | undefined

setLayerVisible() ​
ts
setLayerVisible(id, visible): void;
Parameters ​
id ​

string

visible ​

boolean

Returns ​

void

stats() ​
ts
stats(): TerrainStreamStats;
Returns ​

TerrainStreamStats

tileFailures() ​
ts
tileFailures(): TerrainTileFailure<TerrainTileAddress>[];

Per-tile missing/retrying/abandoned detail, so a host can say which state a hole is in.

Returns ​

TerrainTileFailure&lt;TerrainTileAddress&gt;[]

update() ​
ts
update(cameraPos): void;
Parameters ​
cameraPos ​

[number, number, number]

Returns ​

void

whenIdle() ​
ts
whenIdle(): Promise<void>;
Returns ​

Promise&lt;void&gt;


TerrainStreamBudget ​

Properties ​

loadRadius ​
ts
loadRadius: number;
maxConcurrentLoads ​
ts
maxConcurrentLoads: number;
maxResidentTiles ​
ts
maxResidentTiles: number;
unloadRadius ​
ts
unloadRadius: number;

TerrainStreamErrorContext ​

Properties ​

address ​
ts
address: TerrainTileAddress;
layerId? ​
ts
optional layerId?: string;

TerrainStreamOptions ​

Transient-failure policy shared by the fixed-grid and pyramid terrain streamers.

A tile that a source reports as absent (undefined, e.g. HTTP 404) is missing: stable, never retried on its own. Anything thrown — a dropped range request, a 503, a CORS failure, a reader that cannot read a response — is transient: retried with bounded exponential backoff and then abandoned, so a streamer distinguishes "still retrying" from "gave up" instead of turning every hiccup into a permanent hole.

Extends ​

Extended by ​

Properties ​

cameraPos? ​
ts
optional cameraPos?: [number, number, number];
layers? ​
ts
optional layers?: TerrainTileLayer[];
loadRadius? ​
ts
optional loadRadius?: number;
material? ​
ts
optional material?: Material<MaterialEventMap>;
maxConcurrentLoads? ​
ts
optional maxConcurrentLoads?: number;
maxResidentTiles? ​
ts
optional maxResidentTiles?: number;
maxRetries? ​
ts
optional maxRetries?: number;

Retries after the first failed attempt before a tile is abandoned. Default 3; 0 disables.

Inherited from ​

TerrainTileRetryOptions.maxRetries

maxRetryDelayMs? ​
ts
optional maxRetryDelayMs?: number;

Ceiling for one backoff delay. Default 8000.

Inherited from ​

TerrainTileRetryOptions.maxRetryDelayMs

onError? ​
ts
optional onError?: (error, context) => void;
Parameters ​
error ​

unknown

context ​

TerrainStreamErrorContext

Returns ​

void

requestTimeoutMs? ​
ts
optional requestTimeoutMs?: number;

Per-request deadline in milliseconds. Default 20000; 0 or Infinity disables it.

Inherited from ​

TerrainTileRetryOptions.requestTimeoutMs

retryDelayMs? ​
ts
optional retryDelayMs?: number;

First backoff delay in milliseconds; doubles per attempt. Default 400.

Inherited from ​

TerrainTileRetryOptions.retryDelayMs

unloadRadius? ​
ts
optional unloadRadius?: number;

TerrainStreamStats ​

Extended by ​

Properties ​

decodedSamples ​
ts
decodedSamples: number;
desired ​
ts
desired: number;
drawCalls ​
ts
drawCalls: number;
evictions ​
ts
evictions: number;
failed ​
ts
failed: number;

Tiles that will not load again without retryFailed(): missing plus abandoned.

failedLayers ​
ts
failedLayers: number;
geometryBytes ​
ts
geometryBytes: number;
instances ​
ts
instances: number;
layerObjects ​
ts
layerObjects: number;
loading ​
ts
loading: number;
loadingLayers ​
ts
loadingLayers: number;
missing ​
ts
missing: number;

Tiles the source reported as absent (HTTP 404 / undefined). Stable, never retried.

queued ​
ts
queued: number;
resident ​
ts
resident: number;
retrying ​
ts
retrying: number;

Tiles whose last attempt threw and that are still inside their retry budget.

triangles ​
ts
triangles: number;

TerrainSurfaceDetails ​

Properties ​

crossings? ​
ts
optional crossings?: boolean;
detailLevelsBelowMax? ​
ts
optional detailLevelsBelowMax?: number;

Render details at this many levels below the finest level, default 0.

inferParking? ​
ts
optional inferParking?: boolean;

Infer pavement from aisle patterns and bounded service-road courts near nonresidential buildings. Default true.

markings? ​
ts
optional markings?: boolean;
maxDetailElements? ​
ts
optional maxDetailElements?: number;

Marking/parking layout work limit per tile, default 16,000.

maxFixturesPerTile? ​
ts
optional maxFixturesPerTile?: number;

Fixture and car count limit per tile, default 160.

parkedCars? ​
ts
optional parkedCars?: boolean;
parkedVehicles? ​
ts
optional parkedVehicles?: readonly TerrainParkedVehicle[];

The vehicles parked cars are drawn from, in order: a kind id and its spec, such as the vehicle types of the molen.entities content pack. Omitted or empty, no cars are parked.

parkingOccupancy? ​
ts
optional parkingOccupancy?: number;

Fraction of valid parking bays occupied, [0,1], default 0.7.

parkingStalls? ​
ts
optional parkingStalls?: boolean;
preferMappedProps? ​
ts
optional preferMappedProps?: boolean;

Suppress inferred lamps near mapped ones when a separate mapped-prop layer is active.

sidewalks? ​
ts
optional sidewalks?: boolean;
streetlights? ​
ts
optional streetlights?: boolean;
trafficSignals? ​
ts
optional trafficSignals?: boolean;

TerrainSurfaceGenerator ​

Methods ​

dispose() ​
ts
dispose(): void;
Returns ​

void

generate() ​
ts
generate(
   tile, 
   context, 
   options
): Promise<Group<Object3DEventMap> | undefined>;
Parameters ​
tile ​

TerrainSemanticTile

context ​

TerrainPyramidTileLayerContext

options ​

TerrainSurfaceOptions

Returns ​

Promise&lt;Group&lt;Object3DEventMap&gt; | undefined&gt;


TerrainSurfaceOptions ​

Properties ​

details? ​
ts
optional details?: TerrainSurfaceDetails;
style? ​
ts
optional style?: 
  | TerrainSurfaceStyleId
| Readonly<TerrainSurfaceStyle>;

TerrainSurfaceRenderer ​

Methods ​

createTile() ​
ts
createTile(tile, context): Group;

Synchronous construction for direct/static consumers. Streamed renderers use createTileAsync.

Parameters ​
tile ​

TerrainSemanticTile

context ​

TerrainPyramidTileLayerContext

Returns ​

Group

createTileAsync() ​
ts
createTileAsync(tile, context): Promise<Group<Object3DEventMap> | undefined>;

Resolves only when the newest requested style is ready, or undefined after cancellation.

Parameters ​
tile ​

TerrainSemanticTile

context ​

TerrainPyramidTileLayerContext

Returns ​

Promise&lt;Group&lt;Object3DEventMap&gt; | undefined&gt;

dispose() ​
ts
dispose(): void;
Returns ​

void

disposeTile() ​
ts
disposeTile(object): void;
Parameters ​
object ​

Object3D

Returns ​

void

setOptions() ​
ts
setOptions(options): Promise<void>;

Refresh resident tiles cooperatively, without refetching map data or rebuilding buildings.

Parameters ​
options ​

TerrainSurfaceOptions

Returns ​

Promise&lt;void&gt;

stats() ​
ts
stats(): TerrainSurfaceStats & object;
Returns ​

TerrainSurfaceStats & object


TerrainSurfaceStats ​

Properties ​

detailLimited ​
ts
detailLimited: boolean;
junctions ​
ts
junctions: number;
parkedCars ​
ts
parkedCars: number;
parkingAreas ​
ts
parkingAreas: number;
parkingBays ​
ts
parkingBays: number;
roads ​
ts
roads: number;
streetlights ​
ts
streetlights: number;
trafficSignals ​
ts
trafficSignals: number;

TerrainSurfaceStyle ​

Properties ​

center ​
ts
center: string;
crossings ​
ts
crossings: boolean;
curb ​
ts
curb: string;
dirt ​
ts
dirt: string;
id ​
ts
id: string;
label ​
ts
label: string;
markings ​
ts
markings: boolean;
parkedCars ​
ts
parkedCars: boolean;
parking ​
ts
parking: string;
parkingStalls ​
ts
parkingStalls: boolean;
path ​
ts
path: string;
plaza ​
ts
plaza: string;
road ​
ts
road: string;
roadWidthScale ​
ts
roadWidthScale: number;

Applied to inferred widths; explicitly mapped widths remain authoritative.

shoulder ​
ts
shoulder: string;
sidewalk ​
ts
sidewalk: string;
sidewalks ​
ts
sidewalks: boolean;
sidewalkWidth ​
ts
sidewalkWidth: number;
streetlights ​
ts
streetlights: boolean;
trafficSignals ​
ts
trafficSignals: boolean;
unpavedRoads ​
ts
unpavedRoads: boolean;
white ​
ts
white: string;

TerrainTileFailure ​

Type Parameters ​

TAddress ​

TAddress

Properties ​

address ​
ts
address: TAddress;
attempts ​
ts
attempts: number;

Completed load attempts. Zero for a missing tile, which was answered, not failed.

error? ​
ts
optional error?: unknown;

The last thrown error; absent for a missing tile.

nextAttemptAt? ​
ts
optional nextAttemptAt?: number;

Wall-clock milliseconds of the scheduled next attempt, while one is waiting.

state ​
ts
state: TerrainTileLoadState;

TerrainTileLayer ​

Properties ​

category ​
ts
category: TerrainTileLayerCategory;
id ​
ts
id: string;
visible? ​
ts
optional visible?: boolean;

Methods ​

createTile() ​
ts
createTile(context): 
  | Object3D<Object3DEventMap>
  | Promise<Object3D<Object3DEventMap> | undefined>
  | undefined;
Parameters ​
context ​

TerrainTileLayerContext

Returns ​

| Object3D&lt;Object3DEventMap&gt; | Promise&lt;Object3D&lt;Object3DEventMap&gt; | undefined&gt; | undefined

disposeTile()? ​
ts
optional disposeTile(object): void;

Dispose layer-owned geometry/material resources when a terrain tile leaves residency.

Parameters ​
object ​

Object3D

Returns ​

void


TerrainTileLayerContext ​

Properties ​

address ​
ts
address: TerrainTileAddress;
descriptor ​
ts
descriptor: TerrainDescriptor;
heightfield ​
ts
heightfield: Heightfield;
origin ​
ts
origin: [number, number];

Returned objects use tile-local X/Z coordinates and world-space Y heights.

signal ​
ts
signal: AbortSignal;

TerrainTileRetryOptions ​

Transient-failure policy shared by the fixed-grid and pyramid terrain streamers.

A tile that a source reports as absent (undefined, e.g. HTTP 404) is missing: stable, never retried on its own. Anything thrown — a dropped range request, a 503, a CORS failure, a reader that cannot read a response — is transient: retried with bounded exponential backoff and then abandoned, so a streamer distinguishes "still retrying" from "gave up" instead of turning every hiccup into a permanent hole.

Extended by ​

Properties ​

maxRetries? ​
ts
optional maxRetries?: number;

Retries after the first failed attempt before a tile is abandoned. Default 3; 0 disables.

maxRetryDelayMs? ​
ts
optional maxRetryDelayMs?: number;

Ceiling for one backoff delay. Default 8000.

requestTimeoutMs? ​
ts
optional requestTimeoutMs?: number;

Per-request deadline in milliseconds. Default 20000; 0 or Infinity disables it.

retryDelayMs? ​
ts
optional retryDelayMs?: number;

First backoff delay in milliseconds; doubles per attempt. Default 400.


TerrainWaterMaterialOptions ​

Properties ​

clearcoat? ​
ts
optional clearcoat?: number;
clearcoatRoughness? ​
ts
optional clearcoatRoughness?: number;
color? ​
ts
optional color?: ColorRepresentation;
opacity? ​
ts
optional opacity?: number;
roughness? ​
ts
optional roughness?: number;
waveScale? ​
ts
optional waveScale?: number;

World-space wave frequency. The default produces broad, gently moving highlights.

waveSpeed? ​
ts
optional waveSpeed?: number;
waveStrength? ​
ts
optional waveStrength?: number;

UrlTerrainTileSourceOptions ​

Properties ​

baseUrl? ​
ts
optional baseUrl?: string | URL;

URL against which a relative heightUrl template resolves.

fetcher? ​
ts
optional fetcher?: (input, init?) => Promise<Response>;

Injectable fetch implementation for native hosts and tests.

MDN Reference

Parameters ​
input ​

URL | RequestInfo

init? ​

RequestInit

Returns ​

Promise&lt;Response&gt;

Type Aliases ​

CreateProfiledTerrainPackageSemanticLayersOptions ​

ts
type CreateProfiledTerrainPackageSemanticLayersOptions = Omit<CreateTerrainPackageSemanticLayersOptions, "decoder">;

TerrainArchiveOpener ​

ts
type TerrainArchiveOpener = (url, id, entry?) => TerrainTileArchive;

Opens one PMTiles archive by absolute URL. id names it within its set ('base' for a set's base archive, or the package section for a single archive); entry carries what the set or the package's files list knows about it.

Parameters ​

url ​

string

id ​

string

entry? ​

TerrainArchiveEntryInfo

Returns ​

TerrainTileArchive


TerrainGroundOutline ​

ts
type TerrainGroundOutline = readonly Point[];

TerrainQualityPreset ​

ts
type TerrainQualityPreset = "economy" | "balanced" | "high";

TerrainSurfaceStyleId ​

ts
type TerrainSurfaceStyleId = "modern" | "1910" | "minimal";

Data-only surface art direction. The 1910 preset is an interpretation, not historical data.


TerrainSurfaceWorker ​

ts
type TerrainSurfaceWorker = TerrainLandcoverWorker;

TerrainTileLayerCategory ​

ts
type TerrainTileLayerCategory = "classification" | "hydrology" | "human-feature";

Broad semantic roles let applications compose modes without conflating natural and built data.


TerrainTileLoadState ​

ts
type TerrainTileLoadState = "missing" | "retrying" | "failed";

Why a tile is not resident. retrying still has attempts left; failed has spent them.


TerrainWaterMaterial ​

ts
type TerrainWaterMaterial = THREE.MeshPhysicalMaterial | MeshPhysicalNodeMaterial;

Physical water for either the legacy WebGL renderer or the WebGPU node renderer.

Variables ​

TERRAIN_SURFACE_STYLES ​

ts
const TERRAIN_SURFACE_STYLES: Readonly<Record<TerrainSurfaceStyleId, Readonly<TerrainSurfaceStyle>>>;

Functions ​

buildChunkGeometry() ​

ts
function buildChunkGeometry(
   hf, 
   descriptor, 
   cx, 
   cz, 
   opts?
): ChunkGeometry;

Build the geometry for one chunk (cx, cz) at the given LOD step.

Parameters ​

hf ​

Heightfield

descriptor ​

TerrainDescriptor

cx ​

number

cz ​

number

opts? ​

ChunkMeshOptions

Returns ​

ChunkGeometry


cachingArchiveOpener() ​

ts
function cachingArchiveOpener(cache, options?): TerrainArchiveOpener;

An openArchive hook that reads every archive through cache.

Parameters ​

cache ​

BlockCache

options? ​

CachingArchiveOpenerOptions

Returns ​

TerrainArchiveOpener


createDefaultTerrainSemanticRenderer() ​

ts
function createDefaultTerrainSemanticRenderer(options?): TerrainSemanticTileRenderer;

Reusable default renderer for createTerrainSemanticPyramidLayer.

Parameters ​

options? ​

DefaultTerrainSemanticRendererOptions

Returns ​

TerrainSemanticTileRenderer


createProfiledTerrainPackageSemanticLayers() ​

ts
function createProfiledTerrainPackageSemanticLayers(pkg, options?): Promise<TerrainPackageSemanticLayers>;

Select a built-in decoder only from an explicit package profile declaration.

Parameters ​

pkg ​

TerrainPackageDescriptor

options? ​

CreateProfiledTerrainPackageSemanticLayersOptions

Returns ​

Promise&lt;TerrainPackageSemanticLayers&gt;


createTerrainArchiveSetArchive() ​

ts
function createTerrainArchiveSetArchive(set, options?): TerrainArchiveSetArchive;

Open an archive set from its document URL or an already-loaded document.

Parameters ​

set ​

| string | URL | TerrainArchiveSetDescriptor

options? ​

TerrainArchiveSetArchiveOptions

Returns ​

TerrainArchiveSetArchive


createTerrainElevationWorkerSource() ​

ts
function createTerrainElevationWorkerSource(
   worker, 
   pkg, 
   descriptor, 
   archive, 
   options?
): TerrainPyramidHeightSource;

Parameters ​

worker ​

ElevationWorkerLike

pkg ​

TerrainPackageDescriptor

descriptor ​

TerrainPyramidDescriptor

archive ​

TerrainTileArchive

options? ​

ElevationWorkerOptions

Returns ​

TerrainPyramidHeightSource


createTerrainLandcoverWorkerBridge() ​

ts
function createTerrainLandcoverWorkerBridge(worker): TerrainLandcoverGenerator;

One active job per worker; aborted queued jobs never perform expensive draping.

Parameters ​

worker ​

TerrainLandcoverWorker

Returns ​

TerrainLandcoverGenerator


createTerrainLinearObject() ​

ts
function createTerrainLinearObject(
   lines, 
   context, 
   profile
): Group;

A reusable line renderer: tracks can combine ballast, rail bands and repeated sleepers; utilities can combine elevated bands and repeated poles, without road semantics.

Parameters ​

lines ​

readonly TerrainSemanticLine[]

context ​

TerrainPyramidTileLayerContext

profile ​

TerrainLineProfile

Returns ​

Group


createTerrainObject() ​

ts
function createTerrainObject(
   hf, 
   descriptor, 
   opts?
): Group;

Build a three.js Group of chunk meshes (vertex-colored) for the whole terrain.

Parameters ​

hf ​

Heightfield

descriptor ​

TerrainDescriptor

opts? ​

TerrainObjectOptions

Returns ​

Group


createTerrainPackageCombinedSemanticSource() ​

ts
function createTerrainPackageCombinedSemanticSource(
   pkg, 
   archive, 
   decoder, 
   options?
): TerrainPackageSemanticSource;

Decode a shared MVT sidecar once when landcover and feature layers use the same archive. Only in-flight work is cached, so renderer-owned resident objects remain the memory authority.

Parameters ​

pkg ​

TerrainPackageDescriptor

archive ​

TerrainTileArchive

decoder ​

TerrainSemanticTileDecoder

options? ​

TerrainPackageCombinedSemanticSourceOptions

Returns ​

TerrainPackageSemanticSource


createTerrainPackageHeightSource() ​

ts
function createTerrainPackageHeightSource(
   pkg, 
   descriptor, 
   archive, 
   level, 
   options?
): TerrainHeightTileSource;

Adapt a selected package archive level into the generic decoded-height source contract.

Parameters ​

pkg ​

TerrainPackageDescriptor

descriptor ​

TerrainDescriptor

archive ​

TerrainTileArchive

level ​

number

options? ​

TerrainPackageHeightSourceOptions

Returns ​

TerrainHeightTileSource


createTerrainPackagePyramidHeightSource() ​

ts
function createTerrainPackagePyramidHeightSource(
   pkg, 
   descriptor, 
   archive, 
   options?
): TerrainPyramidHeightSource;

Adapt sparse archive levels into the generic terrain-pyramid source contract.

Parameters ​

pkg ​

TerrainPackageDescriptor

descriptor ​

TerrainPyramidDescriptor

archive ​

TerrainTileArchive

options? ​

TerrainPackagePyramidHeightSourceOptions

Returns ​

TerrainPyramidHeightSource


createTerrainPackagePyramidStream() ​

ts
function createTerrainPackagePyramidStream(pkg, options): Promise<TerrainPackagePyramidStream>;

Open a terrain package and create its camera-driven, multi-level pyramid stream.

Parameters ​

pkg ​

TerrainPackageDescriptor

options ​

TerrainPackagePyramidStreamOptions

Returns ​

Promise&lt;TerrainPackagePyramidStream&gt;


createTerrainPackageSemanticLayers() ​

ts
function createTerrainPackageSemanticLayers(pkg, options): Promise<TerrainPackageSemanticLayers>;

Open declared sidecars and create conservative, detail-bounded adaptive layers.

The defaults decorate the finest three landcover levels and finest two built-feature levels. Hydrology spans every available sidecar level so distant lakes retain mapped shorelines. A caller can override bounds or replace a renderer without changing package/archive code.

Parameters ​

pkg ​

TerrainPackageDescriptor

options ​

CreateTerrainPackageSemanticLayersOptions

Returns ​

Promise&lt;TerrainPackageSemanticLayers&gt;


createTerrainPackageSemanticSource() ​

ts
function createTerrainPackageSemanticSource(
   pkg, 
   content, 
   archive, 
   decoder, 
   options?
): TerrainPackageSemanticSource;

Adapt one declared semantic sidecar into normalized, format-neutral tile geometry.

Parameters ​

pkg ​

TerrainPackageDescriptor

content ​

TerrainPackageSemanticContent

archive ​

TerrainTileArchive

decoder ​

TerrainSemanticTileDecoder

options? ​

TerrainPackageSemanticSourceOptions

Returns ​

TerrainPackageSemanticSource


createTerrainPackageStream() ​

ts
function createTerrainPackageStream(pkg, options): Promise<TerrainPackageStream>;

Open a terrain package and immediately create its bounded fixed-level stream.

Parameters ​

pkg ​

TerrainPackageDescriptor

options ​

TerrainPackageStreamOptions

Returns ​

Promise&lt;TerrainPackageStream&gt;


createTerrainPyramidStream() ​

ts
function createTerrainPyramidStream(
   descriptor, 
   source, 
   options
): TerrainPyramidStream;

Parameters ​

descriptor ​

TerrainPyramidDescriptor

source ​

TerrainPyramidHeightSource

options ​

TerrainPyramidStreamOptions

Returns ​

TerrainPyramidStream


createTerrainSemanticObject() ​

ts
function createTerrainSemanticObject(
   tile, 
   context, 
   options?
): Group;

Default scalable semantic mesh adapter: instanced forest decorators, one combined road ribbon, combined building extrusions, and a draped water mesh. Custom games can replace this renderer.

Parameters ​

tile ​

TerrainSemanticTile

context ​

TerrainPyramidTileLayerContext

options? ​

TerrainSemanticMeshOptions

Returns ​

Group


createTerrainSemanticPyramidLayer() ​

ts
function createTerrainSemanticPyramidLayer(options): TerrainPyramidTileLayer;

Connect any normalized semantic source/renderer pair to adaptive terrain residency.

Parameters ​

options ​

TerrainSemanticPyramidLayerOptions

Returns ​

TerrainPyramidTileLayer


createTerrainStream() ​

ts
function createTerrainStream(
   descriptor, 
   source, 
   options?
): TerrainStream;

Parameters ​

descriptor ​

TerrainDescriptor

source ​

TerrainHeightTileSource

options? ​

TerrainStreamOptions

Returns ​

TerrainStream


createTerrainSurfaceObject() ​

ts
function createTerrainSurfaceObject(
   tile, 
   context, 
   options?, 
   roadMaterial?, 
   renderVehicles?
): Group;

Surface meshes are tile-local, clipped, batched and deterministic.

Parameters ​

tile ​

TerrainSemanticTile

context ​

TerrainPyramidTileLayerContext

options? ​

TerrainSurfaceOptions

roadMaterial? ​

Material&lt;MaterialEventMap&gt;

renderVehicles? ​

boolean

Returns ​

Group


createTerrainSurfaceRenderer() ​

ts
function createTerrainSurfaceRenderer(initial?, generator?): TerrainSurfaceRenderer;

One controller can be shared by all semantic renderers in a viewer.

Parameters ​

initial? ​

TerrainSurfaceOptions

generator? ​

TerrainSurfaceGenerator

Returns ​

TerrainSurfaceRenderer


createTerrainSurfaceWorkerBridge() ​

ts
function createTerrainSurfaceWorkerBridge(worker): TerrainSurfaceGenerator;

One active job; queue cancellation drops stale work before copying or transferring heights.

Parameters ​

worker ​

TerrainLandcoverWorker

Returns ​

TerrainSurfaceGenerator


createTerrainWaterMaterial() ​

ts
function createTerrainWaterMaterial(options?): MeshPhysicalMaterial;

Create an opaque physical water material with subtle world-space animated highlights.

Opaque water is intentional: tiled/LOD water polygons can overlap while coverage refines, and alpha blending would reveal those overlaps as dark crosses or tile seams.

Parameters ​

options? ​

TerrainWaterMaterialOptions

Returns ​

MeshPhysicalMaterial


createTerrainWaterMaterialAsync() ​

ts
function createTerrainWaterMaterialAsync(options?, backend?): Promise<TerrainWaterMaterial>;

Create water for an initialized renderer's selected backend. The WebGPU path uses TSL, since WebGPURenderer does not execute the legacy material's onBeforeCompile shader hooks. Node materials are loaded only when selected; existing WebGL callers retain their shaders.

Parameters ​

options? ​

TerrainWaterMaterialOptions

backend? ​

"webgl" | "webgpu"

Returns ​

Promise&lt;TerrainWaterMaterial&gt;


createUrlTerrainTileSource() ​

ts
function createUrlTerrainTileSource(descriptor, options?): TerrainHeightTileSource;

Fetch descriptor PNG16 tiles from its heightUrl template. HTTP 404 means an absent tile.

Parameters ​

descriptor ​

TerrainDescriptor

options? ​

UrlTerrainTileSourceOptions

Returns ​

TerrainHeightTileSource


disposeTerrainSemanticObject() ​

ts
function disposeTerrainSemanticObject(root): void;

Dispose only tile-owned generated geometry; shared style assets remain reusable.

Parameters ​

root ​

Object3D

Returns ​

void


disposeTerrainSurfaceObject() ​

ts
function disposeTerrainSurfaceObject(object): void;

Dispose tile-owned buffers and GPU instance attributes, retaining shared materials.

Parameters ​

object ​

Object3D

Returns ​

void


installTerrainElevationWorker() ​

ts
function installTerrainElevationWorker(port): void;

Parameters ​

port ​

ElevationWorkerLike

Returns ​

void


installTerrainLandcoverWorker() ​

ts
function installTerrainLandcoverWorker(scope): void;

Pure message handler, usable with a worker scope or a test port.

Parameters ​

scope ​

Pick&lt;TerrainLandcoverWorker, "postMessage" | "addEventListener"&gt;

Returns ​

void


installTerrainSurfaceWorker() ​

ts
function installTerrainSurfaceWorker(scope): void;

Install on a module worker. Three.js supplies CPU geometry utilities only; no WebGL is used.

Parameters ​

scope ​

Pick&lt;TerrainSurfaceWorker, "postMessage" | "addEventListener"&gt;

Returns ​

void


isTerrainTileTimeout() ​

ts
function isTerrainTileTimeout(error): boolean;

True for both AbortSignal.timeout rejections and this module's normalized timeout errors.

Parameters ​

error ​

unknown

Returns ​

boolean


lodStepForDistance() ​

ts
function lodStepForDistance(descriptor, distance): number;

Pick a LOD step for a chunk given its distance from the camera and the descriptor bands.

Parameters ​

descriptor ​

TerrainDescriptor

distance ​

number

Returns ​

number


markTerrainGroundSurface() ​

ts
function markTerrainGroundSurface(mesh): void;

Mark a mesh that represents ground (bare elevation, draped land cover or paving).

Parameters ​

mesh ​

Mesh

Returns ​

void


openTerrainPackageArchive() ​

ts
function openTerrainPackageArchive(
   source, 
   baseUrl?, 
   options?
): TerrainTileArchive;

Open a declared package source: one PMTiles archive, or a lazily routed archive set (molen/archive-set@1) for pmtiles-set. Without a transport, archives use the official PMTiles HTTP reader; openArchive replaces it for every archive (a cache, a native reader).

Parameters ​

source ​

TerrainPackageArchiveSource

baseUrl? ​

string | URL

options? ​

OpenTerrainPackageArchiveOptions

Returns ​

TerrainTileArchive


openTerrainPackageElevation() ​

ts
function openTerrainPackageElevation(pkg, options): Promise<OpenTerrainPackageElevation>;

Open and verify the package elevation archive at one fixed detail level.

Parameters ​

pkg ​

TerrainPackageDescriptor

options ​

OpenTerrainPackageOptions

Returns ​

Promise&lt;OpenTerrainPackageElevation&gt;


openTerrainPackagePyramid() ​

ts
function openTerrainPackagePyramid(pkg, options?): Promise<OpenTerrainPackagePyramid>;

Open and verify the package's complete available elevation pyramid.

Parameters ​

pkg ​

TerrainPackageDescriptor

options? ​

OpenTerrainPackagePyramidOptions

Returns ​

Promise&lt;OpenTerrainPackagePyramid&gt;


openTerrainPackageSemantics() ​

ts
function openTerrainPackageSemantics(pkg, options): Promise<OpenTerrainPackageSemantics>;

Open every declared semantic PMTiles sidecar and expose normalized tile sources.

Parameters ​

pkg ​

TerrainPackageDescriptor

options ​

OpenTerrainPackageSemanticsOptions

Returns ​

Promise&lt;OpenTerrainPackageSemantics&gt;


resolveTerrainPackageArchiveUrl() ​

ts
function resolveTerrainPackageArchiveUrl(source, baseUrl?): string;

Resolve a local package archive against its manifest, leaving remote archives untouched.

Parameters ​

source ​

TerrainPackageArchiveSource

baseUrl? ​

string | URL

Returns ​

string


resolveTerrainSurfaceStyle() ​

ts
function resolveTerrainSurfaceStyle(style?, details?): TerrainSurfaceStyle;

Parameters ​

style? ​

| TerrainSurfaceStyleId | Readonly&lt;TerrainSurfaceStyle&gt;

details? ​

TerrainSurfaceDetails

Returns ​

TerrainSurfaceStyle


resolveTerrainTileUrl() ​

ts
function resolveTerrainTileUrl(
   template, 
   address, 
   baseUrl?
): string;

Parameters ​

template ​

string

address ​

TerrainTileAddress

baseUrl? ​

string | URL

Returns ​

string


selectTerrainPyramidTiles() ​

ts
function selectTerrainPyramidTiles(
   descriptor, 
   view, 
   options
): TerrainPyramidSelection;

Select a non-overlapping set of pyramid leaves for a perspective camera.

Parameters ​

descriptor ​

TerrainPyramidDescriptor

view ​

TerrainPyramidView

options ​

TerrainPyramidSelectionOptions

Returns ​

TerrainPyramidSelection


setTerrainGroundCutout() ​

ts
function setTerrainGroundCutout(object, outline): void;

A simple model-local X/Z polygon. Only a visible owner opens the ground.

Parameters ​

object ​

Object3D

outline ​

TerrainGroundOutline

Returns ​

void


setTerrainWaterTime() ​

ts
function setTerrainWaterTime(
   material, 
   seconds, 
   worldOrigin?
): void;

Advance a terrain water material and preserve wave continuity across floating-origin shifts.

Parameters ​

material ​

Material

seconds ​

number

worldOrigin? ​

readonly [number, number]

Returns ​

void


splatColor() ​

ts
function splatColor(
   descriptor, 
   height, 
   slope
): [number, number, number];

Convenience sampling API; mesh builders reuse the compiled function for every vertex.

Parameters ​

descriptor ​

TerrainDescriptor

height ​

number

slope ​

number

Returns ​

[number, number, number]


subtractTerrainGroundGeometry() ​

ts
function subtractTerrainGroundGeometry(source, outlines): BufferGeometry;

Subtract exact polygon boundaries, interpolating Y and all vertex attributes at new edges. Handles indexed grids, coarse triangles covering the entire opening, and concave outlines. It never drops a whole grid cell just because one corner lies within an opening.

Parameters ​

source ​

BufferGeometry

outlines ​

readonly TerrainGroundOutline[]

Returns ​

BufferGeometry


terrainDescriptorFromPackage() ​

ts
function terrainDescriptorFromPackage(
   pkg, 
   level, 
   frame?
): TerrainDescriptor;

Build the generic fixed-grid descriptor represented by one package pyramid level.

Parameters ​

pkg ​

TerrainPackageDescriptor

level ​

number

frame? ​

TerrainPackageFrame

Returns ​

TerrainDescriptor


terrainGroundSourceGeometry() ​

ts
function terrainGroundSourceGeometry(mesh): BufferGeometry;

Original regular grid, used by terrain height morphs and normal-apron updates.

Parameters ​

mesh ​

Mesh

Returns ​

BufferGeometry


terrainPackageArchiveEntry() ​

ts
function terrainPackageArchiveEntry(pkg, source): TerrainArchiveEntryInfo | undefined;

The files record of a package-relative single archive: its hash and size, when listed.

Parameters ​

pkg ​

TerrainPackageDescriptor

source ​

TerrainPackageArchiveSource

Returns ​

TerrainArchiveEntryInfo | undefined


terrainPackageArchiveSourceLocation() ​

ts
function terrainPackageArchiveSourceLocation(source): string;

Return the authored package-relative path or absolute streaming URL for diagnostics.

Parameters ​

source ​

TerrainPackageArchiveSource

Returns ​

string


terrainPyramidBudgetForQuality() ​

ts
function terrainPyramidBudgetForQuality(quality): TerrainPyramidBudget;

Portable adaptive-terrain budgets expressed as measurable limits.

Parameters ​

quality ​

TerrainQualityPreset

Returns ​

TerrainPyramidBudget


terrainPyramidDescriptorFromPackage() ​

ts
function terrainPyramidDescriptorFromPackage(pkg, levels?): TerrainPyramidDescriptor;

Build the generic planar quadtree represented by a package's complete elevation pyramid.

Parameters ​

pkg ​

TerrainPackageDescriptor

levels? ​
frame? ​

TerrainPackageFrame

maxLevel? ​

number

minLevel? ​

number

Returns ​

TerrainPyramidDescriptor


terrainStreamBudgetForQuality() ​

ts
function terrainStreamBudgetForQuality(quality): TerrainStreamBudget;

Portable quality presets expressed only as streaming budgets, never device-name checks.

Parameters ​

quality ​

TerrainQualityPreset

Returns ​

TerrainStreamBudget

References ​

assertTerrainSemanticTile ​

Re-exports assertTerrainSemanticTile


createEmptyTerrainSemanticTile ​

Re-exports createEmptyTerrainSemanticTile


createProtomapsTerrainMvtDecoder ​

Re-exports createProtomapsTerrainMvtDecoder


createTerrainMvtSemanticDecoder ​

Re-exports createTerrainMvtSemanticDecoder


joinTerrainLines ​

Re-exports joinTerrainLines


sampleTerrainLine ​

Re-exports sampleTerrainLine


TerrainArchiveHeader ​

Re-exports TerrainArchiveHeader


TerrainArchiveTile ​

Re-exports TerrainArchiveTile


TerrainBuildingFeature ​

Re-exports TerrainBuildingFeature


TerrainLandcoverFeature ​

Re-exports TerrainLandcoverFeature


terrainLinePath ​

Re-exports terrainLinePath


TerrainLinePath ​

Re-exports TerrainLinePath


TerrainLineSample ​

Re-exports TerrainLineSample


TerrainMvtSemanticDecoderLimits ​

Re-exports TerrainMvtSemanticDecoderLimits


TerrainMvtSemanticDecoderOptions ​

Re-exports TerrainMvtSemanticDecoderOptions


TerrainMvtSemanticLayerNames ​

Re-exports TerrainMvtSemanticLayerNames


TerrainMvtSemanticPropertyNames ​

Re-exports TerrainMvtSemanticPropertyNames


TerrainPackageSemanticContent ​

Re-exports TerrainPackageSemanticContent


TerrainPoiFeature ​

Re-exports TerrainPoiFeature


TerrainSemanticLine ​

Re-exports TerrainSemanticLine


TerrainSemanticPoint ​

Re-exports TerrainSemanticPoint


TerrainSemanticPolygon ​

Re-exports TerrainSemanticPolygon


TerrainSemanticRing ​

Re-exports TerrainSemanticRing


TerrainSemanticTile ​

Re-exports TerrainSemanticTile


TerrainSemanticTileDecodeContext ​

Re-exports TerrainSemanticTileDecodeContext


TerrainSemanticTileDecoder ​

Re-exports TerrainSemanticTileDecoder


TerrainStructureIdentity ​

Re-exports TerrainStructureIdentity


TerrainTileArchive ​

Re-exports TerrainTileArchive


TerrainTransportationFeature ​

Re-exports TerrainTransportationFeature


TerrainWaterFeature ​

Re-exports TerrainWaterFeature

37 guides · 36 schema formats · 41 API entry points · 10 samples. API, CLI and schema pages are generated from the shipped build.