@nika-js/onlymap 0.10.10 → 0.11.0

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 (51) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +14 -2
  3. package/dist/{basemap-BH76eQA0.js → basemap-Bg73oXUb.js} +2 -2
  4. package/dist/cluster-index.d.ts +77 -0
  5. package/dist/cluster-options.d.ts +92 -0
  6. package/dist/ctx.d.ts +2 -0
  7. package/dist/elements/om-map.d.ts +6 -0
  8. package/dist/{geoparquet-DzKLe-0r.js → geoparquet-BASBa9tf.js} +1 -1
  9. package/dist/{globe-view-B-prUQFh.js → globe-view-CTkofOiM.js} +1 -1
  10. package/dist/{hillshade-CDng2Jsi.js → hillshade-DdVEO8lc.js} +1 -1
  11. package/dist/html-data.d.ts +1 -1
  12. package/dist/{index-laD2SEAB.js → index-BCDmJfeb.js} +3 -3
  13. package/dist/{index-DOfIeNux.js → index-BLfj5bIo.js} +1 -1
  14. package/dist/{index-D86S8KJ1.js → index-BOjo5N6i.js} +1 -1
  15. package/dist/{index-DvEcTZ4i.js → index-C-YAnesV.js} +17527 -16473
  16. package/dist/{index-CpLydTmE.js → index-C7CNrOGW.js} +1 -1
  17. package/dist/{index-Rvd-zFrS.js → index-CVAyXg52.js} +1 -1
  18. package/dist/{index-cwieLGSg.js → index-DbfTOgYl.js} +1 -1
  19. package/dist/{index-8Fj-yh7f.js → index-DsLNa_IB.js} +2 -2
  20. package/dist/{index-CIo8LgRZ.js → index-FtNZZGWv.js} +3 -3
  21. package/dist/ir-snapshot.d.ts +10 -0
  22. package/dist/ir.d.ts +9 -0
  23. package/dist/layer-registry.d.ts +8 -0
  24. package/dist/layers/cluster-layer.d.ts +111 -0
  25. package/dist/{lerc-BJB4-X6n.js → lerc-CoNq0xxX.js} +1 -1
  26. package/dist/onlymap.standalone.js +35944 -34890
  27. package/dist/onlymapjs.js +1 -1
  28. package/dist/{post-process-effect-Bd5plkno.js → post-process-effect-CrZoIEYa.js} +1 -1
  29. package/dist/programmatic.d.ts +6 -0
  30. package/dist/{raster-DJ6vvro6.js → raster-CZMdghdy.js} +3 -3
  31. package/dist/{raster-pipeline-BQhNhrPq.js → raster-pipeline-n2wrLc9r.js} +1 -1
  32. package/dist/runtime-core.d.ts +24 -0
  33. package/dist/{text-on-path-CrqchF3O.js → text-on-path-CHkHjky-.js} +1 -1
  34. package/dist/version.d.ts +1 -1
  35. package/dist/{zarr-oAkG7ZLM.js → zarr-DRBhsEZZ.js} +2 -2
  36. package/docs/cartograph.md +2 -2
  37. package/llms.txt +2 -1
  38. package/onlymapjs.attributes.json +33 -0
  39. package/onlymapjs.html-data.json +68 -0
  40. package/package.json +7 -3
  41. package/skills/onlymapjs/SKILL.md +3 -2
  42. package/skills/onlymapjs/references/react.md +1 -0
  43. package/skills/onlymapjs/references/syntax.md +47 -2
  44. package/docs/design/arrows.md +0 -182
  45. package/docs/design/carto-substrate.md +0 -1067
  46. package/docs/design/cog-v2.md +0 -223
  47. package/docs/design/extensions.md +0 -250
  48. package/docs/design/frame-sources.md +0 -229
  49. package/docs/design/hillshade.md +0 -290
  50. package/docs/design/paced-flyby.md +0 -42
  51. package/docs/design/trace-link-failure.md +0 -20
@@ -1,229 +0,0 @@
1
- # Frame sources — what a cartograph frame shows, and where
2
-
3
- Design for `<om-frame>`'s source resolution: **one ordered mechanism** in place of a
4
- live `src` with a bolted-on rescue, so a sheet renders correctly in the editor that
5
- wrote it, in a browser that has never heard of the host app, and in an export.
6
-
7
- **Versions are assigned at release, not here.** This first read as a minor — a new public
8
- element plus a changed definition of frame readiness. It shipped as a PATCH (0.10.6),
9
- because the readiness change turned out to affect no existing document: a frame with one
10
- source has nothing to fall through to, so it behaves exactly as before, and there is a test
11
- asserting it. What remains is purely additive. The rule this repo actually gates a minor on
12
- — the bundled deck.gl/luma.gl pin moving — is untouched, and precedent agrees: 0.10.5
13
- shipped two new attributes AND a changed default that altered how existing manifests
14
- render, as a patch.
15
-
16
- ---
17
-
18
- ## 1. The observation this rests on
19
-
20
- A generated A3 plate — Albers CONUS, relief, coastal vignette, curved river labels —
21
- validated clean and rendered correctly in the host app's editor. Opened as a file it
22
- showed a blank frame surrounded by correct furniture.
23
-
24
- Tracing it gave a result that invalidates the obvious fix:
25
-
26
- | step | outcome |
27
- |---|---|
28
- | `src="../maps/map-bd54….html"` from the cartograph's own directory | **resolves** — it is a real relative path |
29
- | the map document loads | **succeeds** |
30
- | its layers, on `nika-file://localhost/…` | fail — a host-registered protocol that exists only inside the app |
31
- | its `basemap="none"` | nothing to fall back on |
32
- | the frame | mounts a map with zero drawable layers and reports success |
33
-
34
- ### It fails two different ways, and only one of them is loud
35
-
36
- The trace above is the file:// case. The host app's own PREVIEW fails differently, and
37
- finding that out changed what the readiness test has to cover.
38
-
39
- | context | `src` resolves? | outcome |
40
- |---|---|---|
41
- | opened from the cartograph's own directory | yes — a real relative path | map loads, layers fail on the host protocol → **silent blank frame** |
42
- | the app's HTML preview, before it was fixed | on disk yes, in the URL no — the preview served the sheet through a scheme that percent-encoded its whole path into ONE URL segment, so `../maps/…` resolved to the scheme root | → **loud 404** |
43
-
44
- Two symptoms that need different detection, and — as it turned out — two different root
45
- causes. The loud one was never the sheet's fault: the host served it from a URL whose
46
- whole filesystem path was one percent-encoded segment, so `../maps/…` resolved to the
47
- scheme root and no relative reference of any kind could work. That is fixed in the host,
48
- where it belongs (§10), and it is why the flat preview cache this section first blamed was
49
- a red herring — the preview serves the ORIGINAL file, in its own directory.
50
-
51
- The silent one is the real subject of this design, and the reason readiness cannot be
52
- defined on loading.
53
-
54
- A design that only handled the loud case would look correct in the preview, where it is
55
- most often seen, and do nothing in the file the user actually sends to someone.
56
-
57
- **The silent failure.** `showPlaceholder("load-failed")` never runs, because nothing
58
- failed in the sense the frame checks for. A raster fallback hung off the error path —
59
- the design this document replaced — would have sat unused while the sheet showed a blank
60
- box. It would have been a mechanism that does not fire in the only case it exists for.
61
-
62
- The generalisation matters more than the instance. Outside the host app the live path
63
- does not *sometimes* fail; it fails essentially always, because both halves of it are
64
- app-local: a relative path into the host's storage, and a custom protocol for the data.
65
- So "fallback" misnames it. Outside the app a capture is not the rescue, it is the only
66
- thing that can render, and a design that treats it as exceptional has the priority
67
- backwards.
68
-
69
- ## 2. What is wrong with the current model
70
-
71
- `src` names **one** source and assumes it works. Three contexts need three answers, and
72
- today two of them are served by machinery outside the element:
73
-
74
- - the editor, which has the app protocol and the sibling map — the live path;
75
- - a stored file opened anywhere else — nothing;
76
- - an export, where the host inlines the map, embeds its layer data, and deletes `src`.
77
-
78
- The export path proves the point: it exists precisely because `src` cannot survive
79
- leaving the app. It is a second resolution strategy implemented in the host rather than
80
- in the element, which is why the element cannot degrade on its own.
81
-
82
- ## 3. The model: ordered sources
83
-
84
- A frame declares its sources in priority order and takes the first that **renders**.
85
-
86
- ```html
87
- <om-frame id="main" center="[-96, 38]" zoom="3.25">
88
- <om-source src="../maps/map-bd54….html"></om-source>
89
- <om-source src="captures/main@2x.png" corners="[[…],[…],[…],[…]]" crs="EPSG:5070"></om-source>
90
- </om-frame>
91
- ```
92
-
93
- - `src=` on the frame stays as shorthand for a single `<om-source src=…>`, so every
94
- existing document keeps working and the common case stays one line.
95
- - **One attribute for both kinds: `src`.** A map document and a raster are both "where
96
- this frame's picture comes from", and two attribute names would make the author state
97
- a thing the file extension already says. The kind is read from the extension — `.html`
98
- is a map document, an image extension is a raster — and an unrecognised one is a
99
- validation error naming both, rather than a silent guess. `corners`/`crs` appearing on
100
- a source is what makes it georeferenced, which is orthogonal to its kind.
101
- - **The frame states which source it settled on**, as an attribute reflecting the
102
- resolved index and a `om-frame-source` event. A capture shown silently is its own
103
- trap: an editor should be able to say "showing a capture from 12 March", and F6's
104
- concern about masking a broken map depends on the choice being visible.
105
- - Order is document order. No scoring, no heuristics about the environment: a source
106
- either rendered or it did not, and the frame moves on.
107
- - A raster source carries the georef that was true **when it was captured** — the same
108
- thing `freeze()` already stamps onto a frame — so furniture is correct even when the
109
- live map never loaded and its CRS is therefore unknowable. Deriving corners from the
110
- authored camera via `cornersFromCamera` was considered and is Mercator-only, so it is
111
- wrong for exactly the projected sheets this feature is for.
112
-
113
- Each context then gets the right answer with no special case:
114
-
115
- | context | resolves to |
116
- |---|---|
117
- | the editor | the live map |
118
- | a stored file, opened anywhere | the capture — a correct picture, not a blank box |
119
- | an export | the map inlined; no `src` to resolve |
120
-
121
- ## 4. The hard part: what "rendered" means
122
-
123
- This is the whole design. "Loaded" is not enough — the failure above loaded fine.
124
-
125
- A source has rendered when the frame can show something a reader would recognise as the
126
- map. The proposed test, in order of preference:
127
-
128
- 1. **At least one drawable layer after settle.** The frame already awaits
129
- `mapEl.whenSettled?.({ timeout: 20_000 })`; the map already tracks layer readiness.
130
- Zero drawable layers after settle is observable, needs no cooperation from the map,
131
- and covers the `nika-file://` case exactly — every layer's fetch failed, so none is
132
- drawable.
133
- 2. A basemap counts as drawable. A map that is deliberately only a basemap is a
134
- legitimate frame, and `basemap="none"` is what made the instance above empty.
135
- 3. **Not** "every layer loaded". A sheet whose fifth layer 404s is degraded, not failed,
136
- and silently swapping it for a stale capture would be worse than showing it.
137
-
138
- The bar is deliberately low — *something* drew — because the alternative is the frame
139
- adjudicating cartographic quality, which it cannot do and should not try.
140
-
141
- ### The timing cost
142
-
143
- A source that fails by rendering nothing costs a full settle before the next is tried,
144
- up to the existing 20 s timeout. That is acceptable for the stored-file case, which is
145
- one-shot, and invisible in the editor, where source 1 succeeds. It is not acceptable to
146
- pay it on every frame of a paced flyby — but a flyby drives a live map, not a cartograph
147
- frame, so the path is not shared.
148
-
149
- ## 5. Caveat register
150
-
151
- | # | Caveat | Resolution |
152
- |---|---|---|
153
- | F1 | The failure has TWO shapes: silent from file:// (map loads, draws nothing) and, formerly, a loud 404 in the app preview, whose URL shape broke the relative `src`. A design fitted to the loud one looks right where it is most often seen and does nothing in the file that gets sent to someone | readiness is defined on drawable layers, not on load, so both shapes resolve to the next source. The loud shape was a HOST bug and is fixed there (§10) — which leaves the silent one as the case this design must carry, exactly as argued |
154
- | F2 | A raster's georef cannot be derived when the live map never loaded, because its CRS comes from that map | the capture carries `corners` + `crs`, as `freeze()` already writes them |
155
- | F3 | `cornersFromCamera` needs only the core module and the authored camera — tempting as a no-new-attributes answer | it builds a `WebMercatorViewport`, so it is wrong for any projected sheet, which is the case this serves |
156
- | F4 | Validation forbids `corners`/`crs` on a LIVE frame, for good reason — a live frame derives them | the attributes move to `<om-source>`, where they describe that source rather than the frame |
157
- | F5 | A failed source costs a full settle before the next is tried | one-shot contexts only; no cartograph frame is on a per-frame animation path |
158
- | F6 | Ordered sources could mask a genuinely broken map in the editor, where the author wants the error | the editor is source 1 and reports its own failure; a later source is reached only after source 1 has demonstrably drawn nothing, and the frame should say which source it settled on |
159
- | F7 | Captures go stale against the map they came from | out of scope here; a host that stores captures already versions them, and that is where staleness belongs |
160
-
161
- ## 6. Alternatives considered
162
-
163
- **A raster hung off the error path.** The original proposal, and wrong: the failure it
164
- exists for is silent, so it would never fire. Recorded because the reasoning is not
165
- obvious until the resolution is actually traced.
166
-
167
- **Always inline the map on write.** What export does, and it genuinely works — but it
168
- duplicates the map into every sheet on every autosave, and gives snapshot semantics
169
- where `src` deliberately gives live ones. Edits to the map would stop reaching the
170
- sheet, which is the reason `src` exists.
171
-
172
- **Detect the environment.** "Am I in the host app?" is not knowable from the element, and
173
- a document that behaves differently depending on where it is opened is worse than one
174
- that tries sources in a stated order.
175
-
176
- ## 7. Non-goals
177
-
178
- - Deciding whether a capture is out of date. F7.
179
- - Making `nika-file://` resolve outside its host. That is the host's protocol and its
180
- business; this design is about surviving its absence.
181
- - Choosing a source by quality, resolution or size. Order is the author's statement of
182
- preference, and adding scoring would make the result depend on the environment again.
183
-
184
- ## 8. Acceptance
185
-
186
- - A sheet whose live source draws nothing renders its capture, not a blank box — tested
187
- against the real failure: a map on a host-local protocol, loaded successfully, with
188
- zero drawable layers.
189
- - A sheet whose live source works is unchanged, and pays nothing for the mechanism.
190
- - Furniture is correct on whichever source won, which means `om-frame-view` fires on a
191
- source switch (see §9, `arrows.md`).
192
- - An existing `src=` document renders identically, with no edit.
193
- - The frame states which source it settled on, so a capture is never shown silently.
194
-
195
- ## 9. Decisions
196
-
197
- 1. **The frame reports which source it settled on.** An attribute plus an
198
- `om-frame-source` event. Silence would make a capture indistinguishable from a live
199
- map, and F6 depends on the choice being visible.
200
- 2. **One attribute, `src`, for both kinds**, with the kind read from the extension. Two
201
- names would restate what the filename already says, and a `type` buys extensibility
202
- that no third kind is asking for yet.
203
- 3. **Captures are relative paths in the stored document, embedded at export.** Keeps the
204
- stored file readable and diffable, and export already embeds rasters, so the split follows machinery that exists.
205
-
206
- The consequence must be stated rather than discovered: a stored cartograph is then
207
- **renderable in place, not portable**. Moving the file alone breaks its captures, the
208
- same way it breaks its `src` today. Export is what produces a file that survives
209
- being sent to someone. This belongs in the cartograph skill — the word "standalone"
210
- has already misled once, when it described a document whose head had no runtime.
211
-
212
- ## 10. Adjacent designs, deconflicted
213
-
214
- - **`carto-substrate.md` §7 (freeze to vector)** — `freeze()` converts a live frame to a
215
- static one, writing `corners` + `crs`. This design reuses that georef contract for a
216
- raster source rather than inventing a second one; freeze remains the way a frame stops
217
- being live at all.
218
- - **`arrows.md`** — NOT untouched, as a first pass assumed. It depends on furniture
219
- re-rendering when `om-frame-view` fires (`om-cartograph.ts:81`) and on the frame
220
- footprint `overview-of` computes (`om-frame.ts:452`). Settling on a different source
221
- changes the frame's georef, so **a source switch must fire `om-frame-view`** — an arrow
222
- or a graticule left on the previous source's georef is the same class of silent wrong
223
- output this design exists to remove. Added to the acceptance bar below.
224
- - **`extensions.md`** — no interaction found; it names no frame and no source.
225
- - **The host's preview URL** — a previewed page
226
- is now served with its path separators intact, so a relative `src` resolves against the
227
- sheet's own folder, and each document a frame names is approved on open. That removes
228
- the loud shape in F1 and is a prerequisite for `src` being meaningful in the app at all.
229
- It does nothing for a sheet opened outside the app, which is what §3 is for.
@@ -1,290 +0,0 @@
1
- # Hillshade / shaded relief — design (shipped in 0.9.1)
2
-
3
- ## The tracker situation
4
-
5
- There is **no open hillshade issue**. All 45 issues on the public mirror were read
6
- (title, body and comments); the only place hillshade appears anywhere in the tracker
7
- is issue **#13 — COGLayer v2**, which is `CLOSED / COMPLETED`, and which names it in
8
- the *Non-goals* line:
9
-
10
- > Raster analysis (hillshade/slope — app territory).
11
-
12
- The nearest **open** issue is **#23 — Terrain GPU viewshed + point-to-point
13
- line-of-sight**, which shares this feature's DEM machinery without sharing its
14
- purpose. So the reconciliation below is against those two: a closed decision that
15
- currently says *no*, and an open ticket that owns the same substrate.
16
-
17
- ---
18
-
19
- ## Reconciling #13's "no" with the cartographic "yes"
20
-
21
- #13 was written from a **raster-analysis** framing: a user brings a DEM COG, and the
22
- library derives a queryable product from it — slope in degrees, aspect classes,
23
- numbers you identify and legend. That is app territory, and it still is.
24
-
25
- Cartography wants a different thing that happens to use the same arithmetic:
26
- **shaded relief as rendered texture**. Nothing is queried, nothing is classified,
27
- nothing is reported. It is styling output, in exactly the sense that `classify` and
28
- the raster colormap are styling output while statistics are not. The library already
29
- draws its line there.
30
-
31
- | | #13's hillshade (out) | Cartographic hillshade (in) |
32
- |---|---|---|
33
- | Output | numbers per cell (slope°, aspect) | pixels |
34
- | Queried by `identify` | yes | no |
35
- | Needs the user's own DEM | yes | no — a named keyless global source |
36
- | Lives in | an analysis toolbox | the render pipeline |
37
-
38
- **Resolution:** the non-goal in #13 stands as written. This feature does not
39
- contradict it, because it ships no analytic product. If slope/aspect *values* are
40
- ever wanted, that is still a separate ticket and still probably app territory.
41
-
42
- The one line worth adding to #13's record, if it is ever reopened: the boundary is
43
- **queryability**, not the arithmetic.
44
-
45
- ## Reconciling with #23 (viewshed / LOS)
46
-
47
- #23's implementation plan item 2 is "DEM read-back". That work is **already done** —
48
- it landed for cut/fill volumetrics:
49
-
50
- - `src/terrain-sample.ts` — `tilePixel()` slippy-tile math, one-shot elevation query.
51
- - `src/terrain-heightfield.ts` — bulk tile loader with a per-tile timeout, `elevationAt()`.
52
- - `src/volumetrics.ts` — `sampleBilinear()`, seam-correct, pure, worker-shareable.
53
- - `src/terrain.ts` — `DECODERS` (`terrarium`, `mapbox-rgb`), `registerTerrain`, three presets
54
- including the keyless AWS terrarium default.
55
-
56
- Hillshade and #23 therefore **share a substrate and diverge above it**:
57
-
58
- | | Hillshade | #23 viewshed |
59
- |---|---|---|
60
- | Sampling | GPU, in the fragment shader, per tile texture | CPU (`terrain-heightfield`) for LOS; depth pass for viewshed |
61
- | Needs `terrain=` active | **no** — works at pitch 0 on a flat sheet | yes, hard requirement |
62
- | deck seam | a layer + a raster module | a `LayersPass` fork in `buildEffects()` |
63
- | Coverage honesty | tile pyramid, same as any raster | must clamp to loaded-tile coverage |
64
-
65
- Shared, and worth doing once: **decode correctness** (below), the unexaggerated-height
66
- rule (`terrain-exaggeration` is a display transform; neither feature may read through
67
- it), and the lazy-chunk discipline.
68
-
69
- **Nothing here blocks or is blocked by #23.** The only thing hillshade takes off
70
- #23's plate is half of its item 2, and it hardens it.
71
-
72
- ## Not a mode of `terrain=`
73
-
74
- `terrain="…"` means a 3D surface: it replaces the active basemap, changes what the
75
- camera means, and is meaningless at pitch 0. A print sheet wants a flat shaded raster
76
- that composes *underneath the data layers like any other layer*. Same decoders,
77
- different rendering contract — folding them together would make both harder to
78
- explain. Hillshade is a **layer**.
79
-
80
- That also buys the cartographic property that matters most: a layer draws inside
81
- deck's own framebuffer, so it lands in `snapshot()` and **under `<om-effect>`** — where
82
- a MapLibre basemap composites beneath the effect pass and stays untreated (the exact
83
- case `validateEffectEl` already warns about). Shaded relief that the print finish
84
- cannot reach would be worth very little.
85
-
86
- ---
87
-
88
- ## Two entry points, one shader
89
-
90
- 1. **`<om-layer type="HillshadeLayer">`** over `{z}/{x}/{y}` RGB-encoded DEM tiles —
91
- the cartographic path. Keyless and global — no key, no account, no data of the
92
- author's own — reusing `DECODERS` and the `registerTerrain` presets as sources,
93
- named through `src` (open question 2).
94
- 2. **`shading="hillshade"` on `COGLayer` / `ZarrLayer`** — the author's own DEM, in
95
- float, composing with the existing `stretch` / `gamma` / `colormap` chain so a
96
- hypsometric tint under relief is one layer, not two.
97
-
98
- > **Corrected after phase 2.** This section originally said both entry points would
99
- > compile to one module inside `src/raster-pipeline.ts`. They do not, and the reason
100
- > is worth recording. That pipeline's modules inject at `DECKGL_FILTER_COLOR`, which
101
- > is **pointwise** — a module there receives `color`, not the means to sample its
102
- > neighbours. Hillshade is the first *neighbourhood* module anyone has wanted in it,
103
- > and a neighbourhood module must own a sampler and a texel size. So the shipped
104
- > module lives in `src/hillshade.ts`, declares its own sampler through `fs:#decl` and
105
- > binds it through `getUniforms` — exactly how upstream's own `CompositeBands` binds
106
- > `band0`–`band3`, and what frees it from any host layer's declaration order.
107
- >
108
- > The GLSL is therefore already host-agnostic, which is what phase 4 needs: the COG
109
- > path supplies a different texture and a different texel-to-metres factor, not
110
- > different arithmetic. What phase 4 still has to solve is **ground scale**, which
111
- > the tile path gets free from Web Mercator and a COG does not.
112
-
113
- ```html
114
- <!-- cartographic: keyless relief under everything else -->
115
- <om-map center="[7.65, 45.98]" zoom="9" basemap="none" validate>
116
- <om-layer type="HillshadeLayer" src="terrarium"
117
- sun-azimuth="315 45 135" sun-elevation="45" z-factor="1.4"
118
- opacity="0.55"></om-layer>
119
- <om-layer id="trails" type="GeoJsonLayer" data="./trails.geojson"></om-layer>
120
- <om-effect preset="vintage"></om-effect>
121
- </om-map>
122
-
123
- <!-- the author's own DEM, relief over a hypsometric tint, one layer -->
124
- <om-layer type="COGLayer" src="./dem.tif" colormap="terrain" shading="hillshade"></om-layer>
125
- ```
126
-
127
- Illumination reuses `scene-lighting.ts`'s convention exactly — **azimuth ° clockwise
128
- from north, elevation ° above the horizon** — so `sun-azimuth` on a hillshade and
129
- `lighting-sun-azimuth` on the map mean the same number. It does **not** auto-inherit
130
- the map's lighting (silent coupling between a 3D scene light and a 2D raster is the
131
- kind of thing that is impossible to debug from markup); see open question 1.
132
-
133
- ## Multi-directional is a list, not a boolean
134
-
135
- `sun-azimuth` takes **one to four azimuths**, and `sun-weight` optionally takes the
136
- matching blend weights (defaulting to equal). One value is a single light; three is
137
- Swiss-style relief. There is no `multi-directional` boolean, and this is a tiering
138
- rule rather than a style preference:
139
-
140
- > a preset must be expressible in the tier below it … If a preset ever needed
141
- > something the op tier could not express, the op tier would be the thing to fix.
142
- > — `src/post-process/presets.ts`
143
-
144
- A boolean that blends azimuths the author cannot otherwise name would be exactly
145
- the violation that comment exists to prevent: capability reachable only from the
146
- shorthand. The list is the Tier 1 surface; `multi-directional` may return later as
147
- a *named seeding* of it — `sun-azimuth="315 15 75 135"` under a word — the way
148
- `lighting="daylight"` only seeds `lighting-ambient` / `lighting-sun`, and
149
- `preset="vintage"` only seeds an op list that `expandPreset` will hand back. If it
150
- does, it ejects the same way.
151
-
152
- For cartography this is also the better surface on its own terms: the whole point
153
- of multi-directional relief is that the azimuths are *chosen* for the terrain —
154
- which is a tuning job, not a toggle.
155
-
156
- ---
157
-
158
- ## The five things that will actually bite
159
-
160
- 1. **Decode precision.** Neither `terrain-sample.ts:45` nor `terrain-heightfield.ts:62`
161
- passes `{ premultiplyAlpha: "none", colorSpaceConversion: "none" }` to
162
- `createImageBitmap`, and both then read through a canvas 2D context. For a point
163
- elevation query a ±1 LSB error is sub-metre noise nobody sees. Hillshade
164
- **differentiates neighbouring samples**, so the same error becomes visible banding
165
- across a whole slope. Fix at every site; #23's LOS half inherits the fix. Lossy-
166
- recompressed DEM tiles are unusable for the same reason and warrant a dev notice.
167
- 2. **Tile-edge seams.** A derivative needs a one-pixel halo from the neighbouring
168
- tile. Without it, every tile boundary draws a dark grid line — the single most
169
- recognisable way a hand-rolled hillshade looks broken. Either sample a 1px overlap
170
- or bind neighbour textures; decide in phase 2, test for it explicitly.
171
- 3. **Resolution.** The DEM tile zoom must follow the **capture** pixel ratio, or a
172
- 300 dpi plate renders mushy relief at screen resolution. This is the same class of
173
- bug as the pixel-keyed grain that `<om-effect>` solved with millimetres; bind to
174
- the existing `withCapturePixelRatio` seam in `runtime-core.ts`.
175
- 4. **Latitude.** Web Mercator ground metres per pixel scale with cos(latitude). A
176
- fixed z-factor makes relief flatten toward the equator and exaggerate toward the
177
- poles. Scale the horizontal step per tile by cos φ.
178
- 5. **One light looks like a web map.** Swiss-style relief blends two to four azimuths.
179
- Single-light shading is what every slippy map already ships and is precisely the
180
- look we are trying to get away from. Blended azimuths are a quality feature, not a
181
- nicety — which is why they are an authorable list and not a boolean (above).
182
-
183
- ---
184
-
185
- ## Phases
186
-
187
- Each phase is independently green and independently shippable, with its own doc-sync
188
- per the repo checklist.
189
-
190
- **Phase 1 — decode correctness (shared with #23). — IMPLEMENTED 2026-09-21.**
191
- `src/dem-decode.ts` is now the single decode path: exact-byte `createImageBitmap`
192
- options into an opaque, fixed-colour-space canvas, with `fetchDemTile` used by both
193
- `terrain-sample.ts` and `terrain-heightfield.ts`, and the RGB→metres arithmetic
194
- shared as `volumetrics.ts`'s `decodeElevationRgb`. A lossy DEM source warns once per
195
- host. Pinned by `src/dem-decode.test.ts`, which asserts the decode OPTIONS rather
196
- than a picture — a unit test cannot prove a browser skipped colour management, only
197
- that every site asked it to.
198
-
199
- **Phase 2 — the module and the layer. — IMPLEMENTED 2026-09-21.** The hillshade GPU module in
200
- `raster-pipeline.ts`; `HillshadeLayer` over `{z}/{x}/{y}` RGB DEM tiles resolving
201
- `src` through `getTerrain()` presets (`src="terrarium"`) or a raw URL + `decoder`,
202
- exactly as `parseTerrainAttrs` already does. `src` is **required** — see open
203
- question 2. Single light, greyscale. Registered through `layer-registry`'s `loadClass` seam so the shader chunk is lazy and
204
- core pages are unaffected (CI size check). e2e: renders non-blank, differs from a flat
205
- raster, **no tile-boundary seam**, and a map without a hillshade never fetches the chunk.
206
-
207
- **Phase 3 — cartographic quality. — IMPLEMENTED 2026-09-21.** Multi-azimuth `sun-azimuth` / `sun-weight` (2–4
208
- lights blended), `z-factor`, the cos φ correction, and capture-ratio-aware tile zoom.
209
- Verify at capture scale against a 300 dpi plate, and under each `<om-effect>` preset.
210
-
211
- **Phase 3b — composition. — IMPLEMENTED 2026-09-21 as `blend="normal|multiply"`.** Multiply alone FAILED acceptance criterion 1 (a multiply layer over an empty sheet multiplies against nothing and draws nothing), so it is a two-valued attribute local to this layer rather than a baked constant. No general `blend=` surface was opened.
212
-
213
- **Original note.** Opacity alone greys the fills
214
- above the relief; the cartographic answer is a multiply blend. But **there is no
215
- blend-mode surface in this library today** — nothing in `attribute-resolution.ts` or
216
- `layer-registry.ts` exposes deck's layer `parameters`, so this is not a knob on a new
217
- layer, it is a new authoring concept with no precedent to follow. Two honest options:
218
- bake the multiply into the hillshade module itself (narrow, ships with phase 3, no
219
- general surface promised), or open a real `blend=` attribute for layers in general
220
- (wider, and a design of its own). **Proposed: bake it**, and let a general `blend=`
221
- arrive when a second layer type asks for it. Do not let a general blend surface ride
222
- in on this feature unannounced.
223
-
224
- **Phase 4 — the author's own DEM. — IMPLEMENTED 2026-09-22.** `shading="hillshade"` on `COGLayer`/`ZarrLayer`, sharing the GPU module and the apron with the tiled path. Ground scale comes from the geotransform + CRS units and is ANISOTROPIC for a geographic source. Relief runs LAST (after the colormap, not before it: earlier would hand the ramp a shade value and paint the hillshade in viridis). `identify="off"` is overridden while shading is on, and the validator says so.
225
-
226
- **Original note.** `shading="hillshade"` on `COGLayer` / `ZarrLayer`,
227
- running the same module on the float band path, ordered after nodata filtering and
228
- before the colormap so hypsometric tint and relief compose. Validation messages for
229
- "shading on a multi-band source" and "shading without a single band selected".
230
-
231
- **Phase 5 — surfaces and release. — IMPLEMENTED 2026-09-21** (example page, `docs/hillshade.md`, README section, skill + `llms.txt`, `html-data.ts` regeneration, `dev/build-public.ts` allowlist, architecture entry 148). Remaining: CHANGELOG at the version bump, and the downstream pins. Example page under
232
- `dev/examples/features/styling/`, `docs/hillshade.md`, README feature row, skill +
233
- `llms.txt`, `html-data.ts` regeneration, `dev/build-public.ts` allowlist +
234
- `npm run test:public`, architecture traceability + dated entry, CHANGELOG, then the
235
- downstream pins.
236
-
237
- ## Acceptance criteria
238
-
239
- - [ ] Relief renders from `src="terrarium"` with **zero author-supplied DEM data** and
240
- no API key, at pitch 0, on a `basemap="none"` sheet.
241
- - [ ] No tile-boundary seam at any zoom, pinned by a browser test that samples across
242
- a known boundary.
243
- - [ ] A 300 dpi `snapshot({scale})` shows relief detail proportional to the scale, not
244
- an upscaled screen-resolution image.
245
- - [ ] Shading is visibly affected by `<om-effect>` passes — it is inside deck's frame,
246
- not beneath it.
247
- - [ ] Three-azimuth shading is distinguishable from single-light in a pixel test, and
248
- reordering the azimuth list changes the result.
249
- - [ ] **One shader, not one image.** Both entry points run the same GPU module with the
250
- same uniforms — pinned by a unit test on the module, not a pixel diff between the
251
- two paths. They will *not* match pixel-for-pixel on the same area and should not
252
- be asked to: the tile path is integer-encoded height in Web Mercator at a tile
253
- zoom, the COG path is float bands in the source CRS at the source resolution, so
254
- pixel ground size, reprojection and nodata all differ before the shader runs.
255
- - [ ] Hillshade chunk is lazy; core/2D pages unaffected (CI size check).
256
- - [ ] No analytic product is exposed — no slope/aspect values, no identify integration.
257
-
258
- ## Non-goals
259
-
260
- - **Slope / aspect as queryable values** — #13's non-goal, unchanged.
261
- - **Viewshed / line-of-sight** — #23, which this neither implements nor blocks.
262
- - **Replacing `terrain=`** — the 3D surface is a different contract and stays as is.
263
- - **Sky-view factor / ambient occlusion relief** — a heavier multi-sample technique;
264
- revisit only if multi-azimuth shading proves insufficient.
265
- - **A general `blend=` attribute for layers** — phase 3b bakes multiply into this one
266
- module rather than opening a blend surface the whole layer registry would then owe.
267
- - **Server-side relief tiles** — client-side is the differentiator, as with COG.
268
-
269
- ## Status
270
-
271
- **All six phases implemented; staged for 0.9.1.** What remains is publishing
272
- and the downstream pins (`onlymap-native`, `onlymap-remotion`), which per the
273
- repo checklist must be proved against the candidate before their pins move.
274
-
275
- ## Open questions (maintainer input)
276
-
277
- 1. **Does hillshade inherit the map's sun?** Proposed: no. Same vocabulary and
278
- convention as `lighting-sun-*`, but an independent value, with an explicit opt-in
279
- (`sun="lighting"`) deferred until someone asks.
280
- 2. **Is the keyless terrarium source the default for a bare `<om-layer type="HillshadeLayer">`?**
281
- Proposed: **no — require `src`**, with `src="terrarium"` as the keyless one-word
282
- answer. The precedent cuts this way: every keyless default in this library is still
283
- *named* by the author (`basemap="positron"`, `terrain="terrarium"`). Keyless-first
284
- means "no key and no account", not "no attribute" — and an element that reaches AWS
285
- with nothing written on it is a network call the markup does not show. The cost of
286
- the rule is one word; the benefit is that `src` always says where the heights came
287
- from, which is also what the legend needs to credit.
288
- 3. **Stacking.** Auto-place relief beneath all data layers, or strictly honour
289
- document order as every other layer does? Proposed: document order — the rule is
290
- already universal here, and an exception costs more than it saves.
@@ -1,42 +0,0 @@
1
- # Load-paced ("clean") flyby — design, informed by the warm-tiles A/B data
2
-
3
- > **Status: IMPLEMENTED** — `<om-story paced>`; `src/paced-flyby.ts` (pure
4
- > driver) + `cameraAtTime`/`buildCameraLegs` in `src/tile-warm.ts`; see the
5
- > architecture doc's dated entry 110.
6
-
7
- Goal: a flyby where no frame ever shows unrefined tiles. Wall-clock runs
8
- longer; output is clean by construction. (Monitor data: Google P3DT flight
9
- needs ~970 fine tiles; pre-warming covered ~3% — pacing is the real cure.)
10
-
11
- ## Key architectural fact (why this is NOT just "pause the story clock")
12
- Story fly-to steps dispatch ONE camera action with a duration; the camera
13
- then animates inside deck/maplibre independent of story elapsed time.
14
- Pausing the story clock does not hold the camera. The pace driver must own
15
- the camera per frame.
16
-
17
- ## Design
18
- `<om-story paced>` (or recorder option): a driver that replaces wall-clock
19
- play with manual stepping:
20
- 1. Build the same camera keyframes tile-warm.ts extracts; interpolate with
21
- flyToViewport per step's own duration -> cameraAt(t) (pure; reuse
22
- sampleFlightViewports math, parameterized by t not sample index).
23
- 2. Loop: t += frameInterval (e.g. 1000/30). setViewInternal(cameraAt(t))
24
- (instant camera set — the harness setView path, not a transition), then
25
- story.seek(t) for non-camera actions (manualClock mode), then WAIT:
26
- every live tileset (core.getLiveTilesets) must report isLoaded() before
27
- advancing. rAF-align each advance.
28
- 3. om-paced-tick {t, waitedMs} event per frame -> the recorder (#16) hooks
29
- here; a progress UI can show "paused for tiles".
30
- 4. End: story "ended" state as normal; camera restore via existing capture.
31
-
32
- ## Gotchas recorded for the implementer
33
- - Suppress interrupt="pause" gesture listeners during a paced run (GL tour
34
- precedent, already noted in #16).
35
- - isLoaded() needs the CURRENT viewport selection to have been issued —
36
- after setViewInternal, wait one deck update (the om-tiles-warmed probe
37
- showed selection lags a frame; sleep(0)+rAF is enough).
38
- - tile-warm's destination warming composes: warm first, then paced play
39
- waits far less.
40
- - Tests: manualClock + fake tileset isLoaded toggling; e2e via the existing
41
- demo page + monitor (flight loads > 0 but zero frames advanced while
42
- !isLoaded — assert via om-paced-tick waitedMs sum > 0).
@@ -1,20 +0,0 @@
1
- # RESOLVED — per-feature trace link failure was schema-default array aliasing
2
-
3
- Root cause (found by birth-tagging arrays + in-browser constructor
4
- instrumentation): schema descriptors carry deck's own defaultProps values,
5
- and the defaults pass assigned container defaults (`extensions: []`) BY
6
- REFERENCE — one shared array per layer type, mutated by every layer's
7
- extension push. A trace temp that verifiably skipped filter wiring still
8
- built with a DataFilterExtension from the polluted shared array; with the
9
- extra attributes the temp TripsLayer's pipeline exceeded the vertex-
10
- attribute budget on Metal-ANGLE and failed to link ("Too many attributes
11
- (instancePickingColors)") — traces swept their clock invisibly. Parse
12
- order decided the pollution, hence the non-determinism, and hence
13
- "the story-map example traces fine" (no categorical filters there).
14
-
15
- Fix: `cloneDefault` — schema defaults assigned by value in BOTH front-ends
16
- (attribute-resolution + programmatic). Regression tests pin independence
17
- of per-layer extensions arrays in both lanes. The trace-temp filter-skip
18
- and rounded-cap variant from the investigation are kept as hardening.
19
- Verified: zero link errors across full probe runs; outlines draw visibly
20
- (dev/.probe-atlas-draw1.png).