Skip to content

Quantized Mesh Source

A quantized-mesh source describes Cesium quantized-mesh terrain. Render it with a terrain layer. By default it is treated as geographic (EPSG:4326) with a TMS (south-origin) Y axis, matching Cesium’s convention.

PropertyTypeDefaultDescription
type"quantized-mesh"(required)Source type.
urlstring(required)Tile URL template (contains {z}/{x}/{y}).
geographicbooleantrueUse a geographic (EPSG:4326) tiling scheme; otherwise WebMercator.
tmsbooleantrueWhether the tile Y axis is south-origin (TMS).
requestVertexNormalsbooleanfalseRequest the oct-encoded per-vertex normals extension (octvertexnormals Accept header).
requestWaterMaskbooleanfalseRequest the watermask extension (watermask Accept header).
tokenstringBearer token sent as the Authorization header when fetching tiles.
minZoomnumber0Minimum zoom level tiles are provided for.
maxZoomnumber20Maximum zoom level new tiles are requested for.
overscaledMaxZoomnumber24Maximum zoom overscaled tiles are used up to.
import ThreeView from "@navaramap/three";
const terrain = view.addSource({
type: "quantized-mesh",
url: "https://example.com/terrain/{z}/{x}/{y}.terrain",
requestVertexNormals: true,
});
view.addLayer({ type: "terrain", source: terrain });
// Style the terrain mesh with `terrain`.
view.addLayer({
type: "terrain",
source: terrain,
terrain: { skirt: true, castShadow: true },
});