@nika-js/onlymap 0.3.0 → 0.3.2

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 (47) hide show
  1. package/.vscode/onlymap.code-snippets +13 -0
  2. package/LICENSE.md +4 -0
  3. package/README.md +11 -6
  4. package/THIRD-PARTY-LICENSES.md +7874 -0
  5. package/dist/{Arrow.dom-7AXne1TU.js → Arrow.dom-BNjbQ9jb.js} +23 -23
  6. package/dist/LercDecode.es-BMi87Jez.js +303 -0
  7. package/dist/assets/LercDecode.es-BJb2dZu5.js +305 -0
  8. package/dist/assets/__vite-browser-external-DDArsqdc.js +29 -0
  9. package/dist/assets/lerc-wasm.wasm +0 -0
  10. package/dist/assets/lzw-BY5a_5nb.js +83 -0
  11. package/dist/assets/worker-DtIrTJB7.js +305 -0
  12. package/dist/assets/zstd-QGAv3PMm.js +383 -0
  13. package/dist/{basemap-DrK6zcu8.js → basemap-D_BgGpIa.js} +6228 -6247
  14. package/dist/{convert-arrow-schema-CvZ3cT5m.js → convert-arrow-schema-DrAihRf9.js} +31 -31
  15. package/dist/ctx.d.ts +3 -0
  16. package/dist/index-CDvm17M5.js +1446 -0
  17. package/dist/index-C_zLohC_.js +3108 -0
  18. package/dist/{index-C9tgnPNw.js → index-CaLhpYyz.js} +4 -4
  19. package/dist/{index-CsicbycJ.js → index-DYtODPDb.js} +21383 -21872
  20. package/dist/index-idvzm9MK.js +594 -0
  21. package/dist/index.d.ts +2 -0
  22. package/dist/ir.d.ts +3 -0
  23. package/dist/layer-registry.d.ts +15 -1
  24. package/dist/legend-spec.d.ts +66 -0
  25. package/dist/lerc-DgHmuuRe.js +30 -0
  26. package/dist/lerc-wasm.wasm +0 -0
  27. package/dist/lzw-BY5a_5nb.js +83 -0
  28. package/dist/mgrs-BY9bIvp4.js +799 -0
  29. package/dist/onlymap.standalone.js +133480 -0
  30. package/dist/onlymapjs.css +1 -1
  31. package/dist/onlymapjs.js +24 -23
  32. package/dist/raster-D-MVtlA7.js +8843 -0
  33. package/dist/raster.d.ts +61 -0
  34. package/dist/{recordbatch-HRu0SMKp.js → recordbatch-Bpc0uxFn.js} +200 -200
  35. package/dist/style.css +1 -0
  36. package/dist/{table-accessors-DBjWgN0C.js → table-accessors-CYWTzpQI.js} +71 -76
  37. package/dist/version.d.ts +1 -1
  38. package/dist/zstd-jXobGRcq.js +14 -0
  39. package/llms.txt +10 -3
  40. package/onlymapjs.html-data.json +23 -0
  41. package/package.json +27 -15
  42. package/skills/onlymapjs/SKILL.md +3 -1
  43. package/skills/onlymapjs/references/syntax.md +32 -4
  44. package/dist/index-CiuGqS0i.js +0 -605
  45. package/dist/index-DXoRERAy.js +0 -1457
  46. package/dist/index-Ztkd30f8.js +0 -3907
  47. package/dist/onlymapjs.umd.cjs +0 -8708
@@ -120,6 +120,19 @@
120
120
  ]
121
121
  },
122
122
 
123
+ "!raster": {
124
+ "scope": "html",
125
+ "prefix": "!raster",
126
+ "description": "COGLayer — GeoTIFF/COG raster (src streams by Range request; set min/max for float data)",
127
+ "body": [
128
+ "<om-layer id=\"${1:dem}\" type=\"COGLayer\"",
129
+ " src=\"${2:../data/elevation.tif}\"",
130
+ " label=\"${3:Elevation}\"",
131
+ " min=\"${4:0}\" max=\"${5:1900}\" colormap=\"${6|viridis,gray,plasma,inferno,magma,cividis,rdylgn,rdbu,spectral,terrain,jet,turbo|}\"",
132
+ " opacity=\"0.85\"></om-layer>$0"
133
+ ]
134
+ },
135
+
123
136
  "!overlay": {
124
137
  "scope": "html",
125
138
  "prefix": "!overlay",
package/LICENSE.md CHANGED
@@ -141,3 +141,7 @@ This Agreement, together with any applicable Order Form, is the entire agreement
141
141
  ## 20. Contact
142
142
 
143
143
  For licensing questions or requests for permissions beyond this Agreement, contact Licensor through the official repository, npm package page, website, or other distribution channel for the Software.
144
+
145
+ ## 21. Third-Party Software
146
+
147
+ The Software's distributed bundle includes open-source components that are not governed by this Agreement; each is licensed under its own permissive terms (MIT, ISC, BSD, Apache-2.0, or similar). The complete list of those components and the full text of their licenses is provided in the accompanying THIRD-PARTY-LICENSES.md file. Nothing in this Agreement limits any rights granted by those licenses to their respective components.
package/README.md CHANGED
@@ -12,7 +12,8 @@
12
12
  **Interactive WebGL maps from plain HTML.** OnlyMapJS is a declarative mapping library built on [deck.gl](https://deck.gl), written in TypeScript, with first-class HTML and React APIs. Write a manifest — layers, widgets, popups, behaviors as custom elements — and it drives deck.gl underneath: rendering, GeoJSON/CSV/Arrow data loading, live updates, GPU picking, MapLibre basemaps, and UI, with no build step and no imperative glue code. If you've wanted a declarative deck.gl wrapper — for a geospatial dashboard, a React mapping component, or a single-file HTML map — that's the entire premise.
13
13
 
14
14
  ```html
15
- <script type="module" src="https://esm.sh/@nika-js/onlymap"></script>
15
+ <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap/dist/onlymapjs.css">
16
+ <script type="module" src="https://unpkg.com/@nika-js/onlymap"></script>
16
17
 
17
18
  <om-map center="[-122.42, 37.77]" zoom="11" basemap="maplibre">
18
19
  <om-layer id="quakes" type="ScatterplotLayer" data="./quakes.json"
@@ -45,7 +46,7 @@ deck.gl is the best WebGL data-visualization engine there is — and OnlyMapJS i
45
46
  |---|---|---|
46
47
  | Setup | `new Deck({...})`, canvas + basemap sync wiring | one `<om-map>` element (or `<OmMap>` in React) |
47
48
  | State | your reducers/stores drive `setProps` | the manifest **is** the state — edit an attribute, the map reconciles; undo/redo built in |
48
- | Data loading | fetch + parse + reload yourself | `data="…"` — GeoJSON, CSV, Arrow/GeoArrow, Shapefile, KML, WebSocket streams, polled REST |
49
+ | Data loading | fetch + parse + reload yourself | `data="…"` — GeoJSON, CSV, Arrow/GeoArrow, Shapefile, KML, WebSocket streams, polled REST; GeoTIFF/COG rasters via `type="COGLayer"` |
49
50
  | Accessors | JS functions + `updateTriggers` bookkeeping | `get-*` expressions; update triggers derived automatically |
50
51
  | UI | build legends/popups/filters from scratch | built-in widgets, overlays, behaviors — declarative |
51
52
  | Testing | mock WebGL or ship untested | `OmMap.validate`, IR snapshots, headless behavioral harness |
@@ -62,10 +63,13 @@ npm install @nika-js/onlymap
62
63
  Or with no build step at all, straight from a CDN:
63
64
 
64
65
  ```html
65
- <script type="module" src="https://esm.sh/@nika-js/onlymap"></script>
66
+ <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap/dist/onlymapjs.css">
67
+ <script type="module" src="https://unpkg.com/@nika-js/onlymap"></script>
66
68
  ```
67
69
 
68
- Then `npx @nika-js/onlymap init` wires up VS Code IntelliSense and `!`-prefixed manifest snippets for your project. The library ships with 437 unit/behavioral tests and 25 Playwright GPU tests.
70
+ The bare package URL serves `dist/onlymap.standalone.js`, a single-file bundle built for exactly this (jsDelivr too). Use a CDN that serves the package's raw files — **not** a rebundling CDN like esm.sh, which re-splits the bundle into duplicate copies of the deck.gl/luma.gl runtime and breaks every layer's shader compilation.
71
+
72
+ Then `npx @nika-js/onlymap init` wires up VS Code IntelliSense and `!`-prefixed manifest snippets for your project. The library ships with 451 unit/behavioral tests and 27 Playwright GPU tests.
69
73
 
70
74
  The [examples](https://github.com/NikaGeospatial/onlymapjs/tree/main/examples) are the best tour: widgets, behaviors & overlays, basemaps, columnar/Arrow data, manual drawing, 3D models, scene lighting (with the native lighting widget), DEM terrain, a live WebSocket ship feed, and a polled driver fleet.
71
75
 
@@ -76,8 +80,8 @@ A handful of elements, one rule: **attributes are kebab-case versions of deck.gl
76
80
  | Element | Role |
77
81
  |---|---|
78
82
  | `<om-map>` | The map. `center`, `zoom`, `pitch`, `bearing`; `basemap` takes a free preset (`positron`, `liberty`, `dark-matter`, `osm`, …), a style URL, or `"none"` (standalone canvas) — and switches **live**; `validate` for a live on-page error panel. |
79
- | `<om-layer>` | Any of **33 layer types** by name — all of deck.gl's core, geo, aggregation, and mesh layers (Scatterplot, GeoJson, Arc, Path, Heatmap, Hexagon, Trips, Tile, Tile3D, Scenegraph, …) plus the built-in `PopupLayer` for WebGL badges/labels at scale. `id` required; `label`/`color` feed the legend. |
80
- | `<om-widget>` | UI panels. Built-ins: `legend`, `layer-switcher`, `basemap-switcher`, `lighting`, `zoom-controls`, `undo-redo`, `scale-bar`, `attribution`, `filter`, `draw`, `vega-lite` (live charts). Or write your own inline with HTML + a `<script type="om/widget">`. |
83
+ | `<om-layer>` | Any of **34 layer types** by name — all of deck.gl's core, geo, aggregation, and mesh layers (Scatterplot, GeoJson, Arc, Path, Heatmap, Hexagon, Trips, Tile, Tile3D, Scenegraph, …) plus the built-in `PopupLayer` for WebGL badges/labels at scale and the native `COGLayer` for GeoTIFF rasters. `id` required; `label`/`color` feed the legend. |
84
+ | `<om-widget>` | UI panels. Built-ins: `legend` (symbology-aware: color scales render as gradient ramps or class ranges, categorical ternaries as discrete palettes), `layer-switcher`, `basemap-switcher`, `lighting`, `zoom-controls`, `undo-redo`, `scale-bar`, `attribution`, `filter`, `draw`, `vega-lite` (live charts). Or write your own inline with HTML + a `<script type="om/widget">`. Themeable from plain page CSS via custom properties: `om-map { --om-widget-bg: #111827; --om-widget-fg: #f9fafb; }` (also `-muted`, `-border`, `-hover-bg`, `-accent`). |
81
85
  | `<om-overlay>` | Rich HTML anchored to a map location — a static `anchor="[lng, lat]"`, the current selection, or a feature's own geometry via `anchor-layer`/`anchor-feature-id`. `{{field}}` interpolates the picked feature, HTML-escaped by default. |
82
86
  | `<om-behavior>` | Declarative interactions: `on="click|hover|drag|load|data-loaded"` → a named action. |
83
87
  | `<om-story>` | A storyboard: `<om-step>` children fire actions on a timeline. Controlled by the `player` widget, behaviors, or `storyEl.play()/pause()/seek()`. |
@@ -107,6 +111,7 @@ Built-ins: `scale()` (types: `sequential`, `diverging`, `threshold`, `sqrt`, `lo
107
111
  | **CSV / TSV** | `data="./quakes.csv"` | parsed to typed columns (lazy ~48 KB chunk); numbers auto-typed, quoted fields intact |
108
112
  | **Shapefile** | `data="./countries.shp"` | geometry + `.dbf` attributes joined into GeoJSON features (sidecars fetched with your auth config) |
109
113
  | **KML** | `data="./tour.kml"` | placemarks → GeoJSON features; other formats plug in via `OmMap.registerFormat` |
114
+ | **GeoTIFF / COG raster** | `<om-layer type="COGLayer" src="./dem.tif" min="0" max="1900" colormap="viridis">` | Cloud-Optimized GeoTIFFs stream tiles by Range request (lazy chunk); min/max restretch + colormap swaps are GPU uniforms, nodata → transparent, legend ramp derives automatically; plain 8-bit RGB COGs need no attributes at all |
110
115
  | **WebSocket stream** | `data="wss://feed" key="id" flush="250ms" source="myFormat"` | upsert-by-key, burst coalescing, auto-reconnect; decode any format via `OmMap.registerSource` |
111
116
  | **Polled REST snapshot** | `data="/api/fleet.json" refresh="5s"` | full-snapshot replace per poll; outages keep the last good data |
112
117
  | **Draw store** | `data="draw:sketch"` | live in-memory GeoJSON feature store written by `<om-widget type="draw" target="sketch">` |