@nika-js/onlymap 0.6.21 → 0.6.22
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/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/dist/{LercDecode.es-B_dD2_mY.js → LercDecode.es-Cm-Ah1Pr.js} +1 -1
- package/dist/attribute-resolution.d.ts +43 -1
- package/dist/{basemap-DK0AJ6ZH.js → basemap-BCZ-MbEU.js} +1 -1
- package/dist/{geoparquet-fc2daxMh.js → geoparquet-BaYtod1j.js} +1 -1
- package/dist/html-data.d.ts +14 -0
- package/dist/{index-DOPjev5l.js → index-BlUSpugF.js} +1 -1
- package/dist/{index-BNZFF535.js → index-C2DPJtsQ.js} +2 -2
- package/dist/{index-CuBGRyG-.js → index-Ddn4yvyL.js} +11058 -10970
- package/dist/{index-BwoceNAo.js → index-GkhsIJWB.js} +1 -1
- package/dist/{index-9EEyGbU1.js → index-Qza7MX_l.js} +1 -1
- package/dist/ir-snapshot.d.ts +2 -0
- package/dist/ir.d.ts +8 -0
- package/dist/{lerc-CMJO8KZO.js → lerc-Dt2MXtZG.js} +2 -2
- package/dist/onlymap.standalone.js +22004 -21916
- package/dist/onlymapjs.js +1 -1
- package/dist/parse-manifest.d.ts +8 -0
- package/dist/programmatic.d.ts +2 -0
- package/dist/{raster-GMsuQARC.js → raster-DBB0kjvs.js} +2 -2
- package/dist/{raster-pipeline-DNpKXgO3.js → raster-pipeline-C9FDdaMd.js} +1 -1
- package/dist/react.js +18 -17
- package/dist/runtime-core.d.ts +12 -0
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-KiXluGoJ.js → zarr-9LzdL7Zm.js} +2 -2
- package/llms.txt +1 -0
- package/onlymapjs.attributes.json +1582 -0
- package/onlymapjs.html-data.json +282 -278
- package/package.json +2 -1
- package/skills/onlymapjs/SKILL.md +1 -1
- package/skills/onlymapjs/references/syntax.md +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,13 @@ 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.6.22 — 2026-08-26
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- **Scale-dependent visibility on every layer type.** `visible-zoom-range="[8, 14]"` hides a layer outside that zoom span (min inclusive, max exclusive — the standard minzoom/maxzoom convention), the everyday GIS pattern for keeping dense layers from swamping a zoomed-out view. Works on vector layers, not just tile layers; the layer stays in the legend and layer switcher while zoom-hidden. (#38)
|
|
15
|
+
- **A machine-readable attribute contract, `onlymapjs.attributes.json`.** Tools that generate OnlyMapJS markup can now validate attributes per layer type — the editor IntelliSense file is a flat union and could pass attributes the runtime rejects. The new file is generated from the same registry the runtime validates against, so the two can't drift; IntelliSense hovers now also say which layer types accept each attribute. (#38)
|
|
16
|
+
- **A silent-empty-layer class of mistake now warns.** A layer whose required position accessor resolves to nothing for every row — a `TextLayer` fed GeoJSON with no `get-position` being the reported case — previously rendered an empty map with a clean console. It now warns once with the exact fix, on the console and through the `validate` panel. Layers where the default genuinely works are untouched. (#39)
|
|
17
|
+
|
|
11
18
|
## 0.6.21 — 2026-08-26
|
|
12
19
|
|
|
13
20
|
### Added
|
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ A handful of elements, one rule: **attributes are kebab-case versions of deck.gl
|
|
|
83
83
|
| Element | Role |
|
|
84
84
|
|---|---|
|
|
85
85
|
| `<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. Give it a height: a custom element is `display:inline` by default, so the library injects a `display:block` default (fills a sized parent, else a 400px floor) to keep a bare map visible, but set an explicit height (`om-map { height: 100vh }`) for real layout — any height you set wins outright, including one below the floor. A map that still collapses warns in the console; `hidden` and `display:none` maps stay hidden and stay quiet. |
|
|
86
|
-
| `<om-layer>` | Any of **39 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, the native `COGLayer` for GeoTIFF rasters, `ZarrLayer` for chunked Zarr/GeoZarr rasters, `ImageOverlay` for georeferenced drone JPEGs, `BIMLayer` for BIM source files (`.ifc` today) loaded straight in the browser with no pre-conversion step, and `Route`/`Tracking` for styled routes and live position tracking. `id` required; `label`/`color` feed the legend. |
|
|
86
|
+
| `<om-layer>` | Any of **39 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, the native `COGLayer` for GeoTIFF rasters, `ZarrLayer` for chunked Zarr/GeoZarr rasters, `ImageOverlay` for georeferenced drone JPEGs, `BIMLayer` for BIM source files (`.ifc` today) loaded straight in the browser with no pre-conversion step, and `Route`/`Tracking` for styled routes and live position tracking. `id` required; `label`/`color` feed the legend. `visible-zoom-range="[8, 14]"` gives any layer scale-dependent visibility (hidden outside min ≤ zoom < max, the standard minzoom/maxzoom convention) — the everyday GIS pattern for keeping a dense layer from swamping a zoomed-out view. |
|
|
87
87
|
| `<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`, `clip-box`, `zoom-controls`, `undo-redo`, `scale-bar` (metric/imperial/nautical `units`), `attribution`, `filter`, `draw` (point/line/polygon sketch capture, GeoJSON save/autosave; lines/polygons complete via double-click, touch double-tap — detected by the library itself, since iOS WebViews never synthesize `dblclick` from taps — Enter, or the toolbar's Finish button; `export-3d` adds an "Export 3D" button that clips loaded `Tile3DLayer`/`BIMLayer` content to the drawn footprint and downloads it as a portable GLB — re-framed to a local coordinate frame at the footprint's own centroid, each triangle carrying its own source color as vertex colors, no textures — or, with `export-3d="b3dm"`, the same mesh wrapped for Cesium/3D-Tiles pipelines; only currently-visible 3D Tiles/BIM layers are included — a layer hidden via `visible="false"` or the `toggle-layer` action is skipped, with a distinct console warning for "nothing loaded" vs. "everything hidden"), `measure` (geodesic distance + area + cut/fill volume — live labels, `units` toggle, an `om-measure` readout event; `modes="distance area volume"` adds a footprint-then-extrude tool: outline a polygon, double-click (double-tap on touch) to close it — it turns solid teal, ready — then drag the double-headed arrow gizmo that appears at its centroid up to fill or down to cut, reading out Cut/Fill/Net (signed, fill−cut)/Total (unsigned, cut+fill) volume plus Area/Perimeter, each labelled with its own sign convention. The math is a REAL per-cell grid integration: closing a footprint bulk-loads its covering DEM tiles, lays a metric grid in a local tangent frame at the ring centroid (cell size = the DEM's ground-sample distance; scanline point-in-polygon; bilinear, tile-seam-correct sampling; worker-offloaded), and integrates terrain-vs-base per cell — mixed cut AND fill within one footprint on undulating ground, with a published ±error (per-cell cellArea × 1.5 × GSD, summed per side), the cell size used, and a no-data warning all carried on the `om-measure` readout (`cellSizeM`/`gsdM`/`cutErrorM3`/`fillErrorM3`/`nodataFraction`). A `base-surface` attribute picks the reference surface: `custom` (default — the gizmo's draggable target plane), or boundary-derived stockpile strategies with no gizmo (`triangulated` boundary TIN, `plane` least-squares fit, `lowest`/`highest`/`average`). On `custom`, the extruded prism's own boundary hugs each corner's real ground elevation by default (so it doesn't visibly float above or sink below sloped terrain) — a "Flat target plane" toggle button appears above the readout once a footprint closes, switching that rendering to a single level plane instead (a rendering choice only; the underlying cut/fill numbers were already computed against one flat target elevation either way). Requires `terrain` on `<om-map>` — validation warns if `volume` is in `modes` with none (without terrain a flat-plane fallback runs, with no error figures — nothing honest to quote). A `profile` attribute alongside `modes` — not a mode of its own — samples elevation around a volume footprint's own perimeter as it's drawn and closed, live, and dispatches it on `om-measure`'s `profileSeries` field for a `dynamic-chart` widget to plot. Each sample is `{x: distance-from-start-m, y: elevation-m}`, and samples that ARE one of the drawn footprint's own corners additionally carry `vertexIndex` (0-based, in draw order) — so a chart can mark the real corners instead of every interpolated sample, and the widget's built-in profile chart marks each corner, labelling the first `1 · Start`. The map badges the first two vertices in draw order (`1 · Start`, `2`), which states the ring's direction outright — a start marker alone leaves clockwise vs counter-clockwise ambiguous, and the two wind to mirror-image profiles. Two badges is the minimum that fixes a direction and a constant cost regardless of how many corners the footprint has. Also volume-only: `deadband` (m³) zeroes out a Cut/Fill figure below the threshold, filtering drag noise near zero height (Cut/Fill/Net/Total are always RAW geometric volumes — deliberately unaffected by `swell`/`shrink`, so they keep answering "does this reach target elevation" regardless of what material's configured); `density` (t/m³ metric, lb/yd³ imperial) and `swell`/`shrink` (multipliers, default 1×) instead populate a separate Material section, standard Bank/Loose/Compacted earthworks convention — Adjusted Cut = raw × swell (loose/haul volume, bigger — excavating adds air voids), Adjusted Fill = raw ÷ shrink (loose/borrow volume needed, also bigger — the raw fill is already the compacted target void), plus Cut/Fill tonnage computed from the raw (not adjusted) volume, since swell/shrink change volume, not mass; the section only appears once at least one of `density`/`swell`/`shrink` is actually configured, no separate toggle. A `stale` field on the `om-measure` readout flags the brief window between a footprint committing and its elevation sample resolving, so a consumer doesn't read numbers left over from a prior footprint as current), `vega-lite` (live charts bound to a layer's data), `dynamic-chart` (the same Vega-Lite rendering, but data-driven by a live DOM event instead of a layer — `on="<event-name>"` + `series-field="<name>"` reads `event.detail[seriesField]` as the chart's `values` on every matching event, redrawing at a fixed `width`; a feature "freezes" it for free by simply omitting that field the next time it fires, no separate pause API needed), and the BIM set `ifc-browser` / `feature-inspector` / `ifc-loader` / `ifc-clash`. Or write your own inline with HTML + a `<script type="om/widget">`. Adjacent compact button widgets (`zoom-controls`, `undo-redo`, `widgets-toggle`) **auto-cluster** into one control group (opt out per widget with `cluster="false"`), and `<om-map widgets-hidden>` / the `set-widgets-visible` action / `<om-widget type="widgets-toggle">` hide all authored chrome without destroying it — provider attribution and the license badge never hide. **Placement is managed**: `position` takes one of 8 logical, RTL-aware slots (`top-start`, `top-center`, `top-end`, `center-start`, `center-end`, `bottom-start`, `bottom-center`, `bottom-end`; legacy corner names alias) — same-slot widgets stack with flush edges and a shared gap, `order` sets in-slot ordering, and `position="manual"` opts out entirely (a plain block you style yourself, even outside the map). At map widths ≤640px, managed widgets automatically move into accessible top/end/bottom/start drawers; `fold="never"` keeps an essential control out, `widgets-fold="off"` disables folding, and `--om-widget-fold-breakpoint` changes the map-width threshold. Provider attribution is an in-flow member of `bottom-end` and the license badge of `bottom-start`, so neither covers a widget. A slot dims automatically while an open popup covers it (`widgets-dim="off"` to disable), except slots containing required chrome. Themeable from plain page CSS via custom properties: `om-map { --om-widget-bg: #111827; --om-widget-fg: #f9fafb; }` (also `-muted`, `-border`, `-hover-bg`, `-accent`), plus layout tokens (`--om-widget-inset-x/-y`, `--om-widget-gap-x/-y`, `--om-widget-opacity`, `--om-widget-radius`) or the no-CSS sugar `<om-map widget-style="gap:10 opacity:0.9">`. |
|
|
88
88
|
| `<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`. Selection-anchored overlays scope with `layer` (one layer's picks) and `selection-type="click"`/`"hover"` (one pick type — give a click-opened popup `selection-type="click"` so hovering elsewhere doesn't drag it along). `{{field}}` interpolates the picked feature, HTML-escaped by default; `{{z}}` is a real depth-picked elevation when some layer under the cursor set `pickable="3d"` (terrain does this itself, so hovering the ground always has one) — empty otherwise, never a misleading 0. `clip-to-map` (opt-in) hides the overlay when its own box would spill past the map viewport, not just when its anchor leaves — for small transient tips that track the cursor, where an overhanging box would otherwise inflate the page's scroll overflow and cause visible view jitter. |
|
|
89
89
|
| `<om-behavior>` | Declarative interactions: `on="click|hover|drag|load|data-loaded"` → a named action. |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LayerMeta, LayerFilter, LayerCategoryFilter } from "./ir";
|
|
1
|
+
import type { LayerMeta, LayerFilter, LayerCategoryFilter, LayerData } from "./ir";
|
|
2
2
|
import type { LayerSchema, PropDescriptor } from "./layer-registry";
|
|
3
3
|
import type { Shape } from "./expr";
|
|
4
4
|
/** Sweeps the shared caches down to exactly the keys still referenced by the current manifest (Q4). */
|
|
@@ -39,8 +39,49 @@ export declare function kebabToCamel(name: string): string;
|
|
|
39
39
|
export declare const DASH_ATTRS: Set<string>;
|
|
40
40
|
/** Classified symbology (spec: issue #12; src/classify.ts) — universal layer attributes like `filter-*`, resolved where the data is in hand (parse-manifest / descriptorToIR), never per-schema deck props. */
|
|
41
41
|
export declare const CLASSIFY_ATTRS: Set<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Per-layer zoom visibility (public issue #38) — a universal layer
|
|
44
|
+
* attribute honoured on EVERY layer type: `visible-zoom-range="[8, 14]"`
|
|
45
|
+
* hides the layer outside min ≤ zoom < max (the minzoom/maxzoom convention
|
|
46
|
+
* every web-map stack uses — Mapbox/MapLibre semantics, so translated
|
|
47
|
+
* manifests behave identically). Scale-dependent visibility is the everyday
|
|
48
|
+
* GIS concept; deck's own visible-*-zoom props exist only on tile layers.
|
|
49
|
+
* The gate composes with (never overrides) authored `visible`.
|
|
50
|
+
*/
|
|
51
|
+
export declare const ZOOM_VISIBILITY_ATTR = "visible-zoom-range";
|
|
52
|
+
/** Pure coercion (no console) — validation.ts shares it so validate() reports the same malformed shapes structurally. */
|
|
53
|
+
export declare function coerceVisibleZoomRange(raw: unknown): [number, number] | undefined;
|
|
54
|
+
export declare function parseVisibleZoomRange(raw: unknown, warnLabel: string): [number, number] | undefined;
|
|
55
|
+
/** The gate itself — min inclusive, max exclusive (minzoom/maxzoom convention). */
|
|
56
|
+
export declare function zoomInVisibleRange(range: [number, number], zoom: number): boolean;
|
|
42
57
|
/** Layer types whose deck class strokes a path, so PathStyleExtension's dash takes effect (GeoJsonLayer/PolygonLayer dash their line/stroke sublayers). */
|
|
43
58
|
export declare const DASH_CAPABLE_LAYERS: Set<string>;
|
|
59
|
+
/** A ValidationEntry-compatible shape, structural to avoid the validation.ts import cycle. */
|
|
60
|
+
interface AccessorWarningSink {
|
|
61
|
+
(entry: {
|
|
62
|
+
severity: "warning";
|
|
63
|
+
element: string;
|
|
64
|
+
attribute: string;
|
|
65
|
+
message: string;
|
|
66
|
+
fix: string;
|
|
67
|
+
}): void;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Public issue #39: a standalone TextLayer fed GeoJSON with no get-position
|
|
71
|
+
* renders NOTHING, silently — deck's default accessor (`x => x.position`)
|
|
72
|
+
* resolves undefined for every feature and the glyphs cull. The identical
|
|
73
|
+
* mistake THROWS on columnar data, so the silence is an asymmetry, not a
|
|
74
|
+
* policy. This samples the first row through the deck DEFAULT for every
|
|
75
|
+
* schema-required accessor the author did not claim: a defined result means
|
|
76
|
+
* the default genuinely works (flat rows with a `position` field — stay
|
|
77
|
+
* silent), an undefined one means nothing will draw — warn, with the exact
|
|
78
|
+
* fix. Columnar is skipped (deck already errors loudly there), as is
|
|
79
|
+
* URL-backed data that hasn't arrived (rows resolve on the reparse).
|
|
80
|
+
*
|
|
81
|
+
* `OmMap.validate()` keeps its stricter unconditional required-accessor
|
|
82
|
+
* ERROR — this is the runtime twin for authors who never call validate.
|
|
83
|
+
*/
|
|
84
|
+
export declare function warnUnresolvedRequiredAccessors(schema: LayerSchema, props: Record<string, unknown>, data: LayerData, shape: Shape, elementDesc: string, report?: AccessorWarningSink): void;
|
|
44
85
|
/** A dash pattern authored as a JSON array (`[6, 3]`) OR an SVG-style token list (`6 3`, `6,3`) → `[dashLength, gapLength]`; undefined if it isn't two finite positive numbers. */
|
|
45
86
|
export declare function parseDashArray(raw: string): [number, number] | undefined;
|
|
46
87
|
/** Already-coerced dash declaration — attribute strings (DOM) or typed values (programmatic). */
|
|
@@ -231,3 +272,4 @@ export interface ResolvedAttributes {
|
|
|
231
272
|
categoryFilter?: LayerCategoryFilter;
|
|
232
273
|
}
|
|
233
274
|
export declare function resolveLayerAttributes(el: Element, schema: LayerSchema, shape: Shape): ResolvedAttributes;
|
|
275
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ny, L as sy, M as oy, m as ay, c as ka, a as Sd, z as oc, G as sm, V as ly, W as cy, b as uy, g as hy, d as Vu, f as Ed, e as dy, l as py, u as fy, D as Qf, h as my } from "./index-
|
|
1
|
+
import { C as ny, L as sy, M as oy, m as ay, c as ka, a as Sd, z as oc, G as sm, V as ly, W as cy, b as uy, g as hy, d as Vu, f as Ed, e as dy, l as py, u as fy, D as Qf, h as my } from "./index-Ddn4yvyL.js";
|
|
2
2
|
const Cd = Math.PI / 180, gy = 180 / Math.PI;
|
|
3
3
|
function em(Pe, J = 0) {
|
|
4
4
|
const me = Math.min(180, Pe) * Cd;
|
package/dist/html-data.d.ts
CHANGED
|
@@ -22,4 +22,18 @@ export declare function buildHtmlCustomData(): {
|
|
|
22
22
|
version: number;
|
|
23
23
|
tags: TagData[];
|
|
24
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Machine-readable per-layer-type attribute contract (public issue #38) —
|
|
27
|
+
* shipped as `onlymapjs.attributes.json`. The html-customData format cannot
|
|
28
|
+
* scope an attribute to a `type=` value, so a CI check validating emitted
|
|
29
|
+
* markup against the flat union passes attributes the runtime rejects (the
|
|
30
|
+
* QGIS2WebMap visible-min-zoom case; #36's dash hid in the same gap).
|
|
31
|
+
* Generated from the SAME registry the runtime's typo-check validates
|
|
32
|
+
* against, so the two cannot drift: an attribute is accepted on a type iff
|
|
33
|
+
* it is in `universal` or in `layers[<type>]`.
|
|
34
|
+
*/
|
|
35
|
+
export declare function buildLayerAttributeContract(): {
|
|
36
|
+
universal: string[];
|
|
37
|
+
layers: Record<string, string[]>;
|
|
38
|
+
};
|
|
25
39
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ak as Bt, ax as Xt, ay as Yt, az as Us } from "./index-
|
|
1
|
+
import { ak as Bt, ax as Xt, ay as Yt, az as Us } from "./index-Ddn4yvyL.js";
|
|
2
2
|
import { w as gs, t as Hs, f as Ws, m as Qs } from "./mgrs-BY9bIvp4.js";
|
|
3
3
|
import { c as Xs } from "./convert-arrow-schema-DrAihRf9.js";
|
|
4
4
|
import { y as Ys, A as bt, a as Ks, z as Vs, R as Zs } from "./recordbatch-Bpc0uxFn.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as E, j as S, k as R, o as N, p as h, q as w, s as O, t as W, v as x, w as I, x as B, y as _, A as P, B as k, E as $, F as z, H as v, I as F, J as C, K as U, N as p, O as M } from "./index-
|
|
2
|
-
import { P as $e, R as ze, _ as ve, Q as Ce, S as Ue, T as Me, U as je, X as De, Y as Je, Z as qe, $ as He, a0 as Ve, a1 as Ge, a2 as Ke, a3 as Qe, a4 as Xe, a5 as Ye, a6 as Ze, a7 as et, a8 as tt, a9 as nt, aa as rt, ab as at, ac as st, ad as ot } from "./index-
|
|
1
|
+
import { i as E, j as S, k as R, o as N, p as h, q as w, s as O, t as W, v as x, w as I, x as B, y as _, A as P, B as k, E as $, F as z, H as v, I as F, J as C, K as U, N as p, O as M } from "./index-Ddn4yvyL.js";
|
|
2
|
+
import { P as $e, R as ze, _ as ve, Q as Ce, S as Ue, T as Me, U as je, X as De, Y as Je, Z as qe, $ as He, a0 as Ve, a1 as Ge, a2 as Ke, a3 as Qe, a4 as Xe, a5 as Ye, a6 as Ze, a7 as et, a8 as tt, a9 as nt, aa as rt, ab as at, ac as st, ad as ot } from "./index-Ddn4yvyL.js";
|
|
3
3
|
import { g as j, i as D } from "./table-accessors-CYWTzpQI.js";
|
|
4
4
|
async function J(t, e, n = {}, r = {}) {
|
|
5
5
|
const a = E(t), s = S.getWorkerFarm(n), { source: o } = n, c = { name: a, source: o };
|