@nika-js/onlymap 0.13.0 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/README.md +2 -2
- package/bin/dem-tiles.mjs +270 -0
- package/bin/onlymapjs.mjs +138 -34
- package/dist/{basemap-BxqFTBzX.js → basemap-CdSCIWCl.js} +473 -443
- package/dist/basemap.d.ts +16 -3
- package/dist/{build-D4iI8O9b.js → build-CUx4yR_O.js} +10 -10
- package/dist/camera-altitude.d.ts +29 -0
- package/dist/{client-BYFePLZV.js → client-DVkMuuPp.js} +2 -2
- package/dist/color.d.ts +15 -0
- package/dist/credit-chrome.d.ts +11 -0
- package/dist/elements/om-map.d.ts +41 -1
- package/dist/geodesy.d.ts +2 -0
- package/dist/{geoparquet-BV32P0nI.js → geoparquet-DuCEsCOu.js} +3 -3
- package/dist/{globe-view-B_X6obse.js → globe-view-BWNfn-Sx.js} +1 -1
- package/dist/ground-controller.d.ts +39 -0
- package/dist/{hillshade-9VS_t-Ks.js → hillshade-DyfYxqNm.js} +61 -64
- package/dist/{hillshade-shader-DI2uLSNU.js → hillshade-shader-BWA0USDQ.js} +12 -11
- package/dist/hillshade-shader.d.ts +2 -2
- package/dist/hillshade.d.ts +0 -29
- package/dist/{index-IDWDfgTC.js → index-BfHaNHyY.js} +20687 -19351
- package/dist/{index-JewSBOjJ.js → index-CCj9Z5yt.js} +38 -38
- package/dist/{index-D40H3fpl.js → index-Cc3huYsW.js} +62 -62
- package/dist/{index-Bct9VWxi.js → index-DRGcZmBm.js} +1 -1
- package/dist/{index-eSuCj2Bn.js → index-DYrgHprN.js} +61 -61
- package/dist/{index-D3P6Cfbr.js → index-DabUE8w3.js} +38 -38
- package/dist/{index-CbFw6P0B.js → index-DfzI_j0D.js} +1 -1
- package/dist/{index-Di1LK4JT.js → index-DiDoH_BG.js} +3 -3
- package/dist/{index-BR_5FIN1.js → index-dUoVyYIW.js} +18 -18
- package/dist/index.d.ts +1 -1
- package/dist/{lerc-C42a0ISa.js → lerc-CUV0h9Ci.js} +1 -1
- package/dist/onlymap.standalone.js +37891 -36442
- package/dist/onlymapjs.js +49 -49
- package/dist/plane-gpu/plane-basemap.d.ts +0 -14
- package/dist/{post-process-effect-ktcgAjmv.js → post-process-effect-DPrpqybM.js} +1 -1
- package/dist/programmatic.d.ts +3 -1
- package/dist/{raster-CIxg_M_1.js → raster-CrRQNJE7.js} +4 -4
- package/dist/{raster-pipeline-BODPC9vJ.js → raster-pipeline-D9g8RAo4.js} +11 -11
- package/dist/runtime-core.d.ts +132 -0
- package/dist/sea-surface.d.ts +18 -0
- package/dist/terrain-derive.d.ts +39 -0
- package/dist/terrain-ground.d.ts +31 -0
- package/dist/terrain-heightfield.d.ts +17 -9
- package/dist/terrain-inspect-GowNVtMZ.js +96 -0
- package/dist/terrain-inspect.d.ts +34 -0
- package/dist/terrain-nodata.d.ts +50 -0
- package/dist/terrain-priority.d.ts +92 -0
- package/dist/terrain-sample.d.ts +6 -0
- package/dist/terrain-skirt.d.ts +6140 -0
- package/dist/terrain-texture-mask.d.ts +40 -0
- package/dist/terrain-tint.d.ts +61 -0
- package/dist/terrain.d.ts +132 -8
- package/dist/{text-on-path-LZL6NfwZ.js → text-on-path-BoFbm-tl.js} +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/viewport-filter.d.ts +9 -0
- package/dist/volumetrics.d.ts +11 -0
- package/dist/{zarr-D19fNIZt.js → zarr-C8CU8LXU.js} +2 -2
- package/docs/cartograph.md +2 -2
- package/llms.txt +1 -1
- package/onlymapjs.html-data.json +162 -2
- package/package.json +2 -1
- package/skills/onlymapjs/SKILL.md +5 -2
- package/skills/onlymapjs/references/syntax.md +3 -3
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drape a terrain texture on one side of sea level only
|
|
3
|
+
* (docs/design/underwater-terrain.md, Phase F): `terrain-texture-mask="land"`
|
|
4
|
+
* — imagery on the land, the bare seabed under the sea, so a basemap gives
|
|
5
|
+
* the coast its towns and fields without hiding the seafloor it would
|
|
6
|
+
* otherwise paint over as flat blue. `"sea"` is the reverse (a chart on the
|
|
7
|
+
* seabed, the land left bare).
|
|
8
|
+
*
|
|
9
|
+
* The test is the mesh vertex's own decoded height (metres × exaggeration —
|
|
10
|
+
* the decoder carries it, so the sign is the true one), interpolated per
|
|
11
|
+
* fragment: a coastline as sharp as the mesh, at any zoom, read from the same
|
|
12
|
+
* DEM the ground is drawn from. It is read as `geometry.worldPosition.z`, not
|
|
13
|
+
* the `positions` attribute: luma emits hook functions BEFORE the layer's own
|
|
14
|
+
* source, so nothing the layer declares (`positions`, `vColor`) is visible
|
|
15
|
+
* in a hook. A terrain tile's mesh composes its model matrix (CARTESIAN, no
|
|
16
|
+
* instance offset), so the two are the same value.
|
|
17
|
+
*
|
|
18
|
+
* Injected at DECKGL_FILTER_COLOR before the slope tint (order −2 to its −1)
|
|
19
|
+
* and before deck's terrain module composites draped layers there: what is
|
|
20
|
+
* masked is the mesh's OWN texture, never a draped layer — a marker draped on
|
|
21
|
+
* the seabed stays drawn. The bare colour is the mesh's untextured one, and
|
|
22
|
+
* deck lights it afterwards, as it would an untextured terrain.
|
|
23
|
+
*/
|
|
24
|
+
import { LayerExtension } from "@deck.gl/core";
|
|
25
|
+
import type { Layer } from "@deck.gl/core";
|
|
26
|
+
export type TerrainTextureMask = "land" | "sea";
|
|
27
|
+
type MaskProps = {
|
|
28
|
+
terrainTextureMask?: TerrainTextureMask;
|
|
29
|
+
getColor?: unknown;
|
|
30
|
+
};
|
|
31
|
+
/** Keep a terrain mesh's texture on the land (`"land"`) or the seabed (`"sea"`); the rest is drawn bare. */
|
|
32
|
+
export declare class TerrainTextureMaskExtension extends LayerExtension {
|
|
33
|
+
static extensionName: string;
|
|
34
|
+
static defaultProps: {
|
|
35
|
+
terrainTextureMask: string;
|
|
36
|
+
};
|
|
37
|
+
getShaders(): unknown;
|
|
38
|
+
draw(this: Layer<MaskProps>): void;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Colour a terrain by its shape (docs/design/underwater-terrain.md, Phases D
|
|
3
|
+
* and G). `terrain-tint` takes either or both of:
|
|
4
|
+
*
|
|
5
|
+
* - `slope` — flat ground one colour (sediment), steep ground another (rock),
|
|
6
|
+
* blended between 15° and 35° of TRUE slope (the map's exaggeration divided
|
|
7
|
+
* out), so canyon walls read as rock and floors as sand with no texture of
|
|
8
|
+
* your own. The colleague's 0.4.3 page baked this into its texture tiles;
|
|
9
|
+
* here it is a few lines of shader over any DEM.
|
|
10
|
+
* - `depth` — ground below sea level seen as if through water: the shallow
|
|
11
|
+
* colour tints it at the coast, and the deep colour takes over with depth,
|
|
12
|
+
* entirely at `terrain-tint-max-depth` (true metres) — along a square-root
|
|
13
|
+
* ramp, since most of a map's seabed is shelf and a straight one would leave
|
|
14
|
+
* the first few hundred metres looking alike. Land is left alone, so the
|
|
15
|
+
* coastline is where the colour starts: a seabed reads as under water with
|
|
16
|
+
* no sea surface drawn over it.
|
|
17
|
+
*
|
|
18
|
+
* The slope is the mesh's own, from screen-space derivatives of its common
|
|
19
|
+
* position (deck's common space is isotropic, metres alike in x, y, z), so it
|
|
20
|
+
* is faceted per triangle, like the mesh. The depth is the mesh's height
|
|
21
|
+
* (`geometry.worldPosition.z`, metres × exaggeration — see
|
|
22
|
+
* terrain-texture-mask.ts for why not `positions`), interpolated per fragment.
|
|
23
|
+
* Both act on the mesh's colour (or its texture) before deck lights it, so
|
|
24
|
+
* shading survives at any depth. Slope multiplies; depth multiplies by the
|
|
25
|
+
* shallow colour and then blends to the deep one. Applied in that order they
|
|
26
|
+
* compose: sediment and rock near the coast, fading into deep water.
|
|
27
|
+
*
|
|
28
|
+
* Injected at DECKGL_FILTER_COLOR with a negative order, from a shader module
|
|
29
|
+
* (extension `inject` strings lose their order): deck's terrain module
|
|
30
|
+
* composites draped layers there and RETURNS, and the ground under a drape
|
|
31
|
+
* must already be tinted.
|
|
32
|
+
*/
|
|
33
|
+
import { LayerExtension } from "@deck.gl/core";
|
|
34
|
+
import type { Layer } from "@deck.gl/core";
|
|
35
|
+
type TintProps = {
|
|
36
|
+
terrainTintSlope?: boolean;
|
|
37
|
+
terrainTintFlat?: number[];
|
|
38
|
+
terrainTintSteep?: number[];
|
|
39
|
+
terrainTintDepth?: boolean;
|
|
40
|
+
terrainTintShallow?: number[];
|
|
41
|
+
terrainTintDeep?: number[];
|
|
42
|
+
terrainTintMaxDepth?: number;
|
|
43
|
+
terrainTintExaggeration?: number;
|
|
44
|
+
};
|
|
45
|
+
/** Tint a terrain mesh by slope (`terrainTintFlat` → `terrainTintSteep`) and/or depth (`terrainTintShallow` → `terrainTintDeep`), 0–255 RGB. */
|
|
46
|
+
export declare class TerrainTintExtension extends LayerExtension {
|
|
47
|
+
static extensionName: string;
|
|
48
|
+
static defaultProps: {
|
|
49
|
+
terrainTintSlope: boolean;
|
|
50
|
+
terrainTintFlat: number[];
|
|
51
|
+
terrainTintSteep: number[];
|
|
52
|
+
terrainTintDepth: boolean;
|
|
53
|
+
terrainTintShallow: number[];
|
|
54
|
+
terrainTintDeep: number[];
|
|
55
|
+
terrainTintMaxDepth: number;
|
|
56
|
+
terrainTintExaggeration: number;
|
|
57
|
+
};
|
|
58
|
+
getShaders(): unknown;
|
|
59
|
+
draw(this: Layer<TintProps>): void;
|
|
60
|
+
}
|
|
61
|
+
export {};
|
package/dist/terrain.d.ts
CHANGED
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
*/
|
|
28
28
|
import type { Layer } from "@deck.gl/core";
|
|
29
29
|
import type { LayerIR } from "./ir";
|
|
30
|
+
import { type Extent } from "./terrain-priority";
|
|
31
|
+
import { type TerrainTextureMask } from "./terrain-texture-mask";
|
|
32
|
+
import type { CreditEntry } from "./credit-chrome";
|
|
33
|
+
import type { HeightfieldTile, HeightfieldTiles } from "./volumetrics";
|
|
30
34
|
/** RGB DEM decoder: height = offset + R·rScaler + G·gScaler + B·bScaler. */
|
|
31
35
|
export interface ElevationDecoder {
|
|
32
36
|
rScaler: number;
|
|
@@ -49,6 +53,10 @@ export interface TerrainPreset {
|
|
|
49
53
|
texture?: string;
|
|
50
54
|
/** Display name (switcher UIs). */
|
|
51
55
|
label?: string;
|
|
56
|
+
/** The DEM's credit, one short linked line per provider (the link carries the full list) — shown on the map and printed on sheets. */
|
|
57
|
+
attribution?: CreditEntry[];
|
|
58
|
+
/** The preset `texture`'s credit — shown only while that texture is the one draped. */
|
|
59
|
+
textureAttribution?: CreditEntry[];
|
|
52
60
|
/** Which key `{key}` substitutes — the basemap-registry convention. */
|
|
53
61
|
requiresKey?: "maptiler";
|
|
54
62
|
}
|
|
@@ -62,7 +70,73 @@ export interface TerrainIR {
|
|
|
62
70
|
/** Multiplies decoded DEM heights (1 = true relief). */
|
|
63
71
|
exaggeration: number;
|
|
64
72
|
texture?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Every source, first-ranked first, when the map names several
|
|
75
|
+
* `<om-terrain>` children (`terrain="survey, context"`); the fields above
|
|
76
|
+
* are then the first source's. Absent for a single DEM — read the list
|
|
77
|
+
* through `terrainSources()`.
|
|
78
|
+
*/
|
|
79
|
+
sources?: TerrainSourceIR[];
|
|
80
|
+
/** What the map must credit for the presets it uses (a raw DEM URL is the author's to credit). */
|
|
81
|
+
credits?: CreditEntry[];
|
|
82
|
+
/**
|
|
83
|
+
* `terrain-tint="slope depth"` (either or both) — terrain-tint.ts. `slope`:
|
|
84
|
+
* flat ground `flat`, steep ground `steep`; `depth`: ground below sea level
|
|
85
|
+
* `shallow` at 0 m to `deep` at `maxDepth` true metres. Colours 0–255 RGB.
|
|
86
|
+
*/
|
|
87
|
+
tint?: {
|
|
88
|
+
slope?: {
|
|
89
|
+
flat: number[];
|
|
90
|
+
steep: number[];
|
|
91
|
+
};
|
|
92
|
+
depth?: {
|
|
93
|
+
shallow: number[];
|
|
94
|
+
deep: number[];
|
|
95
|
+
maxDepth: number;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
/** `terrain-texture-mask`: draw every source's texture only on the land (`"land"`) or the seabed (`"sea"`) — terrain-texture-mask.ts. */
|
|
99
|
+
textureMask?: TerrainTextureMask;
|
|
100
|
+
/**
|
|
101
|
+
* A height that means NO DATA, not ground (`terrain-nodata`, or `nodata` on
|
|
102
|
+
* an `<om-terrain>`): decoded metres, before `verticalOffset`. Triangles on
|
|
103
|
+
* it are dropped, readers skip it — terrain-nodata.ts.
|
|
104
|
+
*/
|
|
105
|
+
nodata?: number;
|
|
106
|
+
/** True metres added to every decoded height (`vertical-offset`) — a datum difference between sources. Already folded into `elevationDecoder.offset`. */
|
|
107
|
+
verticalOffset?: number;
|
|
108
|
+
/** `texture-max-zoom`: tiles keep subdividing to this zoom for their texture, their heights derived from the DEM's max zoom (terrain-derive.ts). */
|
|
109
|
+
textureMaxZoom?: number;
|
|
110
|
+
}
|
|
111
|
+
/** `terrain-tint`'s tokens, space- or comma-separated, in order. */
|
|
112
|
+
export declare function terrainTintTokens(raw: string | null): string[];
|
|
113
|
+
/** The tints `terrain-tint` asks for — "slope", "depth", either order; "none" or anything else adds nothing. */
|
|
114
|
+
export declare function terrainTintKinds(raw: string | null): Set<"slope" | "depth">;
|
|
115
|
+
/** A `nodata` / `terrain-nodata` value: a number of metres, or undefined (absent, empty, or not a number — validation reports the last). */
|
|
116
|
+
export declare function parseNoData(raw: string | null): number | undefined;
|
|
117
|
+
/** One DEM of a multi-source terrain (`<om-terrain>`). */
|
|
118
|
+
export interface TerrainSourceIR {
|
|
119
|
+
/** The `<om-terrain>` id. */
|
|
120
|
+
id?: string;
|
|
121
|
+
elevationData: string;
|
|
122
|
+
elevationDecoder: ElevationDecoder;
|
|
123
|
+
maxZoom: number;
|
|
124
|
+
minZoom?: number;
|
|
125
|
+
texture?: string;
|
|
126
|
+
/** Where this source is drawn, [west, south, east, north]; absent = everywhere it has tiles. */
|
|
127
|
+
extent?: Extent;
|
|
128
|
+
meshMaxError?: number;
|
|
129
|
+
/** See TerrainIR.nodata. */
|
|
130
|
+
nodata?: number;
|
|
131
|
+
/** See TerrainIR.verticalOffset (already in `elevationDecoder.offset`). */
|
|
132
|
+
verticalOffset?: number;
|
|
133
|
+
/** See TerrainIR.textureMaxZoom. */
|
|
134
|
+
textureMaxZoom?: number;
|
|
65
135
|
}
|
|
136
|
+
/** A terrain's sources, first-ranked first — one for a plain `terrain=`. */
|
|
137
|
+
export declare function terrainSources(ir: TerrainIR): TerrainSourceIR[];
|
|
138
|
+
/** Is `lngLat` inside a source's extent (everywhere, without one)? */
|
|
139
|
+
export declare function inExtent(source: TerrainSourceIR, [lng, lat]: readonly [number, number] | readonly number[]): boolean;
|
|
66
140
|
export interface ResolvedTerrain {
|
|
67
141
|
ir: TerrainIR | null;
|
|
68
142
|
/** Resolution problem (unknown preset / missing key / missing decoder) — the caller decides how loudly to fail; `ir` is null when unresolvable. */
|
|
@@ -78,9 +152,23 @@ export declare function isDemUrl(raw: string): boolean;
|
|
|
78
152
|
* carries the loud version of the same message.
|
|
79
153
|
*/
|
|
80
154
|
export declare function parseTerrainAttrs(getAttr: (name: string) => string | null, maptilerKey?: string): ResolvedTerrain;
|
|
155
|
+
/**
|
|
156
|
+
* The map's terrain, single or multi-source. `terrain="a, b"` naming
|
|
157
|
+
* `<om-terrain id="a">` / `id="b"` children is a ranked list — the first
|
|
158
|
+
* wins where extents overlap; anything else is `parseTerrainAttrs`' single
|
|
159
|
+
* preset or DEM URL, exactly as before. Each child takes `src` (a preset or
|
|
160
|
+
* a DEM URL), `decoder`, `extent`, `min-zoom`, `max-zoom`, `texture` and
|
|
161
|
+
* `mesh-max-error`; `terrain-exaggeration` stays on the map, one vertical
|
|
162
|
+
* scale per scene.
|
|
163
|
+
*/
|
|
164
|
+
export declare function parseTerrainSources(map: Element, maptilerKey?: string): ResolvedTerrain;
|
|
81
165
|
export declare const TERRAIN_LAYER_ID = "__onlymapjs-terrain";
|
|
82
166
|
export type LayerTerrainMode = "drape" | "offset" | "off";
|
|
83
167
|
export declare const LAYER_TERRAIN_MODES: readonly ["drape", "offset", "off"];
|
|
168
|
+
/** The no-data value as the (offset) decoder reads it, true metres — or undefined. */
|
|
169
|
+
export declare function decodedNoData(source: TerrainSourceIR): number | undefined;
|
|
170
|
+
/** A source's tiles as the samplers read them: zoom, decoder (offset in), and its no-data value. */
|
|
171
|
+
export declare function heightfieldOf(source: TerrainSourceIR, zoom: number, tiles: HeightfieldTile[]): HeightfieldTiles;
|
|
84
172
|
export declare function defaultTerrainMode(type: string): LayerTerrainMode;
|
|
85
173
|
export interface TerrainLayerPatch {
|
|
86
174
|
/**
|
|
@@ -106,13 +194,49 @@ export interface TerrainLayerPatch {
|
|
|
106
194
|
* the terrain surface instead of at literal sea level, invisible below/
|
|
107
195
|
* behind a raised mesh) wins over that default, same as an authored layer.
|
|
108
196
|
*/
|
|
109
|
-
export declare function applyTerrain(irs: readonly LayerIR[], terrainActive: boolean, generation: number): Map<string, TerrainLayerPatch>;
|
|
197
|
+
export declare function applyTerrain(irs: readonly LayerIR[], terrainActive: boolean, generation: number, zRange?: [number, number] | null): Map<string, TerrainLayerPatch>;
|
|
198
|
+
/**
|
|
199
|
+
* The height range a terrain tile covers, in scene metres — from the mesh
|
|
200
|
+
* bounding box deck's TerrainLayer itself reads for its own culling.
|
|
201
|
+
*/
|
|
202
|
+
export declare function terrainTileZRange(tile: unknown): [number, number] | null;
|
|
203
|
+
/**
|
|
204
|
+
* The terrain-surface layers. `operation: "terrain+draw"` makes each double
|
|
205
|
+
* as the elevation surface extension-carrying layers drape onto; `pickable:
|
|
206
|
+
* "3d"` runs the depth pick pass so click/hover coordinates unproject at the
|
|
207
|
+
* SURFACE's depth instead of z=0 sea level. Exempt from license gates by the
|
|
208
|
+
* `__onlymapjs-` prefix.
|
|
209
|
+
*
|
|
210
|
+
* One terrain layer per source (one for a plain `terrain=`, id
|
|
211
|
+
* `__onlymapjs-terrain`; `__onlymapjs-terrain/<id>` for each `<om-terrain>`).
|
|
212
|
+
* Several sources partition the ground (terrain-priority.ts): each draws
|
|
213
|
+
* only inside its own extent and outside every higher-ranked one. Each
|
|
214
|
+
* lower-ranked source also gets a backfill copy (`…/backfill`): drawn only
|
|
215
|
+
* under the higher-ranked extents, behind everything, so the step where two
|
|
216
|
+
* datasets meet is never a see-through line.
|
|
217
|
+
*/
|
|
110
218
|
/**
|
|
111
|
-
* The
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* license gates by the `__onlymapjs-` prefix.
|
|
219
|
+
* The sources that are drawn: ranked, stopping at the first with no extent
|
|
220
|
+
* and no nodata — it draws everywhere, so nothing below it ever shows (those
|
|
221
|
+
* are not built, and validation reports them). With nodata, its holes show
|
|
222
|
+
* the next source. Every reader of the ground (the camera's, the height
|
|
223
|
+
* field) reads these and no others.
|
|
117
224
|
*/
|
|
118
|
-
export declare function
|
|
225
|
+
export declare function drawnSources(ir: TerrainIR): TerrainSourceIR[];
|
|
226
|
+
/**
|
|
227
|
+
* The ground at `lngLat` as it is drawn: the first-ranked source whose extent
|
|
228
|
+
* holds it answers, and the next only where that one has NO DATA (`read`
|
|
229
|
+
* returns null: a no-data cell, a failed tile) — which is where the next
|
|
230
|
+
* source shows. `read` returning "wait" (its tile is coming) answers null
|
|
231
|
+
* rather than borrow the next source's height. The camera's ground and the
|
|
232
|
+
* height field both read the ranking through here.
|
|
233
|
+
*/
|
|
234
|
+
export declare function firstHeight(sources: readonly TerrainSourceIR[], lngLat: readonly number[], read: (index: number) => number | null | "wait"): number | null;
|
|
235
|
+
/** The terrain's layers: `surfaces` draw first, under everything; `backfills` draw last (terrain-priority.ts — they show only where nothing real drew). */
|
|
236
|
+
export interface TerrainLayers {
|
|
237
|
+
surfaces: Layer[];
|
|
238
|
+
backfills: Layer[];
|
|
239
|
+
}
|
|
240
|
+
export declare function buildTerrainLayers(ir: TerrainIR, onTileLoad?: (tile: unknown) => void, seaColor?: number[] | null): TerrainLayers;
|
|
241
|
+
/** One of the runtime's terrain surface layers (any source)? */
|
|
242
|
+
export declare function isTerrainLayerId(id: string): boolean;
|
package/dist/version.d.ts
CHANGED
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { MapViewport } from "./basemap";
|
|
11
11
|
import type { Shape, ColumnarData } from "./ir";
|
|
12
|
+
type Bounds = [number, number, number, number];
|
|
13
|
+
/**
|
|
14
|
+
* The viewport's bounds on the GROUND it shows: at the frame lift's height
|
|
15
|
+
* (deck's view-state `position` z — `camera-target="terrain"`), not at
|
|
16
|
+
* z = 0, which under a lowered frame can sit above the eye. Zero lift is
|
|
17
|
+
* exactly `getBounds()`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function groundBounds(viewport: MapViewport): Bounds;
|
|
12
20
|
export declare function filterInViewport(rows: readonly unknown[], shape: Shape, viewport: MapViewport | undefined, getPosition?: (d: unknown) => number[] | undefined): unknown[];
|
|
13
21
|
/**
|
|
14
22
|
* The columnar counterpart (spec: "Columnar / GeoArrow Ingestion"). A
|
|
@@ -23,3 +31,4 @@ export declare function filterColumnarInViewport(data: ColumnarData, viewport: M
|
|
|
23
31
|
index: number;
|
|
24
32
|
data: ColumnarData;
|
|
25
33
|
}) => unknown) | undefined, rowFilter?: (row: unknown) => boolean): unknown[];
|
|
34
|
+
export {};
|
package/dist/volumetrics.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ export interface HeightfieldTiles {
|
|
|
51
51
|
zoom: number;
|
|
52
52
|
tiles: HeightfieldTile[];
|
|
53
53
|
decoder: ElevationDecoderSpec;
|
|
54
|
+
/** A decoded height that means NO DATA (± 0.5 m) — such a pixel is skipped like a missing tile (docs/design/underwater-terrain.md, Phase I). */
|
|
55
|
+
nodata?: number;
|
|
54
56
|
}
|
|
55
57
|
/**
|
|
56
58
|
* Height in metres from one RGB triple. The whole of "what a DEM tile means"
|
|
@@ -59,6 +61,15 @@ export interface HeightfieldTiles {
|
|
|
59
61
|
* rather than each writing it out.
|
|
60
62
|
*/
|
|
61
63
|
export declare function decodeElevationRgb(d: ElevationDecoderSpec, r: number, g: number, b: number): number;
|
|
64
|
+
/**
|
|
65
|
+
* A decoded height within this of a source's no-data value IS no data —
|
|
66
|
+
* Terrarium rounds to 1/256 m and a tiler may write the sentinel a hair off.
|
|
67
|
+
* Every no-data test (sampler, derived tiles, the mesh cut, the inspector,
|
|
68
|
+
* validation) uses this one tolerance.
|
|
69
|
+
*/
|
|
70
|
+
export declare const NODATA_TOLERANCE_M = 0.5;
|
|
71
|
+
/** Is `height` the no-data value (± NODATA_TOLERANCE_M)? Never, without one. */
|
|
72
|
+
export declare function isNoData(height: number, nodata: number | undefined): boolean;
|
|
62
73
|
/**
|
|
63
74
|
* Bilinear heightfield sample at `lngLat`, correct across TILE SEAMS.
|
|
64
75
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ur, d as lr, R as zt, e as fr, m as dr, p as St, f as hr, k as pr, l as mr } from "./raster-pipeline-
|
|
2
|
-
import { c as gr } from "./index-
|
|
1
|
+
import { A as ur, d as lr, R as zt, e as fr, m as dr, p as St, f as hr, k as pr, l as mr } from "./raster-pipeline-D9g8RAo4.js";
|
|
2
|
+
import { c as gr } from "./index-BfHaNHyY.js";
|
|
3
3
|
import $t from "./index-CW1n5LdO.js";
|
|
4
4
|
var Et;
|
|
5
5
|
function h(e, t, n) {
|
package/docs/cartograph.md
CHANGED
|
@@ -22,8 +22,8 @@ to PDF at true page size via CSS `@page` and exports PNG/JPEG at print DPI throu
|
|
|
22
22
|
<html>
|
|
23
23
|
<head>
|
|
24
24
|
<meta charset="utf-8">
|
|
25
|
-
<script type="module" src="https://unpkg.com/@nika-js/onlymap@0.13.
|
|
26
|
-
<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.13.
|
|
25
|
+
<script type="module" src="https://unpkg.com/@nika-js/onlymap@0.13.2/dist/cartograph.standalone.js"></script>
|
|
26
|
+
<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.13.2/dist/cartograph.css">
|
|
27
27
|
</head>
|
|
28
28
|
<body>
|
|
29
29
|
<om-cartograph cartograph-id="cg-lot-12" format="cartograph/2" size="A4" theme="minimal"
|
package/llms.txt
CHANGED
|
@@ -35,7 +35,7 @@ Programmatic/native bridge rule: `MapController.setLayers()` accepts normal func
|
|
|
35
35
|
|
|
36
36
|
## Element vocabulary
|
|
37
37
|
|
|
38
|
-
- `<om-map center="[lng, lat]" zoom="11" pitch="55" bearing="20" basemap="positron">` — the root. Give it a height (`om-map { display:block; height:100vh }` with `html,body{height:100%}`, or a sized container) — a custom element is display:inline by default and collapses to zero size; with none set, the library falls back to display:block + a 400px floor so a bare map still shows (any height you DO set wins over the floor, including one below 400px), and a collapsed map logs a console warning. A map hidden on purpose (`hidden`, or inside a `display:none` panel) stays hidden and does not warn. `basemap` accepts a free preset (`liberty`, `bright`, `positron`, `dark-matter`, `voyager`, `osm`, `satellite` — no keys; `satellite` is keyless imagery — EOX's 2016 Sentinel-2 cloudless mosaic, 10 m so sharp only to about z13–14, commercial use fine with the credit it renders; for sharp current imagery use keyed `maptiler-satellite`; or `maptiler-streets`/`maptiler-dataviz`/`maptiler-satellite` with `basemap-key="…"` or `OmMap.configureBasemap({ maptilerKey })`), `maplibre` (bare demo style), a style URL (e.g. a MapTiler-customized style; any scheme fetch supports, including desktop asset protocols like Tauri's, query strings fine), or `none` (standalone canvas). The attribute is LIVE — writing it switches the basemap in place (camera + layers survive); the `set-basemap {basemap}` action and `<om-widget type="basemap-switcher" options="positron dark-matter osm">` do the same. Register more via `OmMap.registerBasemap(name, { style })`. Required provider attribution renders automatically (`attribution="false"` opts out). `pitch`/`bearing` tilt the initial camera (use for 3D content). Terrain: `terrain="terrarium"` (keyless AWS DEM; also `mapterhorn` — keyless, CARTO Positron drape by default — `maptiler-terrain` with a key, a raw `{z}/{x}/{y}` DEM URL + `terrain-decoder="terrarium|mapbox-rgb|<JSON>"`, or `off`) raises a 3D surface — geographic layers DRAPE onto it automatically (per-layer `terrain="drape|offset|off"` overrides; 3D-model layers sit ON it), `terrain-exaggeration` scales relief, `terrain-texture` drapes imagery; terrain REPLACES an active basemap while on (restored when off); `set-terrain` action, `terrain` watch token, `OmMap.registerTerrain(name, {...})` for more sources. a georeferenced BIM model REQUIRES the map to author `terrain` explicitly — any value including an explicit `terrain="off"` (flat-ground siting); a model that resolves real elevation (IfcMapConversion + OrthogonalHeight) on a map with no `terrain` attribute raises an ERROR through the validation channel at load time (the library never writes attributes for you — no auto-terrain). Scene lighting for 3D content: `lighting="daylight|studio|flat|custom"` (absent = deck defaults) with `lighting-ambient`/`lighting-sun`/`lighting-sun-azimuth`/`lighting-sun-elevation`/`lighting-camera` overrides and `lighting-sun-date` (ISO/epoch — solar-position sun computed at the map center, wins over azimuth/elevation); attribute-backed (undoable, live-editable), story-steppable via the `set-lighting {lighting, sunAzimuth, ...}` action (`lighting="default"` removes the attribute set; a bare preset is a clean reset — stale overrides clear), native UI via `<om-widget type="lighting">` (preset radios + tuning sliders), widget watch token `lighting`. Clip box (issue #34): `clip-box-min="[lng,lat,elev]"` + `clip-box-max="[lng,lat,elev]"` cut a real axis-aligned 3D box through the scene — every layer clipped by default (per-layer `clip="off"` opts out), `clip-box-invert` shows outside instead of inside, `clip-box-highlight` dims clipped-out geometry instead of discarding it; works on ANY layer including georeferenced Tile3DLayer/BIMLayer content; attribute-backed (undoable) via `set-clip-box {min, max, invert?, highlight?}` (`{clear:true}` removes it), native UI `<om-widget type="clip-box">`; v1 axis-aligned only. XY snapping (issue #34 Part A): `snap="vertex edge midpoint"` + `snap-tolerance="12"` (px, default 12) refines a click/hover to the nearest vertex/edge/edge-midpoint of whichever feature deck ALREADY picked under the cursor — not a spatial index, only that one feature's own geometry is searched, on the CPU, when snapping is on. Applies to every layer by default (`snap="off"` on any `<om-layer>` opts it out, mirroring `clip="off"`) and to a `BIMLayer`'s own edge/crease overlay (its real wall corners/edges, converted from the model's local mesh coordinates to real `[lng,lat]` automatically) — the raw triangle MESH itself is not yet a snap target. Vertex beats midpoint beats edge on range conflicts; hold Space to place a point nearby without snapping. GeoJsonLayer extrudes polygons declaratively: `extruded get-elevation="$height"` (+ `wireframe`). `widgets-hidden` attribute (or the `set-widgets-visible {visible}` action / `<om-widget type="widgets-toggle">` button) hides every widget WITHOUT destroying state — attribution never hides (license); transient (not an undo step) but story-steppable, so a step can clear chrome for a cinematic take. Slots auto-dim while an open `<om-overlay>` popup covers them (position stability over the popup dodging; `widgets-dim="off"` disables). `validate` attribute enables live validation + on-page error panel. Include a `map-id="<random UUID>"` on complete pages (identifies the map artifact for usage telemetry — not a visitor id; the page author deletes it to opt out); `telemetry="off"` disables usage telemetry + library-error reporting for the map (global: `OmMap.configureTelemetry({ disabled: true })`; schema: docs/telemetry.md). Free plan limits (HOSTED http(s) pages only — a dev context (localhost, file://, any non-web scheme) lifts every cap while the attribution badge stays; the exemption is technical convenience, not a license grant — commercial deployment incl. packaged apps still requires a key): 5 layers, 25k rows per layer — layers past a limit don't render and validation says why; a `license-key="om_live_…"` attribute (publishable, origin-restricted) or `OmMap.configureLicense(key)` lifts limits and removes the corner badge — removal is a PERMISSION, not a requirement: `keep-badge` (or `OmMap.setKeepBadge(true)`) keeps the badge on a paid plan, rendering the credit WITHOUT the "free for non-commercial use" sentence (which would be false there); no effect on the free plan, where the badge is the license condition. When a user's map exceeds free limits, say so and point at the validation message rather than silently restructuring their data. Events on the element: `om-map-ready` (boot complete; `await mapEl.ready` is the promise twin), `om-validation-error`, `om-view-changed` (camera settled after a move, debounced; `detail = {longitude, latitude, zoom, pitch, bearing, origin}` where `origin` is `"user"` for gesture bursts vs `"programmatic"` for API/story moves — the camera-persistence hook, and the echo-suppression signal when syncing camera state to an app store), `om-map-point` (`detail = {coordinate: [lng,lat]|null, kind}` — every click/hover map coordinate incl. empty-map clicks, for custom capture tools beyond the draw widget), `om-tileset-load` (`detail = {layerId, tileset}` — a Tile3DLayer's live deck Tileset3D, for tools needing the real tileset like region export), `om-tiles-warmed` (`detail = {tilesets, viewports, ms, timedOut}` — a `warm-tiles` pass finished; see the story bullet), `om-route-resolved` (`detail = {layerId, route}` — a Route layer resolved, direct geometry or provider round-trip; `route` carries the normalized geometry/distanceMeters/durationSec/legs/bounds — how a page reads a provider-computed route without re-fetching, re-fired on every re-resolve). `om-attributions-changed` (bubbles; a basemap style loaded — read `mapEl.attributions()`, the providers as plain text). `MapController` mirrors these as `onViewChange`/`onMapPoint`/`onTilesetLoad`/`onRouteResolved` options. `await mapEl.snapshot()` returns a canvas-only PNG dataURL of the scene (basemap + layers at device pixels; `{as:"blob"}` for files) — DOM widgets/overlays/attribution are NOT captured, so exports must render provider credits themselves.
|
|
38
|
+
- `<om-map center="[lng, lat]" zoom="11" pitch="55" bearing="20" basemap="positron">` — the root. Give it a height (`om-map { display:block; height:100vh }` with `html,body{height:100%}`, or a sized container) — a custom element is display:inline by default and collapses to zero size; with none set, the library falls back to display:block + a 400px floor so a bare map still shows (any height you DO set wins over the floor, including one below 400px), and a collapsed map logs a console warning. A map hidden on purpose (`hidden`, or inside a `display:none` panel) stays hidden and does not warn. `basemap` accepts a free preset (`liberty`, `bright`, `positron`, `dark-matter`, `voyager`, `osm`, `satellite` — no keys; `satellite` is keyless imagery — EOX's 2016 Sentinel-2 cloudless mosaic, 10 m so sharp only to about z13–14, commercial use fine with the credit it renders; for sharp current imagery use keyed `maptiler-satellite`; or `maptiler-streets`/`maptiler-dataviz`/`maptiler-satellite` with `basemap-key="…"` or `OmMap.configureBasemap({ maptilerKey })`), `maplibre` (bare demo style), a style URL (e.g. a MapTiler-customized style; any scheme fetch supports, including desktop asset protocols like Tauri's, query strings fine), or `none` (standalone canvas). The attribute is LIVE — writing it switches the basemap in place (camera + layers survive); the `set-basemap {basemap}` action and `<om-widget type="basemap-switcher" options="positron dark-matter osm">` do the same. Register more via `OmMap.registerBasemap(name, { style })`. Required provider attribution renders automatically (`attribution="false"` opts out). `pitch`/`bearing` tilt the initial camera (use for 3D content). Terrain: `terrain="terrarium"` (keyless AWS DEM, seabed included only to zoom 10 — above it the ocean decodes as 0 m, so a seafloor needs `terrain-max-zoom="10"`; also `mapterhorn` (keyless, land only), `seascape` (keyless bathymetry — Open Waters, GEBCO + regional surveys to z14, land flat, not for navigation), `maptiler-terrain` with a key, a raw `{z}/{x}/{y}` DEM URL + `terrain-decoder="terrarium|mapbox-rgb|<JSON>"`, or `off`) raises a 3D surface — geographic layers DRAPE onto it automatically (per-layer `terrain="drape|offset|off"` overrides; 3D-model layers sit ON it), `terrain-exaggeration` scales relief, `terrain-texture` drapes imagery; terrain REPLACES an active basemap while on (restored when off); `set-terrain` action, `terrain` watch token, `OmMap.registerTerrain(name, {...})` for more sources; `map.getCamera()` gives the eye's `altitude`, the `targetElevation` under the view centre and the eye's `clearance` above ground, in true metres — a depth gauge reads it, no tile sampling of your own. `camera-target="terrain"` orbits the ground under the view centre (zooming in descends — below sea level over a seabed) and `camera-clearance="15"` keeps the eye 15 m off the ground; never drive the camera height through `map.core`. Several DEMs: `<om-terrain id="survey" src="…" decoder="terrarium" extent="[w,s,e,n]">` children ranked in `terrain="survey, context"` — the first-ranked draws alone inside its extent (no z-fighting; don't doctor tiles to hide an overlap); all but the last need an `extent` (or a `nodata="-32768"`: a source's no-data cells are holes that show the next source, colour and height); `vertical-offset="…"` corrects a vertical datum difference; `npx onlymapjs inspect-terrain page.html` (or `map.inspectTerrain()`) measures the step and finds no-data values — run it rather than guess. Own GeoTIFF DEM: `npx onlymapjs dem-tiles survey.tif --out tiles` (needs geotiff) writes the tiles and prints the `<om-terrain>` line to paste. Imagery sharper than the DEM: `texture-max-zoom="15"` (not a higher `max-zoom`). `terrain-tint="slope"` colours ground by true slope (sand flat → rock steep), `terrain-tint="depth"` shades the seabed pale-to-deep by true depth (`terrain-tint-shallow`/`-deep`/`-max-depth`; land untouched; `"slope depth"` for both); `sea-surface="rgba(…)"` is a translucent sea-level plane; `terrain-texture-mask="land"` keeps a `terrain-texture` on the land only, so imagery shows the coast and the seafloor stays visible (`"sea"` is the reverse). Terrain presets credit themselves like basemaps; credit your own DEM URLs yourself. a georeferenced BIM model REQUIRES the map to author `terrain` explicitly — any value including an explicit `terrain="off"` (flat-ground siting); a model that resolves real elevation (IfcMapConversion + OrthogonalHeight) on a map with no `terrain` attribute raises an ERROR through the validation channel at load time (the library never writes attributes for you — no auto-terrain). Scene lighting for 3D content: `lighting="daylight|studio|flat|custom"` (absent = deck defaults) with `lighting-ambient`/`lighting-sun`/`lighting-sun-azimuth`/`lighting-sun-elevation`/`lighting-camera` overrides and `lighting-sun-date` (ISO/epoch — solar-position sun computed at the map center, wins over azimuth/elevation); attribute-backed (undoable, live-editable), story-steppable via the `set-lighting {lighting, sunAzimuth, ...}` action (`lighting="default"` removes the attribute set; a bare preset is a clean reset — stale overrides clear), native UI via `<om-widget type="lighting">` (preset radios + tuning sliders), widget watch token `lighting`. Clip box (issue #34): `clip-box-min="[lng,lat,elev]"` + `clip-box-max="[lng,lat,elev]"` cut a real axis-aligned 3D box through the scene — every layer clipped by default (per-layer `clip="off"` opts out), `clip-box-invert` shows outside instead of inside, `clip-box-highlight` dims clipped-out geometry instead of discarding it; works on ANY layer including georeferenced Tile3DLayer/BIMLayer content; attribute-backed (undoable) via `set-clip-box {min, max, invert?, highlight?}` (`{clear:true}` removes it), native UI `<om-widget type="clip-box">`; v1 axis-aligned only. XY snapping (issue #34 Part A): `snap="vertex edge midpoint"` + `snap-tolerance="12"` (px, default 12) refines a click/hover to the nearest vertex/edge/edge-midpoint of whichever feature deck ALREADY picked under the cursor — not a spatial index, only that one feature's own geometry is searched, on the CPU, when snapping is on. Applies to every layer by default (`snap="off"` on any `<om-layer>` opts it out, mirroring `clip="off"`) and to a `BIMLayer`'s own edge/crease overlay (its real wall corners/edges, converted from the model's local mesh coordinates to real `[lng,lat]` automatically) — the raw triangle MESH itself is not yet a snap target. Vertex beats midpoint beats edge on range conflicts; hold Space to place a point nearby without snapping. GeoJsonLayer extrudes polygons declaratively: `extruded get-elevation="$height"` (+ `wireframe`). `widgets-hidden` attribute (or the `set-widgets-visible {visible}` action / `<om-widget type="widgets-toggle">` button) hides every widget WITHOUT destroying state — attribution never hides (license); transient (not an undo step) but story-steppable, so a step can clear chrome for a cinematic take. Slots auto-dim while an open `<om-overlay>` popup covers them (position stability over the popup dodging; `widgets-dim="off"` disables). `validate` attribute enables live validation + on-page error panel. Include a `map-id="<random UUID>"` on complete pages (identifies the map artifact for usage telemetry — not a visitor id; the page author deletes it to opt out); `telemetry="off"` disables usage telemetry + library-error reporting for the map (global: `OmMap.configureTelemetry({ disabled: true })`; schema: docs/telemetry.md). Free plan limits (HOSTED http(s) pages only — a dev context (localhost, file://, any non-web scheme) lifts every cap while the attribution badge stays; the exemption is technical convenience, not a license grant — commercial deployment incl. packaged apps still requires a key): 5 layers, 25k rows per layer — layers past a limit don't render and validation says why; a `license-key="om_live_…"` attribute (publishable, origin-restricted) or `OmMap.configureLicense(key)` lifts limits and removes the corner badge — removal is a PERMISSION, not a requirement: `keep-badge` (or `OmMap.setKeepBadge(true)`) keeps the badge on a paid plan, rendering the credit WITHOUT the "free for non-commercial use" sentence (which would be false there); no effect on the free plan, where the badge is the license condition. When a user's map exceeds free limits, say so and point at the validation message rather than silently restructuring their data. Events on the element: `om-map-ready` (boot complete; `await mapEl.ready` is the promise twin), `om-validation-error`, `om-view-changed` (camera settled after a move, debounced; `detail = {longitude, latitude, zoom, pitch, bearing, origin}` where `origin` is `"user"` for gesture bursts vs `"programmatic"` for API/story moves — the camera-persistence hook, and the echo-suppression signal when syncing camera state to an app store), `om-map-point` (`detail = {coordinate: [lng,lat]|null, kind}` — every click/hover map coordinate incl. empty-map clicks, for custom capture tools beyond the draw widget), `om-tileset-load` (`detail = {layerId, tileset}` — a Tile3DLayer's live deck Tileset3D, for tools needing the real tileset like region export), `om-tiles-warmed` (`detail = {tilesets, viewports, ms, timedOut}` — a `warm-tiles` pass finished; see the story bullet), `om-route-resolved` (`detail = {layerId, route}` — a Route layer resolved, direct geometry or provider round-trip; `route` carries the normalized geometry/distanceMeters/durationSec/legs/bounds — how a page reads a provider-computed route without re-fetching, re-fired on every re-resolve). `om-attributions-changed` (bubbles; a basemap style loaded — read `mapEl.attributions()`, the providers as plain text). `MapController` mirrors these as `onViewChange`/`onMapPoint`/`onTilesetLoad`/`onRouteResolved` options. `await mapEl.snapshot()` returns a canvas-only PNG dataURL of the scene (basemap + layers at device pixels; `{as:"blob"}` for files) — DOM widgets/overlays/attribution are NOT captured, so exports must render provider credits themselves.
|
|
39
39
|
- `<om-layer id="..." type="ScatterplotLayer" data="./points.json">` — any deck.gl layer class by `type` (41 layer types total: 32 bundled deck.gl core/geo/aggregation/mesh layers, plus the native `COGLayer`/`ZarrLayer` raster types, `ImageOverlay` for georeferenced drone JPEGs, `BIMLayer` for BIM source files, `HillshadeLayer` for shaded relief, `TextOnPathLayer` for a label that follows its line, and `Route`/`Tracking` for routing/live-tracking — see the dedicated bullet below), plus `PopupLayer` (WebGL badges/labels at scale: `layout="badge|pin-label|card"`, `min-zoom`/`max-zoom`). Every type's full attribute list ships in the package's `onlymapjs.html-data.json` — consult it instead of guessing attribute names or reading the minified dist. TextLayer's default font atlas covers ASCII only: set `character-set` when label text carries other glyphs (`—`, `·`, accents) or deck warns and renders them blank. Aggregation layers (`HeatmapLayer`, `HexagonLayer`, `GridLayer`, `ScreenGridLayer`) take `color-domain="[0, 50]"` to fix the range their colour scale spans (Hexagon/Grid also `elevation-domain`) — otherwise it rescales as the view moves; on `ScreenGridLayer`, which re-aggregates on every camera move, it also skips a per-move GPU readback that stalls panning on a busy map. External layer classes register via `OmMap.registerLayer({type, deckClass, props})` — build them on `@nika-js/onlymap/deck` (the bundled `CompositeLayer`/`TileLayer`/… re-exports), never a separately-installed deck.gl (different class hierarchy, breaks in the renderer); function-valued props ride the subclass's `static defaultProps`; register at module top level BEFORE the manifest mounts (see docs/custom-layers.md). Data: `data` URL (JSON, GeoJSON, CSV/TSV `.csv` — parsed to typed columns — Shapefile `.shp` (+`.dbf` attributes) and KML `.kml` as GeoJSON features, GPX `.gpx` (waypoints/tracks/routes → features tagged `_gpxKind`; a `#waypoints`/`#tracks`/`#routes` URL fragment selects one part), FlatGeobuf `.fgb` (cloud-native binary vector, whole-file decode), GeoParquet `.parquet`/`.geoparquet` (cloud-native columnar vector — all-Point files stay columnar like Arrow, lines/polygons become GeoJSON features; requires the file's `geo` metadata with WKB geometry, and CRS84/EPSG:4326 — a projected CRS is a loud error telling you to reproject, not a silent misplacement; snappy/gzip/zstd row-group compression handled), CityJSON `.city.json` / CityJSONSeq `.city.jsonl` (semantic 3D city models — 3DBAG, PLATEAU — decoded to one of two shapes by the `data` URL, no CityJSON layer type: default → extruded footprints, `type="GeoJsonLayer" extruded get-elevation="$roof_height"`; `?om-surfaces=1` → one row PER FACE at its own real per-vertex height so a pitched LoD2.2 roof actually looks pitched, `type="SolidPolygonLayer" get-polygon="$polygon" full3d` (`extruded` stays at its ordinary `false` default) (flat-shaded — deck.gl only lights the `extruded` shader path — each row also carrying `surface_type`: RoofSurface/WallSurface/GroundSurface, and `fill_color`: a ninja-viewer-style default color per surface_type/cityobject_type, verified against cityjson-threejs-loader's own default palette — `get-fill-color` on `SolidPolygonLayer` reads it automatically when left unauthored, no color attribute required, and an authored `get-fill-color` still overrides it); derived properties (both modes) `roof_height` (area-weighted mean roof height above ground), `eaves_height`, `ridge_height`, `ground_height`, `roof_area`, `surface_count`, `lod`, `cityobject_id`, `cityobject_type`, `parent_id` win over same-named source attributes, plus surfaces-mode-only `polygon`/`outline`/`surface_type`/`fill_color` (`outline` is the face's outer ring flattened and closed — bind a companion `type="PathLayer" get-path="$outline"` layer to it for visible face edges, since surfaces mode is flat-shaded and `SolidPolygonLayer`'s own `wireframe` prop is a no-op when unextruded — always pair one, matching `filter-field`/`filter-range` to the fill layer), and a parent Building's attributes are inherited by its BuildingPart rows; national grids NL/CH/DE/JP/AT/SG reproject automatically including axis order, other EPSG codes fail with an error naming the code; highest LoD wins, pin one with `?om-lod=1.2` (combine as `?om-lod=1.2&om-surfaces=1`, cached independently); `.city.jsonl` fills in as it downloads in either mode — see docs/3d-assets.md), or Arrow IPC `.arrow`/`.feather` — large point datasets stay columnar, GeoArrow line/polygon geometry becomes GeoJSON features, zstd-compressed IPC is handled; other formats plug in via `OmMap.registerFormat({match, parse})`; data URLs accept any scheme the runtime's fetch supports — desktop webviews (Tauri, Electron) pass asset-protocol URLs straight in), inline `<script type="application/json">` (row arrays or column-oriented `{"columns": {"lon": [...], "lat": [...]}}`; must be a DIRECT child of the `<om-layer>`, and when present it wins — omit the `data` attribute; NEVER put rows in `data='[…]'` — `data` is always a URL, so that fetches a file named `[…]` and draws nothing, a validation ERROR since 0.11.9; a `data` URL that fails to load is also reported as a diagnostic, `om-layer#<id> [data]`, until it loads), or `wss://` streaming (`key="mmsi"` upserts entities in place, `flush="250ms"` coalesces bursts, `source="name"` selects a `OmMap.registerSource` decoder plugin), or a polled REST snapshot (`refresh="5s"` re-fetches and replaces — for live endpoints that return the full current state). TILED layers: a `{z}/{x}/{y}` `data` template is deck's tile URL for `TileLayer`/`MVTLayer` (NOT rows) — passed through to deck verbatim, never fetched/parsed, so `<om-layer type="TileLayer" data="…/{z}/{x}/{y}.png">` works (raster gets a built-in BitmapLayer sublayer) and `type="MVTLayer" data="…/{z}/{x}/{y}.pbf"` self-renders vector tiles with `get-*` accessors applying to each decoded feature's properties; a tiled layer has no local rows so `ctx.data`/`ctx.stats`/`filter-*` don't apply. Authenticated endpoints: call `OmMap.configureData({ headers: {...} })` in a script — never put tokens in attributes. `$field` accessors work identically on all of them — never write column-index code yourself. One columnar restriction: the `js` full-JS opt-in is not allowed on Arrow/columnar layers (validation will tell you; use `$field` accessors instead). For 3D models use `type="ScenegraphLayer"` with `scenegraph="./model.glb"` (required) and `get-orientation="[0, $heading, 90]"` — the roll of 90 stands Y-up glTF models upright; `color`/`get-color` tint the model as a shader multiply over its own baked texture (default opaque white = no tint; `get-color` is `$field`-driven like other `*Color` accessors, so a fleet recolors by data without swapping model files); see docs/3d-assets.md. 3D Tiles use `type="Tile3DLayer"` with `tileset="…/tileset.json"` (NOT `data`). Any pickable layer can opt into deck's DEPTH-pick pass with `pickable="3d"` instead of a bare `pickable` (issue #34) — the resolved click/hover coordinate then carries a real elevation (`{{z}}` in overlay/tooltip templates, `ctx.selection.coordinate`) instead of the ray∩ground-plane guess, so a click on a building face lands ON the face rather than on the ground behind it; `terrain` sets this on itself. For BIM/photogrammetry, `pickable` alone picks a whole TILE — add `pick-features` to pick an individual ELEMENT (a wall, a window, one IFC product), and the `selection` then carries that element's `featureId`/`properties`/`class` from the tile's own `EXT_mesh_features` + `EXT_structural_metadata` (`feature-id-property` selects the ID set, default `_FEATURE_ID_0`). `feature-styles` recolours/fades/highlights by feature ID — an array indexed BY id of `{color: [r,g,b], strength: 0-1, opacity: 0-1}`, live-settable, uploaded as a small lookup texture (no refetch). Use `strength` below 1 to tint rather than replace, or the model's own texture is hidden. Isolate/hide/ghost are DECLARATIVE and mirror the vector `filter-field`/`filter-categories` pair — `feature-filter-field="component"` names the metadata field, then `isolate-features='["Clock"]'` / `hide-features='["Windows","Skylight"]'` / `ghost-features='["Wall"]'` take JSON value lists matched against the tile's property table (`ghost-opacity` tunes the fade, default 0.18). `isolate-features` is EXCLUSIVE (anything unlisted is hidden); hiding is a shader discard so a hidden element also stops being pickable and whatever is behind it becomes selectable. They compose ONTO `feature-styles` (style table supplies colour, these supply visibility), and being attributes they are undoable and story-steppable — prefer them over computing a style table in page JS. Multi-material/multi-primitive models fan out correctly (glTF allows one material per primitive, so real IFC exports are usually many primitives); only genuinely instanced i3dm tiles stay tile-granularity. Limits to state rather than discover: texture-backed IDs — how photogrammetry classification ships — require `load-options='{"gltf":{"loadBuffers":true,"loadImages":true},"image":{"type":"data"}}'`, and omitting `image.type` makes the tileset take MINUTES to appear (loaders.gl otherwise reads the whole ID texture back through a canvas once per vertex); and `opacity` below 1 currently blanks the model. BIM WIDGETS (all need a `pick-features` layer): `<om-widget type="ifc-browser" layer="clinic" fields="ifcClass material container spatialPath" scale-fields="netVolume" rows="7">` groups the model by a property-table field, counts each value, and gives every row I/H/G buttons that WRITE `isolate-features`/`hide-features`/`ghost-features` (so it is a UI over the attributes — undoable and story-steppable; I is MULTI-SELECT, isolating the union of every pressed row or tree node, since `isolate-features` is a list and the layer matches it as a set) while keeping the companion outline layer's `filter-categories` in step; that same select also offers whichever TREES the file supports — Spatial (`spatialPath`), Type (`typePath`), System (`systemPath`) and Classification (`classificationPath`, built by walking `ReferencedSource`) — each expandable with counts aggregated upward and the same I/H/G on every node, so isolating a storey or a system or a CCS code reaches every element under it. Spatial is NOT privileged (on a real Danish project the classification tree covered 3,415 elements to spatial's 660). A tree is not a separate mode, just a group-by on a hierarchy column — LIST it in `fields` to offer it, or set `field="spatialPath"` to open on it — and `loadIfc` emits a hierarchy column ONLY when the file populates it, so a tree that would render empty is never offered; trees appear automatically when available (no need to list them in `fields`) and `field="spatialPath"` opens straight onto one. ONE browser per layer: `feature-filter-field` and the isolate/hide/ghost attributes are single-valued, so two instances on one layer clobber each other. The widget was renamed from `ifc-legend` (still registered as a deprecated alias) because it is a model browser, not a legend. non-physical classes (IfcSpace, IfcOpeningElement) are hidden unless `show-non-physical`, and `no-color` removes the colour select. `<om-widget type="feature-inspector" fields="ifcClass material container netVolume">` (renamed from `ifc-inspector`, kept as an alias) shows the picked element's properties. `<om-widget type="ifc-loader" layer="ifc" federate>` is a drop zone that parses `.ifc` files IN THE BROWSER and builds both layers itself; `federate` accepts SEVERAL models into one co-registered scene (one drop zone, one layer per model, each with a visibility toggle) rather than one widget per discipline, matching how coordination tools append models; a model that turns out to be georeferenced is AUTO-PLACED (its own coordinates/heading/scale written onto the layers the WIDGET created, camera flown there) — but the widget NEVER writes `<om-map>`'s own scene attributes (`basemap`, `terrain`): those are author-owned, and a georeferenced model on a map with neither raises a structured "no spatial context" warning instead of switching one on. COLOUR BY PROPERTY instead of hand-computing a `feature-styles` table: `feature-color-by` (categorical, `feature-palette` overrides the built-in cycle) or `feature-color-scale` (graduated over a numeric field), with `feature-color-strength` (default 0.85) controlling how hard the colour mixes over the model's own material. Setting NEITHER is the default and is meaningful — the model renders in its own IFC surface colours. A graduated ramp needs the field populated: Revit IFC2x3 exports often carry no `IfcElementQuantity`, so every `netVolume` is 0 and the ramp is flat. Widget scripts read the decoded property table with `ctx.features(layerId)` (undefined until the first tile carrying one lands) and re-render on the `features` watch token. `<om-widget type="ifc-clash" layers="arch mep" tolerance="0">` is the CLASH OVERLAY over two co-registered model layers: it flags element pairs whose bounding boxes interpenetrate, colours both sides via `feature-styles`, and flies to the centre of each overlap. v1 is an axis-aligned box test — fast and serverless, but it over-reports anything diagonal and says nothing about which clashes matter; zones/spaces/openings/proxies and same-class-same-name pairs are excluded as noise. The header carries an overlay on/off switch; an isolation mode select (None/Dim/Hide) sits above the results list and applies once a row is selected (with nothing selected, nothing is hidden), and clicking a row FOCUSES that clash (chosen pair at full strength, every other clashing element dropped to a faint tint, camera flown to the overlap centre) — without that, everything is highlighted and nothing is. Results are GROUPED by the side-A element with a count (one wall crossing four ducts is one row), and the two model selects appear only when more than two models are loaded. It CHECKS co-registration (matching `site-origin`) and says so when it fails, because two mis-registered models report zero clashes exactly like two clean ones. Persisting/sharing results is BCF's job and is out of scope. `<om-layer type="BIMLayer" src="./model.ifc">` is the declarative counterpart to `ifc-loader`/`loadIfc`: point it at a BIM source file (an .ifc today) and it runs the loader itself the moment src resolves — no pre-baked tileset, no site-origin/site-heading/site-scale (the file's own georeference is read and applied automatically; not wired up yet: an authored site-origin on a BIMLayer does not override it), and no separate PathLayer for the outline overlay (added automatically). `pick-features` defaults ON (unlike a plain Tile3DLayer); feature-filter-field/feature-styles/isolate-hide-ghost/feature-color-by/ghost-opacity all work unchanged, since BIMLayer forwards them to a real Tile3DLayer it builds internally. Known gap: the outline overlay does not yet follow isolate/hide/ghost the way the mesh does. Reach for BIMLayer when the model is fixed and known ahead of time; reach for ifc-loader when a visitor picks the file or several models need to federate. IN-BROWSER IFC: `loadIfc(bytes)` parses an `.ifc` with web-ifc (WASM, MPL-2.0, CDN-fetched on first use — NOT a package dependency; `configureIfc({wasmPath})` self-hosts) and returns `{tilesetUrl, edgesUrl, loadOptions, features (rows carry `ifcClass`/`name`/`material`/`container`/`netVolume`/`spatialPath`/`typePath`/`systemPath`/`classificationPath` — hierarchy columns joined by U+001F that the model trees navigate, each emitted only when the file populates it), lonLat, georeferenced, heading, scale, originSource, headingSource, stats, timings, bounds, revoke()}`; the output IS a tileset so picking/styling/`site-*`/isolate-hide-ghost work unchanged. CALL `revoke()` when swapping models — blob URLs are held by the document. FEDERATION: pass the first model's returned `origin` as `LoadIfcOptions.origin` for every later model of the same building, or each is centred on its own bounding box and they drift apart — a clash pass then finds nothing, which looks identical to a clean model. `ifc-loader` shares one origin AND one placement (`site-origin`/`site-heading`/`site-scale`) per map automatically — discipline files routinely declare IfcSite coordinates kilometres apart for the same building, so the first model loaded decides where it goes and the rest follow (`independent` opts out). Every element also carries a tile-local bounding box in the property table (`bboxMinE`/`bboxMinN`/`bboxMinU`/`bboxMaxE`/`bboxMaxN`/`bboxMaxU`). POSITION is read from the file preferring the trustworthy route: `IfcMapConversion` (a surveyed placement into a named projected CRS) WINS over `IfcSite.RefLatitude`/`RefLongitude`, which is very often an authoring default; `originSource` reports which was used, and anything other than `"map-conversion"` raises a structured `"warning"` through the same validation channel other `om-layer` errors use (the on-page panel with `validate` set, `om-validation-error`'s `detail.warnings`) for both `BIMLayer` and `ifc-loader`, once per layer — it never flips `valid` false, only flags the position may be off by tens of metres with no rotation correction applied; override with `site-origin`/`site-heading` or a proper `IfcMapConversion`. Un-projecting a map conversion is supported for WGS84 UTM zones (EPSG:326xx/327xx) and DECLINED with a warning for anything else — a guessed projection lands the model in another country while looking plausible. Eastings/northings are in the target CRS unit, frequently MILLIMETRES. Reading a file correctly and the model being somewhere sensible are SEPARATE problems: all three prepared samples declare placeholders (clinic on Revit's Boston default, which is a 1630 graveyard; duplex on a Chicago city-centre point; bridge — which does carry a real IfcMapConversion — into the mid-Pacific). `headingSource` distinguishes "map-conversion"/"true-north" (read) from "assumed" (file was silent) — report the assumption, never let it read as a measurement. `<om-map>` reads camera attributes ONCE at init, so `setAttribute("center", …)` after mount moves nothing: use `map.flyTo(lonLat, zoom)`. GEOREFERENCING is declarative on `Tile3DLayer` and `PathLayer`: `site-origin="[lng, lat]"` (or `[lng, lat, elevation]`) OVERRIDES the position baked into a tileset's root transform, `site-heading` is a bearing in degrees CLOCKWISE from true north (on its own it rotates the model where it stands), `site-scale` is a uniform multiplier; rotation and scale pivot on the model's own anchor, not the tileset origin. An IFC model is a PAIR of layers — the mesh tileset plus a `PathLayer` outline overlay whose paths are local east/north/up METRES — and both need the same three values or the building separates from its own edges. Never trust a model's declared position without looking at it: authoring tools ship a default project location that is indistinguishable from a survey (the buildingSMART Medical-Dental Clinic sample carries Revit's Boston default, the Duplex a Chicago city-centre point, so both land on occupied downtown blocks at an arbitrary rotation), `IfcMapConversion` is absent from most IFC2x3 exports, and `TrueNorth` is routinely unset. Editing `site-*` on a live Tile3DLayer reloads the tileset (deck.gl only reloads on a URL change); the PathLayer updates as a uniform. GeoTIFF/COG rasters use `type="COGLayer"` with `src="./dem.tif"` (NOT `data` — rasters stream tiles by Range request, they are not parsed rows). COG v2 surface (0.7.0): `bands` selects 1-based bands — one (`bands="4"`, colormap-eligible) or an `[r,g,b]` triple (`bands="[8,4,3]"`, false-color composite); band switches NEVER refetch (the decode is retained; textures re-upload from memory). `min`/`max` set the rescale window — a number broadcasts, a triple pairs per-band with a `bands` triple; `rescale="auto"` reads the window from GDAL statistics tags (coarsest-overview sample fallback, with a warning that the window is data-derived); non-8-bit sources with NO styling attrs auto-stretch automatically now (the "my COG is blank" fix — a dev notice reports the derived window; author min/max for stable styling). `colormap` picks a bundled ramp for single-band sources (gray, viridis, plasma, inferno, magma, cividis, rdylgn, rdbu, spectral, terrain, jet, turbo, ylorrd), `reverse` flips it, `stretch="log|sqrt"` and `gamma="1.8"` shape the display curve, `nodata` overrides the source sentinel (renders transparent). Plain 8-bit RGB COGs need no styling attributes; paletted GeoTIFFs render via their embedded color table and emit a classes legend when few palette entries are used. Every styling change is a GPU uniform (no refetch); the legend derives automatically (authored or auto window). PIXEL IDENTIFY: clicks/hovers over a COGLayer with no vector feature carry the pixel's per-band values through the ordinary selection — overlays/tooltips interpolate `{{value}}`, `{{values}}`, `{{band_1}}`…; `identify="off"` opts out (drops the CPU-retained decode — recommended for memory-tight WebViews; band switches on that layer then refetch tiles instead of re-uploading from memory). Source failures (CORS-refused Range requests, non-COG plain GeoTIFFs, out-of-range bands) surface as structured validation errors with fix strings instead of a silent blank layer. Sources should be Cloud-Optimized (`gdal_translate -of COG`; plain GeoTIFFs render with a warning, re-reading the full image per view).
|
|
40
40
|
- SHADED RELIEF: `<om-layer id="relief" type="HillshadeLayer" src="terrarium">` shades a DEM on the GPU. It is a LAYER, not a mode of `terrain=` — `terrain=` raises a 3D surface, replaces the basemap and means nothing at pitch 0, while relief is a flat raster that composes under your data AND, being inside deck's framebuffer, is captured by `snapshot()` and treated by `<om-effect>` (a MapLibre basemap would not be). `src` is REQUIRED and takes a registered terrain preset (`terrarium`, `mapterhorn` — both keyless and global) or a raw `{z}/{x}/{y}` template plus `decoder="terrarium|mapbox-rgb"|{rScaler,gScaler,bScaler,offset}` JSON; a raw template with no `decoder` is a validation warning, because reading mapbox-encoded heights as terrarium yields smooth plausible relief that is ~25x wrong. Keyless means no key, not no attribute — name the source the way `basemap="positron"` and `terrain="terrarium"` are named. THE SUN IS A LIST: `sun-azimuth="315 45 135"` blends one to four lights (° clockwise from north, `scene-lighting`'s convention — same numbers as `lighting-sun-azimuth`, but NOT coupled to it), `sun-weight="3 1 1"` weights them (normalized for you, equal if omitted). There is deliberately no `multi-directional` boolean: a shorthand must never reach capability the tier below cannot express, and the azimuths want choosing for the terrain. Other knobs: `sun-elevation` (default 45, must be strictly between 0 and 90), `z-factor` (vertical exaggeration), `blend="normal|multiply"` (multiply lets relief read UNDER fills rather than greying them — it needs something beneath it, which is why normal is the default), `opacity`, `max-zoom`, `zoom-offset`. Every illumination knob is a UNIFORM: moving the sun rebuilds no tile and fetches nothing. Correctness the author does not have to think about: tile edges are seamless (each tile is decoded with a one-pixel apron from its eight neighbours — clamping instead collapses the derivative and draws a pale grid over the world), latitude is corrected PER FRAGMENT (Web Mercator metres-per-pixel falls off with cos-phi), tile zoom follows the capture pixel ratio so a 300 dpi plate is not upscaled screen relief, and `terrain-exaggeration` is never read through (display transform vs true ground). DEM tiles must be PNG or LOSSLESS WebP — heights live in the RGB bytes, so a lossy codec invents terrain (one warning per host). The layer + GLSL are a lazy chunk: a map with no relief downloads none of it. SECOND ENTRY POINT — YOUR OWN DEM: `shading="hillshade"` on a `COGLayer`/`ZarrLayer` shades that raster in place with the same `sun-azimuth`/`sun-weight`/`sun-elevation`/`z-factor` attributes. Relief runs LAST in the styling chain, so it MULTIPLIES onto a `colormap` instead of replacing it — `colormap="terrain" shading="hillshade"` is a hypsometric tint with relief through it as ONE layer, not two; with no colormap, relief is drawn alone. It reads ONE band as elevation (the first selected), so a `bands` triple warns. Ground scale comes from the file's own geotransform + CRS units, so UTM metres, state-plane feet and degrees all work — a geographic source is ANISOTROPIC (a longitude degree shrinks with cos-phi, a latitude degree does not) and that is corrected per fragment. CAVEAT: `identify="off"` cannot free memory while shading is on, because the seamless-edge apron reads neighbouring pixels on the CPU — the validator flags the combination rather than letting the flag look like it worked. Deep reference: docs/hillshade.md. Slope/aspect as queryable VALUES stays deliberately out of scope — this ships rendered texture, never an analytic product.
|
|
41
41
|
- CARTOGRAPHY (projections, geometry transforms, vector export): `crs="EPSG:5070"` on `<om-map>` puts the WHOLE renderer in that projection's plane — parallels curve, an equal-area projection is genuinely equal-area. Web Mercator and plate carree need nothing; national grids and UTM zones resolve through proj4, loaded only when a map asks; anything else takes `crs-def="+proj=…"` or `OmMap.registerCrs(code, defOrFunctions)`. THE AUTHORED CAMERA STAYS GEOGRAPHIC: `center` is lng/lat and `zoom` means what it always meant, so stories, `seek()` and `getCamera()` are unchanged, and clicks report lng/lat rather than plane metres (a projected metre in a geodesic formula returns a confident wrong distance). Limits are validation ERRORS with fixes, never silent no-ops: no MapLibre basemap (use `basemap="none"`) except `basemap="positron"`/`"liberty"`/`"bright"` on any `crs` — OpenFreeMap vector tiles drawn in the plane, preset colours, no labels, auto-credited, no terrain/3D tile layers (`TerrainLayer`, `Tile3DLayer`), no `.pbf` TileLayer (use `MVTLayer`, which works on ANY crs: each tile is cut, projected and triangulated once in a worker, so it pans as fast as in Web Mercator), no `terrain`, no clip box (`clip-box-min`/`max` are placed with Mercator arithmetic and would cut every layer away), no `pitch`/`bearing` (the view is planimetric), no H3/S2/geohash/quadkey layers (deck builds their geometry from a token, inside the layer — convert the cells to polygons), and `crs` is LIVE — change the attribute on a mounted map, or `set-crs {crs: "EPSG:27700"}` (`{crs: "mercator"}` goes back), and every layer re-projects in place with no reload and the camera untouched; story-steppable and undoable; a CRS that cannot resolve is reported and the map stays as it was. RELIEF WORKS on a projected sheet both ways: a DEM of your own has no projection tie, and the keyless `HillshadeLayer` re-indexes its Mercator tiles from the plane's own geography and draws them as subdivided warped meshes (sub-pixel — 0.40 output px for Albers at z=3, falling as 1/N^2). `sun-datum="sheet"` (default) keeps apparent light constant across the plate; `"geographic"` is physically true; the swing is 34 degrees across a CONUS sheet and the attribute is inert in Mercator (the validator says so). A GLOBE is `projection="globe"` on `<om-map>` (preview), NOT a crs: it needs a basemap (`basemap="satellite"` is keyless; MapLibre draws the sphere), zoomed in it becomes the flat map by itself, layers and center/zoom are unchanged, and it switches live (`set-projection {projection: "globe" | "mercator"}`; a basemap switch keeps it). Overlays on the far side hide and a click in space reports `coordinate: null`. A globe is flat-on and north-up (no pitch/bearing). Validation ERRORS, each with a fix: crs, terrain/TerrainLayer, basemap="none", TextLayer/IconLayer/TextOnPathLayer/PopupLayer (labels go in `<om-overlay anchor>`), ArcLayer/GreatCircleLayer (a PathLayer through points along the great circle), Heatmap/Hexagon/Grid/ScreenGrid/Contour (pre-aggregate to polygons), and a globe inside a cartograph frame; a clustered layer WARNS (counts are text and do not draw). IMAGE TILES WORK on a projected sheet too, so a raster basemap is a LAYER: keep `basemap="none"` and add `<om-layer type="TileLayer" data="…/{z}/{x}/{y}.jpg">` (`.png`/`.jpg`/`.jpeg`/`.webp`), warped onto the plane like relief. `basemap="satellite"`/`"osm"` on a projected map stays an error whose fix is that preset's own tiles as this layer — the map never swaps a basemap for you. Credit authored tiles yourself (`<om-widget type="attribution" text="…">`, which the error's fix spells out); the map credits only basemaps it picks. GEOMETRY TRANSFORMS: `<om-transform type="simplify|smooth|dot-density|buffer|contour">` as CHILDREN of an `<om-layer>`, applied in document order, in the DATA stage — so deck, `anchor="surface"`, the legend and the vector exporter all see the same geometry. Spatial knobs are MILLIMETRES ON PAPER resolved against a declared `reference-scale="1:50000"` (a cartograph frame supplies its own); a millimetre with no scale is an error naming the fix, because geometry runs once at ingest and cannot be re-resolved per frame the way an effect's uniforms can. Ground units (`tolerance="50m"`) need no scale. `simplify` is Douglas-Peucker measured on the GROUND, not in degrees. `smooth` is Chaikin, 1 pass removes the straight-segment look. `dot-density field="population" per="1000"` is seeded, so a recorded story and a live map place the same dots. `buffer distance="0.9mm" repeat="5" fade` is the engraved shoreline of an old chart: N bands are N thresholds of ONE signed distance field, so five cost what one costs and the output CANNOT self-intersect (no polygon arithmetic ever happens); each band carries `_band` and `_bandOpacity`, outermost first. It is an ORNAMENT with a measured half-cell bound (0.042mm at 300dpi), NOT an analytic setback — asking for the latter is an error naming PostGIS. `contour src="terrarium" bounds="[w,s,e,n]" interval="100m"` marches isolines off a DEM (not deck's ContourLayer, which contours point density); it SOURCES geometry onto a layer with no data, its extent is DECLARED rather than taken from the camera, each line carries `elevation` and `index` (true every fifth line), and the interval is a ground height — `interval="2mm"` is an error. Columnar layers are out of scope and say so. A LABEL THAT FOLLOWS ITS LINE is `<om-layer type="TextOnPathLayer" get-path="$path" get-text="$name">` — a river's name down the river, a range's along the range. deck has no such layer; this is a composite over `TextLayer` emitting one instance per glyph, each rotated to the local tangent. Add `pickable` for clickable labels: a pick reports the label's row (not a glyph), so `{{field}}` popups work (0.11.6+). `get-path` and `get-text` are both REQUIRED (either alone is silently inert, and the validator says so); `get-path` must resolve to a COORDINATE LIST: on GeoJSON that is `get-path="d.geometry.coordinates"`, because a `$field` compiles to `properties.<field>` and `$geometry` yields the geometry OBJECT, dropping every label silently (a `$field` is right only for FLAT rows carrying the list, e.g. `get-path="$path"`); `letter-spacing="1.5"` tracks glyphs out in pixels (the convention for oceans and ranges), `offset="5"` moves the label perpendicular with POSITIVE to the LEFT of the line's direction, `placement="auto"` (the DEFAULT) searches the line for the straightest reach the name fits on rather than pinning it to the midpoint — on real rivers a midpoint label routinely lands on a bend and wraps it; `start|middle|end` opt out when a name belongs somewhere specific. `max-angle="45"` is the legibility limit in degrees between adjacent glyphs (MapLibre's `text-max-angle` default); when no reach satisfies it the label is STRAIGHTENED rather than dropped. `orientation="curve|chord"` — `chord` lays the whole name straight along its span, angled to the line's direction, for data too jagged to follow. `max-labels` caps the glyphs emitted. It READS LEFT TO RIGHT whichever way the line was digitised — a path's direction is an accident of the data, so the layer flips the path and `start`/`end` flip with it. A name that does NOT FIT its line is dropped, not compressed and not run off the end. Placement is computed in SCREEN PIXELS and redone when the camera moves, because a glyph advance is pixels while a path is world distance; on a print sheet the camera is fixed, so it resolves once. The SVG export emits ONE `<textPath>` per label rather than per-glyph `<text>`. VECTOR EXPORT: `await map.snapshot({format: "svg"})` returns SVG TEXT (`as:"blob"` for a file) — polygons/paths as `<path>`, labels as real `<text>` after a deterministic CPU decluttering pass, and anything whose appearance is pixels as a placed raster `<image>`; consecutive raster layers merge into one band and a vector layer between them keeps them apart. A print finish treats the FINISHED frame, so a sheet carrying one exports as a single band at `effectDpi` (default 600, changes the band's pixel dimensions not its scaling) and reports it through `onNotice`; a decluttering layer does NOT trigger that (the test is a real post-process pass, not "deck has effects"). FREEZE: `await frame.freeze({format: "svg"})` turns a cartograph frame static with an inline `<svg>`, placed by the same `crs`+`corners` — a frozen sheet opens with no runtime, no network and nothing defining its custom elements. Deep reference: docs/cartography.md.
|