@nika-js/onlymap 0.11.4 → 0.11.6
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 +16 -0
- package/README.md +2 -2
- package/dist/{basemap-UE11uf6w.js → basemap-jgiazq81.js} +14 -2
- package/dist/basemap.d.ts +9 -0
- package/dist/elements/om-map.d.ts +31 -1
- package/dist/elements/om-overlay.d.ts +0 -14
- package/dist/{geoparquet-D7ZKVPDh.js → geoparquet-BqlfpNfW.js} +1 -1
- package/dist/{globe-view-B7Yn2BbK.js → globe-view-BwEj9ar9.js} +1 -1
- package/dist/{hillshade-tQaqlPhn.js → hillshade-50jNXHyP.js} +1 -1
- package/dist/{index-N5acD4ii.js → index-ALKRO96X.js} +1 -1
- package/dist/{index-CFWt9qS0.js → index-BBeBWH6b.js} +1 -1
- package/dist/{index-DPV7mwIc.js → index-BPRV9yxf.js} +2 -2
- package/dist/{index-C8a3EKM8.js → index-BVIktcJJ.js} +3 -3
- package/dist/{index-CWtaL88w.js → index-CCVeg1y8.js} +3 -3
- package/dist/{index-B_L_7lV0.js → index-CiSq4_Va.js} +1 -1
- package/dist/{index-DIoKYXlh.js → index-CmfYI2km.js} +1 -1
- package/dist/{index-C09RUa1s.js → index-jPifVRWa.js} +1 -1
- package/dist/{index-DzxpYTfi.js → index-mLeavkEr.js} +5491 -5305
- package/dist/index.d.ts +1 -1
- package/dist/{lerc-BDcZeX07.js → lerc-B9Q9wT5l.js} +1 -1
- package/dist/onlymap.standalone.js +13670 -13456
- package/dist/onlymapjs.js +1 -1
- package/dist/{post-process-effect-C1iDE90L.js → post-process-effect-Dzn0f8iO.js} +1 -1
- package/dist/programmatic.d.ts +10 -1
- package/dist/{raster-D4nwLneR.js → raster-C-WM-KNb.js} +3 -3
- package/dist/{raster-pipeline-DX-rZjRG.js → raster-pipeline-qYYrkOdi.js} +1 -1
- package/dist/react.js +128 -125
- package/dist/runtime-core.d.ts +50 -1
- package/dist/selection.d.ts +31 -0
- package/dist/{text-on-path-onhHN4AZ.js → text-on-path-1qHOZW1K.js} +64 -48
- package/dist/text-on-path.d.ts +13 -1
- package/dist/version.d.ts +1 -1
- package/dist/viewport-cull.d.ts +15 -0
- package/dist/{zarr-CBGaInwF.js → zarr-CqHkmYTv.js} +2 -2
- package/docs/cartograph.md +2 -2
- package/docs/cartography.md +1 -0
- package/llms.txt +3 -2
- package/onlymapjs.attributes.json +1 -0
- package/package.json +1 -1
- package/skills/onlymapjs/SKILL.md +4 -3
- package/skills/onlymapjs/references/syntax.md +5 -3
|
@@ -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.6/dist/onlymapjs.css">
|
|
20
|
+
<script type="module" src="https://unpkg.com/@nika-js/onlymap@0.11.6"></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).
|
|
@@ -61,7 +61,7 @@ Common attributes:
|
|
|
61
61
|
- `type="buffer" distance="0.9mm" repeat="5" fade` — bands around a shape, outermost first, each carrying `_band` and `_bandOpacity` (read it: `get-fill-color="[125,155,173, $_bandOpacity * 165]"`). N bands are N thresholds of ONE signed distance field, so five cost what one costs and the output cannot self-intersect. An ORNAMENT with a measured half-cell bound (0.042 mm at 300 dpi), NOT an analytic setback — for a distance somebody will act on, point at PostGIS/turf.
|
|
62
62
|
- `type="contour" src="terrarium" bounds="[w,s,e,n]" interval="100m" zoom="10"` — isolines marched off a DEM (not deck's `ContourLayer`, which contours point DENSITY). It SOURCES geometry onto a layer with no data; its extent is DECLARED rather than taken from the camera, because a transform runs once at ingest. Each line carries `elevation` and `index` (true every fifth line — the cartographer's heavier contour). The interval is a ground height; `interval="2mm"` is an error.
|
|
63
63
|
- Millimetre knobs need `reference-scale` on the map (or a cartograph frame, which supplies its own); without one they are a validation error naming the fix. Ground units need none. Columnar layers are out of scope and say so.
|
|
64
|
-
- A LABEL THAT FOLLOWS ITS LINE is `<om-layer type="TextOnPathLayer" get-path="$path" get-text="$name">` — a river's name along the river, a range's along the range. deck has no such layer; this is a composite over `TextLayer` emitting one instance per glyph, each rotated to the local tangent.
|
|
64
|
+
- A LABEL THAT FOLLOWS ITS LINE is `<om-layer type="TextOnPathLayer" get-path="$path" get-text="$name">` — a river's name along the river, a range's along the range. deck has no such layer; this is a composite over `TextLayer` emitting one instance per glyph, each rotated to the local tangent. `pickable` makes it clickable, and a pick reports the label's row (not a glyph), so `{{field}}` popups and tooltips work (0.11.6+).
|
|
65
65
|
- `get-path` and `get-text` are both REQUIRED — either alone is silently inert, and the validator says so.
|
|
66
66
|
- `get-path` must resolve to a LIST OF COORDINATES, and which expression does that depends on the data's shape. On GEOJSON write `get-path="d.geometry.coordinates"` — a `$field` compiles to `properties.<field>`, so `$geometry` hands the layer the geometry OBJECT and every label is silently dropped (measured: 0 glyphs against 11). A `$field` is correct only when the rows are FLAT and carry the list themselves, as in `get-path="$path"` over `[{"name":"Mississippi","path":[[lng,lat], …]}]`. The validator errors when the data is inline and provably GeoJSON, and warns when the data is a URL, because the shape cannot be known before it loads.
|
|
67
67
|
- WHERE the name sits is a SEARCH, not a constant: `placement="auto"` (the default) scans the line for the straightest reach the name fits on. Pinning it to the midpoint put labels on whatever the line happened to be doing there, which on real hydrography is usually a bend — measured on Natural Earth rivers at continental scale, the Colorado turned 151 degrees between adjacent glyphs and the Columbia spread 292. Auto brought all eleven under 45. Use `start`/`middle`/`end` when a name belongs somewhere specific, such as a river's mouth; they are honoured even where the reach is poor.
|
|
@@ -90,6 +90,8 @@ Events: `om-map-ready` (boot complete; `await mapEl.ready` is the promise twin),
|
|
|
90
90
|
|
|
91
91
|
`await mapEl.snapshot()` (also on `MapController`) returns a canvas-only PNG dataURL of the scene — basemap + layers composited at device pixels (`{as: "blob"}` for files; `type`/`quality` for jpeg/webp). DOM widgets, overlays, and the provider attribution are NOT in the pixels: exports must render credits themselves. Await `ready` first; headless maps reject.
|
|
92
92
|
|
|
93
|
+
Programmatic picking (0.11.5+, also on `MapController`): `mapEl.pickAt([x, y], { radius?, layers? })` returns the `Selection` under a screen pixel (CSS px from the map's top-left; 4px search radius by default) or `null`; `mapEl.pickRect({ x, y, width, height }, { layers?, maxObjects? })` returns every `Selection` inside a rectangle, front to back, at most 100 by default, each with `coordinate: null` (deck reports no per-object position for a rectangle; raster layers are not sampled); `mapEl.unproject([x, y])` and `mapEl.project([lng, lat])` convert between pixels and `[lng, lat]`. All are queries — they leave `ctx.selection`, `om-map-point` and `<om-behavior>`s alone. They see only `pickable` layers unless the `pickMode` PROPERTY is `"all"`, which makes every layer pickable for every pick path (hover, click and `pick-cursor` included) until set back to `"authored"`. It is a property, not an attribute: it never reaches the document, undo history, or a save — arm it for a picker tool instead of writing `pickable`.
|
|
94
|
+
|
|
93
95
|
Example:
|
|
94
96
|
|
|
95
97
|
```html
|