@nika-js/onlymap 0.5.8 → 0.5.10

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.
package/dist/onlymapjs.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aA as e, aB as r, aC as t, aD as o, aE as b, aF as i, ap as l, aG as n, aH as S, aI as E, aJ as T, aK as L, aL as g, aM as A, aN as m, aO as _, aP as p, aQ as d, aR as c, aS as y, aT as I, aU as M, aV as u, aW as D, ao as O, aX as N, aw as R, aY as f, aZ as P, a_ as F, W as h, a$ as B, b0 as C, b1 as G, b2 as U, b3 as W, b4 as v, b5 as x, b6 as w, b7 as Y, b8 as H, b9 as X, ba as k, bb as J, bc as K, bd as V, be as z, bf as Q, bg as Z, bh as $, bi as j, bj as q, bk as aa, bl as sa, bm as ea, bn as ra, bo as ta, bp as oa, bq as ba, br as ia, bs as la, bt as na, bu as Sa, bv as Ea, bw as Ta, bx as La, by as ga, bz as Aa, bA as ma, bB as _a, bC as pa, bD as da, bE as ca, bF as ya, bG as Ia, bH as Ma, bI as ua, bJ as Da, bK as Oa, bL as Na, bM as Ra, bN as fa, bO as Pa, bP as Fa, bQ as ha, bR as Ba, bS as Ca, bT as Ga, bU as Ua, bV as Wa, bW as va, bX as xa, bY as wa, bZ as Ya, b_ as Ha, b$ as Xa } from "./index-C4E9YVtT.js";
1
+ import { aA as e, aB as r, aC as t, aD as o, aE as b, aF as i, ap as l, aG as n, aH as S, aI as E, aJ as T, aK as L, aL as g, aM as A, aN as m, aO as _, aP as p, aQ as d, aR as c, aS as y, aT as I, aU as M, aV as u, aW as D, ao as O, aX as N, aw as R, aY as f, aZ as P, a_ as F, W as h, a$ as B, b0 as C, b1 as G, b2 as U, b3 as W, b4 as v, b5 as x, b6 as w, b7 as Y, b8 as H, b9 as X, ba as k, bb as J, bc as K, bd as V, be as z, bf as Q, bg as Z, bh as $, bi as j, bj as q, bk as aa, bl as sa, bm as ea, bn as ra, bo as ta, bp as oa, bq as ba, br as ia, bs as la, bt as na, bu as Sa, bv as Ea, bw as Ta, bx as La, by as ga, bz as Aa, bA as ma, bB as _a, bC as pa, bD as da, bE as ca, bF as ya, bG as Ia, bH as Ma, bI as ua, bJ as Da, bK as Oa, bL as Na, bM as Ra, bN as fa, bO as Pa, bP as Fa, bQ as ha, bR as Ba, bS as Ca, bT as Ga, bU as Ua, bV as Wa, bW as va, bX as xa, bY as wa, bZ as Ya, b_ as Ha, b$ as Xa } from "./index-B1NnawjM.js";
2
2
  export {
3
3
  e as ALL_POSITION_VALUES,
4
4
  r as AUDIT_EXEMPTIONS,
@@ -52,6 +52,10 @@ export interface LayerDescriptor {
52
52
  filterSoftRange?: [number, number];
53
53
  filterCategoryField?: string;
54
54
  filterCategories?: unknown[];
55
+ /** Dashed lines on a path layer (spec: "PathStyleExtension") — `[dashLength, gapLength]` in line-width units; mirrors the `dash` attribute. */
56
+ dash?: [number, number];
57
+ /** Stretch each segment's dashes to start and end on a dash (deck `dashJustified`); mirrors `dash-justified`. */
58
+ dashJustified?: boolean;
55
59
  /** Stream options for ws(s):// data URLs (spec: "Live & Streaming Data"). */
56
60
  source?: string;
57
61
  key?: string;
@@ -1,5 +1,5 @@
1
1
  import Re from "./index-CW1n5LdO.js";
2
- import { am as Dt, an as zt, ao as ot, ap as it, aq as Ut, b as Nt, ar as Bt, l as Me, as as Kt, d as Wt, at as _t, au as kt, av as Xt, aw as st } from "./index-C4E9YVtT.js";
2
+ import { am as Dt, an as zt, ao as ot, ap as it, aq as Ut, b as Nt, ar as Bt, l as Me, as as Kt, d as Wt, at as _t, au as kt, av as Xt, aw as st } from "./index-B1NnawjM.js";
3
3
  import { w as Ht } from "./mgrs-BY9bIvp4.js";
4
4
  function Vt(e, t, n) {
5
5
  const { projectedCorners: r } = t, { topLeft: o, topRight: i, bottomRight: s, bottomLeft: a } = r, l = n(o[0], o[1]), c = n(i[0], i[1]), u = n(s[0], s[1]), d = n(a[0], a[1]), p = [
@@ -2378,7 +2378,7 @@ D.set(w.Zstd, () => import("./zstd-jXobGRcq.js").then((e) => e.decode));
2378
2378
  D.set(w.Jpeg, () => Promise.resolve(je));
2379
2379
  D.set(w.Jpeg6, () => Promise.resolve(je));
2380
2380
  D.set(w.Webp, () => Promise.resolve(je));
2381
- D.set(w.Lerc, () => import("./lerc-BkDclmAx.js").then((e) => e.l).then((e) => e.decode));
2381
+ D.set(w.Lerc, () => import("./lerc-fOXa6Yt9.js").then((e) => e.l).then((e) => e.decode));
2382
2382
  async function xe(e, t, n) {
2383
2383
  const r = D.get(t);
2384
2384
  if (!r)
package/dist/version.d.ts CHANGED
@@ -5,4 +5,4 @@
5
5
  * the build rootDir, and a `define` would need repeating across vite/vitest/
6
6
  * vite-node configs.
7
7
  */
8
- export declare const LIBRARY_VERSION = "0.5.8";
8
+ export declare const LIBRARY_VERSION = "0.5.10";
package/llms.txt CHANGED
@@ -23,6 +23,7 @@ OnlyMapJS is NOT raw deck.gl and NOT generic HTML/JSX. The rules below are the d
23
23
  - `scale()`/`clamp()`/`lerp()`/`$field` expressions go ONLY in `get-*` accessors — NEVER in a scalar attribute (`radius-min-pixels`, `point-radius-min-pixels`, `opacity`, `line-width-min-pixels`, `color`, …). A data-driven expression in a scalar doesn't coerce, so the layer silently renders defaults (invisible / black points); validation errors on it. Data-driven size/width/opacity/color → the matching `get-*` accessor (`get-radius`, `get-fill-color`, …); scalars take a constant floor/value.
24
24
  - `id` is required on every `<om-layer>`. `label` and `color` feed the legend; an explicit `get-fill-color` overrides `color` for rendering (both together is valid and common). The legend widget also reads `get-fill-color` itself: a `sequential`/`diverging` scale renders as a gradient ramp with domain labels, a `threshold` scale as discrete class ranges, and an equality ternary chain (`$f == 'a' ? '#c1' : '#c2'`) as a category palette — write those canonical shapes and the legend describes the symbology automatically.
25
25
  - Full JavaScript in accessor blocks needs the `js` attribute on the layer (`<om-layer js>` + `<script type="om/accessors">`). Without it, blocks are restricted to `export const name = d => <expression>` — no statements, no loops, no nested functions.
26
+ - Dashed lines are a single attribute: `dash="[6, 3]"` (or SVG-style `dash="6 3"`, plus optional `dash-justified`) on a path-stroking layer (`PathLayer`, `GeoJsonLayer`, `PolygonLayer`, `TripsLayer`). Do NOT hand-wire deck's `PathStyleExtension`/`getDashArray` — the attribute mounts it for you. Values are `[dashLength, gapLength]` in the SAME units as the line width; `dash` on a non-path layer (ScatterplotLayer, etc.) is ignored with a warning.
26
27
  - To capture where the user CLICKS on the map (a measure tool, drop-a-pin, a custom rectangle/circle AOI, snap-to-feature), listen for the `om-map-point` event on `<om-map>`: `mapEl.addEventListener('om-map-point', e => { const { coordinate, kind } = e.detail; })` — `coordinate` is `[lng,lat]` (or `null` off-globe), `kind` is `"click"`|`"hover"`, and it fires on every click/hover including empty-map clicks. Do NOT reach for deck.gl internals (`mapEl.getMap()`, `.deckInstance`, `.deck.viewManager`) or unproject canvas pixels — those are not exposed on `<om-map>` and return nothing. The built-in `draw` widget handles polygon/line/point sketching; `om-map-point` is for tools it doesn't cover.
27
28
 
28
29
  ## Element vocabulary
@@ -396,6 +396,14 @@
396
396
  "name": "filter-categories",
397
397
  "description": "JSON array of categories to keep."
398
398
  },
399
+ {
400
+ "name": "dash",
401
+ "description": "Dashed line pattern \"[dashLength, gapLength]\" (or \"6 3\") in line-width units. PathLayer/GeoJsonLayer/PolygonLayer/TripsLayer."
402
+ },
403
+ {
404
+ "name": "dash-justified",
405
+ "description": "Stretch each segment's dashes to start and end on a dash (boolean)."
406
+ },
399
407
  {
400
408
  "name": "highlighted-id",
401
409
  "description": "Feature id to highlight (set by the highlight-feature action)."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nika-js/onlymap",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
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": {
@@ -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.5.8` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.5.8/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.5.10` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.5.10/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.5.8/dist/onlymapjs.css">
20
- <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.5.8"></script>
19
+ <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.5.10/dist/onlymapjs.css">
20
+ <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.5.10"></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).
@@ -113,6 +113,13 @@ Filtering:
113
113
  filter-field="magnitude" filter-range="[4, 10]"
114
114
  ```
115
115
 
116
+ Dashed lines (on path-stroking layers — `PathLayer`, `GeoJsonLayer`, `PolygonLayer`, `TripsLayer`):
117
+
118
+ ```html
119
+ dash="[6, 3]" <!-- 6-long dash, 3-long gap, in line-width units -->
120
+ dash="6 3" dash-justified <!-- SVG-style values; justify so each segment starts/ends on a dash -->
121
+ ```
122
+
116
123
  For an epoch-millisecond filter, format the built-in widget's numeric labels declaratively:
117
124
 
118
125
  ```html