MVT geometry type (Feature.type).
The local tangent frame the whole scene is rendered in. originEcef is the
ECEF anchor; worldFromEcef rotates+translates ECEF into the engine's Y-up
world (East→+X, Up→+Y, North→−Z) so points near the origin are f32-safe.
ecefFromWorldRot is the inverse rotation (origin-relative), used to map a
world-space camera position back to ECEF for screen-space-error distances.
A streamed geospatial world: terrain + imagery (+ optional buildings) anchored at a longitude/latitude. Renders in both edit and play so the world is visible while authoring.
A GeoJSON vector overlay: bakes a .geojson URL into meshes and renders them,
aligned to the active GeoWorld's frame (or its own lon/lat if there is
none). Polygons extrude to extrudeHeight when positive.
Parsed availability bitstreams of one subtree file. Construct it from the subtree
JSON plus the resolved bytes of each buffer it declares — buffers[i] is the
internal binary chunk for a buffer with no uri, or the fetched bytes for an
external one (see parseSubtree for the internal-only convenience and
parseSubtreeHeader + the traversal for the external path).
Loaded, rebased tile content. Owns the static GltfStaticModel (its non-skinned meshes + textures), all released on cache eviction.
A baked, origin-relative GPU point buffer for a .pnts tile: interleaved
position(float32×3) + color(unorm8×4) (16-byte stride), drawn point-by-point.
A GeoDataSource for MapTiler quantized-mesh terrain via the direct API.
A raster-DEM provider (Seam A). Tile content is fetched through HttpDataSource (so
it shares the persistent Cache-Storage and the data-source log); kind is 'TERRAIN'
since it streams elevation, but it is consumed by RasterDemTileset, not the
quantized-mesh TerrainTileset.
CPU-side terrain elevation lookup for one decoded tile, retained so other
content (e.g. buildings) can be clamped to the ground. Keeps the quantized
surface u/v/height arrays + triangle indices (the heights are otherwise
discarded once baked into the mesh) and buckets the triangles into a uniform
SAMPLER_GRID² grid over u/v, so heightAt is ~O(1) per query.
Land/water lookup for one tile, from the quantized-mesh watermask extension.
A whole-tile flag (size === 1) answers the same for the entire rectangle; a
256×256 grid (size === 256) is sampled at the query's u/v fraction. Rows run
south→north, columns west→east (matching the tile's u/v), and a byte ≥ 128
counts as water (the coastline ramp straddles 128). Retained on
TerrainContent so TerrainTileset.waterAt can answer per point.
Loaded terrain tile: an engine mesh in world space + its material.
Resolved ion endpoint plus the per-asset token / attribution to stream it.
Base for HTTP-backed providers: shared JSON / binary fetch with persistent caching.
Subclasses supply rootUrl, attributions, kind, and — if the
provider authorizes per request rather than via a URL key — override authHeaders.
A 3D-Tiles source from a plain tileset.json URL — no ion/Google auth, so it loads any
public tileset (the CesiumGS/3d-tiles-samples, your own hosting, etc.). The base
HttpDataSource supplies the persistent-cached JSON/binary fetch; tile URIs resolve
relative to rootUrl exactly like an ion 3DTILES source.
Optional instrumentation of data-source loads, for diagnosing what's hitting the network vs. the persistent cache. DISABLED by default: while enabled is false every record call early-returns, so the only cost on the load path is a single boolean test and nothing is retained.
A GeoDataSource for Google Photorealistic 3D Tiles via the direct API.
A vector-tile provider (Seam A). MVT bytes are fetched through HttpDataSource (so they share the persistent cache + data-source log).
A baked vector-tile's drawables (here, one merged building mesh) + its point labels. Structurally matches the drawable contract GeoScene renders (drawables + bakeOriginEcef + lodLevel).
A half-open-ish time interval (inclusive of both ends for contains).
A position that never changes.
A position defined by timestamped ECEF samples, interpolated between them — the analog
of CesiumJS SampledPositionProperty. Samples are kept sorted; getValueEcef clamps to
the first/last sample outside the sampled range (so a tracked object holds at the ends
rather than vanishing). Linear and Lagrange (configurable degree) interpolation.
A simulation clock — the analog of CesiumJS Clock. Advances currentTime by
multiplier × dt each tick, honoring clockRange at the bounds.
A single parsed show / color / define expression.
A clipping plane anchored on the ellipsoid. Content on the side the normalEnu
points away from is hidden (matching Cesium: the normal points toward what is
kept). The normal is given in the local East–North–Up frame at the anchor, so e.g.
{ u: 1 } keeps everything above the anchor height (a horizontal floor cut) and
{ e: 1 } keeps everything east of the anchor (a vertical wall facing west).
A clipping polygon footprint (a single ring of >= 3 geographic positions).
A point in any of our frames (plain f64 numbers, never f32).
A frozen copy of a GeoFrame's placement — its ECEF origin plus the ENU tangent basis — enough to map that frame's world coordinates back to ECEF. Stamped on baked geometry so a later, REORIENTED frame can place it with the correct rigid transform (continuous reorientation / RTC) instead of needing the geometry re-baked.
A geographic rectangle in radians (west/south/east/north).
A quadtree tiling scheme over the globe: how many tiles tile the world at each
level, and the geographic rectangle of any tile. Quantized-mesh terrain endpoints
use either the geographic (EPSG:4326, the default — 2 root tiles wide, square 2:1
tiles) or the Web Mercator (EPSG:3857 — a single square root tile) scheme; the
traversal reads which one from layer.json's projection field. Abstracting it
keeps TerrainTileset from hardcoding the geographic root count / rectangle.
Options for a 3D Tiles tileset added to a GeoScene.
Options for a vector-tile tileset added to a GeoScene.
Options for a terrain tileset added to a GeoScene.
Per-frame camera/selection inputs for GeoScene.update.
What GeoScene.update produced this frame. All arrays are owned and reused (pooled) across frames — copy them if you need to retain past the next update.
Cache-budget settings shared by every tileset's TileCache.
Options for GeoScene.attach: everything GeoFeatureOptions needs minus
scene (it's the scene attach is called on), plus optional one-call floating-origin
wiring.
Implicit coordinates relative to the implicit root (z unused for quadtree).
Per-implicit-tileset configuration, built once from the implicitTiling tile
and shared by every tile generated under it.
Anything the cache can hold: it must report its cost and release GPU memory.
One drawable primitive of a tile, with its rebased engine transforms.
One tile to draw this frame: its loaded content and the cross-fade alpha to render it with (1 = fully opaque; < 1 = screen-door dithered over the coarser tile below).
Boundary vertex index lists, in the order quantized-mesh stores them.
A descendant-availability range in the metadata extension (TMS tile coords).
Decoded metadata extension JSON. available[offset] lists the tile ranges
available at level tileLevel + offset + 1 — lets refinement go deeper than the
layer.json available array enumerates.
The quantized-mesh watermask extension (id 2): per the spec, either a single
byte covering the whole tile, or a 256×256 row-major grid — 255 = water,
0 = land (intermediate values appear along coastlines). Rows run south →
north and columns west → east, the same orientation as the tile's u/v
(so row index maps to the v fraction, column to the u fraction).
Options for a RasterDemSource.
The rigid floating-origin frame as plain transferable data, so the bake can run in
a worker. worldFromEcef is the f64 column-major world←ECEF matrix; the basis
vectors rotate ECEF directions (normals) into world space. Mirrors the relevant
fields of GeoFrame.
The result of baking — the three arrays the GPU terrain mesh is built from.
The decoded-tile inputs a bake needs, bundled for one TerrainBakePool.bake.
The minimal parent-surface data upsampleQuantizedMesh reads: quantized u/v/height plus the surface triangle indices and the parent's height range (to de-quantize heights into meters before re-quantizing to the child's own range). These are exactly the arrays a TerrainHeightSampler already retains.
A line of attribution text (HTML) that must be displayed while a source is on
screen. collapsible marks long provider lists that a UI may fold away.
The minimal surface Tileset3D / TerrainTileset need from a provider.
One retained load event — a network download or a persistent-cache hit.
A Web Mercator (EPSG:3857) XYZ raster imagery source for draping over terrain.
Options for xyzImagery, a generic {z}/{x}/{y} slippy-map source.
A rectangular block of Web Mercator tiles at one zoom, draped as a single
composited texture. (x0,y0) is the north-west tile; the block is
cols × rows tiles, each 256².
Per-layer color / opacity adjustments, applied at composite time. Every field defaults to a
no-op (alpha/brightness/contrast/gamma/saturation = 1, hue = 0).
One provider in a stack + its adjustments.
An ordered imagery stack (layer 0 is the base; later layers composite on top).
One batch of line segments to draw: the instance buffer (see buildLineSegments), the segment count, and the world model matrix (origin-shift), like a point-cloud draw.
A point primitive (one of a Point / each part of a MultiPoint).
A polyline primitive (a LineString / each part of a MultiLineString).
A polygon primitive (a Polygon / each part of a MultiPolygon). rings[0] is the
exterior ring; any further rings are holes. Rings keep their GeoJSON winding (exterior
CCW, holes CW per the spec) but the builders are orientation-agnostic.
The flat, primitive-typed result of parseGeoJson — three lists ready for the
builders, with Multi* parts already expanded.
A point feature's stable anchor for the label / billboard feature: an ECEF position (so it survives floating-origin reanchors), plus its properties / id.
Per-geometry-kind styling for a baked layer. A heightAt set here (or on each sub-option)
drapes geometry onto streamed terrain.
One baked, drawable mesh + the material to draw it with.
A successful GeoJsonLayer.pick: the feature id + its properties + the world hit point.
Options for geoJsonPointLabels.
A draped polygon layer.
A draped line layer (rendered as a metric-width ribbon).
An extruded (building) layer.
A label (symbol) layer — point features whose textField property becomes a map label.
The vector layers grouped by how they become 3D geometry (+ labels).
Result of parsing a full MapLibre style document.
A decoded feature: its geometry as rings of tile-local points + decoded properties.
A decoded layer.
Options for a VectorTileSource. Provide template for a direct {z}/{x}/{y} URL, or
tilejson to resolve the template (+ max zoom) from a TileJSON document at init — many hosts
(e.g. OpenFreeMap) put a rotating version segment in the real tile path, so the bare path is a
stub; the TileJSON is the source of truth.
Render-time terrain-clamp anchor for a baked tile: the tile is baked once against the terrain height at build time, then GeoScene nudges its whole draw vertically each frame by the delta between the live terrain height under its center and buildHeight — so it conforms continuously as terrain refines, instead of re-baking.
Debug isolation knobs (set from geo_osm_buildings's ?only=/?onlyId= for diagnosing
building z-fighting). Off in normal use.
One water tile to draw: its conformed surface mesh (tile-local UVs in slot 2), the world model matrix (origin-shift), and the per-tile mask texture view.
Live look controls, read each frame.
One parsed CZML entity.
A parsed CZML document.
A position that may vary with time, evaluated in ECEF.
Options for Clock.
A heading/pitch point-of-view in degrees (Google's convention: heading 0 = north, CW).
An RGBA color in 0–1 (the result type of color() / rgb() expressions).
The JSON form of a 3D Tiles style.
Loads a value; receives an AbortSignal so a stale request can cancel its fetch.
How a DEM tile's RGB encodes meters of elevation.
What a source streams, so a caller can pick the right tileset class without knowing the provider: a 3D Tiles tree, quantized-mesh terrain, or raster imagery.
A GeoJSON position: [lon, lat] or [lon, lat, altitude] (degrees / meters). Altitude
defaults to 0 when absent.
A feature's free-form properties (GeoJSON allows any JSON; null when the feature has none).
A terrain height sampler: meters above the ellipsoid at a lon/lat (degrees), or null when no streamed terrain covers the point (the caller falls back to ellipsoid height).
An RGBA color in 0–1.
Interpolation algorithm for SampledPositionProperty.
How the Clock treats reaching its stopTime.
Imagery preset choices exposed by GeoWorld.
A feature's properties (the getAll bag of a FeatureTable, or any plain object).
WGS84 ellipsoid semi-major axis (meters).
WGS84 semi-minor axis (meters).
Cesium's default geographic scheme (EPSG:4326): 2 root tiles in longitude, 1 in latitude; each tile spans equal lon/lat steps.
Maximum geodetic latitude (radians) Web Mercator can represent — the square cutoff at ±~85.05°, where the projection's normalized Y reaches ±π.
Web Mercator scheme (EPSG:3857): a SINGLE square root tile covering the world in both axes (latitude clamped to ±WEB_MERCATOR_MAX_LATITUDE), quartered per level. Tile rows are equal steps in the Mercator Y, so their geographic latitude bands narrow toward the poles (unprojected here via the inverse Gudermannian).
Default target screen-space error (pixels) for a tileset — CesiumJS's default
maximumScreenSpaceError. Lower = sharper / more tiles. Overridable per instance
via Tileset3D.maxSSE / TerrainTileset.maxSSE.
Default render-distance cap (world meters) for a 3D-Tiles set — see
Tileset3D.maxRenderDistance. Buildings beyond this are skipped; set the
tileset's maxRenderDistance = Infinity to draw to the horizon.
Priority offset added to a preload-ring (off-screen) load so it always sorts AFTER every in-view load in the cache's priority dispatch — warming the ring must never delay a visible tile. Larger than any real camera-to-tile distance (≫ a planet diameter), so ring loads only start once the on-screen frontier is busy.
Max selection-leaf tiles a single frame's preload-ring walk will request, a safety bound on the warm traversal (the cache's concurrency cap already bounds the loads that actually start).
Largest u/v/height quantization value (15-bit).
AWS Terrain Tiles (Mapzen Terrarium encoding) — global, no API key.
Heightmap geometric error at level 0 (meters), per Cesium's estimate for the
geographic scheme: a · 2π · quality / (tileWidth · rootTilesX) with
quality 0.25, tileWidth 65, rootTilesX 2. Halved each level.
Interleaved vertex stride in floats — must equal VERTEX_STRIDE / 4 from
mesh.js (48 bytes / 4 = 12 floats: pos3, normal3, uv2, tangent4). Defined here
(not imported) to keep this module free of the GPU-side mesh.js; the caller
asserts the two agree.
Well-known Cesium ion asset IDs used by the sample's dataset switcher.
Shared, optional data-source load log — off by default (see DataSourceLog).
Esri World Imagery (the default drape): global aerial, no key for light/dev use.
Note the non-standard /{z}/{row}/{col} = /{z}/{y}/{x} path order.
Standard OpenStreetMap raster tiles. NB the OSMF tile servers carry a usage policy that forbids heavy/bulk use — fine for dev, but self-host or use Carto/Stadia/MapTiler for anything shipping.
CARTO Positron ("light") basemap — OSM-derived, clean cartography, generous free tier.
CARTO Dark Matter basemap — OSM-derived dark cartography.
CARTO Positron LABELS-ONLY — place/road labels on a TRANSPARENT background, for compositing as an OVERLAY layer over aerial imagery (the classic "satellite + labels" stack).
CARTO Dark Matter LABELS-ONLY (transparent), for an overlay over dark / night imagery.
CARTO Positron at 2× (512 px) — sharper draping on high-DPI displays (4× the texels per tile).
Stadia Alidade Smooth — light, low-contrast OSM basemap (keyless from localhost).
Stadia Alidade Smooth Dark.
Attribution string that must be shown when the default Esri World Imagery is displayed. (Per-provider attribution now lives on ImageryProvider.attribution.)
Convenience: the default single-layer stack (Esri aerial), for callers that want the stack API.
The built-in style used when a VectorTileset is given no MapLibre style — matches the original hand-coded buildings + roads + water/greenery look (OpenMapTiles schema).
OpenFreeMap — free, key-less OpenMapTiles-schema vector tiles (https://openfreemap.org). The real tile path carries a rotating version segment, so resolve it from the TileJSON.
Max clipping planes (matches the planes array in geometry.wgsl).
Max clipping-polygon vertices (matches the poly array in geometry.wgsl).
Byte size of the clipping uniform buffer.
Loads a glb and returns a TileContent (so the main loop can draw it exactly like a tile) placed at the given geolocation. Reuses the tile drawable builder; the model's own GltfModel is owned by the returned content.
Geodetic (lon/lat in radians, height in meters above the ellipsoid) to ECEF.
Defaults to the WGS84 (Earth) ellipsoid; pass a/b to convert on another body —
e.g. the Moon's sphere (a = b = 1,737,400) for Cesium Moon Terrain region bounds,
interpreted in that body's own fixed frame. For a sphere (a == b) the eccentricity is
0, so this reduces to the plain spherical mapping.
Convenience: geodetic in degrees → ECEF.
ECEF → geodetic (lon/lat in radians, height in meters) via Bowring's closed form, which is accurate to well under a millimeter for terrestrial heights.
Column-major product a · b (applies b first when transforming a point).
Transforms a point (w=1) by a column-major f64 matrix.
Builds an f64 matrix from a 3D Tiles / glTF column-major 16-number array.
Column-major translation matrix.
Converts a fully composed, origin-relative f64 matrix to an engine Mat4. Only call this once the matrix's translation has been rebased near the world origin — collapsing a raw ECEF matrix to f32 would jitter.
Cesium's default geographic tiling scheme: level 0 has two tiles covering [−π, π] × [−π/2, π/2], each subsequent level quarters every tile. Returns the rectangle (radians) of tile (x, y, level), with y measured from the north.
Picks the tiling scheme from a quantized-mesh layer.json projection string:
"EPSG:3857" / "mercator" / "EPSG:900913" → Web Mercator; anything else
(incl. undefined / "EPSG:4326") → geographic.
Reanchors the floating origin under the camera when it roams past reanchorDist meters
from the origin, shifting the camera GameObject to compensate so nothing moves on
screen. World coordinates stay small (f32-safe) at planetary distances.
Interleaves the low bits of x, y (and z for octree) into a Morton index.
Availability bit index of a tile within the subtree that contains it, from its
local level + local Morton index: levelOffset(localLevel) + morton.
Availability bit index of a child subtree (single level, no level offset).
Subdivides a root region (radians/meters) to an implicit tile's region. y is
measured from the south, matching CesiumJS.
Subdivides a root box (12 numbers: center, x/y/z half-axes) for a QUADTREE
tile — the x and y half-axes shrink and the center shifts; the z (vertical)
half-axis is kept (height is not subdivided in a quadtree).
Subdivides a root box for an OCTREE tile — like deriveBoxQuadtree but
ALL THREE half-axes shrink and the center shifts along the z (vertical) axis too
(an octree subdivides height as well as the horizontal extent).
Subdivides a root region for an OCTREE tile — like deriveRegion but the
height range [minH, maxH] subdivides along z as well (z from the bottom).
Parses a .subtree binary into its JSON + internal binary chunk, WITHOUT
resolving availability — so the caller can resolve external buffers (an async
fetch) before building the Subtree.
Resolves the per-buffer byte arrays a Subtree needs. A buffer with no
uri is the file's internal binary chunk; an external one (uri set) is fetched
through fetchExternal (the caller resolves the URI against the subtree's base).
No declared buffers → bufferViews reference the internal binary as buffer 0.
Parses a .subtree binary with INTERNAL availability buffers only (no fetch). A
referenced external buffer leaves its slot unresolved, so building the subtree
throws — use parseSubtreeHeader + resolveSubtreeBuffers for those.
Builds the shared context from a tile's implicitTiling JSON + content template.
The subtree root (level/x/y) that governs a tile at the given coordinates.
Substitutes {level}/{x}/{y}/{z} (and {version}-style) placeholders.
Host bucket of a cache key, for the per-host concurrency cap: the origin host of
an absolute URL key (https://host/... → host), or the empty string for a
synthetic key with no :// (e.g. an upsample fill, which does no fetch of its own
— grouping them costs nothing). Avoids new URL (which throws on relative keys
and is far slower than a couple of indexOfs called once per pending request).
World matrices for every glTF node, in the model's local (Y-up) space.
Loads tile content bytes into rebased, engine-ready drawables.
Builds rebased drawables for every primitive of a loaded glTF, given the f64
contentToWorld matrix that maps the model's local (Y-up) space into the
engine world frame. Shared by tile content and the geolocation anchor.
Lazily-created shared decode pool (workers spawn on first TileDecodePool.decode).
Dilates frustum planes outward by margin world meters, for the preload ring:
tiles within margin of the real frustum (just off-screen) pass the dilated test
and get their content warmed, so a quick pan doesn't reveal an unloaded hole. With
normalized inward-normal planes (n·w + d ≥ 0 inside), pushing a plane out by m
is just d += m. Returns the input array unchanged when margin ≤ 0.
Extracts 6 normalized frustum planes (inward normals) from a column-major view-projection matrix (clip = M · world).
Screen-space error of a tile in pixels — CesiumJS's metric: a tile's geometric error projected to the screen at its camera distance. Lower target = sharper / more tiles. Returns 0 for a non-positive geometric error (a tile with no error never refines).
Streaming load priority (smaller = more urgent): camera distance, pulled forward for tiles far over the error budget so the cache resolves the most visible error first. Bounded to (0, distance], so a near tile is never starved by a far high-error one.
Builds a MapTiler terrain source for a MapTiler Cloud API key. Optional — Cesium World Terrain via ion is the default; this is the ion-free alternative.
Decodes a quantized-mesh-1.0 terrain tile from its raw bytes.
Decodes one DEM pixel's RGB to meters. terrarium (Mapzen/AWS):
MapTiler terrain-rgb (keyed).
Repackages a decoded DEM height grid as a synthetic QuantizedMeshTile: a regular
res × res vertex grid over the tile's geographic rectangle, so buildTerrainContent
bakes it exactly like a real quantized-mesh tile (world-space transform, skirts, height
sampler, imagery UVs). res is the output mesh resolution (vertices per side); the source
grid is bilinear-downsampled to it.
Decodes a PNG/WebP DEM tile (bytes) to an size × size Float32 height grid in meters.
Uses createImageBitmap + an OffscreenCanvas read-back, so it runs in the
browser (and workers); it is intentionally absent from the pure demToQuantizedMeshTile
path so that stays unit-testable without a canvas.
Builds a world-space Mesh + terrain material from a decoded
quantized-mesh tile and its rectangle. When a drape is supplied the mesh gets
Web Mercator UVs into the imagery tile and the imagery as an albedo map (vertex
colors go white so it shows pure); otherwise vertices carry an elevation-ramp
color and the surface renders as flat shaded terrain.
Bakes a decoded quantized-mesh tile into interleaved world-space vertices, colors,
and indices, including the skirt curtain. When drapeBlock is set, vertices get
Web Mercator UVs into the imagery block and white vertex colors (so the imagery
shows un-tinted); otherwise they get tile-local UVs and an elevation-ramp color.
Elevation color ramp (blue water → green → brown → gray → snow).
The skirt-curtain depth (meters) for a tile, exactly CesiumJS's model: 5× the level's
maximum geometric error (createQuantizedMeshTerrainData's
getLevelMaximumGeometricError(level) * 5.0). This is small at fine LODs — just enough
to hide the inter-LOD cracks, whose size is bounded by the geometric error — so skirts
never dangle as tall curtains in high-relief terrain. (An earlier version floored this
at the tile relief ×1.5, which produced hundred-meter curtains over canyons; Cesium has
no such term.) Shared by the inline and worker bake so both produce identical geometry.
Lazily-created shared bake pool (workers spawn on first TerrainBakePool.bake).
Builds a synthetic child QuantizedMeshTile for child quadrant (dx, dy)
of a parent surface, by clipping the parent triangles to that quadrant. dx is
0 (west) or 1 (east); dy is 0 (north) or 1 (south) — matching the engine's
north-down tile-y convention, where v=0 is the south edge so the north child
(dy=0) takes the parent's upper-v half.
Resolves an ion asset endpoint. ionToken is the user's Cesium ion access token
(from the in-page field).
Fetches binary tile content with persistent Cache-Storage caching + data-source logging — the
shared engine behind HttpDataSource.fetchArrayBuffer. Exposed as a free function so
loaders that aren't a GeoDataSource can opt into the SAME persistent cache and hit-ratio
logging: notably the public raster imagery in imagery.ts, which has no auth header and so
previously leaned only on the browser HTTP cache (invisible to the cache HUD, not durable).
Resolves a 3D Tiles / terrain uri relative to its parent tileset URL, inheriting
any query parameters the parent carries that the child omits. This is how a key /
session token propagates down a tree: the parent (root) URL holds ?key=… (Google,
MapTiler) and/or the response embeds a ?session=… (Google Photorealistic), and
every descendant request inherits whatever it doesn't already specify.
Builds a Google Photorealistic 3D Tiles source for a Map Tiles API key. Optional — the default datasets still flow through Cesium ion; this is the ion-free alternative.
The deepest (highest-resolution) Web Mercator tile that fully contains the geographic rectangle — so a single imagery fetch covers the whole terrain tile and every vertex UV lands in [0,1].
UV of a lon/lat (radians) within tile (v=0 at the tile's north edge).
Builds an ImageryProvider from a standard XYZ URL template — covers OSM and almost every OSM-derived basemap (Carto, Stadia, self-hosted tileserver, …).
Stadia Maps raster basemap (OSM-based, retina 512 px). Keyless from localhost / an allowed
domain; pass a Stadia key for production. style is e.g. alidade_smooth,
alidade_smooth_dark, osm_bright, outdoors. See https://stadiamaps.com.
Tile URL for a provider (default Esri). Back-compat shim; prefer ImageryProvider.url.
The deepest Mercator tile block (≤ MOSAIC_MAX_PER_AXIS tiles per axis)
that covers the geographic rectangle. Deeper than mercatorTileForRect
(which is limited to one tile) and immune to its straddle step-back.
A Mercator tile block covering the rectangle at a specific zoom z (vs
mercatorBlockForRect, which picks the deepest zoom ≤ MOSAIC_MAX_PER_AXIS
per axis). Used by loadImageryWithFallback to step to a coarser, more
widely-available level when the deepest block 404s. Coarser zooms cover the rect in
fewer tiles, so the per-axis count only shrinks.
UV of a lon/lat (radians) within a MercTileBlock (v=0 at the block's north edge), i.e. into the composited mosaic texture.
Fetches every tile of a MercTileBlock and composites them into one sRGB
texture (cols·256 × rows·256). Tiles are placed by copyExternalImageToTexture
into their grid cell; a failed tile leaves its cell zero-cleared (rare at valid
zooms). Throws only when every tile failed, so the caller can fall back to flat
coloring (mirrors the single-tile path).
Loads the imagery mosaic for a terrain tile's rectangle, falling back to progressively COARSER Mercator zooms when the deepest block can't be fetched (typically Esri 404s for areas it doesn't cover to the deepest level). This is the imagery-pyramid equivalent of CesiumJS draping a ready ancestor imagery tile while the exact-level one is unavailable: rather than dropping the tile to the flat elevation ramp, it keeps real aerial imagery at a lower resolution. Returns the texture together with the block it was actually loaded at (so the terrain vertex UVs map into the right block), or null only when every level — down to the world-spanning z0 — failed (genuine network outage), where the caller falls back to the elevation ramp.
Fetches one imagery tile and uploads it as an sRGB Texture. Goes through the shared persistent Cache-Storage path (fetchTileBytes), so repeats are served from the same durable store as ion/DEM/vector tiles. Throws on HTTP error so the caller can fall back to flat coloring.
Builds an ImageryStack from an ordered layer list (base first).
Combined attribution for every provider in a stack (deduped, " · "-joined).
Pure mirror of the compositor shader's block remap: the UV into layer's block for the texel
at UV uv of base's block (both Web Mercator). Exposed for unit testing the math without a
device. When the two blocks are the same it's the identity.
Loads + composites an ImageryStack for a terrain tile's rectangle into one draped texture, mirroring loadImageryWithFallback's return shape (so the terrain path is unchanged). Each layer's mosaic is fetched best-effort; failed layers are dropped, and the first that loads becomes the base block. A single identity layer skips the composite pass. Returns null only when every layer failed (→ caller falls back to the elevation ramp).
Parses a GeoJSON object (a FeatureCollection, a Feature, a GeometryCollection, or a
bare geometry) into a ParsedGeoJson. Malformed parts are skipped rather than
thrown on, so one bad feature doesn't drop a whole dataset; pass an already-JSON.parsed
object (this module does no fetching).
Bakes polygon features into one merged world mesh: a triangulated fill (hole-aware), or —
when extrudeHeight resolves above the base — extruded prisms (vertical walls with outward
horizontal normals + a flat roof cap). Returns null when nothing was emitted.
Bakes polyline features into a flat ribbon mesh of constant world width: each segment is a quad offset ±half-width perpendicular to its direction in the local tangent plane, the vertices welded at joints (a simple miter-free strip). Returns null when nothing emitted.
Bakes polyline features into a flat instance buffer of world-space SEGMENTS for a
screen-constant-width line pass (each consecutive vertex pair → one instance). Unlike
buildPolylines (which makes a constant-WORLD-width ribbon mesh for the deferred
path), this leaves the width to the line feature's vertex shader. Layout per instance:
posA(3) posB(3) rgba(4) = 10 floats / 40 bytes. Returns null when nothing was emitted.
Resolves point features to ECEF anchors (no world geometry — points render as screen-space labels / billboards, which want a stable ECEF position).
Resolves polygon features to ECEF label anchors at each exterior-ring centroid — so a park /
building can carry a name label even though it isn't a point feature. The anchor sits at the
roof height for an extruded polygon (else the base), plus labelHeightOffset.
Maps GeoJSON anchors to GeoLabels: text from opts.textProperty (default name),
ECEF anchor straight through. Anchors missing a non-empty string value are skipped.
Fetches + parses a GeoJSON document by URL. No tiling — GeoJSON is a single document, so this
is a plain cached fetch (not the tileset HttpDataSource machinery); throws on a
non-OK response or HTML (a misrouted error page) instead of a JSON body.
Parses a CSS color string (hex / rgb()/rgba() / hsl()/hsla() / a few names) to LINEAR RGB, or undefined for an expression / unrecognized value (the caller then uses a default).
Evaluates a MapLibre filter (legacy ['==','class','grass'] or expression
['==',['get','class'],'grass']) against a feature's properties. Handles the common operators;
anything it doesn't recognize passes (so a feature is never wrongly dropped). $type/geometry
comparisons always pass (the build buckets already separate points/lines/polygons).
Parses a MapLibre style document into the builder config, evaluating zoom-dependent values at
zoom (use the tile zoom the layers will render at — ~14 for buildings).
Fetches + parses a MapLibre style JSON from a URL.
Decodes an MVT tile into its layers. Gzip is NOT handled here — pass already-inflated bytes
(providers serve .pbf either raw or Content-Encoding: gzip, which the browser inflates).
Signed area of a ring (shoelace). In MVT's y-down tile space an exterior ring is clockwise → positive area; a hole is counter-clockwise → negative.
Ear-clipping triangulation of a simple polygon (no holes), returning index triplets into the input ring. Orientation-agnostic: the ring is normalized to CCW first, and the result is used with double-sided rendering, so world winding doesn't matter.
MapTiler OpenMapTiles vector tiles (keyed).
Geographic rectangle (radians) of a Web Mercator XYZ tile. y is north-down (slippy): row 0 is
the north edge.
Tight bounding sphere (ECEF) of a tile's geographic rectangle between minH/maxH (m): the
centroid + max-distance of the 18 corner/edge/center samples at both heights.
Parse a CZML document (already JSON.parsed — an array of packets) into a
CzmlDocument. The document packet supplies the Clock; every other
packet becomes a CzmlEntity.
Fetch a CZML document by URL and parse it.
The GeoScene currently active for an engine (set by a GeoWorld), or null.
Register the geo component factories (idempotent; called on module import).
Parse an ISO-8601 time (2026-06-14T12:00:00Z) to epoch seconds. Throws on a bad string.
Format epoch seconds back to an ISO-8601 string (UTC).
The geospatial streaming stack: an f64 floating-origin frame (GeoFrame), a multi-tileset scene orchestrator (GeoScene) and its engine integration (GeoFeature), quantized-mesh terrain (TerrainTileset) and 3D-Tiles (Tileset3D) streaming, data sources (Cesium ion, Google, MapTiler), imagery, water, and the geodesy/decoding helpers underneath.
Imported via the
taos/geosubpath rather than the top-leveltaosbarrel, e.g.import { GeoScene, GeoFrame } from 'taos/geo';.The Worker entry points (
tile_decode_worker.ts,terrain_bake_worker.ts) are intentionally NOT re-exported here — they run in a worker context and would execute their top-level code if pulled into the main thread.