Appearance
@bendyline/molen-terrain/client
Molen terrain capability: heightfield sampling (kernel) and chunked LOD meshing (client).
ts
import { /* … */ } from '@bendyline/molen-terrain/client';Classes
CorruptTerrainArchiveError
A tile or directory that is not what the archive's header says it holds.
Extends
Error
Constructors
Constructor
ts
new CorruptTerrainArchiveError(message): CorruptTerrainArchiveError;Parameters
message
string
Returns
Overrides
ts
Error.constructorTerrainGroundCutoutController
Coordinates cutouts across tile and LOD boundaries. No material or source grid is mutated.
Constructors
Constructor
ts
new TerrainGroundCutoutController(options?): TerrainGroundCutoutController;Parameters
options?
Returns
Accessors
changedMeshes
Get Signature
ts
get changedMeshes(): ReadonlySet<Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material<MaterialEventMap> | Material<MaterialEventMap>[], Object3DEventMap>>;Meshes whose rendered geometry the last update replaced or restored.
Returns
ReadonlySet<Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material<MaterialEventMap> | Material<MaterialEventMap>[], Object3DEventMap>>
pending
Get Signature
ts
get pending(): boolean;Whether an update has work waiting: the last one left cuts for a later one, its time budget spent, or a cut sent away (see TerrainGroundCutoutOptions.cut) has come back since. Cuts still away are not work: onResult says when one lands.
Returns
boolean
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, budgetMs?): boolean;Bring every visible ground mesh's cut up to date. With budgetMs, cutting stops once that much time has passed: a cut in progress resumes in the next update, its ground keeping the current state (or staying uncut a moment longer) until it is done, and pending asks for that update. Each update advances at least one cut a slice. Several tiles arriving together each needed their own cut, and made in one pass they held a frame for 20-40 ms; a coarse tile under open water took 300 ms on its own.
Parameters
root
Object3D
budgetMs?
number
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?
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
admission?
ts
optional admission?: SceneAdmission;Decode tiles as admission jobs (usually the renderer's queue, as the stream's admission). A tile's decode runs on the main thread as its bytes arrive, and several arriving together stacked into one late frame. For a decoder that only posts the bytes to a worker, leave it out (createProfiledTerrainPackageSemanticLayers does when given a decoderWorker).
baseUrl?
ts
optional baseUrl?: string | URL;Inherited from
OpenTerrainPackageSemanticsOptions.baseUrl
buildingDetail?
ts
optional buildingDetail?:
| false
| {
maxDepth?: number;
};Compose classification and built-feature tiles' buildings and places from 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
distantCoverage?
ts
optional distantCoverage?: boolean;Carry broad landcover and bounded building massing into distant terrain tiles. Custom renderers must bound their work at these coarser levels. Default false.
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.
roadGrading?
ts
optional roadGrading?: object;Grade roads with their neighboring tiles: bridges clear what they cross and meet at tile edges, and (with the returned roadGrading.transformHeightfield on the stream) the ground is leveled under every road. heights is the stream's elevation source; earthworks: false keeps the bridge grading only. Off by default.
earthworks?
ts
optional earthworks?: boolean;heights
ts
heights: TerrainPyramidHeightSource;maxSpacing?
ts
optional maxSpacing?: number;transport?
ts
optional transport?: TerrainArchiveTransport;How sidecar archives the host did not provide are opened (a cache, a native reader).
Inherited from
OpenTerrainPackageSemanticsOptions.transport
tunnels?
ts
optional tunnels?: object;Render inferred underground corridors in the finest feature levels. Share the stream's elevation source.
heights
ts
heights: TerrainPyramidHeightSource;minLevel?
ts
optional minLevel?: number;waterLayer?
ts
optional waterLayer?: TerrainPackageSemanticLayerStyle;DefaultTerrainSemanticRendererOptions
Extends
Properties
buildingColors?
ts
optional buildingColors?: object;Weighted roof and wall colors for plain building extrusions, chosen per building from a stable hash of its id or outline, so a distant city is not one color. Without it every building takes the building material's own color.
roofs
ts
roofs: readonly readonly [string, number][];walls
ts
walls: readonly readonly [string, number][];Inherited from
TerrainSemanticMeshOptions.buildingColors
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
landcoverDetail?
ts
optional landcoverDetail?: Readonly<Record<string, readonly [number, number]>>;Exact land-cover appearance to [brush, bare] ground detail, each 0..1, carried per vertex as landcoverDetail for the ground material: dark shrub speckle, and lighter bare-soil patches. Paved urban ground (see urbanGround) shows neither.
Inherited from
TerrainSemanticMeshOptions.landcoverDetail
landcoverOffset?
ts
optional landcoverOffset?: number;Inherited from
TerrainSemanticMeshOptions.landcoverOffset
landcoverPaletteAreas?
ts
optional landcoverPaletteAreas?: readonly object[];Optional world-space palettes, sampled per vertex. Half-open bounds meet across tiles.
Inherited from
TerrainSemanticMeshOptions.landcoverPaletteAreas
landcoverRaster?
ts
optional landcoverRaster?: TerrainLandcoverRasterOptions;Draw land cover on distant tiles as one texture a tile instead of the draped mesh: see TerrainLandcoverRasterOptions, and pass materials.landcoverRaster on WebGPU, where the default material has no shader. Omitted, every tile drapes.
Inherited from
TerrainSemanticMeshOptions.landcoverRaster
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
shorelineGroundOffset?
ts
optional shorelineGroundOffset?: number;Bank upper-edge lift; defaults to landcoverOffset or 0.18m, even in a separate water layer. Set 0 for bare elevation without a raised landcover surface.
Inherited from
TerrainSemanticMeshOptions.shorelineGroundOffset
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
urbanGround?
ts
optional urbanGround?: TerrainUrbanGround;Built-up ground. Unmapped ground and broad land-use classes blend toward color (default: the urban_ground land-cover color, else pavement) as the share of nearby ground under building footprints rises from from to full (defaults 0.15 and 0.45), so a downtown block between its buildings reads as paving while suburban lawns stay green.
Inherited from
TerrainSemanticMeshOptions.urbanGround
waterFeatureStyle?
ts
optional waterFeatureStyle?: (feature, surface?) => TerrainWaterFeatureStyle | undefined;Supply consistent water levels across tiles and control duplicate waterway ribbons.
Parameters
feature
surface?
context
TerrainPyramidTileLayerContext
polygon
Returns
TerrainWaterFeatureStyle | undefined
Inherited from
TerrainSemanticMeshOptions.waterFeatureStyle
waterOffset?
ts
optional waterOffset?: number;Inherited from
TerrainSemanticMeshOptions.waterOffset
ElevationStageTiming
Properties
milliseconds
ts
milliseconds: number;stage
ts
stage: "decode" | "resample" | "mesh" | "earthworks" | "cut";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
filterElevation?
ts
optional filterElevation?: boolean;Defaults on for geospatial packages; false preserves raw DEM samples.
onParentFallback?
ts
optional onParentFallback?: (event) => void;Parameters
event
Returns
void
onTiming?
ts
optional onTiming?: (timing) => void;Parameters
timing
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).
Parameters
input
URL | RequestInfo
init?
RequestInit
Returns
Promise<Response>
Inherited from
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.
filterElevation?
ts
optional filterElevation?: boolean;Remove isolated extreme DEM samples before resampling; defaults on for geospatial packages.
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
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.
filterElevation?
ts
optional filterElevation?: boolean;Remove isolated extreme DEM samples before resampling; defaults on for geospatial packages.
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
Returns
void
onParentFallback?
ts
optional onParentFallback?: (event) => void;Parameters
event
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).
SurfaceSign
Properties
allWay?
ts
optional allWay?: boolean;appearance
ts
appearance: Readonly<TerrainRoadSignProfile>;Shared resolved country convention; source text and pattern identity remain separate.
arrow?
ts
optional arrow?: "down" | "left" | "right";Only attached when the connected road topology establishes a direction.
bladeTurn?
ts
optional bladeTurn?: number;A pair of street-name panels on one post: the upper one (lines[1]) turns this far (radians, as atan2(dz, dx) turns) from the lower one, which faces dx, dz and names lines[0].
dx
ts
dx: number;Face normal toward approaching traffic.
dz
ts
dz: number;evidence
ts
evidence: string[];Cues actually used; mapped describes the legend/control, not surveyed hardware placement.
ground
ts
ground: number;Bottom of the support, in absolute world Y.
hang?
ts
optional hang?: number;A street name hung from a signal mast arm: panel center height above ground; no support.
kind
ts
kind:
| "stop"
| "yield"
| "speed"
| "guide"
| "exit"
| "attraction"
| "route"
| "street-name";lines
ts
lines: string[];mount?
ts
optional mount?: "mast" | "post" | "wall" | "frame";How a street name stands: hung from a signal mast arm (hang), two panels on a corner post (bladeTurn), a plate fixed to a building wall (facing dx, dz from the wall), or a plate on a low two-legged frame. Absent: mast with hang, else post.
panelColor?
ts
optional panelColor?: string;Uniform mapped destination colour, when provided.
pattern
ts
pattern: TerrainRoadSignPatternId;roadId?
ts
optional roadId?: string | number;Source road identity when supplied by the semantic provider.
routeShield?
ts
optional routeShield?: TerrainRouteMarker;source
ts
source: "mapped" | "inferred";span?
ts
optional span?: number;Overhead gantry span; absent for roadside signs.
x
ts
x: number;z
ts
z: number;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<TerrainArchiveSetDescriptor>
getHeader()
ts
getHeader(): Promise<TerrainArchiveHeader>;Returns
Promise<TerrainArchiveHeader>
Overrides
getZxy()
ts
getZxy(
level,
x,
y,
signal?
): Promise<TerrainArchiveTile | undefined>;Parameters
level
number
x
number
y
number
signal?
AbortSignal
Returns
Promise<TerrainArchiveTile | undefined>
Inherited from
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).
Parameters
input
URL | RequestInfo
init?
RequestInit
Returns
Promise<Response>
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).
Parameters
input
URL | RequestInfo
init?
RequestInit
Returns
Promise<Response>
openArchive?
ts
optional openArchive?: TerrainArchiveOpener;Open each PMTiles archive (default: the official PMTiles HTTP reader).
TerrainGroundCutAttribute
One attribute of a ground geometry as plain values, to cross to a cut made elsewhere and back.
Properties
array
ts
array: TypedArray;itemSize
ts
itemSize: number;name
ts
name: string;normalized
ts
normalized: boolean;TerrainGroundCutoutOptions
Properties
cut?
ts
optional cut?: TerrainGroundCutter;Make cuts off the calling thread. A tile's land cover over a shoreline is tens of thousands of vertices and dozens of openings: 46 ms of clipping on average over Seattle, 160 ms at worst, which a controller on a 4 ms budget spread over fifteen frames while every tile behind it waited its turn. Sent away, the cut costs this thread a copy of the mesh's arrays; the ground keeps its current state until the result is back.
cutVertices?
ts
optional cutVertices?: number;Fewest vertices a mesh has for its cut to be sent away (default 5,000, a 65-sample grid and its skirts). A smaller one is a few milliseconds to cut here, in the pass that first shows it; away, its ground would stand uncut over its water for the frames the trip takes.
onResult?
ts
optional onResult?: () => void;A cut sent away has come back: pending is true, and an update applies it.
Returns
void
TerrainGroundCutRequest
A ground geometry and the openings to cut from it, as plain arrays: what subtractTerrainGroundGeometry reads, for a TerrainGroundCutter that makes the cut in a worker. Posted without a transfer list, the arrays are copied and the geometry stays whole.
Properties
attributes
ts
attributes: TerrainGroundCutAttribute[];bounds
ts
bounds: number[] | undefined;The source's bounds where it has them (box min and max, sphere center and radius).
drawRange
ts
drawRange: object;count
ts
count: number;start
ts
start: number;groups
ts
groups: CutGroup[];index
ts
index: TypedArray | undefined;maxHeights
ts
maxHeights: (number | undefined)[];minHeights
ts
minHeights: (number | undefined)[];outlines
ts
outlines: TerrainGroundOutline[];TerrainGroundCutResult
The cut geometry on its way back (see TerrainGroundCutRequest).
Properties
attributes
ts
attributes: TerrainGroundCutAttribute[];bounds
ts
bounds: number[] | undefined;groups
ts
groups: CutGroup[];index
ts
index: TypedArray | undefined;TerrainGroundMaterialOptions
Properties
agriculture?
ts
optional agriculture?: boolean;Landcover geometries carry per-field row and soil attributes and the neighboring-class blend (landcoverBlend) that softens class boundaries.
roughness?
ts
optional roughness?: number;strength?
ts
optional strength?: number;Variation amount: 0 is the flat vertex color, 1 the default, up to 2.
TerrainHeightTileSource
Methods
dispose()?
ts
optional dispose(): void;Returns
void
load()
ts
load(address, signal): Promise<Heightfield | undefined>;Parameters
address
signal
AbortSignal
Returns
Promise<Heightfield | undefined>
TerrainLandcoverGenerator
Methods
dispose()
ts
dispose(): void;Returns
void
generate()
ts
generate(
tile,
context,
options
): Promise<Object3D<Object3DEventMap> | undefined>;Parameters
tile
context
TerrainPyramidTileLayerContext
options
Returns
Promise<Object3D<Object3DEventMap> | undefined>
TerrainLandcoverRasterOptions
Properties
canopy?
ts
optional canopy?: object;Tint wooded classes toward color (default a dark canopy green) by cover (default 0.6), varied texel by texel, on tiles at least minDepth levels coarser than the finest. For the tiles past the range a host places trees in: a wood otherwise changed there from dark crowns to its pale ground color, along the straight edge of a tile. Omitted, woods keep their color.
color?
ts
optional color?: string;cover?
ts
optional cover?: number;minDepth
ts
minDepth: number;features?
ts
optional features?: boolean;Paint the tile's mapped roads and building footprints over the land cover (default true), so a town past the range of road and building geometry still reads as one.
minDepth?
ts
optional minDepth?: number;Tiles at least this many levels coarser than the pyramid's finest level draw the texture (default 2). Nearer tiles keep the draped mesh, with its crop rows and soft class edges.
roadColor?
ts
optional roadColor?: string;Road and roof colors for features (defaults: asphalt gray and a neutral roof).
roofColor?
ts
optional roofColor?: string;size?
ts
optional size?: number;Texels across a tile (default 256, a power of two from 32 to 1024).
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
beneath?
ts
optional beneath?: TerrainPaintBeneath;Paint only: the surface it lies on (default the modern style's road). Where the line narrows under a pixel the pavement material fades it into that surface, so distant markings melt into the asphalt instead of breaking into dashes that beat into moiré.
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";fray?
ts
optional fray?: "outer" | "inner" | "both";Edges the pavement material frays into the ground beneath, for a band that meets bare ground: the one away from the line (outer), toward it (inner) or both. Not for roads.
lanes?
ts
optional lanes?: number;offset?
ts
optional offset?: number;phase?
ts
optional phase?: number;riser?
ts
optional riser?: number;Height of a vertical face dropping from the band's inner edge (the one toward the line), as a curb's face drops to the road beside it. Draped bands only; 0 or absent for none.
surface?
ts
optional surface?: TerrainSurfaceKind;Write surfaceDetail for the pavement material: the kind, and a road's lane count.
variant?
ts
optional variant?: number;A small whole number (0-63) a non-road surface kind reads beside its fray mask, packed as surfaceDetail.w = fray + 4 * variant: a track band's gauge and sleepers.
wear?
ts
optional wear?: TerrainRoadWear;How worn a road's asphalt is, for the pavement material's cracks, patches and potholes: 0 well kept (no potholes), 1 fair, 2 worn, 3 poor. Roads with lanes only; default 0.
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
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
filterElevation?
ts
optional filterElevation?: boolean;Defaults on for geospatial packages; false preserves raw DEM samples.
maxAvailableLevel?
ts
optional maxAvailableLevel?: number;minLevel?
ts
optional minLevel?: number;onParentFallback?
ts
optional onParentFallback?: (event) => void;Parameters
event
Returns
void
parentFallback?
ts
optional parentFallback?: boolean;TerrainPackagePyramidHeightSourceOptions
Properties
filterElevation?
ts
optional filterElevation?: boolean;Defaults on for geospatial packages; false preserves raw DEM samples.
maxDecodedArchiveTiles?
ts
optional maxDecodedArchiveTiles?: number;LRU capacity for raw and corrected tiles, shared by exact and ancestor fallback requests.
onParentFallback?
ts
optional onParentFallback?: (event) => void;Parameters
event
Returns
void
onTiming?
ts
optional onTiming?: (timing) => void;Parameters
timing
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. An abandoned tile is only set aside: the first replan after its cool-down tries it again, so an outage longer than the quick retries (a dropped connection, a restarted server) does not leave holes behind once it is over.
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
failedRetryDelayMs?
ts
optional failedRetryDelayMs?: number;How long an abandoned tile waits before the stream may try it again, doubling with each further failure up to eight times as long. The attempt starts on the first update() after the wait that still wants the tile. Default 15000; 0 or Infinity keeps it abandoned until retryFailed().
Inherited from
TerrainPyramidStreamOptions.failedRetryDelayMs
filterElevation?
ts
optional filterElevation?: boolean;Remove isolated extreme DEM samples before resampling; defaults on for geospatial packages.
Inherited from
OpenTerrainPackagePyramidOptions.filterElevation
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
independentLayers?
ts
optional independentLayers?: readonly TerrainTileLayerCategory[];Layer categories built for ground outside the view as well (the peripheral band and the surround) and shown as soon as each is ready, rather than together with the tile's other layers. Default ['hydrology']. A host whose land cover is the ground's color adds 'classification': without it, ground the camera turns to face is bare until every layer of its tile has been built, and reads as a hole in the world. Handoffs between levels are unchanged: a replacement still waits for every layer its predecessor shows.
Inherited from
TerrainPyramidStreamOptions.independentLayers
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
lookAhead?
ts
optional lookAhead?:
| false
| TerrainPyramidLookAheadOptions;Build ahead of a moving camera (on by default). The stream follows the camera's track through update, so it works for anything that moves it: a car, an aircraft, an orbit pan.
Inherited from
TerrainPyramidStreamOptions.lookAhead
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
maxHiddenBytes?
ts
optional maxHiddenBytes?: number;Soft cap on the bytes kept for ground the camera has left (see TerrainPyramidBudget).
Inherited from
TerrainPyramidStreamOptions.maxHiddenBytes
maxLevel?
ts
optional maxLevel?: number;The finest level to refine to, when it should stop short of the descriptor's.
Inherited from
TerrainPyramidStreamOptions.maxLevel
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
now?
ts
optional now?: () => number;Clock for the camera's track, ms (default performance.now).
Returns
number
Inherited from
TerrainPyramidStreamOptions.now
onElevationTiming?
ts
optional onElevationTiming?: (timing) => void;Parameters
timing
Returns
void
Inherited from
OpenTerrainPackagePyramidOptions.onElevationTiming
onError?
ts
optional onError?: (error, context) => void;Parameters
error
unknown
context
TerrainPyramidStreamErrorContext
Returns
void
Inherited from
TerrainPyramidStreamOptions.onError
onLayerTiming?
ts
optional onLayerTiming?: (sample) => void;Where each finished layer's time went, for a host's diagnostics.
Parameters
sample
Returns
void
Inherited from
TerrainPyramidStreamOptions.onLayerTiming
onParentFallback?
ts
optional onParentFallback?: (event) => void;Parameters
event
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<Object3DEventMap>
Returns
Promise<void>
Inherited from
TerrainPyramidStreamOptions.prepareObject
previousTiles?
ts
optional previousTiles?: readonly TerrainPyramidTileAddress[];Previous selection supplies a stable coarsening threshold while moving.
Inherited from
TerrainPyramidStreamOptions.previousTiles
refineScale?
ts
optional refineScale?: (tile) => number;How far past maxScreenSpaceError a tile's error must go before it refines into its children, as a multiple of it (1 or more; default 1). Above 1 that detail reaches less far from the camera: a fast camera keeps its finest levels around itself, rather than giving them up or building them across the whole view.
Parameters
tile
Returns
number
Inherited from
TerrainPyramidStreamOptions.refineScale
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
surfaceColor?
ts
optional surfaceColor?: TerrainSurfaceColor;Optional spatial color prior, applied once before upload to both worker and local meshes.
Inherited from
TerrainPyramidStreamOptions.surfaceColor
surroundDetail?
ts
optional surroundDetail?: number;Error weight of ground everywhere else round the camera, in (0, 1] (default: none, so that ground is not selected at all). A camera can look round faster than ground can load: a quarter turn in a third of a second, against seconds for a tile and its layers. With a small weight (0.1 or so) the whole circle stays selected several levels coarser than the view, with the layers of independentLayers on it, so a look to the side shows coarse finished ground that refines rather than bare ground that fills in.
Inherited from
TerrainPyramidStreamOptions.surroundDetail
surroundDistance?
ts
optional surroundDistance?: number;How far round the camera surroundDetail reaches, world units (default: viewDistance).
Inherited from
TerrainPyramidStreamOptions.surroundDistance
tileHeight?
ts
optional tileHeight?: (address) =>
| {
max: number;
min: number;
}
| undefined;The ground heights a tile really holds, when known (a tile without any inherits its nearest known ancestor's). Without it a tile can reach anywhere in the descriptor's height range, and a camera inside that range measures no height above the ground: an aircraft at 3 km over a package whose range reaches 5 km refines the land beneath it as if it stood there.
Parameters
address
Returns
| { max: number; min: number; } | undefined
Inherited from
TerrainPyramidStreamOptions.tileHeight
transformHeightfield?
ts
optional transformHeightfield?: (context, source) =>
| Heightfield
| Promise<Heightfield>;Grade source heights before publishing terrain or creating layers. Return the original field when unchanged to retain worker-prepared geometry. A replacement is meshed again (by the source's meshPrepared when it has one, otherwise on the main thread) and becomes the field shared by surface sampling and every layer. source is unmodified, for stable reference samples; work must respect the context's cancellation signal.
Parameters
context
TerrainPyramidTileLayerContext
source
Returns
| Heightfield | Promise<Heightfield>
Inherited from
TerrainPyramidStreamOptions.transformHeightfield
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;roadGrading?
ts
optional roadGrading?: TerrainRoadGrading;Present when roadGrading was asked for and the package has roads: pass its transformHeightfield to the terrain stream to level the ground for them.
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
signal
AbortSignal
Returns
Promise<TerrainSemanticTile | undefined>
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. An abandoned tile is only set aside: the first replan after its cool-down tries it again, so an outage longer than the quick retries (a dropped connection, a restarted server) does not leave holes behind once it is over.
Extends
Properties
archive?
ts
optional archive?: TerrainTileArchive;baseUrl?
ts
optional baseUrl?: string | URL;cameraPos?
ts
optional cameraPos?: [number, number, number];Inherited from
TerrainStreamOptions.cameraPos
failedRetryDelayMs?
ts
optional failedRetryDelayMs?: number;How long an abandoned tile waits before the stream may try it again, doubling with each further failure up to eight times as long. The attempt starts on the first update() after the wait that still wants the tile. Default 15000; 0 or Infinity keeps it abandoned until retryFailed().
Inherited from
TerrainStreamOptions.failedRetryDelayMs
filterElevation?
ts
optional filterElevation?: boolean;Defaults on for geospatial packages; false preserves raw DEM samples.
frame?
ts
optional frame?: TerrainPackageFrame;Metric frame for projected packages; defaults to the bounds' center latitude.
layers?
ts
optional layers?: TerrainTileLayer[];Inherited from
level
ts
level: number;loadRadius?
ts
optional loadRadius?: number;Inherited from
TerrainStreamOptions.loadRadius
material?
ts
optional material?: Material<MaterialEventMap>;Inherited from
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
Returns
void
Inherited from
onParentFallback?
ts
optional onParentFallback?: (event) => void;Parameters
event
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
TerrainPaintBeneath
The surface paint lies on; see TerrainLineBand.beneath.
Properties
color
ts
color: string;surface?
ts
optional surface?: TerrainSurfaceKind;Its kind, a road by default. Paint fading into a parking lot (TERRAIN_SURFACE_KIND.parking) takes on the lot's oil stains; any other surface is shaded as plain asphalt.
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
colors?
ts
optional colors?: readonly string[];Optional model-specific paint palette.
id
ts
id: string;spec
ts
spec: VehicleSpec;weight?
ts
optional weight?: number;Relative regional prevalence (default 1); zero excludes a vehicle.
TerrainPavementMaterialOptions
Options for the draped road, sidewalk, marking and lot material.
Properties
roughness?
ts
optional roughness?: number;strength?
ts
optional strength?: number;Detail amount: 0 is the flat vertex color, 1 the default, up to 2.
TerrainPyramidBudget
Extends
Properties
hysteresis?
ts
optional hysteresis?: number;Inherited from
TerrainPyramidSelectionOptions.hysteresis
maxConcurrentLayerLoads
ts
maxConcurrentLayerLoads: number;maxConcurrentLoads
ts
maxConcurrentLoads: number;maxHiddenBytes?
ts
optional maxHiddenBytes?: number;Soft cap on the part of those buffers held by ground the camera has left (resident, but not displayed, wanted, replacing displayed ground or ahead of the camera): the warm cache that makes a return instant. Without it the warm cache fills whatever maxResidentBytes leaves, so a large cap, meant to show more, mostly kept more hidden.
maxLevel?
ts
optional maxLevel?: number;The finest level to refine to, when it should stop short of the descriptor's.
Inherited from
TerrainPyramidSelectionOptions.maxLevel
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
refineScale?
ts
optional refineScale?: (tile) => number;How far past maxScreenSpaceError a tile's error must go before it refines into its children, as a multiple of it (1 or more; default 1). Above 1 that detail reaches less far from the camera: a fast camera keeps its finest levels around itself, rather than giving them up or building them across the whole view.
Parameters
tile
Returns
number
Inherited from
TerrainPyramidSelectionOptions.refineScale
surroundDetail?
ts
optional surroundDetail?: number;Error weight of ground everywhere else round the camera, in (0, 1] (default: none, so that ground is not selected at all). A camera can look round faster than ground can load: a quarter turn in a third of a second, against seconds for a tile and its layers. With a small weight (0.1 or so) the whole circle stays selected several levels coarser than the view, with the layers of independentLayers on it, so a look to the side shows coarse finished ground that refines rather than bare ground that fills in.
Inherited from
TerrainPyramidSelectionOptions.surroundDetail
surroundDistance?
ts
optional surroundDistance?: number;How far round the camera surroundDetail reaches, world units (default: viewDistance).
Inherited from
TerrainPyramidSelectionOptions.surroundDistance
tileHeight?
ts
optional tileHeight?: (address) =>
| {
max: number;
min: number;
}
| undefined;The ground heights a tile really holds, when known (a tile without any inherits its nearest known ancestor's). Without it a tile can reach anywhere in the descriptor's height range, and a camera inside that range measures no height above the ground: an aircraft at 3 km over a package whose range reaches 5 km refines the land beneath it as if it stood there.
Parameters
address
Returns
| { max: number; min: number; } | undefined
Inherited from
TerrainPyramidSelectionOptions.tileHeight
viewDistance
ts
viewDistance: number;Radial world-space limit around the camera.
Inherited from
TerrainPyramidSelectionOptions.viewDistance
TerrainPyramidCoverageBand
How finished the view is within one distance band; see TerrainPyramidStream.viewCoverage.
Properties
bare
ts
bare: number;Terrain drawn, with layers still missing.
complete
ts
complete: number;Drawn at their selected detail, with every layer.
drawnLevel
ts
drawnLevel: number | undefined;Mean level of the ground drawn over the band's selected tiles, weighted by area; undefined when nothing is drawn. complete is measured against the selection, which coarsens at speed, so it reads the same for coarse and fine ground; this says how fine the ground is.
empty
ts
empty: number;Nothing drawn.
from
ts
from: number;Band limits in world units from the camera; the last band's to is Infinity.
stale
ts
stale: number;Drawn from another level's tiles that carry layers.
tiles
ts
tiles: number;In-view selected tiles in the band.
to
ts
to: number;TerrainPyramidHeightSource
Properties
cutGround?
ts
optional cutGround?: TerrainGroundCutter;Cut openings from ground meshes off the main thread (a TerrainGroundCutter): the stream hands it to its cutout controller. Undefined leaves each cut to be made in slices between frames.
Methods
dispose()?
ts
optional dispose(): void;Returns
void
gradeEarthworks()?
ts
optional gradeEarthworks(request, signal): Promise<Heightfield | undefined>;Grade a tile's ground for its roads (see gradeRoadEarthworks) where it does not hold the main thread: the elevation worker's source does it there, and meshes the result, which meshPrepared then hands over for the field this returns. Resolves to the request's own field when nothing moved, and to undefined when cancelled. Undefined leaves the road grading to do it itself, a slice at a time.
Parameters
request
RoadEarthworksRequest
signal
AbortSignal
Returns
Promise<Heightfield | undefined>
load()
ts
load(address, signal): Promise<Heightfield | undefined>;Parameters
address
signal
AbortSignal
Returns
Promise<Heightfield | undefined>
loadPrepared()?
ts
optional loadPrepared(
address,
signal,
maxResolution
): Promise<
| {
geometry: ChunkGeometry;
heightfield: Heightfield;
}
| undefined>;Parameters
address
signal
AbortSignal
maxResolution
number
Returns
Promise< | { geometry: ChunkGeometry; heightfield: Heightfield; } | undefined>
meshPrepared()?
ts
optional meshPrepared(
heightfield,
address,
signal,
maxResolution
): Promise<ChunkGeometry | undefined>;Mesh a field this source did not produce, a transformHeightfield replacement, the way loadPrepared meshes its own (the elevation worker's source does it off the main thread). Undefined leaves the stream to mesh the field itself.
Parameters
heightfield
address
signal
AbortSignal
maxResolution
number
Returns
Promise<ChunkGeometry | undefined>
TerrainPyramidLayerRefresh
What TerrainPyramidStream.refreshLayers builds again.
Properties
bounds
ts
bounds: readonly [number, number, number, number];World X/Z rectangle [minX, minZ, maxX, maxZ]: every resident tile it overlaps or touches.
layers?
ts
optional layers?: readonly string[];Layer ids to build again (default: every layer). An unknown id throws.
TerrainPyramidLayerTiming
One layer build, by phase, in milliseconds.
Properties
createMs
ts
createMs: number;Generating the object: reading its source, worker time, and scene assembly.
layerId
ts
layerId: string;level
ts
level: number;prepareMs
ts
prepareMs: number;GPU preparation: uploads and shaders, which run in the frame budget.
publishMs
ts
publishMs: number;Waiting for a frame to publish it.
TerrainPyramidLookAheadOptions
How far ahead of a moving camera tiles are built. Tiles the track reaches are built while the stream has capacity beyond what the camera sees now, and stay hidden until selected, so they appear finished. They are the first thing given up under memory pressure.
Properties
fastDetail?
ts
optional fastDetail?: number;How much of the work of one full-detail level each of those faster levels may take, in [0, 1] (default 0.25). The faster the camera crosses a level, the nearer it its detail stops. This limits building only: finer ground already built stays while the view would show it at rest, so speeding up or turning does not take detail off the screen. 0 builds none.
maxTiles?
ts
optional maxTiles?: number;Most tiles tracked ahead of the camera (default the budget's maxSelectedTiles).
minTileSeconds?
ts
optional minTileSeconds?: number;Levels whose tiles the camera crosses in less than this keep their detail only near the camera (default 5 seconds; 0 turns it off). Each level finer is four times the tiles for the same ground, so a fast camera that refined its whole view to the finest level would build far more than the stream can finish, and finish little of it.
seconds?
ts
optional seconds?: readonly number[];Times along the predicted track to select tiles for (default 3, 6, 12 and 20 seconds).
TerrainPyramidSelection
Properties
effectiveScreenSpaceError
ts
effectiveScreenSpaceError: number;effectiveViewDistance
ts
effectiveViewDistance: number;tiles
ts
tiles: TerrainPyramidTileAddress[];TerrainPyramidSelectionOptions
Extended by
Properties
hysteresis?
ts
optional hysteresis?: number;maxLevel?
ts
optional maxLevel?: number;The finest level to refine to, when it should stop short of the descriptor's.
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.
refineScale?
ts
optional refineScale?: (tile) => number;How far past maxScreenSpaceError a tile's error must go before it refines into its children, as a multiple of it (1 or more; default 1). Above 1 that detail reaches less far from the camera: a fast camera keeps its finest levels around itself, rather than giving them up or building them across the whole view.
Parameters
tile
Returns
number
surroundDetail?
ts
optional surroundDetail?: number;Error weight of ground everywhere else round the camera, in (0, 1] (default: none, so that ground is not selected at all). A camera can look round faster than ground can load: a quarter turn in a third of a second, against seconds for a tile and its layers. With a small weight (0.1 or so) the whole circle stays selected several levels coarser than the view, with the layers of independentLayers on it, so a look to the side shows coarse finished ground that refines rather than bare ground that fills in.
surroundDistance?
ts
optional surroundDistance?: number;How far round the camera surroundDetail reaches, world units (default: viewDistance).
tileHeight?
ts
optional tileHeight?: (address) =>
| {
max: number;
min: number;
}
| undefined;The ground heights a tile really holds, when known (a tile without any inherits its nearest known ancestor's). Without it a tile can reach anywhere in the descriptor's height range, and a camera inside that range measures no height above the ground: an aircraft at 3 km over a package whose range reaches 5 km refines the land beneath it as if it stood there.
Parameters
address
Returns
| { max: number; min: number; } | undefined
viewDistance
ts
viewDistance: number;Radial world-space limit around the camera.
TerrainPyramidStatsOptions
Properties
geometry?
ts
optional geometry?: "measured" | "tracked";'measured' (the default) walks every resident tile's objects for byte totals, so it also finds geometry an adapter added without calling refreshMemoryUsage(). 'tracked' reports the retained estimate pressure() keeps and counts triangles, draws and instances among visible objects only, at most a second ago. The full walk took several milliseconds over a warm cache; a panel refreshing a few times a second stalled a frame each time, and the walk of the visible objects alone was still 3 ms each time over a city at High.
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
dispose()
ts
dispose(): void;Returns
void
failedTiles()
ts
failedTiles(): TerrainPyramidTileAddress[];Tiles outside the quick retries: missing plus abandoned (see failedRetryDelayMs).
Returns
getBudget()
ts
getBudget(): TerrainPyramidBudget;Returns
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), none of them still showing what a refreshLayers call is replacing. 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
refreshLayers()
ts
refreshLayers(options): Promise<void>;Build layers again where what they are made from changed (a host edited the tiles a layer's source or renderer hands out). A layer on screen stays until its replacement is prepared and takes its place in one step, so the ground never stands bare in between; one that is resident but hidden is dropped and built when next wanted; a build under way starts over. isAreaReady is false for ground still showing what is being replaced.
Resolves when everything that was on screen has been replaced, or will not be: its tile was evicted, it left the screen or its layer was hidden, or its build failed for good (what was there then stays until a later attempt succeeds). whenIdle also waits for these builds.
Parameters
options
Returns
Promise<void>
refreshMemoryUsage()
ts
refreshMemoryUsage(tiles?): void;Refresh retained allocation estimates after an adapter mutates resident layer geometry. 'displayed' re-counts only tiles on screen, where an adapter's in-place updates land: re-counting the whole warm cache walked every resident tile's objects.
Parameters
tiles?
"all" | "displayed"
Returns
void
residentTiles()
ts
residentTiles(): TerrainPyramidTileAddress[];Returns
retryFailed()
ts
retryFailed(): void;Returns
void
sampleHeight()
ts
sampleHeight(x, z): number | undefined;Full-resolution source elevation before mesh simplification, preferring displayed tiles and falling back to resident coverage outside the camera's cut.
Parameters
x
number
z
number
Returns
number | undefined
sampleSurfaceHeight()
ts
sampleSurfaceHeight(x, z): number | undefined;Height on the displayed terrain triangles, including refinement morphs. Use for movement and ground placement, with resident coverage as a fallback outside the camera's cut. Roads, land cover and model-owned openings still need collision queries.
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<TerrainPyramidBudget>
Returns
void
setLayerVisible()
ts
setLayerVisible(id, visible): void;Parameters
id
string
visible
boolean
Returns
void
stats()
ts
stats(options?): 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(), and a live diagnostics panel passes { geometry: 'tracked' }.
Parameters
options?
Returns
tileFailures()
ts
tileFailures(): TerrainTileFailure<TerrainPyramidTileAddress>[];Per-tile missing/retrying/abandoned detail, so a host can say which state a hole is in.
Returns
TerrainTileFailure<TerrainPyramidTileAddress>[]
update()
ts
update(view, preloadViews?): void;Optional future views prepare a bounded set of leaves, including layers and GPU resources, without changing displayed coverage. Supply nearest-in-time views first; omit to stop.
Parameters
view
preloadViews?
readonly TerrainPyramidView[]
Returns
void
updateTransitions()
ts
updateTransitions(nowMs?): void;Call once a frame: advances refinement morphs and carries on ground cuts the last pass left unfinished, within one cut budget a frame shared with update.
Parameters
nowMs?
number
Returns
void
viewCoverage()
ts
viewCoverage(edges): TerrainPyramidCoverageBand[];What the camera sees right now, by distance: edges are ascending band limits in world units. Walks the selection, so sample it a few times a second at most.
Parameters
edges
readonly number[]
Returns
whenIdle()
ts
whenIdle(): Promise<void>;Returns
Promise<void>
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. An abandoned tile is only set aside: the first replan after its cool-down tries it again, so an outage longer than the quick retries (a dropped connection, a restarted server) does not leave holes behind once it is over.
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
failedRetryDelayMs?
ts
optional failedRetryDelayMs?: number;How long an abandoned tile waits before the stream may try it again, doubling with each further failure up to eight times as long. The attempt starts on the first update() after the wait that still wants the tile. Default 15000; 0 or Infinity keeps it abandoned until retryFailed().
Inherited from
TerrainTileRetryOptions.failedRetryDelayMs
hysteresis?
ts
optional hysteresis?: number;Inherited from
TerrainPyramidSelectionOptions.hysteresis
independentLayers?
ts
optional independentLayers?: readonly TerrainTileLayerCategory[];Layer categories built for ground outside the view as well (the peripheral band and the surround) and shown as soon as each is ready, rather than together with the tile's other layers. Default ['hydrology']. A host whose land cover is the ground's color adds 'classification': without it, ground the camera turns to face is bare until every layer of its tile has been built, and reads as a hole in the world. Handoffs between levels are unchanged: a replacement still waits for every layer its predecessor shows.
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.
lookAhead?
ts
optional lookAhead?:
| false
| TerrainPyramidLookAheadOptions;Build ahead of a moving camera (on by default). The stream follows the camera's track through update, so it works for anything that moves it: a car, an aircraft, an orbit pan.
material?
ts
optional material?: Material<MaterialEventMap>;maxConcurrentLayerLoads?
ts
optional maxConcurrentLayerLoads?: number;Independent ceiling for semantic tile decodes and mesh construction.
maxConcurrentLoads
ts
maxConcurrentLoads: number;maxHiddenBytes?
ts
optional maxHiddenBytes?: number;Soft cap on the bytes kept for ground the camera has left (see TerrainPyramidBudget).
maxLevel?
ts
optional maxLevel?: number;The finest level to refine to, when it should stop short of the descriptor's.
Inherited from
TerrainPyramidSelectionOptions.maxLevel
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.
now?
ts
optional now?: () => number;Clock for the camera's track, ms (default performance.now).
Returns
number
onError?
ts
optional onError?: (error, context) => void;Parameters
error
unknown
context
TerrainPyramidStreamErrorContext
Returns
void
onLayerTiming?
ts
optional onLayerTiming?: (sample) => void;Where each finished layer's time went, for a host's diagnostics.
Parameters
sample
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<Object3DEventMap>
Returns
Promise<void>
previousTiles?
ts
optional previousTiles?: readonly TerrainPyramidTileAddress[];Previous selection supplies a stable coarsening threshold while moving.
Inherited from
TerrainPyramidSelectionOptions.previousTiles
refineScale?
ts
optional refineScale?: (tile) => number;How far past maxScreenSpaceError a tile's error must go before it refines into its children, as a multiple of it (1 or more; default 1). Above 1 that detail reaches less far from the camera: a fast camera keeps its finest levels around itself, rather than giving them up or building them across the whole view.
Parameters
tile
Returns
number
Inherited from
TerrainPyramidSelectionOptions.refineScale
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).
surfaceColor?
ts
optional surfaceColor?: TerrainSurfaceColor;Optional spatial color prior, applied once before upload to both worker and local meshes.
surroundDetail?
ts
optional surroundDetail?: number;Error weight of ground everywhere else round the camera, in (0, 1] (default: none, so that ground is not selected at all). A camera can look round faster than ground can load: a quarter turn in a third of a second, against seconds for a tile and its layers. With a small weight (0.1 or so) the whole circle stays selected several levels coarser than the view, with the layers of independentLayers on it, so a look to the side shows coarse finished ground that refines rather than bare ground that fills in.
Inherited from
TerrainPyramidSelectionOptions.surroundDetail
surroundDistance?
ts
optional surroundDistance?: number;How far round the camera surroundDetail reaches, world units (default: viewDistance).
Inherited from
TerrainPyramidSelectionOptions.surroundDistance
tileHeight?
ts
optional tileHeight?: (address) =>
| {
max: number;
min: number;
}
| undefined;The ground heights a tile really holds, when known (a tile without any inherits its nearest known ancestor's). Without it a tile can reach anywhere in the descriptor's height range, and a camera inside that range measures no height above the ground: an aircraft at 3 km over a package whose range reaches 5 km refines the land beneath it as if it stood there.
Parameters
address
Returns
| { max: number; min: number; } | undefined
Inherited from
TerrainPyramidSelectionOptions.tileHeight
transformHeightfield?
ts
optional transformHeightfield?: (context, source) =>
| Heightfield
| Promise<Heightfield>;Grade source heights before publishing terrain or creating layers. Return the original field when unchanged to retain worker-prepared geometry. A replacement is meshed again (by the source's meshPrepared when it has one, otherwise on the main thread) and becomes the field shared by surface sampling and every layer. source is unmodified, for stable reference samples; work must respect the context's cancellation signal.
Parameters
context
TerrainPyramidTileLayerContext
source
Returns
| Heightfield | Promise<Heightfield>
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
aheadReady
ts
aheadReady: number;Those of aheadTiles already built, layers included.
aheadTiles
ts
aheadTiles: number;Tiles the camera's track is about to reach that are not selected yet.
builtLayers
ts
builtLayers: number;Tile layers built so far, and how many of those had been built before and evicted.
builtTiles
ts
builtTiles: number;Terrain surfaces built so far, and how many of those had been built before and evicted.
cameraSpeed
ts
cameraSpeed: number;The camera's speed along its track, world units per second.
coarsenedInView
ts
coarsenedInView: number;decodedSamples
ts
decodedSamples: number;Inherited from
TerrainStreamStats.decodedSamples
desired
ts
desired: number;Inherited from
displayed
ts
displayed: number;drawCalls
ts
drawCalls: number;Inherited from
effectiveScreenSpaceError
ts
effectiveScreenSpaceError: number;effectiveViewDistance
ts
effectiveViewDistance: number;evictions
ts
evictions: number;Inherited from
failed
ts
failed: number;Tiles outside the quick retries: missing plus abandoned. An abandoned tile is tried again after failedRetryDelayMs; a missing one only by retryFailed().
Inherited from
failedLayers
ts
failedLayers: number;Semantic layer requests that exhausted their retry budget and wait out a cool-down.
Overrides
TerrainStreamStats.failedLayers
fallbackLeaves
ts
fallbackLeaves: number;geometryBytes
ts
geometryBytes: number;Inherited from
TerrainStreamStats.geometryBytes
instances
ts
instances: number;Inherited from
layerObjects
ts
layerObjects: number;Inherited from
TerrainStreamStats.layerObjects
loading
ts
loading: number;Inherited from
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
preloaded
ts
preloaded: number;Future-view leaves with terrain and all enabled layers prepared for display.
preloading
ts
preloading: number;Future-view leaves requested for hidden preparation, within the resident budget.
queued
ts
queued: number;Inherited from
rebuiltLayers
ts
rebuiltLayers: number;rebuiltTiles
ts
rebuiltTiles: number;refinedInView
ts
refinedInView: number;Times ground in the camera's view changed level so far: replaced by finer tiles, and by coarser ones. Detail arriving is the point of streaming; detail given up while in view reads as popping.
refreshedLayers
ts
refreshedLayers: number;Of builtLayers, those refreshLayers built in place of one on screen. A host asked for these: they are not the cache losing work, and rebuiltLayers does not count them.
refreshingLayers
ts
refreshingLayers: number;Tile layers on screen still showing what a refreshLayers call is replacing.
resident
ts
resident: number;Inherited from
retrying
ts
retrying: number;Tiles whose last attempt threw and that are still inside their retry budget.
Inherited from
retryingLayers
ts
retryingLayers: number;Semantic layer requests waiting for or performing another attempt.
selected
ts
selected: number;speedLevel
ts
speedLevel: number;The finest level refined across the whole view at that speed; finer levels refine only near the camera (lookAhead.fastDetail).
triangles
ts
triangles: number;Inherited from
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<Object3DEventMap> | Promise<Object3D<Object3DEventMap> | undefined> | 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.
priority?
ts
optional priority?: () => number;How soon the current view needs this tile, lower first, read again each time it is asked (meters from the camera, ground outside the view after ground in it). A worker queue picks its next job by it: a fast camera reorders the view while tiles wait their turn, and in request order a jet's nearest ground queued behind ground it had already passed.
Returns
number
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;TerrainRailLamp
A self-lit lamp: a signal aspect, tile-local, facing along yaw (+Z rotated about Y).
Properties
color
ts
color: TerrainRailAspect | "white";radius
ts
radius: number;x
ts
x: number;y
ts
y: number;yaw
ts
yaw: number;z
ts
z: number;TerrainRoadGrading
Methods
dispose()
ts
dispose(): void;Returns
void
gradeTile()
ts
gradeTile(tile, context): Promise<TerrainSemanticTile>;A tile whose bridges, and the roads climbing to them, carry height profiles that clear whatever they cross, worked out with the tiles around it so the profiles meet at tile edges. Returns the tile itself when it has nothing to grade.
Parameters
tile
context
Pick<TerrainPyramidTileLayerContext, "address" | "pyramid" | "signal">
Returns
Promise<TerrainSemanticTile>
transformHeightfield()
ts
transformHeightfield(context, source): Promise<Heightfield>;Level the ground under and beside a tile's roads: the stream's transformHeightfield. Compose it before any transform that must win (an airport's leveling).
Parameters
context
TerrainPyramidTileLayerContext
source
Returns
Promise<Heightfield>
TerrainRoadGradingOptions
Properties
earthworks?
ts
optional earthworks?: boolean;Level the ground for roads (default true); false keeps bridge grading only.
features
ts
features: TerrainSemanticTileSource;Road tiles; neighbors are read from it too (it should share the layer's decoded tiles).
heights?
ts
optional heights?: TerrainPyramidHeightSource;Elevation for bridge grading. Optional when transformHeightfield is installed on the stream, which hands its own source over with the first tile.
maxSpacing?
ts
optional maxSpacing?: number;Coarsest rendered grid (meters between vertices) whose ground is leveled (default 28).
minLevel?
ts
optional minLevel?: number;Coarsest tile level graded (default: every level the features source answers).
TerrainRoadSignPattern
Properties
cues
ts
cues: readonly string[];fallback
ts
fallback: string;family
ts
family: "speed" | "highway" | "junction";id
ts
id: TerrainRoadSignPatternId;placement
ts
placement: string;title
ts
title: string;TerrainSemanticDecoderWorker
The part of a Worker (or a worker's global scope) the decoder needs.
Methods
addEventListener()
ts
addEventListener(type, listener): void;Parameters
type
"message"
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"
listener
(event) => void
Returns
void
terminate()?
ts
optional terminate(): void;Returns
void
TerrainSemanticMeshMaterials
Properties
building?
ts
optional building?: Material<MaterialEventMap>;landcover?
ts
optional landcover?: Material<MaterialEventMap>;landcoverRaster?
ts
optional landcoverRaster?: Material<MaterialEventMap>;The shared material for land cover drawn as a texture (landcoverRaster), from createTerrainGroundTextureMaterialAsync for the renderer's backend. Default: a WebGL one without ground variation.
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
buildingColors?
ts
optional buildingColors?: object;Weighted roof and wall colors for plain building extrusions, chosen per building from a stable hash of its id or outline, so a distant city is not one color. Without it every building takes the building material's own color.
roofs
ts
roofs: readonly readonly [string, number][];walls
ts
walls: readonly readonly [string, number][];defaultBuildingHeight?
ts
optional defaultBuildingHeight?: number;defaultLevelHeight?
ts
optional defaultLevelHeight?: number;forestClasses?
ts
optional forestClasses?: readonly string[];landcoverColors?
ts
optional landcoverColors?: Readonly<Record<string, string>>;landcoverDetail?
ts
optional landcoverDetail?: Readonly<Record<string, readonly [number, number]>>;Exact land-cover appearance to [brush, bare] ground detail, each 0..1, carried per vertex as landcoverDetail for the ground material: dark shrub speckle, and lighter bare-soil patches. Paved urban ground (see urbanGround) shows neither.
landcoverOffset?
ts
optional landcoverOffset?: number;landcoverPaletteAreas?
ts
optional landcoverPaletteAreas?: readonly object[];Optional world-space palettes, sampled per vertex. Half-open bounds meet across tiles.
landcoverRaster?
ts
optional landcoverRaster?: TerrainLandcoverRasterOptions;Draw land cover on distant tiles as one texture a tile instead of the draped mesh: see TerrainLandcoverRasterOptions, and pass materials.landcoverRaster on WebGPU, where the default material has no shader. Omitted, every tile drapes.
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.
shorelineGroundOffset?
ts
optional shorelineGroundOffset?: number;Bank upper-edge lift; defaults to landcoverOffset or 0.18m, even in a separate water layer. Set 0 for bare elevation without a raised landcover surface.
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>;urbanGround?
ts
optional urbanGround?: TerrainUrbanGround;Built-up ground. Unmapped ground and broad land-use classes blend toward color (default: the urban_ground land-cover color, else pavement) as the share of nearby ground under building footprints rises from from to full (defaults 0.15 and 0.45), so a downtown block between its buildings reads as paving while suburban lawns stay green.
waterFeatureStyle?
ts
optional waterFeatureStyle?: (feature, surface?) => TerrainWaterFeatureStyle | undefined;Supply consistent water levels across tiles and control duplicate waterway ribbons.
Parameters
feature
surface?
context
TerrainPyramidTileLayerContext
polygon
Returns
TerrainWaterFeatureStyle | undefined
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
createEmptyTile()?
ts
optional createEmptyTile(context):
| Object3D<Object3DEventMap>
| Promise<Object3D<Object3DEventMap> | undefined>
| undefined;Optional supplemental content outside the basemap's coverage (for example airports).
Parameters
context
TerrainPyramidTileLayerContext
Returns
| Object3D<Object3DEventMap> | Promise<Object3D<Object3DEventMap> | undefined> | undefined
createTile()
ts
createTile(tile, context):
| Object3D<Object3DEventMap>
| Promise<Object3D<Object3DEventMap> | undefined>
| undefined;Parameters
tile
context
TerrainPyramidTileLayerContext
Returns
| Object3D<Object3DEventMap> | Promise<Object3D<Object3DEventMap> | undefined> | 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
signal
AbortSignal
Returns
Promise<TerrainSemanticTile | undefined>
TerrainStream
Properties
object
ts
readonly object: Group;Methods
dispose()
ts
dispose(): void;Returns
void
failedTiles()
ts
failedTiles(): TerrainTileAddress[];Tiles outside the quick retries: missing plus abandoned (see failedRetryDelayMs).
Returns
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
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
tileFailures()
ts
tileFailures(): TerrainTileFailure<TerrainTileAddress>[];Per-tile missing/retrying/abandoned detail, so a host can say which state a hole is in.
Returns
TerrainTileFailure<TerrainTileAddress>[]
update()
ts
update(cameraPos): void;Parameters
cameraPos
[number, number, number]
Returns
void
whenIdle()
ts
whenIdle(): Promise<void>;Returns
Promise<void>
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. An abandoned tile is only set aside: the first replan after its cool-down tries it again, so an outage longer than the quick retries (a dropped connection, a restarted server) does not leave holes behind once it is over.
Extends
Extended by
Properties
cameraPos?
ts
optional cameraPos?: [number, number, number];failedRetryDelayMs?
ts
optional failedRetryDelayMs?: number;How long an abandoned tile waits before the stream may try it again, doubling with each further failure up to eight times as long. The attempt starts on the first update() after the wait that still wants the tile. Default 15000; 0 or Infinity keeps it abandoned until retryFailed().
Inherited from
TerrainTileRetryOptions.failedRetryDelayMs
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
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 outside the quick retries: missing plus abandoned. An abandoned tile is tried again after failedRetryDelayMs; a missing one only by retryFailed().
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;TerrainStreetLight
Tile-local luminaire position and its pavement receiver height above the terrain.
Properties
groundLift
ts
groundLift: number;post?
ts
optional post?: boolean;A post-top lantern (glowing all round), not a mast arm's downward lens.
x
ts
x: number;y
ts
y: number;yaw
ts
yaw: number;z
ts
z: number;TerrainStreetNameStyle
How a region signs its street names: where the names stand, panel colours and shape, letter case, and any abbreviations its signs use for the spelled-out names map data carries ("Northeast 45th Street" is posted as "NE 45th St").
Properties
borderColor?
ts
optional borderColor?: string;Panel border; the ink colour when omitted.
directions?
ts
optional directions?: Record<string, string>;Compass words, abbreviated as a name's first or last word when another word remains.
inkColor
ts
inkColor: string;letterCase?
ts
optional letterCase?: "mapped" | "upper";upper letters names in capitals, as many British, French and Italian plates do.
mastArms?
ts
optional mastArms?: boolean;Also hang the cross street's name from each signal mast arm, as in North America.
mount?
ts
optional mount?: "post" | "wall";post (default) stands both of a corner's names on one post. wall fixes a plate for each street to the corner building's wall facing that street, and a low two-legged frame where no wall stands near the corner.
panel?
ts
optional panel?: "blade" | "plate";Panel shape on a post or frame: narrow North American blades (default) or taller plates.
panelColor
ts
panelColor: string;types?
ts
optional types?: Record<string, string>;Street types, abbreviated as the last word (or the last before a direction), never the first.
words?
ts
optional words?: Record<string, string>;Other words abbreviated anywhere but the last position, e.g. Saint, Mount, Junior.
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.
inferStopSigns?
ts
optional inferStopSigns?: boolean;Infer decorative stop controls where no mapped controls exist. Defaults to the sign profile.
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.
maxStreetlightsPerTile?
ts
optional maxStreetlightsPerTile?: number;Separate lamp budget, default 1.5 × maxFixturesPerTile; lamps do not displace parked cars.
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.
railCarOccupancy?
ts
optional railCarOccupancy?: number;Scales how full yards and sidings are, 0 to about 1.3 (default 1).
railCars?
ts
optional railCars?: readonly TerrainParkedVehicle[];Rolling stock that stands in yards and on sidings: rail vehicle types (specs with rail), freight cars and locomotives for heavy rail, light-rail cars for light-rail yards. Omitted or empty, the yards stand empty. Drawn when parked cars are.
railElectrification?
ts
optional railElectrification?: TerrainRailElectrification;Override the style's railway electrification policy.
railEquipment?
ts
optional railEquipment?: boolean;Override the style's railway equipment (signals, crossing gear, signs, catenary).
railGauge?
ts
optional railGauge?: number;Override the style's heavy-rail gauge, meters.
roadSigns?
ts
optional roadSigns?: boolean;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
context
TerrainPyramidTileLayerContext
options
Returns
Promise<Group<Object3DEventMap> | undefined>
TerrainSurfaceOptions
Properties
details?
ts
optional details?: TerrainSurfaceDetails;drivingSide?
ts
optional drivingSide?: "left" | "right";Override regional handedness for road markings, signals and signs together.
fonts?
ts
optional fonts?: FontLibrary;Host-loaded font content, shared by direct rendering and workers. No font means unlettered panels.
routeShields?
ts
optional routeShields?: TerrainRouteShieldLibrary;Host-loaded vector route artwork, shared with workers once per change.
signFont?
ts
optional signFont?: string;Face id or semantic role; defaults to the library's highway role.
signProfile?
ts
optional signProfile?: Readonly<TerrainRoadSignProfile>;Country-specific appearance and conservative stop inference; data-only for workers.
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
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
context
TerrainPyramidTileLayerContext
Returns
Promise<Group<Object3DEventMap> | undefined>
dispose()
ts
dispose(): void;Returns
void
disposeTile()
ts
disposeTile(object): void;Parameters
object
Object3D
Returns
void
setMaterial()
ts
setMaterial(material): void;Draw roads, sidewalks, markings and lots with material (for example createTerrainPavementMaterialAsync, which reads their surfaceDetail), on resident tiles and every later one. Undefined restores the plain vertex-color material.
Parameters
material
Material<MaterialEventMap> | undefined
Returns
void
setNightFactor()
ts
setNightFactor(factor): void;Fade streetlamp emission and pavement pools, 0 (day) to 1 (night).
Parameters
factor
number
Returns
void
setOptions()
ts
setOptions(options): Promise<void>;Refresh resident tiles cooperatively, without refetching map data or rebuilding buildings.
Parameters
options
Returns
Promise<void>
stats()
ts
stats(): TerrainSurfaceStats & object;Returns
TerrainSurfaceStats & object
updateDetail()
ts
updateDetail(position): void;Hide each tile's small street detail (signs, fixtures, signal lenses, lane markings, parked cars) when the tile lies farther from position (the scene camera's world position) than the detail's userData.detailDistance, and show it again as the camera nears. Call every frame; it works only after the camera has moved or tiles have changed.
Parameters
position
Vector3
Returns
void
updateSignals()
ts
updateSignals(elapsedSeconds, resolve?): void;Absolute simulation time in seconds; optionally resolve colours from a traffic graph.
Parameters
elapsedSeconds
number
resolve?
Returns
void
visitStreetLights()
ts
visitStreetLights(visit): void;Visit lamps on attached, visible tiles; positions are local to each source object.
Parameters
visit
(light, source) => void
Returns
void
TerrainSurfaceStats
Properties
aprons
ts
aprons: number;detailLimited
ts
detailLimited: boolean;junctions
ts
junctions: number;parkedCars
ts
parkedCars: number;parkingAreas
ts
parkingAreas: number;parkingBays
ts
parkingBays: number;railCrossings
ts
railCrossings: number;railSignals
ts
railSignals: number;railSwitches
ts
railSwitches: number;railTracks
ts
railTracks: number;Railway track fragments, level crossings, turnouts and signals (see surface-rail).
roads
ts
roads: number;roadSigns
ts
roadSigns: number;runways
ts
runways: number;Resident tile fragments; a runway crossing tiles contributes more than once.
streetFurniture
ts
streetFurniture: number;Utility poles and hydrants along blocks with sidewalks.
streetlights
ts
streetlights: number;streetNameSigns
ts
streetNameSigns: number;Of roadSigns: corner name posts, wall and frame nameplates, and mast-arm name panels.
taxiways
ts
taxiways: 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;railElectrification?
ts
optional railElectrification?: TerrainRailElectrification;Which tracks carry overhead catenary (see TerrainRailElectrification); default light: light rail, trams and open-air subways. Regions whose main lines are electrified use all.
railEquipment?
ts
optional railEquipment?: boolean;Railway equipment: signals, switch stands, level-crossing signs, lights and gates, lineside signs and overhead catenary. Track beds and rails are drawn regardless. Default true.
railGauge?
ts
optional railGauge?: number;Gauge of the region's heavy-rail network, meters: standard 1.435 by default, 1.067 for Japan's conventional lines, 1.676 for India's. Light rail, trams, subways and lines named as Shinkansen stay standard gauge.
road
ts
road: string;roadSigns?
ts
optional roadSigns?: boolean;Physical road signs. Optional on custom styles for source compatibility.
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 next attempt, while one is waiting. For an abandoned tile it is the earliest time an update may try it again.
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
Returns
| Object3D<Object3DEventMap> | Promise<Object3D<Object3DEventMap> | undefined> | 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. An abandoned tile is only set aside: the first replan after its cool-down tries it again, so an outage longer than the quick retries (a dropped connection, a restarted server) does not leave holes behind once it is over.
Extended by
Properties
failedRetryDelayMs?
ts
optional failedRetryDelayMs?: number;How long an abandoned tile waits before the stream may try it again, doubling with each further failure up to eight times as long. The attempt starts on the first update() after the wait that still wants the tile. Default 15000; 0 or Infinity keeps it abandoned until retryFailed().
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.
TerrainTrafficSignal
World-space junction and outward approach direction, shared by heads on that approach.
Properties
direction
ts
direction: readonly [number, number];junction
ts
junction: readonly [number, number];radius
ts
radius: number;TerrainTunnelClearance
Properties
ceiling
ts
ceiling: number;floor
ts
floor: number;TerrainUrbanGround
Properties
classes?
ts
optional classes?: readonly string[];Land-cover appearances that pave over; default unmapped ground and broad urban uses.
color?
ts
optional color?: string;coverage?
ts
optional coverage?: TerrainBuildingCoverage;Precomputed coverage, for a tile whose buildings are not at hand (a landcover worker).
from?
ts
optional from?: number;full?
ts
optional full?: number;TerrainWaterFeatureStyle
Properties
elevation?
ts
optional elevation?: number;Absolute rendered water elevation in the terrain frame. Used for polygon surfaces.
hideLines?
ts
optional hideLines?: boolean;Omit a centerline ribbon when the mapped polygon already represents this reach.
hidePolygons?
ts
optional hidePolygons?: boolean;Omit mapped areas that describe hydraulic works instead of standing water.
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;swells?
ts
optional swells?: WaterWave[];Analytic swell slopes matching kernel sampleWaves. Polygon shorelines remain at their datum.
waveScale?
ts
optional waveScale?: number;World-space ripple frequency. Smaller values make broader ripples. Default 0.035.
waveSpeed?
ts
optional waveSpeed?: number;Speed of the independently drifting ripple layers. Zero freezes ripples, not swells.
waveStrength?
ts
optional waveStrength?: number;Ripple slope and surface variation. Zero leaves only authored swells. Default 0.035.
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.
Parameters
input
URL | RequestInfo
init?
RequestInit
Returns
Promise<Response>
Type Aliases
CreateProfiledTerrainPackageSemanticLayersOptions
ts
type CreateProfiledTerrainPackageSemanticLayersOptions = Omit<CreateTerrainPackageSemanticLayersOptions, "decoder"> & object;Type Declaration
decoderWorker?
ts
optional decoderWorker?: TerrainSemanticDecoderWorker;A worker running installTerrainSemanticDecoderWorker: tiles decode there rather than on the main thread, where a town tile took 10-18 ms of a frame. The host owns and ends it. Decodes then go straight to the worker, whatever admission says: queued as admission jobs they waited behind the frame's uploads (a median 3.4 s, up to 11 s, in a city) while the worker sat idle, and every layer built from them waited too.
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?
Returns
TerrainGroundCutter
ts
type TerrainGroundCutter = (request, signal) => Promise<TerrainGroundCutResult | undefined>;Makes a cut somewhere other than the calling thread. Resolves to undefined when it cannot (cancelled, or nobody there to make it), and the controller then makes the cut itself.
Parameters
request
signal
AbortSignal
Returns
Promise<TerrainGroundCutResult | undefined>
TerrainGroundMaterial
ts
type TerrainGroundMaterial = THREE.MeshStandardMaterial | MeshStandardNodeMaterial;Vertex-colored ground for either the legacy WebGL renderer or the WebGPU node renderer.
TerrainGroundOutline
ts
type TerrainGroundOutline = readonly Point[];TerrainQualityPreset
ts
type TerrainQualityPreset = "economy" | "balanced" | "high";TerrainRoadSignPatternId
ts
type TerrainRoadSignPatternId =
| "highway-overhead"
| "highway-exit"
| "all-way-stop"
| "minor-stop"
| "street-speed"
| "freeway-speed"
| "yield"
| "attraction"
| "route-guide"
| "route-marker"
| "street-name-mast"
| "street-name-blade"
| "street-name-wall";Global sign patterns and their detection cues; regional profiles supply appearance and inference defaults.
TerrainRoadWear
ts
type TerrainRoadWear = 0 | 1 | 2 | 3;Asphalt condition grades; see TerrainLineBand.wear.
TerrainSurfaceColor
ts
type TerrainSurfaceColor = (x, y, z, slope, base) => readonly [number, number, number] | undefined & object;World coordinates and slope, with linear RGB. Undefined preserves the package palette.
Type Declaration
colorTile()?
ts
optional colorTile(
positions,
normals,
colors,
originX,
originZ
): void;The same coloring for a whole tile in one call: positions and normals are tile-local (add originX/originZ for the world X/Z the callback receives) and colors holds the base colors, replaced in place. Called per vertex, a tile's quarter of a million arguments were each boxed: a third of the main thread's allocations in a fast flight at High detail.
Parameters
positions
Float32Array
normals
Float32Array
colors
Float32Array
originX
number
originZ
number
Returns
void
TerrainSurfaceKind
ts
type TerrainSurfaceKind = typeof TERRAIN_SURFACE_KIND[keyof typeof TERRAIN_SURFACE_KIND];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.
TerrainTrafficSignalColor
ts
type TerrainTrafficSignalColor = "red" | "amber" | "green";TerrainTrafficSignalResolver
ts
type TerrainTrafficSignalResolver = (signal) => TerrainTrafficSignalColor | undefined;Return the simulation's colour, or undefined to use the decorative deterministic cycle.
Parameters
signal
Returns
TerrainTrafficSignalColor | undefined
TerrainWaterMaterial
ts
type TerrainWaterMaterial = THREE.MeshPhysicalMaterial | MeshPhysicalNodeMaterial;Physical water for either the legacy WebGL renderer or the WebGPU node renderer.
Variables
TERRAIN_COVERS_GROUND
ts
const TERRAIN_COVERS_GROUND: "terrainCoversGround";userData flag for a tile layer object that drapes its whole tile with opaque ground (for example landcover over a full-tile background). While that object is displayed, the stream does not draw the tile's bare terrain surface, which it would hide completely.
TERRAIN_PAVEMENT
ts
const TERRAIN_PAVEMENT: "terrainPavement";userData flag on draped pavement meshes that a host pavement material may replace.
TERRAIN_RAIL_MESHES
ts
const TERRAIN_RAIL_MESHES: object;Mesh names; hosts and tests can find each part by them.
Type Declaration
bed
ts
readonly bed: "surface:rail-bed";lamps
ts
readonly lamps: "surface:signal-rail-lamps";rails
ts
readonly rails: "surface:rails";wires
ts
readonly wires: "surface:rail-wires";TERRAIN_RAILWAY_GROUND
ts
const TERRAIN_RAILWAY_GROUND: "#7f7c74" = "#7f7c74";Ground color of mapped railway land (yards, corridors): ballast and cinders.
TERRAIN_ROAD_SIGN_PATTERNS
ts
const TERRAIN_ROAD_SIGN_PATTERNS: readonly TerrainRoadSignPattern[];Data cues describe supported inputs, not a guarantee that a PMTiles archive retains them.
TERRAIN_ROAD_WEAR_STEP
ts
const TERRAIN_ROAD_WEAR_STEP: 16 = 16;A road band's surfaceDetail.w packs its lane width (0.5–12 m) with its wear grade as laneWidth + TERRAIN_ROAD_WEAR_STEP * wear; the pavement material splits them with a floor.
TERRAIN_SURFACE_KIND
ts
const TERRAIN_SURFACE_KIND: object;Surface kinds for draped bands and areas, read by the pavement material through the surfaceDetail attribute (x: meters along the band, y: meters across it from its edge, z: kind * 128 + width, w: a road's lane width and wear grade (TERRAIN_ROAD_WEAR_STEP), paint's surface beneath (TerrainLineBand.beneath), otherwise its fraying edges; see TerrainLineBand.fray).
Type Declaration
ballast
ts
readonly ballast: 9;curb
ts
readonly curb: 3;dirt
ts
readonly dirt: 7;paint
ts
readonly paint: 4;parking
ts
readonly parking: 5;plain
ts
readonly plain: 0;plaza
ts
readonly plaza: 6;rail
ts
readonly rail: 11;Rails modeled in 3D: steel, polished on top where variant is 1. The pavement material drops them where they would be thinner than a pixel, leaving the track's drawn rails.
road
ts
readonly road: 1;shoulder
ts
readonly shoulder: 8;sidewalk
ts
readonly sidewalk: 2;track
ts
readonly track: 10;Ballasted track: sleepers and a pair of rails drawn across the band's middle, by gauge and sleeper type from TerrainLineBand.variant (see terrainRailVariant).
TERRAIN_SURFACE_STYLES
ts
const TERRAIN_SURFACE_STYLES: Readonly<Record<TerrainSurfaceStyleId, Readonly<TerrainSurfaceStyle>>>;Functions
appendTerrainStreetLights()
ts
function appendTerrainStreetLights(
group,
lights,
context
): void;No point lights: two draws per tile, bounded by the surface fixture budget.
Parameters
group
Group
lights
readonly TerrainStreetLight[]
context
TerrainPyramidTileLayerContext
Returns
void
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
descriptor
cx
number
cz
number
opts?
Returns
cachingArchiveOpener()
ts
function cachingArchiveOpener(cache, options?): TerrainArchiveOpener;An openArchive hook that reads every archive through cache, repairing what it finds corrupt.
Parameters
cache
BlockCache
options?
Returns
cloneTerrainGroundMaterial()
ts
function cloneTerrainGroundMaterial<T>(material): T;A copy of a ground material for one mesh's own texture or flags. It draws with the original's shaders and follows its origin, strength and snow; on WebGL clone() alone drops the shader hooks.
Type Parameters
T
T extends Material<MaterialEventMap>
Parameters
material
T
Returns
T
createAgricultureTileEnricher()
ts
function createAgricultureTileEnricher(
source,
baseUrl?,
options?
): (base) => TerrainSemanticTileSource;Parameters
source
baseUrl?
string | URL
options?
fetch?
(input, init?) => Promise<Response>
onError?
(error) => void
Returns
(base) => TerrainSemanticTileSource
createDefaultTerrainSemanticRenderer()
ts
function createDefaultTerrainSemanticRenderer(options?): TerrainSemanticTileRenderer;Reusable default renderer for createTerrainSemanticPyramidLayer.
Parameters
options?
DefaultTerrainSemanticRendererOptions
Returns
createProfiledTerrainPackageSemanticLayers()
ts
function createProfiledTerrainPackageSemanticLayers(pkg, options?): Promise<TerrainPackageSemanticLayers>;Select a built-in decoder only from an explicit package profile declaration.
Parameters
pkg
options?
CreateProfiledTerrainPackageSemanticLayersOptions
Returns
Promise<TerrainPackageSemanticLayers>
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
createTerrainElevationWorkerSource()
ts
function createTerrainElevationWorkerSource(
worker,
pkg,
descriptor,
archive,
options?
): TerrainPyramidHeightSource;Parameters
worker
pkg
descriptor
archive
options?
Returns
createTerrainGroundMaterial()
ts
function createTerrainGroundMaterial(options?): MeshStandardMaterial;WebGL ground: a standard vertex-color material with the variation in its shader hooks.
Parameters
options?
Returns
MeshStandardMaterial
createTerrainGroundMaterialAsync()
ts
function createTerrainGroundMaterialAsync(options?, backend?): Promise<TerrainGroundMaterial>;Ground for an initialized renderer's backend. WebGPU does not run onBeforeCompile hooks, so that path builds the same variation as TSL nodes; node modules load only when selected.
Parameters
options?
backend?
"webgl" | "webgpu"
Returns
Promise<TerrainGroundMaterial>
createTerrainGroundTextureMaterial()
ts
function createTerrainGroundTextureMaterial(options?): MeshStandardMaterial;WebGL ground drawn from a texture instead of vertex colors (map, with texture coordinates across the mesh): the shared material for land cover drawn as one texture a tile. Each tile draws with its own copy, made with cloneTerrainGroundMaterial. Texels without alpha are cut.
Parameters
options?
Pick<TerrainGroundMaterialOptions, "roughness" | "strength">
Returns
MeshStandardMaterial
createTerrainGroundTextureMaterialAsync()
ts
function createTerrainGroundTextureMaterialAsync(options?, backend?): Promise<TerrainGroundMaterial>;Ground drawn from a texture for an initialized renderer's backend: on WebGPU the same variation as nodes over the map of the copy each tile draws with. Without it a WebGPU host has no material for land cover drawn as a texture and drapes every tile's as a mesh: about four times the land-cover triangles and memory of a view from the air.
Parameters
options?
Pick<TerrainGroundMaterialOptions, "roughness" | "strength">
backend?
"webgl" | "webgpu"
Returns
Promise<TerrainGroundMaterial>
createTerrainLandcoverWorkerBridge()
ts
function createTerrainLandcoverWorkerBridge(worker): TerrainLandcoverGenerator;One active job per worker; aborted queued jobs never perform expensive draping.
Parameters
worker
Returns
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
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
descriptor
opts?
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. Past the last few decoded tiles, only tiles something else still holds are reused (see DecodedSemanticTiles), so renderer-owned resident objects remain the memory authority.
Parameters
pkg
archive
decoder
options?
TerrainPackageCombinedSemanticSourceOptions
Returns
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
descriptor
archive
level
number
options?
TerrainPackageHeightSourceOptions
Returns
createTerrainPackagePyramidHeightSource()
ts
function createTerrainPackagePyramidHeightSource(
pkg,
descriptor,
archive,
options?
): TerrainPyramidHeightSource;Adapt sparse archive levels into the generic terrain-pyramid source contract.
Parameters
pkg
descriptor
archive
options?
TerrainPackagePyramidHeightSourceOptions
Returns
createTerrainPackagePyramidStream()
ts
function createTerrainPackagePyramidStream(pkg, options): Promise<TerrainPackagePyramidStream>;Open a terrain package and create its camera-driven, multi-level pyramid stream.
Parameters
pkg
options
TerrainPackagePyramidStreamOptions
Returns
Promise<TerrainPackagePyramidStream>
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 that the layers reach: with overzoom, the package's finest terrain levels, not the sidecar's. A package deeper than its vector archive would otherwise generate trees and buildings for tiles many kilometres across (zoom 11 to 13 over a zoom-15 package). 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
options
CreateTerrainPackageSemanticLayersOptions
Returns
Promise<TerrainPackageSemanticLayers>
createTerrainPackageSemanticSource()
ts
function createTerrainPackageSemanticSource(
pkg,
content,
archive,
decoder,
options?
): TerrainPackageSemanticSource;Parameters
pkg
content
archive
decoder
options?
TerrainPackageSemanticSourceOptions
Returns
createTerrainPackageStream()
ts
function createTerrainPackageStream(pkg, options): Promise<TerrainPackageStream>;Open a terrain package and immediately create its bounded fixed-level stream.
Parameters
pkg
options
Returns
Promise<TerrainPackageStream>
createTerrainPavementMaterial()
ts
function createTerrainPavementMaterial(options?): MeshStandardMaterial;WebGL pavement: the standard draped-surface material with band-aware detail in its hooks.
Parameters
options?
TerrainPavementMaterialOptions
Returns
MeshStandardMaterial
createTerrainPavementMaterialAsync()
ts
function createTerrainPavementMaterialAsync(options?, backend?): Promise<TerrainGroundMaterial>;Pavement for an initialized renderer's backend; WebGPU builds the same detail as TSL nodes.
Parameters
options?
TerrainPavementMaterialOptions
backend?
"webgl" | "webgpu"
Returns
Promise<TerrainGroundMaterial>
createTerrainPyramidStream()
ts
function createTerrainPyramidStream(
descriptor,
source,
options
): TerrainPyramidStream;Parameters
descriptor
source
options
Returns
createTerrainRoadGrading()
ts
function createTerrainRoadGrading(options): TerrainRoadGrading;Share one grading between a terrain stream and its features layer.
Parameters
options
Returns
createTerrainRoadSignObject()
ts
function createTerrainRoadSignObject(
sign,
context,
options?
): Group;Render one planned sign with exactly the same geometry as a surface tile, its night glow included (updateTerrainStreetLights sets it). Coordinates are tile-local and clipped to context.tileSize. Dispose with disposeTerrainSurfaceObject.
Parameters
sign
context
TerrainPyramidTileLayerContext
options?
Pick<TerrainSurfaceOptions, "fonts" | "signFont" | "routeShields">
Returns
Group
createTerrainSemanticDecoderWorker()
ts
function createTerrainSemanticDecoderWorker(worker): TerrainSemanticTileDecoder & object;A decoder that hands each tile to worker (one running installTerrainSemanticDecoderWorker). The bytes are copied before they cross, as an archive may cache and reuse them.
Parameters
worker
Returns
TerrainSemanticTileDecoder & object
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
context
TerrainPyramidTileLayerContext
options?
Returns
Group
createTerrainSemanticObjectSliced()
ts
function createTerrainSemanticObjectSliced(
tile,
context,
options,
run,
sliceMs?
): Promise<Group<Object3DEventMap> | undefined>;createTerrainSemanticObject a few milliseconds at a time: each slice runs through run (a frame's admission, say), pausing between water polygons, footprints and the object's parts. A harbor's water or a coarse tile's thousands of footprints, built in one go, held a frame 11-19 ms. The same group as createTerrainSemanticObject's, or undefined once context.signal aborts (with anything built so far disposed).
Parameters
tile
context
TerrainPyramidTileLayerContext
options
run
<T>(slice) => Promise<T>
sliceMs?
number
Returns
Promise<Group<Object3DEventMap> | undefined>
createTerrainSemanticPyramidLayer()
ts
function createTerrainSemanticPyramidLayer(options): TerrainPyramidTileLayer;Connect any normalized semantic source/renderer pair to adaptive terrain residency.
Parameters
options
TerrainSemanticPyramidLayerOptions
Returns
createTerrainStream()
ts
function createTerrainStream(
descriptor,
source,
options?
): TerrainStream;Parameters
descriptor
source
options?
Returns
createTerrainSurfaceObject()
ts
function createTerrainSurfaceObject(
tile,
context,
options?,
roadMaterial?,
renderVehicles?
): Group;Surface meshes are tile-local, clipped, batched and deterministic.
Parameters
tile
context
TerrainPyramidTileLayerContext
options?
roadMaterial?
Material<MaterialEventMap>
renderVehicles?
boolean
Returns
Group
createTerrainSurfaceRenderer()
ts
function createTerrainSurfaceRenderer(
initial?,
generator?,
parkedVehiclesAt?,
signProfileAt?
): TerrainSurfaceRenderer;One controller can be shared by all semantic renderers in a viewer.
Parameters
initial?
generator?
parkedVehiclesAt?
(x, z) => readonly TerrainParkedVehicle[]
signProfileAt?
(x, z) => | Readonly<TerrainRoadSignProfile> | undefined
Returns
createTerrainSurfaceWorkerBridge()
ts
function createTerrainSurfaceWorkerBridge(worker): TerrainSurfaceGenerator;Parameters
worker
Returns
createTerrainSurfaceWorkerPool()
ts
function createTerrainSurfaceWorkerPool(workers): TerrainSurfaceGenerator;Surface generation over several workers, each tile to the one with the fewest in flight. A streamed tile's roads, markings and parked cars wait for its surface; one worker for a whole view held a fast aircraft's buildings back by seconds.
Parameters
workers
readonly TerrainLandcoverWorker[]
Returns
createTerrainTunnelObject()
ts
function createTerrainTunnelObject(
tile,
context,
groundAt?
): Group;Create open-ended bores. Full route endpoints and their ground heights must be available. groundAt uses tile-local metres and may sample neighboring heightfields for complete routes. The inference is a straight grade between portal ground heights, not surveyed engineering.
Parameters
tile
context
TerrainPyramidTileLayerContext
groundAt?
(x, z) => number | undefined
Returns
Group
createTerrainWaterMaterial()
ts
function createTerrainWaterMaterial(options?): MeshPhysicalMaterial;Create opaque physical water with irregular, animated ripple normals and sky reflections.
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?
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?
backend?
"webgl" | "webgpu"
Returns
Promise<TerrainWaterMaterial>
createUrlTerrainTileSource()
ts
function createUrlTerrainTileSource(descriptor, options?): TerrainHeightTileSource;Fetch descriptor PNG16 tiles from its heightUrl template. HTTP 404 means an absent tile.
Parameters
descriptor
options?
Returns
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
Returns
void
installTerrainLandcoverWorker()
ts
function installTerrainLandcoverWorker(scope): void;Pure message handler, usable with a worker scope or a test port.
Parameters
scope
Pick<TerrainLandcoverWorker, "postMessage" | "addEventListener">
Returns
void
installTerrainSemanticDecoderWorker()
ts
function installTerrainSemanticDecoderWorker(scope, decoder?): void;Serve decode requests in a worker, with the Protomaps preset unless given another decoder.
Parameters
scope
Pick<TerrainSemanticDecoderWorker, "postMessage" | "addEventListener">
decoder?
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<TerrainSurfaceWorker, "postMessage" | "addEventListener">
Returns
void
isTerrainGroundMaterial()
ts
function isTerrainGroundMaterial(material): boolean;Whether a material carries the ground variation (and accepts setTerrainGroundOrigin).
Parameters
material
Material
Returns
boolean
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
distance
number
Returns
number
markTerrainGroundSurface()
ts
function markTerrainGroundSurface(mesh, shoreline?): void;Mark ground for model openings. Native shorelines clear elevation/landcover, not paving.
Parameters
mesh
Mesh
shoreline?
boolean
Returns
void
markTerrainPavementSurface()
ts
function markTerrainPavementSurface(mesh): void;Mark native road/sidewalk surfaces that a terrain-only bridge opening may retain.
Parameters
mesh
Mesh
Returns
void
markTerrainWaterSurface()
ts
function markTerrainWaterSurface(mesh): void;Mark native water that can be replaced by an explicit model-owned water opening.
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
baseUrl?
string | URL
options?
OpenTerrainPackageArchiveOptions
Returns
openTerrainPackageElevation()
ts
function openTerrainPackageElevation(pkg, options): Promise<OpenTerrainPackageElevation>;Open and verify the package elevation archive at one fixed detail level.
Parameters
pkg
options
Returns
Promise<OpenTerrainPackageElevation>
openTerrainPackagePyramid()
ts
function openTerrainPackagePyramid(pkg, options?): Promise<OpenTerrainPackagePyramid>;Open and verify the package's complete available elevation pyramid.
Parameters
pkg
options?
OpenTerrainPackagePyramidOptions
Returns
Promise<OpenTerrainPackagePyramid>
openTerrainPackageSemantics()
ts
function openTerrainPackageSemantics(pkg, options): Promise<OpenTerrainPackageSemantics>;Open every declared semantic PMTiles sidecar and expose normalized tile sources.
Parameters
pkg
options
OpenTerrainPackageSemanticsOptions
Returns
Promise<OpenTerrainPackageSemantics>
pickParkedVehicle()
ts
function pickParkedVehicle(vehicles, u): TerrainParkedVehicle | undefined;Stable weighted selection, shared by synchronous and worker surface generation.
Parameters
vehicles
readonly TerrainParkedVehicle[]
u
number
Returns
TerrainParkedVehicle | undefined
resolveTerrainPackageArchiveUrl()
ts
function resolveTerrainPackageArchiveUrl(source, baseUrl?): string;Resolve a local package archive against its manifest, leaving remote archives untouched.
Parameters
source
baseUrl?
string | URL
Returns
string
resolveTerrainSurfaceStyle()
ts
function resolveTerrainSurfaceStyle(style?, details?): TerrainSurfaceStyle;Parameters
style?
| TerrainSurfaceStyleId | Readonly<TerrainSurfaceStyle>
details?
Returns
resolveTerrainTileUrl()
ts
function resolveTerrainTileUrl(
template,
address,
baseUrl?
): string;Parameters
template
string
address
baseUrl?
string | URL
Returns
string
sampleAirportPavement()
ts
function sampleAirportPavement(
root,
x,
z,
ground
): number | undefined;Height of the visible airport pavement at (x, z) in root's frame (the terrain stream's object) where it is drawn just above ground, otherwise undefined. Aprons, taxiways and runways are draped about half a metre above the terrain, so whatever stands on them, such as a parked aircraft, rests at this height rather than the terrain's.
Parameters
root
Object3D
x
number
z
number
ground
number
Returns
number | undefined
sampleTerrainTunnel()
ts
function sampleTerrainTunnel(
root,
x,
y,
z
): TerrainTunnelClearance | undefined;Query a visible bore in root's coordinate frame. Above-ground observers retain DEM support.
Parameters
root
Object3D
x
number
y
number
z
number
Returns
TerrainTunnelClearance | undefined
selectTerrainPyramidTiles()
ts
function selectTerrainPyramidTiles(
descriptor,
view,
options
): TerrainPyramidSelection;Select a non-overlapping set of pyramid leaves for a perspective camera.
Parameters
descriptor
view
options
TerrainPyramidSelectionOptions
Returns
setTerrainGroundCutout()
ts
function setTerrainGroundCutout(
object,
outline,
maxHeight?,
options?
): void;A simple model-local X/Z polygon. Only a visible owner opens the ground. maxHeight limits removal to ground below this model-local Y, preserving terrain above a bore. minHeight retains lower banks and caps removed high ground at that model-local Y. Height-limited owners use translation and rotation about Y (no pitch/roll).
Parameters
object
Object3D
outline
maxHeight?
number
options?
ceilings?
readonly number[]
minHeight?
number
pavingOutlines?
readonly TerrainGroundOutline[]
preservePaving?
boolean
withinScope?
boolean
The outlines lie within the owner's cut scope (its tile, see markTerrainGroundCutScope): they cut only that scope's ground, as shorelines do. A city's tunnel bores are thousands of owners; checked against every ground mesh, they made each pass cost 10 ms and more.
Returns
void
setTerrainGroundCutouts()
ts
function setTerrainGroundCutouts(
object,
outlines,
maxHeight?,
options?
): void;Separate model-local openings preserve ground between river channels, stairs and basements. Replaces this owner's previous openings. The optional ceiling applies to every outline.
Parameters
object
Object3D
outlines
readonly TerrainGroundOutline[]
maxHeight?
number
options?
ceilings?
readonly number[]
minHeight?
number
pavingOutlines?
readonly TerrainGroundOutline[]
preservePaving?
boolean
withinScope?
boolean
The outlines lie within the owner's cut scope (its tile, see markTerrainGroundCutScope): they cut only that scope's ground, as shorelines do. A city's tunnel bores are thousands of owners; checked against every ground mesh, they made each pass cost 10 ms and more.
Returns
void
setTerrainGroundOrigin()
ts
function setTerrainGroundOrigin(material, worldOrigin): void;Keep the pattern fixed to the ground across floating-origin rebases. Pass the renderer's world origin [x, z] whenever it changes (every frame is fine).
Parameters
material
Material
worldOrigin
readonly [number, number]
Returns
void
setTerrainGroundSnow()
ts
function setTerrainGroundSnow(
material,
cover,
worldOriginY?
): void;Lay snow on a ground or pavement material above a snow line (weather.snowCover), or clear it with undefined; copies made with cloneTerrainGroundMaterial follow. Open ground whitens in patches through the transition band and fully above it, steep faces stay bare, and roads keep worn, greyer snow with the paving showing through. Changing it never rebuilds a shader. worldOriginY is the renderer's floating-origin height, when it rebases Y (default 0).
Parameters
material
Material
cover
| { depth?: number; depthGain?: number; level: number; maxDepth?: number; transition?: number; } | undefined
worldOriginY?
number
Returns
void
setTerrainSurfacePassages()
ts
function setTerrainSurfacePassages(object, ids): void;A resident model supplies the walls and roof. The road renderer supplies the surface.
Parameters
object
Object3D
ids
ReadonlySet<number>
Returns
void
setTerrainWaterCutout()
ts
function setTerrainWaterCutout(object, outline): void;Replace only native water within this visible owner's footprint. Ground remains intact.
Parameters
object
Object3D
outline
Returns
void
setTerrainWaterTime()
ts
function setTerrainWaterTime(
material,
seconds,
worldOrigin?
): void;Advance a terrain water material and preserve wave continuity across floating-origin shifts. worldOrigin is the renderer's floating origin (X, Z): any size works, since it is folded in double precision into wrapped offsets rather than added on the GPU.
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
height
number
slope
number
Returns
[number, number, number]
streetSignName()
ts
function streetSignName(style, name): string;The legend a street-name sign posts for a mapped name. Only presentation changes: a direction or type that is the whole name ("North Street", "Avenue A") keeps its spelling.
Parameters
style
Readonly<TerrainStreetNameStyle>
name
string
Returns
string
subtractTerrainGroundGeometry()
ts
function subtractTerrainGroundGeometry(
source,
outlines,
maxHeights?,
minHeights?
): 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[]
maxHeights?
readonly (number | undefined)[]
minHeights?
readonly (number | undefined)[]
Returns
BufferGeometry
taggedTerrainObjects()
ts
function taggedTerrainObjects(tag): Generator<Object3D<Object3DEventMap>>;The live objects tagged tag, in tagging order. A host still checks that each is attached and visible under its own root: a tile evicted or hidden keeps its tag until it is collected.
Parameters
tag
string
Returns
Generator<Object3D<Object3DEventMap>>
tagTerrainObject()
ts
function tagTerrainObject(tag, object): void;Remember a terrain object a host looks for by kind ('water' surfaces, 'parked-vehicles' surface groups), so it can visit those instead of walking the whole scene: a view's graph is thousands of objects, and a vehicle host walked it twice, five times a second, to find a few dozen. Held weakly; disposed objects drop out.
Parameters
tag
string
object
Object3D
Returns
void
terrainDescriptorFromPackage()
ts
function terrainDescriptorFromPackage(
pkg,
level,
frame?
): TerrainDescriptor;Build the generic fixed-grid descriptor represented by one package pyramid level.
Parameters
pkg
level
number
frame?
Returns
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
source
Returns
TerrainArchiveEntryInfo | undefined
terrainPackageArchiveSourceLocation()
ts
function terrainPackageArchiveSourceLocation(source): string;Return the authored package-relative path or absolute streaming URL for diagnostics.
Parameters
source
Returns
string
terrainPyramidBudgetForQuality()
ts
function terrainPyramidBudgetForQuality(quality): TerrainPyramidBudget;Portable adaptive-terrain budgets expressed as measurable limits.
Parameters
quality
Returns
terrainPyramidDescriptorFromPackage()
ts
function terrainPyramidDescriptorFromPackage(pkg, levels?): TerrainPyramidDescriptor;Build the generic planar quadtree represented by a package's complete elevation pyramid.
Parameters
pkg
levels?
frame?
maxLevel?
number
minLevel?
number
Returns
terrainSemanticTileContentHash()
ts
function terrainSemanticTileContentHash(tile): string | undefined;A content hash computed where the tile was decoded (a decoder worker), for in-memory cache keys: equal content gives equal hashes. Undefined for tiles made elsewhere; hash those yourself. Hashing a dense town's tile on the main thread cost 8-20 ms a tile.
Parameters
tile
Returns
string | undefined
terrainStreamBudgetForQuality()
ts
function terrainStreamBudgetForQuality(quality): TerrainStreamBudget;Portable quality presets expressed only as streaming budgets, never device-name checks.
Parameters
quality
Returns
terrainWaterSurfaceHeight()
ts
function terrainWaterSurfaceHeight(
polygon,
context,
offset,
seaLevel?,
elevation?
): number;Shared rendered water datum for water-bound ambient objects and the surface mesh.
Parameters
polygon
context
TerrainPyramidTileLayerContext
offset
number
seaLevel?
number
elevation?
number
Returns
number
updateTerrainStreetLights()
ts
function updateTerrainStreetLights(object, factor): void;Updates emission only; tile geometry and street-detail distance culling stay intact.
Parameters
object
Object3D
factor
number
Returns
void
updateTerrainSurfaceSignals()
ts
function updateTerrainSurfaceSignals(
object,
elapsedSeconds,
resolve?
): void;Advance a direct/static surface object with an absolute time in seconds.
Parameters
object
Object3D
elapsedSeconds
number
resolve?
Returns
void
withTerrainRoadGrading()
ts
function withTerrainRoadGrading(renderer, grading): TerrainSemanticTileRenderer;Grade each tile's bridges (see TerrainRoadGrading.gradeTile) before it is drawn.
Parameters
renderer
grading
Returns
withTerrainTunnels()
ts
function withTerrainTunnels(
renderer,
source,
heights,
minLevel
): TerrainSemanticTileRenderer;Join clipped vector fragments before inferring a grade, so tile edges cannot become portals. Only completed, unbranched routes are inferred. Bounded searches omit unresolved long routes.
Parameters
renderer
source
heights
minLevel
number
Returns
References
applyAgricultureGrid
Re-exports applyAgricultureGrid
assertTerrainSemanticTile
Re-exports assertTerrainSemanticTile
createEmptyTerrainSemanticTile
Re-exports createEmptyTerrainSemanticTile
createProtomapsTerrainMvtDecoder
Re-exports createProtomapsTerrainMvtDecoder
createTerrainMvtSemanticDecoder
Re-exports createTerrainMvtSemanticDecoder
decodeAgricultureGrid
Re-exports decodeAgricultureGrid
DEFAULT_ROAD_SIGN_PROFILE
Re-exports DEFAULT_ROAD_SIGN_PROFILE
deriveOverzoomTerrainSemanticTilePacket
Re-exports deriveOverzoomTerrainSemanticTilePacket
deriveTerrainSemanticTileContentHash
Re-exports deriveTerrainSemanticTileContentHash
deriveTerrainSemanticTilePacket
Re-exports deriveTerrainSemanticTilePacket
joinTerrainLines
Re-exports joinTerrainLines
keepTerrainSemanticTile
Re-exports keepTerrainSemanticTile
packTerrainSemanticTile
Re-exports packTerrainSemanticTile
placeTerrainYardCars
Re-exports placeTerrainYardCars
resolveTerrainRouteMarker
Re-exports resolveTerrainRouteMarker
sampleTerrainBuildingCoverage
Re-exports sampleTerrainBuildingCoverage
sampleTerrainLine
Re-exports sampleTerrainLine
TERRAIN_RAIL_HEIGHT
Re-exports TERRAIN_RAIL_HEIGHT
TerrainAgricultureGrid
Re-exports TerrainAgricultureGrid
TerrainAgricultureSource
Re-exports TerrainAgricultureSource
TerrainArchiveHeader
Re-exports TerrainArchiveHeader
TerrainArchiveTile
Re-exports TerrainArchiveTile
TerrainBridgeProfileSample
Re-exports TerrainBridgeProfileSample
terrainBuildingCoverage
Re-exports terrainBuildingCoverage
TerrainBuildingCoverage
Re-exports TerrainBuildingCoverage
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
TerrainRailElectrification
Re-exports TerrainRailElectrification
terrainRailElectrified
Re-exports terrainRailElectrified
TerrainRailMode
Re-exports TerrainRailMode
terrainRailOffset
Re-exports terrainRailOffset
TerrainRailService
Re-exports TerrainRailService
terrainRailTrack
Re-exports terrainRailTrack
TerrainRailTrack
Re-exports TerrainRailTrack
TerrainRoadSignCatalog
Re-exports TerrainRoadSignCatalog
terrainRoadSignCatalogSchema
Re-exports terrainRoadSignCatalogSchema
TerrainRoadSignProfile
Re-exports TerrainRoadSignProfile
terrainRoadSignProfileSchema
Re-exports terrainRoadSignProfileSchema
terrainRoadSignProfilesSchema
Re-exports terrainRoadSignProfilesSchema
TerrainRouteMarker
Re-exports TerrainRouteMarker
TerrainRouteShieldLibrary
Re-exports TerrainRouteShieldLibrary
terrainRouteShieldLibrarySchema
Re-exports terrainRouteShieldLibrarySchema
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
TerrainSemanticTileEdit
Re-exports TerrainSemanticTileEdit
terrainSemanticTileFromPacket
Re-exports terrainSemanticTileFromPacket
terrainSemanticTilePacket
Re-exports terrainSemanticTilePacket
TerrainSemanticTilePacket
Re-exports TerrainSemanticTilePacket
TerrainStructureIdentity
Re-exports TerrainStructureIdentity
TerrainTileArchive
Re-exports TerrainTileArchive
TerrainTransportationFeature
Re-exports TerrainTransportationFeature
TerrainWaterFeature
Re-exports TerrainWaterFeature
TerrainYardCarInput
Re-exports TerrainYardCarInput
unpackTerrainSemanticTile
Re-exports unpackTerrainSemanticTile