@nika-js/onlymap 0.11.1 → 0.11.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.
- package/CHANGELOG.md +5 -0
- package/README.md +1 -1
- package/dist/{basemap-CHFwxaRT.js → basemap-BlMlSRTo.js} +2 -2
- package/dist/cluster-options.d.ts +11 -0
- package/dist/{geoparquet-DBzSJJz_.js → geoparquet-Bqhh_idk.js} +1 -1
- package/dist/{globe-view-D0eDmIGO.js → globe-view-DQ0GLKSn.js} +1 -1
- package/dist/{hillshade-DodGS9DL.js → hillshade-CxMG6ocE.js} +1 -1
- package/dist/{index-Ca5y3OLs.js → index-9W2ZrRyF.js} +1 -1
- package/dist/{index-D04CeeYu.js → index-CE3n5pQz.js} +11169 -11132
- package/dist/{index-wRR0a71N.js → index-CF7q_mKH.js} +2 -2
- package/dist/{index-C7Tpf_BA.js → index-CdAb2VR8.js} +1 -1
- package/dist/{index-DH1_IQmW.js → index-DBYIrdvb.js} +3 -3
- package/dist/{index-em-_HmNV.js → index-DO3-mfIk.js} +3 -3
- package/dist/{index-BGvTOkkE.js → index-DklXFu6D.js} +1 -1
- package/dist/{index-5iFHs_bW.js → index-aoMhS8VK.js} +1 -1
- package/dist/{index-CrnprTab.js → index-m-7enOKi.js} +1 -1
- package/dist/layers/cluster-layer.d.ts +7 -0
- package/dist/{lerc-KZgSVKKQ.js → lerc-vNjPdkTs.js} +1 -1
- package/dist/onlymap.standalone.js +19164 -19127
- package/dist/onlymapjs.js +1 -1
- package/dist/{post-process-effect-eJXo3MSl.js → post-process-effect-eVlcdR0m.js} +1 -1
- package/dist/{raster-CHuauCiR.js → raster-8iVEbDdp.js} +3 -3
- package/dist/{raster-pipeline-Coou2lF-.js → raster-pipeline-OqdVks6Y.js} +1 -1
- package/dist/{text-on-path-DUfdTGzX.js → text-on-path-C34MMnKY.js} +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-BYLzFMeQ.js → zarr-Dla-EY4o.js} +2 -2
- package/docs/cartograph.md +2 -2
- package/llms.txt +1 -1
- package/onlymapjs.attributes.json +12 -0
- package/onlymapjs.html-data.json +16 -0
- package/package.json +1 -1
- package/skills/onlymapjs/SKILL.md +1 -1
- package/skills/onlymapjs/references/syntax.md +7 -5
package/dist/onlymapjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bP as e, bQ as r, bR as t, as as c, C as o, bS as i, c as n, bT as d, bU as l, bV as S, bW as E, ah as g, bX as L, bY as T, bZ as _, b_ as A, b$ as p, c0 as m, c1 as I, c2 as D, L as M, g as u, c3 as b, c4 as y, c5 as f, c6 as O, c7 as P, bE as R, c8 as C, ap as N, c9 as F, aB as h, ca as B, W as v, cb as x, aA as G, cc as U, cd as W, ce as w, cf as Y, cg as k, ch as X, ci as H, cj as K, ck as V, cl as j, cm as z, cn as J, co as q, cp as Q, cq as Z, cr as $, ak as aa, cs as sa, ct as ea, cu as ra, cv as ta, cw as ca, cx as oa, cy as ia, cz as na, cA as da, cB as la, cC as Sa, cD as Ea, aq as ga, cE as La, cF as Ta, ae as _a, cG as Aa, cH as pa, cI as ma, cJ as Ia, cK as Da, cL as Ma, cM as ua, cN as ba, cO as ya, cP as fa, cQ as Oa, cR as Pa, cS as Ra, cT as Ca, cU as Na, cV as Fa, cW as ha, cX as Ba, cY as va, cZ as xa, c_ as Ga, c$ as Ua, d0 as Wa, d1 as wa, d2 as Ya, d3 as ka, d4 as Xa, d5 as Ha, d6 as Ka, aC as Va, d7 as ja, d8 as za, d9 as Ja, da as qa, db as Qa, dc as Za, dd as $a, de as as, df as ss, dg as es, dh as rs, di as ts, dj as cs, dk as os, dl as is, dm as ns, dn as ds } from "./index-
|
|
1
|
+
import { bP as e, bQ as r, bR as t, as as c, C as o, bS as i, c as n, bT as d, bU as l, bV as S, bW as E, ah as g, bX as L, bY as T, bZ as _, b_ as A, b$ as p, c0 as m, c1 as I, c2 as D, L as M, g as u, c3 as b, c4 as y, c5 as f, c6 as O, c7 as P, bE as R, c8 as C, ap as N, c9 as F, aB as h, ca as B, W as v, cb as x, aA as G, cc as U, cd as W, ce as w, cf as Y, cg as k, ch as X, ci as H, cj as K, ck as V, cl as j, cm as z, cn as J, co as q, cp as Q, cq as Z, cr as $, ak as aa, cs as sa, ct as ea, cu as ra, cv as ta, cw as ca, cx as oa, cy as ia, cz as na, cA as da, cB as la, cC as Sa, cD as Ea, aq as ga, cE as La, cF as Ta, ae as _a, cG as Aa, cH as pa, cI as ma, cJ as Ia, cK as Da, cL as Ma, cM as ua, cN as ba, cO as ya, cP as fa, cQ as Oa, cR as Pa, cS as Ra, cT as Ca, cU as Na, cV as Fa, cW as ha, cX as Ba, cY as va, cZ as xa, c_ as Ga, c$ as Ua, d0 as Wa, d1 as wa, d2 as Ya, d3 as ka, d4 as Xa, d5 as Ha, d6 as Ka, aC as Va, d7 as ja, d8 as za, d9 as Ja, da as qa, db as Qa, dc as Za, dd as $a, de as as, df as ss, dg as es, dh as rs, di as ts, dj as cs, dk as os, dl as is, dm as ns, dn as ds } from "./index-CE3n5pQz.js";
|
|
2
2
|
export {
|
|
3
3
|
e as ALL_POSITION_VALUES,
|
|
4
4
|
r as AUDIT_EXEMPTIONS,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as se, t as $e, i as Ct, a as ke, s as Lt, C as It, b as Gt, F as vt, A as Et, d as Ft, R as ye, e as At, p as jt, m as Rt, f as Mt, g as We, h as Ut, r as le, j as Ot, k as xt, l as Kt, n as Dt } from "./raster-pipeline-
|
|
1
|
+
import { c as se, t as $e, i as Ct, a as ke, s as Lt, C as It, b as Gt, F as vt, A as Et, d as Ft, R as ye, e as At, p as jt, m as Rt, f as Mt, g as We, h as Ut, r as le, j as Ot, k as xt, l as Kt, n as Dt } from "./raster-pipeline-OqdVks6Y.js";
|
|
2
2
|
import { N as Nt, c as zt } from "./hillshade-apron-Bem3DWyJ.js";
|
|
3
3
|
import { r as Bt } from "./hillshade-shader-DI2uLSNU.js";
|
|
4
|
-
import { bK as _t, bL as $t } from "./index-
|
|
4
|
+
import { bK as _t, bL as $t } from "./index-CE3n5pQz.js";
|
|
5
5
|
import we from "./index-CW1n5LdO.js";
|
|
6
6
|
function kt(e, t) {
|
|
7
7
|
const n = e.length / 3, r = new Uint8ClampedArray(n * 4), o = 0, i = n, a = n * 2;
|
|
@@ -1072,7 +1072,7 @@ j.set(f.Zstd, () => import("./zstd-jXobGRcq.js").then((e) => e.decode));
|
|
|
1072
1072
|
j.set(f.Jpeg, () => Promise.resolve(ce));
|
|
1073
1073
|
j.set(f.Jpeg6, () => Promise.resolve(ce));
|
|
1074
1074
|
j.set(f.Webp, () => Promise.resolve(ce));
|
|
1075
|
-
j.set(f.Lerc, () => import("./lerc-
|
|
1075
|
+
j.set(f.Lerc, () => import("./lerc-vNjPdkTs.js").then((e) => e.decode));
|
|
1076
1076
|
async function ue(e, t, n) {
|
|
1077
1077
|
const r = j.get(t);
|
|
1078
1078
|
if (!r)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { w as he } from "./mgrs-BY9bIvp4.js";
|
|
2
|
-
import { a3 as de, bD as fe, bE as re, c as oe, bF as me, G as pe, bG as ge, aK as Z, bH as ve, N as be, bI as xe, bJ as Pe, al as Te, ap as ie } from "./index-
|
|
2
|
+
import { a3 as de, bD as fe, bE as re, c as oe, bF as me, G as pe, bG as ge, aK as Z, bH as ve, N as be, bI as xe, bJ as Pe, al as Te, ap as ie } from "./index-CE3n5pQz.js";
|
|
3
3
|
import { p as ye, a as Le, h as we } from "./hillshade-shader-DI2uLSNU.js";
|
|
4
4
|
function Oe(n, e, t) {
|
|
5
5
|
const { projectedCorners: s } = e, { topLeft: r, topRight: o, bottomRight: i, bottomLeft: a } = s, c = t(r[0], r[1]), u = t(o[0], o[1]), l = t(i[0], i[1]), d = t(a[0], a[1]), f = [
|
package/dist/version.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ur, d as lr, R as zt, e as fr, m as dr, p as St, f as hr, k as pr, l as mr } from "./raster-pipeline-
|
|
2
|
-
import { c as gr } from "./index-
|
|
1
|
+
import { A as ur, d as lr, R as zt, e as fr, m as dr, p as St, f as hr, k as pr, l as mr } from "./raster-pipeline-OqdVks6Y.js";
|
|
2
|
+
import { c as gr } from "./index-CE3n5pQz.js";
|
|
3
3
|
import $t from "./index-CW1n5LdO.js";
|
|
4
4
|
var Et;
|
|
5
5
|
function h(e, t, n) {
|
package/docs/cartograph.md
CHANGED
|
@@ -22,8 +22,8 @@ to PDF at true page size via CSS `@page` and exports PNG/JPEG at print DPI throu
|
|
|
22
22
|
<html>
|
|
23
23
|
<head>
|
|
24
24
|
<meta charset="utf-8">
|
|
25
|
-
<script type="module" src="https://unpkg.com/@nika-js/onlymap@0.11.
|
|
26
|
-
<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.11.
|
|
25
|
+
<script type="module" src="https://unpkg.com/@nika-js/onlymap@0.11.2/dist/cartograph.standalone.js"></script>
|
|
26
|
+
<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.11.2/dist/cartograph.css">
|
|
27
27
|
</head>
|
|
28
28
|
<body>
|
|
29
29
|
<om-cartograph cartograph-id="cg-lot-12" format="cartograph/2" size="A4" theme="minimal"
|
package/llms.txt
CHANGED
|
@@ -55,7 +55,7 @@ Programmatic/native bridge rule: `MapController.setLayers()` accepts normal func
|
|
|
55
55
|
- `<om-story id="tour" autoplay loop interrupt="pause|ignore">` — a storyboard of `<om-step>` children. Each step: `action="..."` + payload attributes (same kebab-case rule as behaviors) + `duration`/`delay`/`parallel` timing. Steps REFERENCE layers/overlays by id (`layer=`/`target=`) — a step must NEVER contain elements (validation error). Control: `<om-widget type="player" story="tour">`, the story-play/story-pause/story-seek actions, or `storyEl.play()/pause()/seek(ms)`. Seeking restores initial state then applies steps before T; use declarative payloads (e.g. `action="toggle-layer" visible="true"`, not bare toggles) so scrubbing is deterministic. Scene actions are story-steppable AND scrub-capturable: `set-basemap`, `set-lighting` (a sunset story: steps walking sun-elevation down; a bare preset step is a clean reset), and `set-terrain` all rewind on seek — the story captures the map's scene attributes before first play. Effect verbs as bare step attributes: `<om-step fade layer="regions" duration="1s">` (opacity reveal — start the layer at `opacity="0"`), `pulse` (attention flash), `trace` (progressive draw — whole-layer needs a TripsLayer; add `feature-id="..."` to make ONE polygon/line draw itself on inside any layer, or use it from a click behavior for click-to-trace), `populate` (rows drop in one by one — ordered by the authored filter-field, a payload `field`, or data order).
|
|
56
56
|
- Hover picking & the pointer cursor: hovering a pickable feature shows `cursor: pointer` automatically (the is-this-interactive affordance; `pick-cursor` on `<om-map>` overrides the cursor value, `pick-cursor="none"` disables). Hover GPU picks are REST-DEBOUNCED by default — one pick when the pointer stops moving, none while it sweeps — which eliminates the per-mousemove GPU ReadPixels stall that made hover popups freeze integrated-graphics machines (measured ~1.1s of main-thread stall per move on real layers). `hover-pick` on `<om-map>` tunes it: `"rest"` (default), `"continuous"` (deck-native per-frame — for hover-follow UIs on capable hardware), `"off"` (click picking only), or a throttle interval in ms (leading + trailing). Click picking is never gated.
|
|
57
57
|
- Zoom visibility: `visible-zoom-range="[8, 14]"` on ANY layer type — scale-dependent visibility (hidden outside min ≤ zoom < max, the minzoom/maxzoom convention; the tile-only visible-min-zoom/visible-max-zoom deck props remain tile-layer-specific). Composes with `visible`; a zoom-hidden layer stays in the legend/switcher/ctx. For CI that emits om-layer markup, validate attributes per layer type against the shipped `onlymapjs.attributes.json` (generated from the same registry the runtime checks — `universal` + `layers[<type>]`), not the flat per-tag union in the IntelliSense html-data file. Also: a layer whose REQUIRED position accessor resolves undefined for every row (e.g. a TextLayer fed GeoJSON with no get-position) now warns at runtime with the exact fix (`get-position="$geometry.coordinates"`) instead of silently drawing nothing.
|
|
58
|
-
- Clustering: `cluster="true"` on a `ScatterplotLayer`, `GeoJsonLayer` (Point features) or `IconLayer` merges points that would overlap into count bubbles that split as the reader zooms in — a toggle, NOT a separate layer type; the layer keeps its id, data, its own `get-*` symbology for standalone points, picks and actions. Options use MapLibre's names: `cluster-radius` (px, 50), `cluster-max-zoom` (16), `cluster-min-points` (2). `cluster-properties="sum:f,max:f,mean:f,mode:f,first:f"` puts `$sum_f`/`$mode_f`/`$first_f`… on every bubble beside `$count` (`first` = the earliest member's value in data order, any type); style bubbles with `get-cluster-radius` / `get-cluster-fill-color` / `get-cluster-line-color` / `get-cluster-label`, and put an IMAGE on a bubble with `get-cluster-icon="$first_photo"` — a URL draws as a circular thumbnail ringed in the bubble's fill (needs CORS; a loading or failed image leaves the circle), a name draws a glyph from `cluster-icon-atlas`/`cluster-icon-mapping`. Every bubble also carries `$count_max` and `$<agg>_max` (the largest at the CURRENT zoom) — divide by them so a ramp stays meaningful at every zoom; the default radius is `scale($count / $count_max, sqrt, [12, 36], domain=[0, 1])`. A click on a bubble flies (eased) to where it splits (`cluster-click="none"` opts out; action `expand-cluster`); bubble picks carry `cluster: true`, `count`, `cluster_id` and the aggregates into overlays — give bubbles and points separate behaviors with `pick="cluster"` / `pick="point"` (a template cannot branch, so one shared card would open half-empty for bubbles); `map.clusterLeaves(layerId, clusterId)` lists the rows inside; `ctx.layers[i].cluster` says whether the toggle is on, and `set-layer-attribute {layer, name: "cluster", value}` flips it from a widget. Point data only (lines/polygons refuse with a structured error); not on projected (`crs=`) sheets. Bubbles far out and icons close in = two layers over the same file with complementary `visible-zoom-range`s (`[0, 12]` clustered with `cluster-max-zoom="11"`, an `IconLayer` on `[12, 24]`).
|
|
58
|
+
- Clustering: `cluster="true"` on a `ScatterplotLayer`, `GeoJsonLayer` (Point features) or `IconLayer` merges points that would overlap into count bubbles that split as the reader zooms in — a toggle, NOT a separate layer type; the layer keeps its id, data, its own `get-*` symbology for standalone points, picks and actions. Options use MapLibre's names: `cluster-radius` (px, 50), `cluster-max-zoom` (16), `cluster-min-points` (2). `cluster-properties="sum:f,max:f,mean:f,mode:f,first:f"` puts `$sum_f`/`$mode_f`/`$first_f`… on every bubble beside `$count` (`first` = the earliest member's value in data order, any type); style bubbles with `get-cluster-radius` / `get-cluster-fill-color` / `get-cluster-line-color` / `get-cluster-label`, and put an IMAGE on a bubble with `get-cluster-icon="$first_photo"` — a URL draws as a circular thumbnail ringed in the bubble's fill (needs CORS; a loading or failed image leaves the circle), a name draws a glyph from `cluster-icon-atlas`/`cluster-icon-mapping`. Over an image, make the count a badge: `cluster-label-position="top-right"` (or any edge/corner; default `center`) + `cluster-label-background="#111827"` (a pill; absent = a dark halo), with `cluster-label-color`/`cluster-label-size`; `cluster-label="false"` hides it. Every bubble also carries `$count_max` and `$<agg>_max` (the largest at the CURRENT zoom) — divide by them so a ramp stays meaningful at every zoom; the default radius is `scale($count / $count_max, sqrt, [12, 36], domain=[0, 1])`. A click on a bubble flies (eased) to where it splits (`cluster-click="none"` opts out; action `expand-cluster`); bubble picks carry `cluster: true`, `count`, `cluster_id` and the aggregates into overlays — give bubbles and points separate behaviors with `pick="cluster"` / `pick="point"` (a template cannot branch, so one shared card would open half-empty for bubbles); `map.clusterLeaves(layerId, clusterId)` lists the rows inside; `ctx.layers[i].cluster` says whether the toggle is on, and `set-layer-attribute {layer, name: "cluster", value}` flips it from a widget. Point data only (lines/polygons refuse with a structured error); not on projected (`crs=`) sheets. Bubbles far out and icons close in = two layers over the same file with complementary `visible-zoom-range`s (`[0, 12]` clustered with `cluster-max-zoom="11"`, an `IconLayer` on `[12, 24]`).
|
|
59
59
|
- Filtering: `filter-field="magnitude" filter-range="[4, 10]"` on a layer (GPU-side, live-updatable via the `filter-layer` action); pair with `<om-widget type="filter" layer="..." field="...">`. For an epoch-millisecond field, make the slider labels readable with `<om-widget type="filter" layer="quakes" field="time" format="date" date-style="datetime" time-zone="UTC"></om-widget>`. Up to 4 numeric dimensions at once via `filter-fields='[{"field":"magnitude","range":[4,10]},{"field":"time","range":[…]}]'` (JSON array, additive to filter-field/filter-range — wins if both are authored) — one `<om-widget type="filter">` per field, each moves its own dimension independently (filter-layer merges the range onto the matching field rather than replacing the whole filter); a row must pass every active dimension (AND). A dimension can't be added live — the full set is declared up front in filter-fields. Categorical filtering is a SEPARATE mechanism (deck.gl's own discrete keep-list test, not a range) with its own attributes: `filter-category="fuel" filter-categories='["Coal","Gas"]'` (single) or `filter-category-fields='[{"field":"fuel","categories":[...]},...]'` (up to 4); the SAME `<om-widget type="filter">` auto-renders checkboxes instead of a slider when its `field` is declared categorically (mode is inferred from the layer's own filter, never a separate widget attribute) — one checkbox per distinct value present in the data, with its row count. A category dimension with no keep-list is dropped from the active filter (there is no "matches everything" category the way a numeric range has [-Infinity, Infinity]). Numeric and categorical filters on the same layer combine — a row must pass both. `ctx.stats`/`ctx.dataInViewport` respect whichever kind(s) are active by default (`{filtered:false}` opts out). CLASSIFIED SYMBOLOGY: `classify-by="<numeric field>"` (+ `classify-scale="quantile|equal-interval|jenks"`, `classify-classes="2-12"` default 5, `classify-ramp="viridis|plasma|inferno|magma|cividis|turbo|blues|greens|oranges|purples|reds|ylorrd|rdbu|spectral"`) computes class breaks FROM THE DATA at reconcile time, installs the fill-color accessor and the auto classes legend — use it when the user asks for graduated/choropleth styling WITHOUT hand-authoring domains; an authored get-fill-color/color always wins (validation warns on the conflict); URL-backed layers classify when their data arrives. TEMPORAL PLAYBACK: `<om-widget type="time-slider" layer="…" field="<numeric/epoch-ms field>" duration="20s" window="<span in field units>" loop format="date" date-style time-zone>` — play/pause/scrub emitting the ordinary filter-layer action (cumulative from the domain start, or a sliding window with `window`); manifest stays the source of truth so undo/story/external filter edits re-sync the thumb — prefer it over hand-rolling a playback loop.
|
|
60
60
|
- Routing & tracking are two library-owned layer types (not `PathLayer`/`IconLayer` hand-wired) that expand into ordinary `PathLayer`/`IconLayer` instances internally, same pattern as `BIMLayer`→`Tile3DLayer`. `<om-layer type="Route" geometry='{"type":"LineString","coordinates":[[lng,lat],...]}'>` draws a styled route (casing + line + origin/destination pins) from geometry you already have — resolves SYNCHRONOUSLY, no network. `<om-layer type="Route" origin="[lng,lat]" destination="[lng,lat]" provider="nika" profile="driving">` (+ optional `waypoints`) resolves one ASYNCHRONOUSLY via a `RoutingProvider` named by `provider` — `"nika"` is registered by default but its endpoint is an UNVERIFIED PLACEHOLDER until NIKA's real routing service ships (register a working one with `OmMap.registerRoutingProvider(name, provider)` — a ~15-line adapter over OSRM's keyless public demo server (`router.project-osrm.org/route/v1/{profile}/{lng},{lat};{lng},{lat}?geometries=geojson&overview=full`, map `distance`/`duration`/`legs` onto `distanceMeters`/`durationSec`/`legs[]`) is the verified keyless real-data recipe; the skill's syntax.md carries it in full). `geometry` wins outright if both are authored (validation warns). `color`/`casing-color` style the line; `follow="fit-route"` auto-fits the camera once resolved. `<om-layer type="Tracking" get-position="[$lng,$lat]">` renders ONE moving entity (v1 — a fleet is one `Tracking` layer per vehicle) with bearing-derived icon rotation; position data arrives through the ORDINARY `data`/`source` mechanism, no separate tracking-subscription API. `bearing-field` (default `"bearing"`) names the plain field to rotate by (checks `properties.<field>` on GeoJSON rows, `<field>` directly on flat rows); `interpolate-ms` (default `1000`) glides the marker between two fixes via the per-frame channel instead of jumping; `follow="follow"` eases the camera along with it, same timing. `color`/`size` style the marker; `icon="arrow|car|motorcycle"` picks the shape (default arrow — all nose-up, baked in `color`, unknown names fall back with a validation warning). Tail modes: on the ROUTE layer, `progress-from="<tracking-layer-id>"` + `tail="none"` (client view — only current position → destination renders, origin pin dropped) or `tail="dim"` (operator view — traveled portion darkened; `tail-color` overrides) split the route at the marker's interpolated position per frame; default full ignores the split; validation warns on partial wiring.
|
|
61
61
|
|
|
@@ -325,6 +325,10 @@
|
|
|
325
325
|
"cluster-icon-atlas",
|
|
326
326
|
"cluster-icon-mapping",
|
|
327
327
|
"cluster-label",
|
|
328
|
+
"cluster-label-background",
|
|
329
|
+
"cluster-label-color",
|
|
330
|
+
"cluster-label-position",
|
|
331
|
+
"cluster-label-size",
|
|
328
332
|
"cluster-max-zoom",
|
|
329
333
|
"cluster-min-points",
|
|
330
334
|
"cluster-properties",
|
|
@@ -735,6 +739,10 @@
|
|
|
735
739
|
"cluster-icon-atlas",
|
|
736
740
|
"cluster-icon-mapping",
|
|
737
741
|
"cluster-label",
|
|
742
|
+
"cluster-label-background",
|
|
743
|
+
"cluster-label-color",
|
|
744
|
+
"cluster-label-position",
|
|
745
|
+
"cluster-label-size",
|
|
738
746
|
"cluster-max-zoom",
|
|
739
747
|
"cluster-min-points",
|
|
740
748
|
"cluster-properties",
|
|
@@ -1210,6 +1218,10 @@
|
|
|
1210
1218
|
"cluster-icon-atlas",
|
|
1211
1219
|
"cluster-icon-mapping",
|
|
1212
1220
|
"cluster-label",
|
|
1221
|
+
"cluster-label-background",
|
|
1222
|
+
"cluster-label-color",
|
|
1223
|
+
"cluster-label-position",
|
|
1224
|
+
"cluster-label-size",
|
|
1213
1225
|
"cluster-max-zoom",
|
|
1214
1226
|
"cluster-min-points",
|
|
1215
1227
|
"cluster-properties",
|
package/onlymapjs.html-data.json
CHANGED
|
@@ -933,6 +933,22 @@
|
|
|
933
933
|
"name": "cluster-label",
|
|
934
934
|
"description": "Set \"false\" to drop the count text on bubbles. Valid on: GeoJsonLayer, IconLayer, ScatterplotLayer."
|
|
935
935
|
},
|
|
936
|
+
{
|
|
937
|
+
"name": "cluster-label-position",
|
|
938
|
+
"description": "Where the count sits: \"center\" (default) or an edge/corner — \"top-right\" moves it off a photo thumbnail. Valid on: GeoJsonLayer, IconLayer, ScatterplotLayer."
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
"name": "cluster-label-background",
|
|
942
|
+
"description": "A pill behind the count (any CSS colour or [r,g,b,a]) so it reads over an image. Absent = a thin dark halo on the text instead. Valid on: GeoJsonLayer, IconLayer, ScatterplotLayer."
|
|
943
|
+
},
|
|
944
|
+
{
|
|
945
|
+
"name": "cluster-label-color",
|
|
946
|
+
"description": "The count's text colour (default white). Valid on: GeoJsonLayer, IconLayer, ScatterplotLayer."
|
|
947
|
+
},
|
|
948
|
+
{
|
|
949
|
+
"name": "cluster-label-size",
|
|
950
|
+
"description": "The count's font size in pixels (default 12). Valid on: GeoJsonLayer, IconLayer, ScatterplotLayer."
|
|
951
|
+
},
|
|
936
952
|
{
|
|
937
953
|
"name": "get-cluster-radius",
|
|
938
954
|
"description": "Bubble radius in pixels — an expression over $count, $count_max (the largest cluster at this zoom), $count_total, $zoom and the cluster-properties aggregates. Default: scale($count / $count_max, sqrt, [12, 36], domain=[0, 1]). Valid on: GeoJsonLayer, IconLayer, ScatterplotLayer."
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nika-js/onlymap",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
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.11.
|
|
26
|
+
For no-build CDN pages, use the single-file standalone bundle from a raw-file CDN — `https://unpkg.com/@nika-js/onlymap@0.11.2` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.11.2/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.11.
|
|
20
|
-
<script type="module" src="https://unpkg.com/@nika-js/onlymap@0.11.
|
|
19
|
+
<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.11.2/dist/onlymapjs.css">
|
|
20
|
+
<script type="module" src="https://unpkg.com/@nika-js/onlymap@0.11.2"></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).
|
|
@@ -189,13 +189,15 @@ One `<om-widget type="filter">` per dimension — each moves its own field's ran
|
|
|
189
189
|
| `cluster-radius` | Cluster radius in screen pixels (default 50). |
|
|
190
190
|
| `cluster-max-zoom` | The last zoom at which clusters still form (default 16); past it every point stands alone. |
|
|
191
191
|
| `cluster-min-points` | Fewest points that make a cluster (default 2). |
|
|
192
|
-
| `cluster-properties` | `"op:field,…"` with op `sum` `min` `max` `mean` `mode` `first` → `$op_field` on every bubble (`$sum_capacity_mw`, `$mode_fuel`, `$first_photo`), beside `$count`. `mode` is the commonest value — the way to colour a bubble by category; `first` (0.11.
|
|
192
|
+
| `cluster-properties` | `"op:field,…"` with op `sum` `min` `max` `mean` `mode` `first` → `$op_field` on every bubble (`$sum_capacity_mw`, `$mode_fuel`, `$first_photo`), beside `$count`. `mode` is the commonest value — the way to colour a bubble by category; `first` (0.11.2) is the earliest member's value in data order, any type — the way to pick a representative photo or name. |
|
|
193
193
|
| `cluster-click` | `expand` (default: a click flies to the zoom where the bubble splits) or `none`. |
|
|
194
194
|
| `cluster-label` | `"false"` drops the count text. |
|
|
195
|
+
| `cluster-label-position` | Where the count sits (0.11.2): `center` (default), `top`, `bottom`, `left`, `right`, `top-left`, `top-right`, `bottom-left`, `bottom-right` — a corner moves it off a photo thumbnail onto the rim. |
|
|
196
|
+
| `cluster-label-background` / `cluster-label-color` / `cluster-label-size` | A pill behind the count (any colour; absent = a thin dark halo on the text), its text colour (default white), its font size in px (default 12). `cluster-label-position="top-right" cluster-label-background="#111827"` is the badge over an image. |
|
|
195
197
|
| `get-cluster-radius` | Bubble radius in px — an expression over the cluster fields. |
|
|
196
198
|
| `get-cluster-fill-color` / `get-cluster-line-color` | Bubble fill/outline. Default fill: the layer's own `color`, else blue; outline white. |
|
|
197
199
|
| `get-cluster-label` | Bubble text (default `$count_abbreviated`, e.g. `1.2k`). |
|
|
198
|
-
| `get-cluster-icon` | An IMAGE on the bubble (0.11.
|
|
200
|
+
| `get-cluster-icon` | An IMAGE on the bubble (0.11.2). A URL (`$first_photo`) draws as a circular thumbnail, cover-fit, ringed in the bubble's fill; a name draws a glyph from `cluster-icon-atlas` (or an `IconLayer` host's own atlas). Images need CORS (same-origin, or `Access-Control-Allow-Origin`); a bubble whose image is loading or failed stays a circle. |
|
|
199
201
|
| `cluster-icon-atlas` / `cluster-icon-mapping` | The glyph sheet for names from `get-cluster-icon`, as `icon-atlas`/`icon-mapping` on IconLayer. |
|
|
200
202
|
|
|
201
203
|
Cluster fields available to `get-cluster-*`: `$count`, `$count_abbreviated`, `$count_total` (all points), `$zoom`, the aggregates, and — for scaling — `$count_max` and `$<aggregate>_max` / `_min`: the largest/smallest value among ALL clusters at the bubble's own zoom. Divide by them, as the default radius does, and a size or colour ramp stays meaningful at every zoom (a literal `domain=[2, 1000]` is right at z3 and collapses every bubble at z11). `scale()` domains must be literals, so this normalisation is the way to get a zoom-adaptive ramp.
|
|
@@ -685,7 +687,7 @@ Templates:
|
|
|
685
687
|
- `{{field}}` HTML-escaped interpolation.
|
|
686
688
|
- `{{{field}}}` raw HTML; avoid unless trusted.
|
|
687
689
|
- `{{z}}` — the pick's elevation in meters, present only when a `pickable="3d"` layer ran the depth pass for it (see `<om-layer>`'s `pickable` above). Absent, not `0`, otherwise.
|
|
688
|
-
- **Image or link tokens → wrap the content in a `<template>` child** (0.11.
|
|
690
|
+
- **Image or link tokens → wrap the content in a `<template>` child** (0.11.2): `<om-overlay …><template><img src="{{photo}}"></template></om-overlay>`. A `<template>` is inert, so the browser never requests the literal `{{photo}}` at page load the way it does for live light-DOM children. Tokens are blanked until the first pick fills them (an empty `src` is not fetched), and the tooltip path does the same.
|
|
689
691
|
|
|
690
692
|
Example:
|
|
691
693
|
|