@nika-js/onlymap 0.6.25 → 0.7.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 (37) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +5 -3
  3. package/dist/{LercDecode.es-DNwkPiJw.js → LercDecode.es-CYOgDeVu.js} +1 -1
  4. package/dist/{basemap-Da9yotkI.js → basemap-0rGUZkQT.js} +9 -1
  5. package/dist/basemap.d.ts +4 -0
  6. package/dist/elements/om-map.d.ts +9 -1
  7. package/dist/{geoparquet-D8-txekS.js → geoparquet-Cau8fzH7.js} +1 -1
  8. package/dist/hover-pick.d.ts +53 -0
  9. package/dist/html-data.d.ts +1 -1
  10. package/dist/{index-D6SeYdqX.js → index-BF3xZe9d.js} +1 -1
  11. package/dist/{index-CUnb2y9k.js → index-Bt3U7sbb.js} +1 -1
  12. package/dist/{index-Z6ZPKbXa.js → index-CpSUZ-J3.js} +1 -1
  13. package/dist/{index-31e3kTgK.js → index-CriPOt1s.js} +2 -2
  14. package/dist/{index-CPf0evzb.js → index-CxOS31XG.js} +11725 -11392
  15. package/dist/index.d.ts +1 -1
  16. package/dist/layer-registry.d.ts +10 -0
  17. package/dist/{lerc-CkqppWZk.js → lerc-aeqKo4fK.js} +2 -2
  18. package/dist/onlymap.standalone.js +29545 -28735
  19. package/dist/onlymapjs.js +91 -89
  20. package/dist/programmatic.d.ts +5 -0
  21. package/dist/{raster-CXPV5d4b.js → raster-D70FrkLt.js} +1049 -790
  22. package/dist/raster-identify.d.ts +19 -0
  23. package/dist/{raster-pipeline-CKW1mTzH.js → raster-pipeline-A-zvBnKU.js} +660 -450
  24. package/dist/raster-pipeline.d.ts +109 -14
  25. package/dist/raster.d.ts +91 -1
  26. package/dist/react.js +253 -234
  27. package/dist/runtime-core.d.ts +44 -0
  28. package/dist/version.d.ts +1 -1
  29. package/dist/widget-layout.d.ts +18 -0
  30. package/dist/{zarr-9YGMeWT7.js → zarr-DmrbmSNx.js} +10 -3
  31. package/docs/design/cog-v2.md +223 -0
  32. package/llms.txt +3 -2
  33. package/onlymapjs.attributes.json +9 -0
  34. package/onlymapjs.html-data.json +57 -0
  35. package/package.json +4 -2
  36. package/skills/onlymapjs/SKILL.md +1 -1
  37. package/skills/onlymapjs/references/syntax.md +17 -7
@@ -64,6 +64,33 @@
64
64
  "name": "basemap-key",
65
65
  "description": "Provider API key for keyed basemap presets (maptiler-*) — publishable origin-restricted key; or call OmMap.configureBasemap once."
66
66
  },
67
+ {
68
+ "name": "hover-pick",
69
+ "description": "Hover-pick cadence: \"rest\" (default — one GPU pick when the pointer stops, none while it sweeps; kills the per-mousemove ReadPixels stall on integrated graphics), \"continuous\" (deck-native, per frame), \"off\" (click picking only), or a throttle interval in ms (leading + trailing).",
70
+ "values": [
71
+ {
72
+ "name": "rest"
73
+ },
74
+ {
75
+ "name": "continuous"
76
+ },
77
+ {
78
+ "name": "off"
79
+ }
80
+ ]
81
+ },
82
+ {
83
+ "name": "pick-cursor",
84
+ "description": "CSS cursor shown while the pointer is over a pickable feature (default \"pointer\" — the is-this-interactive affordance). \"none\" disables.",
85
+ "values": [
86
+ {
87
+ "name": "pointer"
88
+ },
89
+ {
90
+ "name": "none"
91
+ }
92
+ ]
93
+ },
67
94
  {
68
95
  "name": "attribution",
69
96
  "description": "Set \"false\" to opt out of the compact attribution control shown with basemaps.",
@@ -1175,6 +1202,18 @@
1175
1202
  "name": "texture-parameters",
1176
1203
  "description": "deck.gl textureParameters. Valid on: BitmapLayer, IconLayer, ImageOverlay, SimpleMeshLayer."
1177
1204
  },
1205
+ {
1206
+ "name": "bands",
1207
+ "description": "deck.gl bands. Valid on: COGLayer."
1208
+ },
1209
+ {
1210
+ "name": "rescale",
1211
+ "description": "deck.gl rescale. Valid on: COGLayer."
1212
+ },
1213
+ {
1214
+ "name": "identify",
1215
+ "description": "deck.gl identify. Valid on: COGLayer."
1216
+ },
1178
1217
  {
1179
1218
  "name": "min",
1180
1219
  "description": "deck.gl rescaleMin. Valid on: COGLayer, ZarrLayer."
@@ -1187,6 +1226,18 @@
1187
1226
  "name": "colormap",
1188
1227
  "description": "deck.gl colormap. Valid on: COGLayer, ZarrLayer."
1189
1228
  },
1229
+ {
1230
+ "name": "reverse",
1231
+ "description": "deck.gl reverse. Valid on: COGLayer, ZarrLayer."
1232
+ },
1233
+ {
1234
+ "name": "stretch",
1235
+ "description": "deck.gl stretch. Valid on: COGLayer, ZarrLayer."
1236
+ },
1237
+ {
1238
+ "name": "gamma",
1239
+ "description": "deck.gl gamma. Valid on: COGLayer, ZarrLayer."
1240
+ },
1190
1241
  {
1191
1242
  "name": "nodata",
1192
1243
  "description": "deck.gl nodataOverride. Valid on: COGLayer, ZarrLayer."
@@ -1822,6 +1873,9 @@
1822
1873
  {
1823
1874
  "name": "toggle-layer"
1824
1875
  },
1876
+ {
1877
+ "name": "set-pickable"
1878
+ },
1825
1879
  {
1826
1880
  "name": "zoom-in"
1827
1881
  },
@@ -2424,6 +2478,9 @@
2424
2478
  {
2425
2479
  "name": "toggle-layer"
2426
2480
  },
2481
+ {
2482
+ "name": "set-pickable"
2483
+ },
2427
2484
  {
2428
2485
  "name": "zoom-in"
2429
2486
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nika-js/onlymap",
3
- "version": "0.6.25",
3
+ "version": "0.7.0",
4
4
  "description": "Declarative deck.gl maps for HTML and React — interactive WebGL mapping with GeoJSON/CSV/Arrow data, MapLibre basemaps, widgets, popups, and live streams from a custom-element manifest or typed React components. TypeScript, no build step.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "publishConfig": {
@@ -112,7 +112,9 @@
112
112
  "build:types": "tsc -p tsconfig.build.json --emitDeclarationOnly",
113
113
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.e2e.json --noEmit && tsc -p cloud/workers/telemetry/tsconfig.json && tsc -p cloud/workers/examples/tsconfig.json",
114
114
  "test": "vitest run",
115
- "prepublishOnly": "node dev/tools/announce-release.mjs --check && npm run build",
115
+ "comment:e2e-smoke": "Release gate for rendered-pixel guarantees the unit suite can't see: the license-condition badge chrome (a red badge e2e shipped across 0.6.24 AND 0.6.25 because only vitest gated publish) and frame determinism. Deliberately tiny — the full e2e suite stays a manual/CI concern.",
116
+ "test:e2e:smoke": "playwright test e2e/deterministic-frames.spec.ts && playwright test e2e/examples.spec.ts -g \"attribution badge\"",
117
+ "prepublishOnly": "node dev/tools/announce-release.mjs --check && npm run build && npm run test:e2e:smoke",
116
118
  "postpublish": "node dev/tools/announce-release.mjs",
117
119
  "try": "vite-node dev/expr-repl.mjs",
118
120
  "test:e2e": "playwright test",
@@ -23,7 +23,7 @@ Use OnlyMapJS as a declarative HTML map library. Write custom elements such as `
23
23
  </script>
24
24
  ```
25
25
 
26
- For no-build CDN pages, use the single-file standalone bundle from a raw-file CDN — `https://unpkg.com/@nika-js/onlymap@0.6.25` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.6.25/dist/onlymapjs.css">`. Never a rebundling CDN (esm.sh, skypack): re-bundling duplicates the deck.gl/luma.gl runtime and every layer fails shader compilation.
26
+ For no-build CDN pages, use the single-file standalone bundle from a raw-file CDN — `https://unpkg.com/@nika-js/onlymap@0.7.0` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.7.0/dist/onlymapjs.css">`. Never a rebundling CDN (esm.sh, skypack): re-bundling duplicates the deck.gl/luma.gl runtime and every layer fails shader compilation.
27
27
 
28
28
  ## React Projects
29
29
 
@@ -16,8 +16,8 @@ Vite/npm project:
16
16
  Static CDN page (raw-file CDNs only — unpkg/jsDelivr; never esm.sh or another rebundling CDN, which duplicates the WebGL runtime and breaks layer shaders):
17
17
 
18
18
  ```html
19
- <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.6.25/dist/onlymapjs.css">
20
- <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.6.25"></script>
19
+ <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.7.0/dist/onlymapjs.css">
20
+ <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.7.0"></script>
21
21
  ```
22
22
 
23
23
  Always include `onlymapjs.css` — it carries the MapLibre basemap styles and the no-JS fallback rules (`<om-fallback>` / default banner). For the fallback to work in script-disabled previews it must load without JavaScript: a real `<link rel="stylesheet">` or inlined `<style>` on no-build pages (a bundler-emitted stylesheet is fine in npm projects).
@@ -193,12 +193,17 @@ Common choices:
193
193
  ```
194
194
 
195
195
  - `src` (required) — the GeoTIFF URL. NOT `data`: rasters stream tiles by HTTP Range request through the layer's own reader; they are never parsed rows (`$field`, `ctx.data()`, `ctx.stats()`, filters do not apply).
196
- - Sources must be Cloud-Optimized GeoTIFFs (`gdal_translate -of COG` otherwise).
197
- - `min`/`max` — the rescale window mapped onto the colormap. Defaults to 0–255, so ALWAYS set them for float or 16-bit data (DEMs, NDVI, temperature).
198
- - `colormap` — single-band ramps from the bundled sprite: `gray` (default), `viridis`, `plasma`, `inferno`, `magma`, `cividis`, `rdylgn`, `rdbu`, `spectral`, `terrain`, `jet`, `turbo`, `ylorrd` (ColorBrewer yellow→orange→red a gentler sequential ramp than turbo/jet). Sources with 3+ bands composite as RGB and ignore it.
196
+ - Sources should be Cloud-Optimized GeoTIFFs (`gdal_translate -of COG`); a plain GeoTIFF renders with a structured warning (every view re-reads the full image).
197
+ - `bands` — 1-based band selection (GDAL convention): one band (`bands="4"`, colormap-eligible) or an `[r,g,b]` triple (`bands="[8,4,3]"`, false-color composite). Band switches NEVER refetch tiles every band is decoded once and retained; textures re-upload from memory.
198
+ - `min`/`max` — the rescale window. A number broadcasts to every selected band; with a `bands` triple, each may be an `[r,g,b]` triple for per-band windows (`min="[0,0,0]" max="[3000,8000,3000]"`). Defaults to 0–255 set them for float/16-bit data, or use `rescale="auto"`.
199
+ - `rescale="auto"` — window(s) from the file's GDAL statistics tags (deterministic per file; per-band for composites); falls back to sampling the coarsest overview with a warning that the window is data-derived. Explicit `min`/`max` always win. Non-8-bit sources with NO styling attributes auto-stretch automatically (a dev notice reports the derived window).
200
+ - `colormap` — single-band ramps from the bundled sprite: `gray` (default), `viridis`, `plasma`, `inferno`, `magma`, `cividis`, `rdylgn`, `rdbu`, `spectral`, `terrain`, `jet`, `turbo`, `ylorrd`. Composites ignore it (validation warns). `reverse` flips the ramp.
201
+ - `stretch="linear|log|sqrt"` + `gamma` (> 0) — display-curve shaping between rescale and colormap; both are uniforms.
199
202
  - `nodata` — overrides the source's nodata sentinel; nodata pixels render transparent.
200
- - Plain 8-bit RGB COGs (satellite truecolor) need no styling attributes at all.
201
- - Restretch/recolor (min/max/colormap edits) are GPU uniform updates tiles are not refetched. The legend widget renders the colormap ramp automatically when `colormap` + `min`/`max` are authored.
203
+ - Plain 8-bit RGB COGs (satellite truecolor) need no styling attributes at all; paletted GeoTIFFs render via their embedded color table and emit a classes legend when few entries are used.
204
+ - PIXEL IDENTIFY: a click/hover over the raster (no vector feature hit) produces a selection whose object carries `{ value, values, bands, nodata, band_1..n }` overlays/tooltips interpolate `{{value}}` etc. with zero extra wiring. `identify="off"` disables it and releases the CPU-retained decode (recommended on memory-tight WebViews).
205
+ - Every styling change (bands/min/max/colormap/reverse/stretch/gamma/nodata) is a GPU-side update — tiles are never refetched. The legend renders automatically from the authored OR auto-resolved window.
206
+ - Failure modes are structured (`validate` panel / `om-validation-error`): CORS-refused Range requests, non-COG sources, and out-of-range `bands` each carry an actionable fix string; the map stays alive.
202
207
 
203
208
  ### ZarrLayer (Zarr / GeoZarr rasters)
204
209
 
@@ -648,6 +653,7 @@ Common built-in actions:
648
653
  - `show-overlay`, `hide-overlay`
649
654
  - `show-tooltip`, `hide-tooltip`
650
655
  - `toggle-layer`
656
+ - `set-pickable` — payload `{ layer, pickable: true|false|"3d" }`; writes/removes the layer's `pickable` attribute at runtime (turns popups/tooltips/hover behaviors on or off per layer — the viewer-facing popup toggle), story-capturable and undoable
651
657
  - `highlight-feature` — sets the layer's `highlighted-id`; style the selection with `highlight-color="[220, 38, 38, 255]"` (or hex) on the `<om-layer>` — a constant color, not a `get-*` accessor
652
658
  - `zoom-to-feature`
653
659
  - `filter-layer`
@@ -664,6 +670,10 @@ Common built-in actions:
664
670
 
665
671
  Payload attributes are kebab-case and become camelCase payload keys.
666
672
 
673
+ ## Hover picking & the pointer cursor
674
+
675
+ Hovering a pickable feature shows `cursor: pointer` automatically — the "is this map interactive?" affordance; `pick-cursor` on `<om-map>` overrides the cursor value and `pick-cursor="none"` disables it. Hover GPU picks are REST-DEBOUNCED by default: one pick when the pointer stops, none while it sweeps — this eliminates the per-mousemove GPU ReadPixels stall that froze hover-popup maps on integrated graphics. `hover-pick` on `<om-map>` tunes the cadence: `"rest"` (default), `"continuous"` (deck-native per-frame, for hover-follow UIs on capable hardware), `"off"` (click picking only), or a throttle interval in ms (leading + trailing picks). Click picking is never gated. `MapController` twins: `setHoverPicking(mode)` / `setPickCursor(value)`.
676
+
667
677
  Example:
668
678
 
669
679
  ```html