@nika-js/onlymap 0.9.1 → 0.10.0
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 +18 -0
- package/README.md +26 -2
- package/dist/{basemap-DL0mk9Bf.js → basemap-9lXclX9H.js} +3882 -3980
- package/dist/cartograph/elements/om-frame.d.ts +67 -1
- package/dist/cartograph/georef.d.ts +18 -4
- package/dist/cartograph/schema.d.ts +11 -0
- package/dist/cartograph.js +1480 -1311
- package/dist/cartograph.standalone.js +1808 -1615
- package/dist/{cityjson-D_V5GY8b.js → cityjson-k-z1r6c0.js} +1 -1
- package/dist/{crs-DsDQ4Q4i.js → crs-BzE_KP4M.js} +25 -2
- package/dist/{crs-Ciu7Xs7a.js → crs-ChglCB3O.js} +39 -16
- package/dist/elements/om-map.d.ts +10 -0
- package/dist/{geoparquet-DJxZA0if.js → geoparquet-DFDZDBun.js} +10 -10
- package/dist/globe-view-D9wjfL0T.js +104 -0
- package/dist/hillshade-C2BQr6pd.js +298 -0
- package/dist/{hillshade-shader-n_zManfZ.js → hillshade-shader-DI2uLSNU.js} +15 -10
- package/dist/hillshade-shader.d.ts +18 -2
- package/dist/hillshade.d.ts +30 -0
- package/dist/{ifc-Dc-TdSJr.js → ifc-DXwePQRv.js} +131 -131
- package/dist/{index-CvuDsvnk.js → index-4Tvlt0iO.js} +47 -47
- package/dist/{index-BjcPjICh.js → index-Bn66l3KG.js} +59 -59
- package/dist/index-BuXrMq5D.js +322 -0
- package/dist/index-CNRbZHkK.js +459 -0
- package/dist/{index-DdTZSuAb.js → index-CkovmN47.js} +106 -106
- package/dist/index-CmuOizAF.js +641 -0
- package/dist/index-CvT5QHBS.js +65 -0
- package/dist/{index-vLXZuog4.js → index-DnVHKI61.js} +1 -1
- package/dist/{index-oY3XHIux.js → index-JjyDEqAS.js} +18178 -16943
- package/dist/index.d.ts +4 -0
- package/dist/layer-registry.d.ts +27 -0
- package/dist/{lerc-Bph62dCb.js → lerc-C1mQ_Kqq.js} +1 -1
- package/dist/onlymap.standalone.js +48211 -45574
- package/dist/onlymapjs.js +77 -74
- package/dist/parse-manifest.d.ts +6 -0
- package/dist/plane-camera.d.ts +59 -0
- package/dist/plane-layers.d.ts +56 -0
- package/dist/plane-tiles.d.ts +99 -0
- package/dist/plane-tileset.d.ts +31 -0
- package/dist/plane-warp.d.ts +91 -0
- package/dist/post-process-effect-DfslKPM6.js +197 -0
- package/dist/programmatic.d.ts +16 -1
- package/dist/projection.d.ts +118 -0
- package/dist/{raster-D-eTzCE3.js → raster-D2NzdjZE.js} +4 -4
- package/dist/{raster-pipeline-BlOnMPJe.js → raster-pipeline-qnD1icOv.js} +4 -3
- package/dist/runtime-core.d.ts +140 -1
- package/dist/serialize/clip.d.ts +50 -0
- package/dist/serialize/declutter.d.ts +44 -0
- package/dist/serialize/emit.d.ts +60 -0
- package/dist/serialize/index.d.ts +64 -0
- package/dist/serialize/strategy.d.ts +30 -0
- package/dist/serialize/style.d.ts +77 -0
- package/dist/snapshot.d.ts +46 -0
- package/dist/surface-anchor.d.ts +6 -0
- package/dist/text-on-path-Dm7vtNqt.js +146 -0
- package/dist/text-on-path.d.ts +157 -0
- package/dist/transform/buffer.d.ts +63 -0
- package/dist/transform/contour.d.ts +37 -0
- package/dist/transform/dot-density.d.ts +19 -0
- package/dist/transform/field.d.ts +80 -0
- package/dist/transform/geometry.d.ts +20 -0
- package/dist/transform/index.d.ts +29 -0
- package/dist/transform/simplify.d.ts +10 -0
- package/dist/transform/smooth.d.ts +12 -0
- package/dist/transform-stage.d.ts +92 -0
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-BGDoEtFb.js → zarr-D5e5agMG.js} +2 -2
- package/docs/cartograph.md +12 -4
- package/docs/cartography.md +328 -0
- package/docs/design/arrows.md +182 -0
- package/docs/design/carto-substrate.md +1055 -0
- package/docs/design/extensions.md +250 -0
- package/llms.txt +2 -1
- package/onlymapjs.attributes.json +18 -0
- package/onlymapjs.html-data.json +169 -19
- package/package.json +1 -1
- package/skills/onlymapjs/SKILL.md +6 -2
- package/skills/onlymapjs/references/syntax.md +22 -2
- package/dist/hillshade-DR3TxO1a.js +0 -186
- package/dist/index-DO_w0tqR.js +0 -514
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,24 @@ 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.10.0 — 2026-09-23
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- **Maps in a real projection.** `crs="EPSG:5070"` on `<om-map>` draws the whole map in that projection's plane — parallels curve, an equal-area map is genuinely equal-area, and a national-grid sheet is drawn in its own grid rather than stretched out of Web Mercator. Albers, the UTM zones, British National Grid, Swiss LV95, Lambert 93, RD New and more are built in; anything else takes a `+proj=` string. Your camera does not change: `center` is still lng/lat and `zoom` still means what it meant, so stories, tours and saved views keep working, and clicks still report real coordinates.
|
|
15
|
+
- **Shaded relief on a projected map.** The keyless global relief layer now works on any projection, and so does a DEM of your own. `sun-datum` picks which north the sun means: by default the light stays constant across the sheet, the way printed relief atlases do, because true north rotates by 34° across a map of the United States and light that turns with it reads as a printing fault.
|
|
16
|
+
- **Geometry your data doesn't contain.** `<om-transform>` inside a layer adds `simplify` (thin a dense coastline), `smooth` (one pass removes the chain-of-straight-segments look that marks a map as a web map), `dot-density` (scatter points for a population figure), `buffer` (bands around a shape) and `contour` (elevation lines marched straight off a DEM). Sizes are millimetres on the page, so a line looks the same on screen and on a 300 dpi plate.
|
|
17
|
+
- **The engraved shoreline.** `buffer` with `repeat` and `fade` draws the receding bands around a coast that old charts are known for. Five bands cost what one costs, and they cannot tangle into the slivers that polygon-offsetting usually produces.
|
|
18
|
+
- **Labels that follow the line they name.** `<om-layer type="TextOnPathLayer">` runs a river's name along the river and a mountain range's along the range — the oldest label convention there is, and one no web map library ships. It reads the right way round whichever direction the line was drawn in, and a name too long for its line is left off rather than squeezed. In an SVG export it becomes a single editable word still attached to its path.
|
|
19
|
+
- **Export a map as editable vector.** `snapshot({ format: "svg" })` gives you real `<path>` outlines and real `<text>` labels you can open in Illustrator, with relief and imagery placed as images underneath — vector linework over a raster base, the way printed maps have always been made. A print finish covers the whole frame, so a map carrying one exports as a single image at a resolution you choose, and the export tells you so rather than letting you find out at the print shop.
|
|
20
|
+
- **Freeze a sheet to vector.** `frame.freeze({ format: "svg" })` turns a live map frame in a cartograph into editable artwork in place. The frozen sheet opens with no JavaScript at all and still reads correctly.
|
|
21
|
+
- **A new example**, *Compose an atlas plate*: an Albers sheet of the United States with warped relief, an engraved coastal vignette, contour lines in a detail inset, and buttons for SVG export and freezing.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
- **Relief with `blend="multiply"` no longer tints the map red.** It affected every map using that setting.
|
|
25
|
+
- **A projected cartograph frame is no longer placed upside down.** Its graticule labels, north arrow and frozen output were all mirrored vertically.
|
|
26
|
+
- **Contour lines no longer re-download their elevation tiles on every edit**, which made a page with contours far slower than it needed to be.
|
|
27
|
+
- **Relief no longer stops short of a projected sheet's corners.**
|
|
28
|
+
|
|
11
29
|
## 0.9.1 — 2026-09-22
|
|
12
30
|
|
|
13
31
|
### Added
|
package/README.md
CHANGED
|
@@ -364,6 +364,30 @@ Sources are the `terrain=` registry: `terrarium` and `mapterhorn` are keyless, o
|
|
|
364
364
|
|
|
365
365
|
Two things it gets right that hand-rolled hillshades usually don't. **Tile edges are seamless**: a hillshade is a derivative, so each tile is decoded with a one-pixel apron from its eight neighbours rather than clamping at the border and drawing a pale grid over the world. And **latitude is corrected per fragment**, so relief doesn't flatten toward the equator and exaggerate toward the poles. Tile zoom follows the capture pixel ratio, so a 300 dpi plate gets sharper relief rather than an upscaled screen image. The shader chunk is lazy — a map with no relief never downloads it. Examples: `dev/examples/features/styling/shade-the-terrain.html` (global tiles) and `dev/examples/features/rasters/shade-your-own-dem.html` (your own GeoTIFF). Guide: [docs/hillshade.md](docs/hillshade.md).
|
|
366
366
|
|
|
367
|
+
## Cartography — projections, geometry transforms, vector export
|
|
368
|
+
|
|
369
|
+
`crs` puts the whole renderer in a real projection's plane. Parallels curve, an equal-area projection is genuinely equal-area, and a state-plane sheet is drawn in state plane rather than stretched out of Web Mercator:
|
|
370
|
+
|
|
371
|
+
```html
|
|
372
|
+
<om-map crs="EPSG:5070" reference-scale="1:6500000" basemap="none" center="[-96.8, 38.6]" zoom="3.8">
|
|
373
|
+
<om-layer id="land" type="GeoJsonLayer" data="./countries.geojson">
|
|
374
|
+
<om-transform type="simplify" tolerance="0.18mm"></om-transform>
|
|
375
|
+
<om-transform type="smooth" iterations="2"></om-transform>
|
|
376
|
+
</om-layer>
|
|
377
|
+
<om-layer id="relief" type="HillshadeLayer" src="terrarium" sun-datum="sheet"></om-layer>
|
|
378
|
+
</om-map>
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
**The authored camera stays geographic.** `center` is lng/lat and `zoom` means what it always meant, so stories, `seek()`, `getCamera()` and every state bridge keep working; clicks report lng/lat rather than plane metres, which matters because a projected metre in a geodesic formula returns a confident wrong distance. Web Mercator and plate carrée need nothing; the national grids and UTM zones load proj4 only when a map asks for one; anything else takes `crs-def="+proj=…"` or `registerCrs()`. What a projected map can't do — MapLibre basemaps, `terrain`, pitch, spatial-index layers — is a validation error with a fix, never a silent no-op.
|
|
382
|
+
|
|
383
|
+
**Relief works on a projected sheet**, both ways: a DEM of your own has no projection tie at all, and the keyless global `HillshadeLayer` re-indexes its Mercator tiles from the plane's own geography and draws them as subdivided warped meshes (measured sub-pixel — 0.40 output pixels for Albers at z=3, falling as 1/N²). `sun-datum` picks which north the sun means: sheet north by default, because geographic north swings 34° across a CONUS plate and light that rotates reads as a mistake.
|
|
384
|
+
|
|
385
|
+
**`<om-transform>` adds geometry the data doesn't contain** — `simplify`, `smooth`, `dot-density`, `buffer`, `contour` — in the data stage, so deck, `anchor="surface"`, the legend and the vector exporter all see the same shape. Spatial knobs are millimetres on paper, resolved against a declared `reference-scale`; ground units (`tolerance="50m"`) need none. `buffer` with `repeat` and `fade` is the engraved shoreline of an old chart: five bands are five thresholds of ONE signed distance field, so they cost what one costs and cannot self-intersect. It is an ornament with a measured half-cell bound, not an analytic setback — asking for the latter is an error naming PostGIS.
|
|
386
|
+
|
|
387
|
+
**Labels can follow the line they name.** `<om-layer type="TextOnPathLayer">` runs a river's name along the river and a range's along the range — one text instance per glyph, each rotated to the local tangent. It reads left to right whichever way the line was digitised, and a name that does not fit its line is dropped rather than squeezed. In the SVG export it becomes a single `<textPath>`: one editable word still attached to the river's own path.
|
|
388
|
+
|
|
389
|
+
**`snapshot({ format: "svg" })` exports vector.** Polygons and paths become `<path>`, labels become real `<text>` after a deterministic CPU decluttering pass, and anything whose appearance is pixels becomes a placed raster band — vector linework over relief, which is how cartographic production has always worked. A print finish treats the finished frame, so a sheet carrying one exports as a single band at `effectDpi` (default 600) and says so rather than letting you find out at a print shop. `frame.freeze({format: "svg"})` stores that SVG inline in a cartograph frame, placed by the same `crs` + `corners`: a frozen sheet opens with no runtime, no network, and nothing defining its custom elements. Example: `dev/examples/features/cartography/compose-an-atlas-plate.html`. Guide: [docs/cartography.md](docs/cartography.md).
|
|
390
|
+
|
|
367
391
|
## Programmatic surface
|
|
368
392
|
|
|
369
393
|
- **`OmMap.*`** — `validate`, `snapshotIR`, `snapshotDescriptorIR`, `resolveImageOverlay`, `registerLayer`, `registerWidget`, `registerAction`, `registerSource`, `registerFormat`, `registerBasemap`, `configureBasemap`, `configureData`, `configureTelemetry`, `configureLicense`, `getLayerSchema`
|
|
@@ -408,13 +432,13 @@ The library reports one **deployment-scoped** usage snapshot per map per page lo
|
|
|
408
432
|
|
|
409
433
|
## Not implemented yet (honestly)
|
|
410
434
|
|
|
411
|
-
Mapbox GL basemaps, depth-interleaved 3D compositing, globe projection, SSE transport, `dblclick` behaviors, the
|
|
435
|
+
Mapbox GL basemaps, depth-interleaved 3D compositing, globe projection, SSE transport, `dblclick` behaviors, the typed fluent builder, and stories/draw as React components (both work via the HTML manifest). On cartography: relief cannot be masked to land (clipping one layer to another's geometry is layer-extension work), `contour` marches in the DEM's Mercator grid even on a projected sheet (the polylines project exactly; the sampling is what is Mercator), and native-CRS tile pyramids are deferred until asked for. On React Native (`@nika-js/onlymap-native`): stories, draw, widgets, and overlays as native components (build native UI beside the map instead), and bare (non-Expo) React Native until its `0.2.0`. On `pick-features`: instanced (i3dm) tiles keep tile-granularity picking, and `feature-styles`' `opacity` below 1 is still being validated. On BIM: clash detection is bounding-box only (no mesh-level test, and it cannot tell a resolved penetration from a collision), there is no BCF export, no equivalent of Navisworks' Auto Reveal, and prepared tilesets converted before the `bbox*` columns existed cannot take part in a clash pass — `strength` tinting and `opacity: 0` (hide, a shader discard) work. On the measure widget's `volume` mode: the per-cell grid integration measures against the map's active terrain DEM only — measuring against an imported design surface or a previous survey (period-over-period reconciliation) and a cut/fill heat-map overlay are not implemented yet, and a snapped footprint vertex takes the matched feature's horizontal position only — its exact elevation is not threaded through (see **XY snapping** above).
|
|
412
436
|
|
|
413
437
|
## Going deeper
|
|
414
438
|
|
|
415
439
|
| | |
|
|
416
440
|
|---|---|
|
|
417
|
-
| [docs/react.md](docs/react.md) · [docs/basemaps.md](docs/basemaps.md) · [docs/testing.md](docs/testing.md) · [docs/live-data.md](docs/live-data.md) · [docs/image-overlays.md](docs/image-overlays.md) · [docs/3d-assets.md](docs/3d-assets.md) · [docs/stories.md](docs/stories.md) · [docs/routing.md](docs/routing.md) · [docs/effects.md](docs/effects.md) · [docs/hillshade.md](docs/hillshade.md) · [docs/telemetry.md](docs/telemetry.md) | Consumer guides |
|
|
441
|
+
| [docs/react.md](docs/react.md) · [docs/basemaps.md](docs/basemaps.md) · [docs/testing.md](docs/testing.md) · [docs/live-data.md](docs/live-data.md) · [docs/image-overlays.md](docs/image-overlays.md) · [docs/3d-assets.md](docs/3d-assets.md) · [docs/stories.md](docs/stories.md) · [docs/routing.md](docs/routing.md) · [docs/effects.md](docs/effects.md) · [docs/hillshade.md](docs/hillshade.md) · [docs/cartography.md](docs/cartography.md) · [docs/telemetry.md](docs/telemetry.md) | Consumer guides |
|
|
418
442
|
| [CHANGELOG.md](CHANGELOG.md) | Version-by-version release notes |
|
|
419
443
|
| [llms.txt](llms.txt) | The agent-facing quick reference |
|
|
420
444
|
| `skills/onlymapjs` | Installable LLM skill for OnlyMapJS authoring |
|