@nika-js/onlymap 0.13.1 → 0.13.3

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +3 -2
  3. package/bin/dem-tiles.mjs +270 -0
  4. package/bin/onlymapjs.mjs +138 -34
  5. package/dist/{basemap-zG1-omic.js → basemap-5NHR6Gio.js} +2 -2
  6. package/dist/{build-Bbi4SleC.js → build-DJjheWZ2.js} +10 -10
  7. package/dist/camera-altitude.d.ts +29 -0
  8. package/dist/{client-CIH6ToMI.js → client-0mQmDog8.js} +2 -2
  9. package/dist/color.d.ts +15 -0
  10. package/dist/credit-chrome.d.ts +11 -0
  11. package/dist/data-layer.d.ts +7 -15
  12. package/dist/elements/om-map.d.ts +41 -1
  13. package/dist/geodesy.d.ts +2 -0
  14. package/dist/{geoparquet-CyWsYt9S.js → geoparquet-B_nO2OyP.js} +3 -3
  15. package/dist/{globe-view-Xelgj_KW.js → globe-view-BFUa9ksE.js} +1 -1
  16. package/dist/ground-controller.d.ts +39 -0
  17. package/dist/{hillshade-Zbg50lm6.js → hillshade-B_CxPhtA.js} +61 -64
  18. package/dist/{hillshade-shader-DI2uLSNU.js → hillshade-shader-r7GxxjXj.js} +12 -11
  19. package/dist/hillshade-shader.d.ts +2 -2
  20. package/dist/hillshade.d.ts +0 -29
  21. package/dist/{index-JFuN4DCn.js → index-A1FYw2dy.js} +1 -1
  22. package/dist/{index-BbVnkgld.js → index-BvNxS6dM.js} +38 -38
  23. package/dist/{index-ClAPAqcm.js → index-CObPGkze.js} +38 -38
  24. package/dist/{index-BL_YCKiW.js → index-CU7RnKnO.js} +62 -62
  25. package/dist/{index-6eeSlSqN.js → index-CgIuV5Oh.js} +3 -3
  26. package/dist/{index-DnCmvLuC.js → index-ChmxbIdj.js} +61 -61
  27. package/dist/{index-BwtXeP_F.js → index-DT5d7kFO.js} +1 -1
  28. package/dist/{index-CpFNIkOO.js → index-DWijIMti.js} +22217 -20712
  29. package/dist/{index-BtRsa5oc.js → index-YMu_yLXO.js} +18 -18
  30. package/dist/index.d.ts +1 -1
  31. package/dist/{lerc-C3SKC6CU.js → lerc-Bl4vym9y.js} +1 -1
  32. package/dist/onlymap.standalone.js +39073 -37485
  33. package/dist/onlymapjs.js +49 -49
  34. package/dist/plane-gpu/plane-basemap.d.ts +0 -14
  35. package/dist/{post-process-effect-C3P9VwC9.js → post-process-effect-gFGVlC77.js} +1 -1
  36. package/dist/programmatic.d.ts +3 -1
  37. package/dist/{raster-BgCnz9-Z.js → raster-1ShXyF12.js} +4 -4
  38. package/dist/{raster-pipeline-CKdpKgFo.js → raster-pipeline-BMS54TX2.js} +11 -11
  39. package/dist/runtime-core.d.ts +147 -0
  40. package/dist/sea-surface.d.ts +18 -0
  41. package/dist/terrain-derive.d.ts +39 -0
  42. package/dist/terrain-ground.d.ts +31 -0
  43. package/dist/terrain-heightfield.d.ts +17 -9
  44. package/dist/terrain-inspect-Cndlmxig.js +96 -0
  45. package/dist/terrain-inspect.d.ts +34 -0
  46. package/dist/terrain-nodata.d.ts +50 -0
  47. package/dist/terrain-priority.d.ts +92 -0
  48. package/dist/terrain-sample.d.ts +6 -0
  49. package/dist/terrain-skirt.d.ts +6140 -0
  50. package/dist/terrain-texture-mask.d.ts +40 -0
  51. package/dist/terrain-tint.d.ts +61 -0
  52. package/dist/terrain.d.ts +132 -8
  53. package/dist/{text-on-path-BpVLX8Yt.js → text-on-path-QInco4aP.js} +1 -1
  54. package/dist/tile-url.d.ts +94 -0
  55. package/dist/version.d.ts +1 -1
  56. package/dist/viewport-filter.d.ts +9 -0
  57. package/dist/volumetrics.d.ts +11 -0
  58. package/dist/{zarr-Cur_pzNa.js → zarr-CYD8fyBe.js} +2 -2
  59. package/docs/cartograph.md +2 -2
  60. package/llms.txt +2 -2
  61. package/onlymapjs.html-data.json +163 -3
  62. package/package.json +2 -1
  63. package/skills/onlymapjs/SKILL.md +6 -2
  64. package/skills/onlymapjs/references/syntax.md +12 -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 terrain-surface layer itself. `operation: "terrain+draw"` makes it
112
- * double as the elevation surface extension-carrying layers drape onto;
113
- * `pickable: "3d"` runs the depth pick pass so click/hover coordinates
114
- * unproject at the SURFACE's depth instead of z=0 sea level (without it,
115
- * tilted-view picks/drawn vertices land behind the cursor). Exempt from
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 buildTerrainLayer(ir: TerrainIR): Layer;
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;
@@ -1,4 +1,4 @@
1
- import { c as N, ad as E } from "./index-CpFNIkOO.js";
1
+ import { c as N, am as E } from "./index-DWijIMti.js";
2
2
  const z = Math.PI / 180, O = 45, I = 24, T = /* @__PURE__ */ new Map();
3
3
  let P = null;
4
4
  function W(e) {
@@ -0,0 +1,94 @@
1
+ /** Every token a raster TileLayer template may carry. */
2
+ export declare const TILE_TOKENS: readonly ["z", "x", "y", "-y", "bbox-epsg-3857", "width", "height", "quadkey"];
3
+ /** The tokens deck fills on its own — the only ones an MVTLayer, terrain or hillshade template can use. */
4
+ export declare const DECK_TILE_TOKENS: readonly ["z", "x", "y", "-y"];
5
+ /** The tokens only OnlyMapJS fills, for a raster TileLayer. */
6
+ export declare const EXTENDED_TILE_TOKENS: readonly ["bbox-epsg-3857", "width", "height", "quadkey"];
7
+ /**
8
+ * The `{token}` names in a template, in order, duplicates kept. Only
9
+ * identifier-like names count: `{"rasterFunction":"Hillshade"}` in an ArcGIS
10
+ * query string is JSON the service reads, not a token.
11
+ */
12
+ export declare function templateTokens(template: string): string[];
13
+ /** Does the template carry a token deck cannot fill (bbox, size, quadkey)? */
14
+ export declare function hasExtendedTokens(template: string | string[] | null | undefined): boolean;
15
+ /** A tile's Web Mercator bounds in metres: [minx, miny, maxx, maxy]. */
16
+ export declare function tileBboxEpsg3857(x: number, y: number, z: number): [number, number, number, number];
17
+ /** A tile's quadkey: one base-4 digit per zoom level, most significant first ("" at z0). */
18
+ export declare function tileQuadkey(x: number, y: number, z: number): string;
19
+ /**
20
+ * One tile's URL. deck's own filler does `{x}`/`{y}`/`{z}`/`{-y}` and picks
21
+ * among several templates by tile id; the extended tokens are filled here.
22
+ * Every token present is substituted, so a template mixing `{z}` with
23
+ * `{bbox-epsg-3857}` gets both.
24
+ */
25
+ export declare function fillTileTemplate(template: string | string[], index: {
26
+ x: number;
27
+ y: number;
28
+ z: number;
29
+ }, tileSize?: number): string;
30
+ /** The extended tokens only, on a URL deck has already filled (deck's TileLayer sets `tile.url` before calling getTileData). */
31
+ export declare function fillExtendedTokens(url: string, index: {
32
+ x: number;
33
+ y: number;
34
+ z: number;
35
+ }, tileSize?: number): string;
36
+ /**
37
+ * A tile template, passed to deck as its `data` rather than fetched as a
38
+ * document: tile-indexed (`{z}`, `{x}` and `{y}`), extent-addressed
39
+ * (`{bbox-epsg-3857}`, a WMS), or quadkey-addressed (`{quadkey}`).
40
+ */
41
+ export declare function isTileTemplateUrl(url: string): boolean;
42
+ /**
43
+ * A tile template whose tiles are IMAGES — what a bare TileLayer draws as
44
+ * bitmaps, and the one tiled source a projected map can warp into its plane.
45
+ * Recognised by an image extension on the path (`…/{z}/{x}/{y}.png`) or, for a
46
+ * service that names its format as a parameter, `FORMAT=image/…` (a WMS
47
+ * GetMap) or `format=png|jpg|jpeg|webp` (an ArcGIS export). One predicate, shared by the renderer and the validator.
48
+ */
49
+ export declare function isImageTileTemplate(url: string | null | undefined): boolean;
50
+ /**
51
+ * The request options a layer's `load-options` give deck's own tile fetch
52
+ * (loaders.gl reads `fetch`, or `core.fetch`): headers, credentials, mode. A
53
+ * function-valued fetch is deck's to call; only a plain options object
54
+ * carries over to the template loader.
55
+ */
56
+ export declare function tileFetchInit(loadOptions: unknown): RequestInit;
57
+ /** A tile request that failed, carrying the URL and enough of the cause to name a fix. */
58
+ export declare class TileLoadError extends Error {
59
+ readonly url: string;
60
+ readonly kind: "network" | "http" | "service-exception" | "not-an-image";
61
+ readonly status?: number | undefined;
62
+ constructor(message: string, url: string, kind: "network" | "http" | "service-exception" | "not-an-image", status?: number | undefined);
63
+ }
64
+ /**
65
+ * getTileData for a template deck cannot fill on its own. Fetches the filled
66
+ * URL and returns the decoded image (an ImageBitmap, what deck's own image
67
+ * loading yields). A response that is not an image — a WMS ServiceException
68
+ * is XML served with status 200 — throws a TileLoadError naming the cause
69
+ * rather than failing to decode; deck then leaves that tile empty.
70
+ */
71
+ export declare function templateTileLoader(template: string | string[], tileSize: number, init?: RequestInit): (tile: {
72
+ index: {
73
+ x: number;
74
+ y: number;
75
+ z: number;
76
+ };
77
+ signal?: AbortSignal;
78
+ url?: string | null;
79
+ }) => Promise<ImageBitmap>;
80
+ /**
81
+ * A failed tile as a runtime diagnostic: what went wrong and how to fix it.
82
+ * `key` groups failures of the same kind, so a layer reports each cause once
83
+ * rather than once per tile.
84
+ */
85
+ export declare function describeTileError(layerId: string, error: unknown): {
86
+ key: string;
87
+ entry: {
88
+ severity: "error" | "warning";
89
+ element: string;
90
+ attribute: string;
91
+ message: string;
92
+ fix: string;
93
+ };
94
+ } | null;
package/dist/version.d.ts CHANGED
@@ -5,4 +5,4 @@
5
5
  * the build rootDir, and a `define` would need repeating across vite/vitest/
6
6
  * vite-node configs.
7
7
  */
8
- export declare const LIBRARY_VERSION = "0.13.1";
8
+ export declare const LIBRARY_VERSION = "0.13.3";
@@ -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 {};
@@ -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-CKdpKgFo.js";
2
- import { c as gr } from "./index-CpFNIkOO.js";
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-BMS54TX2.js";
2
+ import { c as gr } from "./index-DWijIMti.js";
3
3
  import $t from "./index-CW1n5LdO.js";
4
4
  var Et;
5
5
  function h(e, t, n) {
@@ -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.1/dist/cartograph.standalone.js"></script>
26
- <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.13.1/dist/cartograph.css">
25
+ <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.13.3/dist/cartograph.standalone.js"></script>
26
+ <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.13.3/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"