@nika-js/onlymap 0.8.3 → 0.9.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 (41) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE.md +2 -0
  3. package/README.md +40 -2
  4. package/dist/{LercDecode.es-DW-G7u1_.js → LercDecode.es-BMcxSLhD.js} +1 -1
  5. package/dist/{basemap-C6mTd_uL.js → basemap-m98j2wxG.js} +780 -780
  6. package/dist/cartograph/elements/om-cartograph.d.ts +6 -0
  7. package/dist/cartograph.js +429 -416
  8. package/dist/cartograph.standalone.js +1235 -1222
  9. package/dist/elements/om-map.d.ts +21 -0
  10. package/dist/{geoparquet-CMESy27r.js → geoparquet-XOwOmChh.js} +1 -1
  11. package/dist/html-data.d.ts +1 -1
  12. package/dist/{index-CgpoaR-U.js → index-BMbpftvm.js} +1 -1
  13. package/dist/{index-DgHzTg2n.js → index-BSAY6CWm.js} +12159 -11695
  14. package/dist/index-CfPbQUqO.js +511 -0
  15. package/dist/{index-CrMM0kHK.js → index-DDNElBTs.js} +106 -106
  16. package/dist/{index-FEPpi86V.js → index-DzOvV-O7.js} +25 -25
  17. package/dist/{index-BfL5W1Ay.js → index-HZWdgtm4.js} +36 -36
  18. package/dist/index.d.ts +8 -3
  19. package/dist/{lerc-BQFrOj7h.js → lerc-qK-nhCaB.js} +2 -2
  20. package/dist/license.d.ts +46 -1
  21. package/dist/onlymap.standalone.js +26793 -25831
  22. package/dist/onlymapjs.js +97 -92
  23. package/dist/post-process/catalogue.d.ts +61 -0
  24. package/dist/post-process/compile.d.ts +37 -0
  25. package/dist/post-process/index.d.ts +71 -0
  26. package/dist/post-process/ops.d.ts +22 -0
  27. package/dist/post-process/presets.d.ts +33 -0
  28. package/dist/post-process/validate.d.ts +8 -0
  29. package/dist/programmatic.d.ts +11 -0
  30. package/dist/{raster-6vW4_NSI.js → raster-Dg5p_99H.js} +3 -3
  31. package/dist/{raster-pipeline-CYiGgsil.js → raster-pipeline-DhjkqDYd.js} +1 -1
  32. package/dist/runtime-core.d.ts +39 -1
  33. package/dist/version.d.ts +1 -1
  34. package/dist/{zarr-BNQZpB1t.js → zarr-D3CzK1Zm.js} +2 -2
  35. package/docs/cartograph.md +10 -2
  36. package/docs/effects.md +197 -0
  37. package/llms.txt +3 -2
  38. package/onlymapjs.html-data.json +171 -0
  39. package/package.json +3 -3
  40. package/skills/onlymapjs/SKILL.md +3 -2
  41. package/skills/onlymapjs/references/syntax.md +10 -3
@@ -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.8.0/dist/onlymapjs.css">
20
- <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.8.0"></script>
19
+ <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.9.0/dist/onlymapjs.css">
20
+ <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.9.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).
@@ -41,9 +41,14 @@ Common attributes:
41
41
  - `validate` to show live validation errors during authoring
42
42
  - `map-id="<random UUID>"` — identifies the map artifact for usage telemetry (not a visitor id). Include one on new complete pages, freshly generated — never copied from an example; deleting it is the opt-out.
43
43
  - `telemetry="off"` disables usage telemetry for this map (global: `OmMap.configureTelemetry({ disabled: true })`)
44
- - `license-key="om_live_…"` — lifts the free-plan limits (5 layers, 25k rows per layer — a layer past the layer cap doesn't render, a layer past the row cap renders its first 25k rows plus a dismissible on-map notice; caps apply only on HOSTED http(s) pages — localhost/file:// and other dev contexts run uncapped, badge stays) and removes the corner badge; publishable origin-restricted token, safe in page source (or `OmMap.configureLicense(key)` once). Free-plan violations don't break the map: the offending layer isn't rendered and validation names the limit.
44
+ - `license-key="om_live_…"` — lifts the free-plan limits (5 layers, 25k rows per layer — a layer past the layer cap doesn't render, a layer past the row cap renders its first 25k rows plus a dismissible on-map notice; caps apply only on HOSTED http(s) pages — localhost/file:// and other dev contexts run uncapped, badge stays) and removes the corner badge; publishable origin-restricted token, safe in page source (or `OmMap.configureLicense(key)` once). Free-plan violations don't break the map: the offending layer isn't rendered and validation names the limit. Badge removal is a permission, not a requirement — `keep-badge` on `<om-map>` (or `OmMap.setKeepBadge(true)`) keeps it on a paid plan, rendering the credit without the free-tier license sentence; on the free plan it changes nothing. The preference is page-level and live (editable after boot), and a sheet's foot credit follows it; `<om-cartograph keep-badge>` opts one in on its own, for a static sheet with no map runtime.
45
45
  - `terrain="terrarium|<preset>|<{z}/{x}/{y} DEM URL>|off"` — 3D elevation surface. `terrarium` is keyless (AWS); `mapterhorn` is also keyless and carries a CARTO Positron drape by default; `maptiler-terrain` needs `basemap-key`/`configureBasemap`; raw DEM URLs need `terrain-decoder` (`terrarium`, `mapbox-rgb`, or `{rScaler,gScaler,bScaler,offset}` JSON). `terrain-exaggeration` scales relief (1 = true); `terrain-max-zoom` = the provider's REAL tileset cap; `terrain-texture` drapes a `{z}/{x}/{y}` imagery template. Geographic layers drape automatically; per-layer `terrain="drape|offset|off"` overrides (3D-model layers default to `offset`). Terrain REPLACES an active basemap while on (restored when off) — validation warns. Register presets with `OmMap.registerTerrain(name, {...})`; `set-terrain` action + `terrain` watch token; attribute-backed (undoable). **BIM requires explicit terrain**: a model that resolves real elevation on a map with no `terrain` attribute raises an ERROR through the validation channel at load time — the library never writes `terrain` for you; author a preset (`mapterhorn` pairs a keyless DEM with a CARTO drape) or an explicit `terrain="off"` for flat-ground siting.
46
46
  - `lighting="daylight|studio|flat|custom"` — scene lighting for 3D content (extruded polygons, models); absent = deck defaults. Preset seeds values; `lighting-ambient`, `lighting-sun` (intensity; 0 removes the sun), `lighting-sun-azimuth` (° CW from north), `lighting-sun-elevation` (° above horizon), `lighting-camera` (model-inspection fill) override individual fields; `lighting-sun-date` (ISO 8601 or epoch ms) computes the sun from solar position at the map center and wins over azimuth/elevation. Attribute-backed: changes are undoable, and the `set-lighting {lighting, sunAzimuth, …}` action makes lighting story-steppable (`lighting="default"` removes the whole attribute set; a bare preset is a clean reset). `<om-widget type="lighting">` is the native UI. Widget scripts can `watch = ["lighting"]`.
47
+ - POST-PROCESS FINISHES (core `<om-map>`, no extra entry point needed) are `<om-effect>` children of `<om-map>`, which ARE deck's `effects` array (document order = pipeline order). Exactly one lane per element:
48
+ - `preset="vintage|engraved|night|blueprint|riso|newsprint|muted"` — a named look. Override one knob with `<op>-<param>` (`grain-amount="0.02"`); get the preset as editable markup with `OmMap.expandPreset(name)`.
49
+ - `op="tint|levels|saturation|posterize|vignette|grain|edges|blur|sharpen|halftone"` — one operation, its knobs as attributes.
50
+ - an inline `<script type="application/json">` luma ShaderModule — raw GLSL, multi-pass, passed to deck untouched.
51
+ Spatial knobs are MILLIMETRES (`size="0.12mm"`): they resolve against the live pixel density so a look keeps its physical size at print DPI, and a pixel value is a validation error. A preset is literally a saved op list. `set-effect {preset}` swaps it live and writes the document. With a MapLibre basemap the basemap is composited underneath and stays untreated — the validator warns.
47
52
  - `clip-box-min="[lng, lat, elevation]"` + `clip-box-max="[lng, lat, elevation]"` (issue #34) — a real axis-aligned 3D box clipping the whole scene: geometry outside it is discarded (order of the two corners doesn't matter). Every layer is clipped once a box is configured; opt a specific layer out with `clip="off"` on its `<om-layer>`. `clip-box-invert` shows what's OUTSIDE the box instead; `clip-box-highlight` dims clipped-out geometry instead of discarding it (non-destructive preview — nothing disappears). Works on ANY layer type, including georeferenced `Tile3DLayer`/`BIMLayer` content, so a dense BIM scene can be cut open to see what's inside — not just flat `GeoJsonLayer` extrusions. Attribute-backed (undoable, story-steppable) via `set-clip-box {min, max, invert?, highlight?}` (`{clear: true}` removes the box) and `<om-widget type="clip-box">` (six number inputs + invert/highlight checkboxes + clear button). v1 is axis-aligned only — rotated boxes are a documented follow-up.
48
53
  - `snap="vertex edge midpoint"` + `snap-tolerance="12"` (issue #34 Part A) — XY snapping for draw/measure vertex capture: refines whatever deck already picked under the cursor to the nearest vertex, edge, or edge midpoint of THAT feature's own geometry, within `snap-tolerance` pixels (default 12) — not a spatial index, only the already-picked feature is searched. Applies to every layer by default; `snap="off"` on any `<om-layer>` opts it out, mirroring `clip="off"`. Also snaps to a `BIMLayer`'s own edge/crease overlay (its real wall corners/edges, converted from local mesh coordinates automatically) — the raw triangle mesh itself is not a snap target. Vertex beats midpoint beats edge on range conflicts. Hold Space to place a point nearby without snapping. No action/attribute-backed toggle beyond the attribute itself; live-reactive like `terrain`/`clip-box-*`.
49
54
  - `widgets-dim="off"` disables collision-dim — by default a widget slot dims (`--om-widget-opacity-dimmed`, 0.35) while an open `<om-overlay>` popup covers it, rather than the popup dodging (attribution/toggle slots never dim).
@@ -640,6 +645,7 @@ A separate lazy entry (`import "@nika-js/onlymap/cartograph"`; CDN: `https://unp
640
645
  ```
641
646
 
642
647
  - Frames: live (`<om-map>` child, the FRAME's camera attributes win) or `mode="static"` with `crs` + `corners` for a georeferenced raster. `overview-of="<frame-id>"` draws a locator footprint.
648
+
643
649
  - A live frame georeferences whatever its map shows. Zoomed out past the whole world, the map wraps inside the frame like any web map — the graticule labels each copy by where it is on the globe, and the scale bar measures its own row — and the frame never limits or rewrites the camera. Once the map inside a frame settles after a pan, rotate or tilt, the frame's georeference follows the map's own view: north arrow, scale bar, graticule, locator inset and `{{frame.<id>.scale}}` describe what is on screen, and freezing captures that view. `max-pitch` and `min-zoom` on `<om-map>` are author-set controls (a kiosk map that should stay upright or within an area); nothing sets them for you.
644
650
  - `<om-legend for>` derives rows from the live map's own symbology (classified breaks included); literal rows via `derived="false"` + `<om-legend-row>` children.
645
651
  - `<om-atlas for="<frame-id>" layer="<layer-id>">` renders one page per feature sequentially and exports a ZIP.
@@ -682,6 +688,7 @@ Common built-in actions:
682
688
  - `show-overlay`, `hide-overlay`
683
689
  - `show-tooltip`, `hide-tooltip`
684
690
  - `toggle-layer`
691
+ - `set-effect` — payload `{ preset }` (a preset name, or `"none"` to remove it); optional `<op>-<param>` knob overrides, e.g. `{ preset: "vintage", "grain-amount": 0.02 }`. Writes one `<om-effect preset>` child, so it is undoable; NOT story-rewindable yet (rewind restores `<om-map>` attributes, this adds an element). A hand-composed op chain is left alone.
685
692
  - `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
686
693
  - `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
687
694
  - `zoom-to-feature`