@nika-js/onlymap 0.11.5 → 0.11.7

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 (34) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/{basemap-CnjAGLZo.js → basemap-BrQCDtfj.js} +2 -2
  4. package/dist/elements/om-map.d.ts +20 -1
  5. package/dist/elements/om-overlay.d.ts +8 -0
  6. package/dist/{geoparquet-CHtunmD2.js → geoparquet-BSQY5PIo.js} +1 -1
  7. package/dist/{globe-view-CgQa-07O.js → globe-view-CGXyelOy.js} +1 -1
  8. package/dist/{hillshade-BgXgVdjg.js → hillshade-BtfW1P2c.js} +1 -1
  9. package/dist/{index-D4x57ql0.js → index-Bl8RF_ZY.js} +1 -1
  10. package/dist/{index-NCXX8bDe.js → index-CNderrhB.js} +1 -1
  11. package/dist/{index-BTTCf4nb.js → index-CPoNS0ZN.js} +308 -271
  12. package/dist/{index-aOe9cOFs.js → index-Clg4OPrB.js} +1 -1
  13. package/dist/{index-DoNtp5Nh.js → index-CtsYIqaJ.js} +3 -3
  14. package/dist/{index-ClLMdW3k.js → index-CvLkkFyD.js} +2 -2
  15. package/dist/{index-DjtM8ecq.js → index-Df36FLVl.js} +1 -1
  16. package/dist/{index-k7l7kqTk.js → index-riq9qTYh.js} +3 -3
  17. package/dist/{index-BTsRqhXB.js → index-wHUqi1zW.js} +1 -1
  18. package/dist/{lerc-BtdiMDO7.js → lerc-B31CKJ6m.js} +1 -1
  19. package/dist/onlymap.standalone.js +759 -706
  20. package/dist/onlymapjs.js +1 -1
  21. package/dist/{post-process-effect-BWrq5IR8.js → post-process-effect-8OT9O84M.js} +1 -1
  22. package/dist/{raster-iGwPuAgo.js → raster-Dx2oylKT.js} +3 -3
  23. package/dist/{raster-pipeline-Dxs9TpD6.js → raster-pipeline-CPM9CeZ0.js} +1 -1
  24. package/dist/{text-on-path-C8h_3Snf.js → text-on-path-Bki2IUm0.js} +64 -48
  25. package/dist/text-on-path.d.ts +13 -1
  26. package/dist/version.d.ts +1 -1
  27. package/dist/{zarr-C1zXD9VD.js → zarr-CsY2lbLD.js} +2 -2
  28. package/docs/cartograph.md +2 -2
  29. package/docs/cartography.md +1 -0
  30. package/llms.txt +2 -1
  31. package/onlymapjs.attributes.json +1 -0
  32. package/package.json +1 -1
  33. package/skills/onlymapjs/SKILL.md +3 -2
  34. package/skills/onlymapjs/references/syntax.md +5 -3
package/CHANGELOG.md CHANGED
@@ -8,6 +8,18 @@ Note: npm collapsed a few closely-spaced releases — the GPX/FlatGeobuf (0.5.4)
8
8
  and GeoParquet (0.5.5) work shipped to npm together as **0.5.6**, so npm's
9
9
  version list jumps 0.5.3 → 0.5.6. Each logical version is listed here regardless.
10
10
 
11
+ ## 0.11.7 — 2026-10-05
12
+
13
+ ### Added
14
+ - **Tools can read what a map says is wrong with it, without changing the map.** Set `mapEl.diagnostics = true` and the map reports its problems — each with a suggested fix — as `om-validation-error` events, with no error panel and nothing written into the page; `mapEl.getDiagnostics()` returns the latest. An editor that saves its live page no longer has to add `validate` to get them.
15
+ - **Legend and layer-switcher rows say which layer they describe**, as `data-layer="<layer id>"`, so a click on a legend entry can be traced to its layer even when the row is not interactive.
16
+ - **A popup's template is readable as written**: `templateSource` on `<om-overlay>` returns it with its `{{fields}}` intact, so a tool can tell which fields a popup shows.
17
+
18
+ ## 0.11.6 — 2026-10-02
19
+
20
+ ### Fixed
21
+ - **Curved labels can be clicked, and a click tells you which one.** `pickable` now works on a `TextOnPathLayer`, and clicking or hovering a label reports the river or road it names, with all its fields — so a `{{name}}` popup shows the right text instead of coming up blank. Before, the layer rejected `pickable`, and a pick landed on a single letter of the label rather than the feature behind it.
22
+
11
23
  ## 0.11.5 — 2026-10-02
12
24
 
13
25
  ### Added
package/README.md CHANGED
@@ -404,7 +404,7 @@ Two things it gets right that hand-rolled hillshades usually don't. **Tile edges
404
404
 
405
405
  - **`OmMap.*`** — `validate`, `snapshotIR`, `snapshotDescriptorIR`, `resolveImageOverlay`, `registerLayer`, `registerWidget`, `registerAction`, `registerSource`, `registerFormat`, `registerBasemap`, `configureBasemap`, `configureData`, `configureTelemetry`, `configureLicense`, `getLayerSchema`
406
406
  - **`@nika-js/onlymap/deck`** — the bundled deck.gl classes (`CompositeLayer`, `TileLayer`, …) for building custom layer types: shims must extend the same class hierarchy the core renders with, not a second installed deck.gl copy. Recipe: [docs/custom-layers.md](docs/custom-layers.md)
407
- - **On a `<om-map>` element** — `ready` (promise), `flyTo(coords, zoom?)`, `setLayerVisible(id, bool)`, `getLayers()`, `emit(action, payload)`, `snapshot(opts?)` (canvas-only PNG of basemap + layers at device pixels — DOM widgets/overlays and provider attribution are NOT captured, so exports must render credits themselves; `{as: "blob"}` for files, default dataURL); `attributions()` (the basemap's providers as plain text — what an export must credit; the bubbling `om-attributions-changed` event fires when a style loads); the `om-view-changed` event fires once the camera settles (debounced; `detail` = `{longitude, latitude, zoom, pitch, bearing, origin}`, where `origin` is `"user"` for gesture-driven bursts vs `"programmatic"` for API/story moves — the echo-suppression signal for state sync) — the camera-persistence hook; the `om-map-point` event (`detail = {coordinate: [lng,lat]|null, kind: "click"|"hover"}`) fires on every click/hover with the map coordinate, including empty-map clicks picks discard — the hook for custom capture tools the built-in draw widget doesn't cover; the `om-tileset-load` event (`detail = {layerId, tileset}`) surfaces a `Tile3DLayer`'s live deck `Tileset3D` for tools that need the real tileset (e.g. region export), not the IR; `pickAt([x, y])` / `pickRect({x, y, width, height})` ask what is under a pixel or inside a screen rectangle and `unproject([x, y])` / `project([lng, lat])` convert between pixels and coordinates — queries that leave the selection, `om-map-point` and behaviors alone, with a `pickMode` property (`"authored"` | `"all"`) that lets a picker tool reach layers the author did not make `pickable` without editing the document; `document.querySelector("om-map")` is fully typed
407
+ - **On a `<om-map>` element** — `ready` (promise), `flyTo(coords, zoom?)`, `setLayerVisible(id, bool)`, `getLayers()`, `emit(action, payload)`, `snapshot(opts?)` (canvas-only PNG of basemap + layers at device pixels — DOM widgets/overlays and provider attribution are NOT captured, so exports must render credits themselves; `{as: "blob"}` for files, default dataURL); `attributions()` (the basemap's providers as plain text — what an export must credit; the bubbling `om-attributions-changed` event fires when a style loads); the `om-view-changed` event fires once the camera settles (debounced; `detail` = `{longitude, latitude, zoom, pitch, bearing, origin}`, where `origin` is `"user"` for gesture-driven bursts vs `"programmatic"` for API/story moves — the echo-suppression signal for state sync) — the camera-persistence hook; the `om-map-point` event (`detail = {coordinate: [lng,lat]|null, kind: "click"|"hover"}`) fires on every click/hover with the map coordinate, including empty-map clicks picks discard — the hook for custom capture tools the built-in draw widget doesn't cover; the `om-tileset-load` event (`detail = {layerId, tileset}`) surfaces a `Tile3DLayer`'s live deck `Tileset3D` for tools that need the real tileset (e.g. region export), not the IR; `pickAt([x, y])` / `pickRect({x, y, width, height})` ask what is under a pixel or inside a screen rectangle and `unproject([x, y])` / `project([lng, lat])` convert between pixels and coordinates — queries that leave the selection, `om-map-point` and behaviors alone, with a `pickMode` property (`"authored"` | `"all"`) that lets a picker tool reach layers the author did not make `pickable` without editing the document; a `diagnostics` property that makes the map report its validation problems as `om-validation-error` events (and `getDiagnostics()` for the latest) without a `validate` attribute or panel, `data-layer` on legend and layer-switcher rows, and an overlay's `templateSource` (its template with `{{fields}}` intact) — what a host's picker reads without editing the document (0.11.7+); `document.querySelector("om-map")` is fully typed
408
408
  - **`MapController`** — the framework-grade programmatic front-end (typed `LayerDescriptor`s → the same reconcile core, no DOM manifest): `setLayers`, `watch`, `emit`, camera methods, `injectPick`, `ready`, `snapshot`, `setEffects` (deck `Effect` instances, 1:1 — takes precedence over the document's `<om-effect>` chain while set; `null` hands the chain back), `suspend`/`resume`, an `onViewChange(view, origin)` option (the `om-view-changed` twin), plus `onMapPoint` / `onTilesetLoad` options (the `om-map-point` / `om-tileset-load` twins). Active descriptors own reference-counted fetch/poll/socket handles: layer removal, transport-option change, suspend, and destroy release them. Accessor props normally take functions; schema-declared accessors also accept restricted expression strings such as `getPosition: "[$lon, $lat]"`, which makes the descriptor JSON-safe for native/cross-process bridges. `snapshotDescriptorIR(descriptors)` resolves that lane without fetching URL data. The same `pickAt`/`pickRect`/`unproject`/`pickMode` the element has are on the controller. The React adapter rides the function form; vanilla/native hosts may use either
409
409
  - **`getStore(token)`** — the external-store contract: per-token `{subscribe, getSnapshot}` stores (`viewport`/`selection`/`layers`/`data:<id>`) with cached immutable plain-data snapshots and `origin` tagging — directly consumable by `useSyncExternalStore` (the React adapter's own hooks ride it), MobX autoruns, Redux listeners, Zustand mirrors. ~20-line integration-tested recipes for Redux Toolkit, MobX/mobx-keystone, Zustand, and Jotai: [docs/external-stores.md](docs/external-stores.md)
410
410
  - **Testing** — `mountForTest`, and imports are SSR-safe (importing in Node/jsdom never touches browser globals)
@@ -1,5 +1,5 @@
1
- import { aJ as Y_, N as Bu, H as Pd, k as K_, aK as J_, aL as Q_, D as Xf, Z as ey } from "./index-BTTCf4nb.js";
2
- import { a as ty } from "./globe-view-CgQa-07O.js";
1
+ import { aJ as Y_, N as Bu, H as Pd, k as K_, aK as J_, aL as Q_, D as Xf, Z as ey } from "./index-CPoNS0ZN.js";
2
+ import { a as ty } from "./globe-view-CGXyelOy.js";
3
3
  const iy = {
4
4
  copy: "©",
5
5
  reg: "®",
@@ -6,7 +6,7 @@ import { type ClipBoxIR } from "../clip-box";
6
6
  import { type TerrainIR } from "../terrain";
7
7
  import { type WidgetSlot } from "../widget-layout";
8
8
  import { type SnapshotOptions } from "../snapshot";
9
- import { type ValidationEntry } from "../validation";
9
+ import { type ValidationEntry, type ValidationResult } from "../validation";
10
10
  import type { LayerIR } from "../ir";
11
11
  import type { PickAtOptions, PickMode, PickRect, PickRectOptions, Selection } from "../selection";
12
12
  import type { MapViewport } from "../basemap";
@@ -52,6 +52,10 @@ export declare class OmMapElement extends HTMLElementBase {
52
52
  private overlayFlushPending;
53
53
  private errorPanel;
54
54
  private runtimeErrors;
55
+ /** Host diagnostics channel (the `diagnostics` property) — see its setter. */
56
+ private diagnosticsOn;
57
+ /** The last merged static + runtime report, while anyone is listening. */
58
+ private lastDiagnostics;
55
59
  /** Dedup guard for the approximate-BIM-georeferencing warning — same shape as applyLicenseGates' own `warned` set, keyed per layer id. */
56
60
  private warnedApproximatePlacement;
57
61
  /** Dedup guard for the no-terrain-for-elevation error — same shape as `warnedApproximatePlacement`. */
@@ -498,6 +502,21 @@ export declare class OmMapElement extends HTMLElementBase {
498
502
  * above: real and callable, not part of the documented public API.
499
503
  */
500
504
  reportRuntimeErrorInternal(entry: ValidationEntry): void;
505
+ /**
506
+ * A host's own diagnostics channel — a PROPERTY, never an attribute. While
507
+ * `true`, the map validates on every reconcile and fires
508
+ * `om-validation-error` exactly as `validate="silent"` would, with no
509
+ * on-page panel and without touching the document. For an editor that
510
+ * autosaves the DOM (writing `validate` there would save it into the user's
511
+ * file) or a preview that must not change what it shows. An authored
512
+ * `validate` attribute still decides whether the panel appears.
513
+ */
514
+ get diagnostics(): boolean;
515
+ set diagnostics(on: boolean);
516
+ /** The latest merged static + runtime report — `null` until the map is
517
+ * validating (a `validate` attribute, or `diagnostics = true`). For a host
518
+ * that starts listening after the first reconcile. */
519
+ getDiagnostics(): ValidationResult | null;
501
520
  private publishValidation;
502
521
  }
503
522
  declare global {
@@ -39,6 +39,14 @@ export declare class OmOverlayElement extends HTMLElementBase {
39
39
  private featureAnchorCache;
40
40
  connectedCallback(): void;
41
41
  disconnectedCallback(): void;
42
+ /**
43
+ * The template this overlay renders, `{{fields}}` and all — read-only. The
44
+ * authored content moves into the shadow root and is shown with its fields
45
+ * filled in, so neither the light DOM nor the rendered text still holds the
46
+ * template; a tool that needs to know which fields a popup shows (an
47
+ * element picker naming what it reads) reads it here.
48
+ */
49
+ get templateSource(): string;
42
50
  /**
43
51
  * Replaces the overlay's content template (used by the internal, runtime-
44
52
  * managed tooltip overlay the `show-tooltip` action drives — see
@@ -1,4 +1,4 @@
1
- import { a4 as p, a5 as d } from "./index-BTTCf4nb.js";
1
+ import { a4 as p, a5 as d } from "./index-CPoNS0ZN.js";
2
2
  function g(t) {
3
3
  if (t == null) return !0;
4
4
  const e = t, n = e.id?.code;
@@ -1,4 +1,4 @@
1
- import { d as L, j as x, a6 as A, a7 as E, a8 as d, a9 as h, aa as u, ab as z, p as V, W as Z, G as D } from "./index-BTTCf4nb.js";
1
+ import { d as L, j as x, a6 as A, a7 as E, a8 as d, a9 as h, aa as u, ab as z, p as V, W as Z, G as D } from "./index-CPoNS0ZN.js";
2
2
  const c = Math.PI / 180, G = 180 / Math.PI;
3
3
  function w(l, t = 0) {
4
4
  const a = Math.min(180, l) * c;
@@ -1,4 +1,4 @@
1
- import { al as P, am as T, an as N, ao as Z, c as B, ap as E, aq as C, ar as b, as as D, at as I, au as O } from "./index-BTTCf4nb.js";
1
+ import { al as P, am as T, an as N, ao as Z, c as B, ap as E, aq as C, ar as b, as as D, at as I, au as O } from "./index-CPoNS0ZN.js";
2
2
  import { N as _, c as H } from "./hillshade-apron-Bem3DWyJ.js";
3
3
  import { p as $, h as j, m as A, a as U } from "./hillshade-shader-DI2uLSNU.js";
4
4
  function R(t, e, o) {
@@ -1,4 +1,4 @@
1
- import { bv as _t, bw as Ct } from "./index-BTTCf4nb.js";
1
+ import { bv as _t, bw as Ct } from "./index-CPoNS0ZN.js";
2
2
  function Yt(e, r, t = 2, i, o = "xy") {
3
3
  const s = r && r.length, l = s ? r[0] * t : e.length;
4
4
  let c = Ut(e, 0, l, t, !0, i && i[0], o);
@@ -1,4 +1,4 @@
1
- import { bx as Be, by as le, bz as ce, bA as De, bB as Oe, bC as ke } from "./index-BTTCf4nb.js";
1
+ import { bx as Be, by as le, bz as ce, bA as De, bB as Oe, bC as ke } from "./index-CPoNS0ZN.js";
2
2
  import { y as ve, a as he, z as G, R as J, A as ue, C as Fe, F as xe, n as je, S as Ie, E as Ne } from "./recordbatch-Bpc0uxFn.js";
3
3
  import { g as V, a as fe, b as Le, c as Ue, d as Me, e as qe, m as Ve } from "./table-accessors-CYWTzpQI.js";
4
4
  import { c as $e } from "./convert-arrow-schema-DrAihRf9.js";