@nika-js/onlymap 0.6.26 → 0.7.1

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 (33) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +2 -2
  3. package/dist/{LercDecode.es-B4KknLMs.js → LercDecode.es-gFG_4xNk.js} +1 -1
  4. package/dist/{basemap-C4bmWq6M.js → basemap-oVln_CKU.js} +1 -1
  5. package/dist/elements/om-map.d.ts +9 -1
  6. package/dist/{geoparquet-BPMda753.js → geoparquet-CufpN8G1.js} +1 -1
  7. package/dist/{index-DtU_XhTX.js → index--zvhxlLl.js} +2 -2
  8. package/dist/{index-B5hsHnPl.js → index-CLe7spTj.js} +1 -1
  9. package/dist/{index-COuIQk2Z.js → index-CnwhAoQ5.js} +11283 -11046
  10. package/dist/{index-DMT_7aV3.js → index-DEIMxmvY.js} +1 -1
  11. package/dist/{index-DK5w4OxN.js → index-EXrBWGX7.js} +1 -1
  12. package/dist/index.d.ts +1 -1
  13. package/dist/layer-registry.d.ts +10 -0
  14. package/dist/{lerc-BNW5A6zN.js → lerc-nHFgnN0N.js} +2 -2
  15. package/dist/onlymap.standalone.js +29352 -28617
  16. package/dist/onlymapjs.js +91 -89
  17. package/dist/{raster-eMqzBMQf.js → raster-CE4jsgUi.js} +1086 -799
  18. package/dist/raster-identify.d.ts +19 -0
  19. package/dist/{raster-pipeline-Dg-GSDP3.js → raster-pipeline-ghFqryqb.js} +665 -453
  20. package/dist/raster-pipeline.d.ts +109 -14
  21. package/dist/raster.d.ts +135 -1
  22. package/dist/react.js +253 -234
  23. package/dist/runtime-core.d.ts +23 -0
  24. package/dist/version.d.ts +1 -1
  25. package/dist/widget-layout.d.ts +18 -0
  26. package/dist/{zarr-Dv7OiUcg.js → zarr-DjEYckHG.js} +10 -3
  27. package/docs/design/cog-v2.md +223 -0
  28. package/llms.txt +2 -2
  29. package/onlymapjs.attributes.json +9 -0
  30. package/onlymapjs.html-data.json +24 -0
  31. package/package.json +1 -1
  32. package/skills/onlymapjs/SKILL.md +1 -1
  33. package/skills/onlymapjs/references/syntax.md +12 -7
@@ -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.26/dist/onlymapjs.css">
20
- <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.6.26"></script>
19
+ <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.7.1/dist/onlymapjs.css">
20
+ <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.7.1"></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); the trade: band switches on that layer refetch tiles instead of re-uploading from memory.
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