@nika-js/onlymap 0.11.10 → 0.12.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +10 -4
  3. package/dist/attribute-resolution.d.ts +2 -0
  4. package/dist/{basemap-Cc8v5hPA.js → basemap-CtDse0mW.js} +1328 -1263
  5. package/dist/basemap-request.d.ts +24 -0
  6. package/dist/basemap.d.ts +41 -1
  7. package/dist/cartograph.js +362 -321
  8. package/dist/cartograph.standalone.js +1995 -1914
  9. package/dist/{cityjson-k-z1r6c0.js → cityjson-DMc_dwu1.js} +1 -1
  10. package/dist/{crs-BzE_KP4M.js → crs-D5FyQfEu.js} +74 -7
  11. package/dist/{crs-ChglCB3O.js → crs-ZdDBJ2EY.js} +39 -36
  12. package/dist/data-layer.d.ts +36 -3
  13. package/dist/elements/om-map.d.ts +2 -1
  14. package/dist/geoparquet-BTHYX1ET.js +30 -0
  15. package/dist/geoparquet.d.ts +6 -7
  16. package/dist/{globe-view-BF6-01N_.js → globe-view-KrKNOmVs.js} +11 -11
  17. package/dist/hillshade-CijRdYyU.js +209 -0
  18. package/dist/html-data.d.ts +1 -1
  19. package/dist/{ifc-DXwePQRv.js → ifc-sisRo7I7.js} +1 -1
  20. package/dist/{index-CwoqJ6IK.js → index-21KGElDr.js} +9 -9
  21. package/dist/{index-C9gVsJaG.js → index-A45DtXly.js} +18 -18
  22. package/dist/{index-Dk12Fazj.js → index-BPa2CC8T.js} +20 -20
  23. package/dist/{index-CCY7Rk1s.js → index-B_Vhebf7.js} +1 -1
  24. package/dist/{index-C_0KCx9L.js → index-Bfocr1_A.js} +106 -106
  25. package/dist/{index-Bwdaim-c.js → index-DMc81n9B.js} +14362 -13782
  26. package/dist/{index-CawlYDgE.js → index-DS6VUGi6.js} +11 -11
  27. package/dist/{index-BaR4MzNc.js → index-DoGY-Vgi.js} +3 -3
  28. package/dist/{index-T5LATpR7.js → index-eHYe06mM.js} +1 -1
  29. package/dist/index.d.ts +3 -2
  30. package/dist/ir.d.ts +6 -0
  31. package/dist/layer-registry.d.ts +21 -0
  32. package/dist/layers/warped-bitmap-layer.d.ts +27 -0
  33. package/dist/{lerc-CElHRqrE.js → lerc-DjrPALEj.js} +1 -1
  34. package/dist/onlymap.standalone.js +53028 -52451
  35. package/dist/onlymapjs.js +86 -84
  36. package/dist/parse-manifest.d.ts +12 -9
  37. package/dist/{post-process-effect-VAE0lQ4c.js → post-process-effect-Be1qa2DD.js} +5 -5
  38. package/dist/programmatic.d.ts +12 -0
  39. package/dist/projection.d.ts +44 -1
  40. package/dist/{raster-pipeline-D26Sl0X2.js → raster-pipeline-DspBYxwc.js} +1 -1
  41. package/dist/{raster-Cn8jugd2.js → raster-zC3qXBrs.js} +3 -3
  42. package/dist/react/om-layer.d.ts +4 -0
  43. package/dist/react/om-map.d.ts +2 -0
  44. package/dist/react.js +225 -218
  45. package/dist/runtime-core.d.ts +24 -0
  46. package/dist/source-crs.d.ts +99 -0
  47. package/dist/{text-on-path-C6SLSkus.js → text-on-path-D0_URrD2.js} +1 -1
  48. package/dist/version.d.ts +1 -1
  49. package/dist/{zarr-Do5FzYXm.js → zarr-DopOhzfY.js} +2 -2
  50. package/docs/basemaps.md +1 -1
  51. package/docs/cartograph.md +2 -2
  52. package/docs/cartography.md +106 -1
  53. package/llms.txt +2 -1
  54. package/onlymapjs.attributes.json +2 -0
  55. package/onlymapjs.html-data.json +26 -4
  56. package/package.json +1 -1
  57. package/skills/onlymapjs/SKILL.md +5 -3
  58. package/skills/onlymapjs/references/syntax.md +18 -3
  59. package/dist/geoparquet-B9p5-Yxf.js +0 -35
  60. package/dist/hillshade-Dd7MQHfp.js +0 -298
package/CHANGELOG.md CHANGED
@@ -8,6 +8,11 @@ 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.11 — 2026-10-08
12
+
13
+ ### Fixed
14
+ - **The `osm` basemap now draws in a map opened from disk.** OpenStreetMap's tile server refuses requests it cannot tie to a website, and answers with an "Access blocked" picture tile that arrives as a normal 200 — so an exported map opened from a file showed a grid of them in Firefox, and in Chrome after a hard reload or with DevTools' cache disabled, while Safari was fine. Tile requests to OSM now carry the `X-Requested-With` header OSM's own guidance asks for in that situation, which its servers accept. Other tile servers are untouched.
15
+
11
16
  ## 0.11.10 — 2026-10-07
12
17
 
13
18
  ### Added
package/README.md CHANGED
@@ -124,7 +124,7 @@ Numeric timestamps are always epoch **milliseconds**, never guessed as seconds.
124
124
  | **Apache Arrow / GeoArrow** | `data="./big.arrow"` | points stay columnar (zero row objects on the render path); GeoArrow line/polygon geometry becomes GeoJSON features — trace, anchored cards, picking all work; zstd-compressed IPC supported; parsers lazy-load on first use |
125
125
  | Columnar JSON | `{"columns": {"lon": [...], ...}}` | same columnar fast path without Arrow tooling |
126
126
  | **CSV / TSV** | `data="./quakes.csv"` | parsed to typed columns (lazy ~48 KB chunk); numbers auto-typed, quoted fields intact |
127
- | **Shapefile** | `data="./countries.shp"` | geometry + `.dbf` attributes joined into GeoJSON features (sidecars fetched with your auth config) |
127
+ | **Shapefile** | `data="./countries.shp"` | geometry + `.dbf` attributes joined into GeoJSON features (sidecars fetched with your auth config); a `.prj` in a local grid is converted to lng/lat |
128
128
  | **KML** | `data="./tour.kml"` | placemarks → GeoJSON features; other formats plug in via `OmMap.registerFormat` |
129
129
  | **CityJSON / CityJSONSeq** | `data="./tile.city.json"` + `extruded get-elevation="$roof_height"` | semantic 3D city models (3DBAG, PLATEAU) → extruded footprints with derived `roof_height`/`eaves_height`/`ridge_height`/`roof_area`; national grids reprojected automatically (NL/CH/DE/JP/AT/SG); `.city.jsonl` streams in as it downloads; lazy chunk — see [docs/3d-assets.md](docs/3d-assets.md#semantic-city-models-cityjson) |
130
130
  | **GeoTIFF / COG raster** | `<om-layer type="COGLayer" src="./dem.tif" min="0" max="1900" colormap="viridis">` | Cloud-Optimized GeoTIFFs stream tiles by Range request (lazy chunk); min/max restretch + colormap swaps are GPU uniforms, nodata → transparent, legend ramp derives automatically; plain 8-bit RGB COGs need no attributes at all |
@@ -135,6 +135,8 @@ Numeric timestamps are always epoch **milliseconds**, never guessed as seconds.
135
135
  | **Tiled layer (XYZ / vector)** | `<om-layer type="TileLayer" data="…/{z}/{x}/{y}.png">` or `type="MVTLayer"` | a `{z}/{x}/{y}` `data` template is deck's tile URL — passed through, never fetched as rows; raster `TileLayer` gets a built-in `BitmapLayer` renderer, `MVTLayer` self-renders vector tiles (`get-*` accessors apply to tile features) |
136
136
  | **Draw store** | `data="draw:sketch"` | live in-memory GeoJSON feature store written by `<om-widget type="draw" target="sketch">` |
137
137
 
138
+ **Data in a local grid** — eastings/northings in British National Grid, SVY21, State Plane or any UTM zone — is converted to longitude/latitude when it loads. A file that names its CRS (a shapefile `.prj`, a FlatGeobuf or GeoParquet header, a legacy GeoJSON `crs` member) needs nothing; otherwise declare it on the layer, which also overrides the file: `<om-layer type="ScatterplotLayer" data="./sites.csv" crs="EPSG:3414" get-position="[$easting, $northing]">`. Coordinates that cannot be degrees with no CRS anywhere are a diagnostic naming the fix, never a silent layer in the ocean. The UTM zones and common national grids are bundled; any other EPSG code is fetched once from `https://epsg.io/<code>.proj4` by the reader's browser — the GeoTIFF/Zarr layers make the same lookup for their own CRS — and `OmMap.configureCrs({ online: false })` turns that off.
139
+
138
140
  Private endpoints: `OmMap.configureData({ headers, credentials, fetch })` — applied to every fetch including refreshes. Credentials stay out of markup by design. Full guide: [docs/live-data.md](docs/live-data.md).
139
141
 
140
142
  ### Clustering
@@ -157,7 +159,7 @@ Hovering a pickable feature shows a pointer cursor automatically, so recipients
157
159
 
158
160
  **Undo/redo:** user-facing manifest changes — layer toggles, filter changes, basemap switches, element edits, drawn sketches — are undoable out of the box; the manifest *is* the state, so history is recorded from the DOM itself. Add `<om-widget type="undo-redo">` for buttons, or just press Cmd/Ctrl-Z (Shift-Cmd/Ctrl-Z or Ctrl-Y to redo). Camera moves, hover effects, and story playback are deliberately not undo steps.
159
161
 
160
- **Basemaps:** free presets out of the box — OpenFreeMap `liberty`/`bright`/`positron` (no key, no limits), CARTO `dark-matter`/`voyager`, classic `osm` raster, keyless `satellite` imagery (EOX's 2016 Sentinel-2 cloudless mosaic — worldwide, commercial-safe with its credit, sharp to about zoom 13–14), and keyed `maptiler-*` presets (MapTiler's style editor is the visual way to customize basemap JSON; keys are publishable, via `basemap-key` or `OmMap.configureBasemap`). The `basemap` attribute switches **live** — camera and layers survive — from a hand edit, the `set-basemap` action, or `<om-widget type="basemap-switcher">`. Add your own with `OmMap.registerBasemap(name, { style })`; required attribution renders automatically. Guide: [docs/basemaps.md](docs/basemaps.md).
162
+ **Basemaps:** free presets out of the box — OpenFreeMap `liberty`/`bright`/`positron` (no key, no limits), CARTO `dark-matter`/`voyager`, classic `osm` raster (works from a file opened on disk too — tile requests identify themselves the way OSM asks), keyless `satellite` imagery (EOX's 2016 Sentinel-2 cloudless mosaic — worldwide, commercial-safe with its credit, sharp to about zoom 13–14), and keyed `maptiler-*` presets (MapTiler's style editor is the visual way to customize basemap JSON; keys are publishable, via `basemap-key` or `OmMap.configureBasemap`). The `basemap` attribute switches **live** — camera and layers survive — from a hand edit, the `set-basemap` action, or `<om-widget type="basemap-switcher">`. Add your own with `OmMap.registerBasemap(name, { style })`; required attribution renders automatically. Guide: [docs/basemaps.md](docs/basemaps.md).
161
163
 
162
164
  **Animation:** camera moves accept a duration — `map.flyTo(coords, zoom, { duration: 1200, curve: true })`, or the `fly-to` action (`center`/`zoom`/`pitch`/`bearing`/`duration`) from any behavior or button; `prefers-reduced-motion` is honored (moves become instant, final state identical). Per-prop GPU transitions via the `transition` attribute: `transition="get-fill-color 800ms"` fades color changes; on a streaming layer, `transition="get-position 300ms"` makes entities glide between updates.
163
165
 
@@ -390,10 +392,14 @@ Two things it gets right that hand-rolled hillshades usually don't. **Tile edges
390
392
  </om-map>
391
393
  ```
392
394
 
393
- **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.
395
+ **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, vector tiles — is a validation error with a fix, never a silent no-op.
394
396
 
395
397
  **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.
396
398
 
399
+ **A raster basemap works on a projected sheet as a layer.** An image `TileLayer` (`data="…/{z}/{x}/{y}.png"`, `.jpg` or `.webp`) is warped the same way and lands where the projection puts it. Set `basemap="none"` and add the tiles: for `basemap="satellite"` or `"osm"`, the validation error's fix is that preset's own tiles as a layer. Show the tiles' credit yourself with an `attribution` widget, because the map only credits basemaps it picks.
400
+
401
+ **A globe** is `projection="globe"` on a map with a basemap (preview). Zoomed out the Earth is a sphere you can spin, and zoomed in it is the ordinary flat map. Layers, data and `center`/`zoom` are unchanged; overlays on the far side hide, and a click in space reports no coordinate. It switches live, with the `set-projection` action or the attribute. A globe is drawn flat-on and north-up. Text, icon, arc and screen-space aggregation layers can't draw on it yet, and validation says so with a fix. See [docs/cartography.md](docs/cartography.md).
402
+
397
403
  **`<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.
398
404
 
399
405
  **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.
@@ -444,7 +450,7 @@ The library reports one **deployment-scoped** usage snapshot per map per page lo
444
450
 
445
451
  ## Not implemented yet (honestly)
446
452
 
447
- 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 clustering: lines and polygons are not clustered by centroid (Point data only), tiled sources (`MVTLayer`/`TileLayer`) do not cluster, and a projected (`crs=`) sheet renders a clustered layer unclustered with a warning. 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).
453
+ Mapbox GL basemaps, depth-interleaved 3D compositing, a globe without a basemap (and text, icon and arc layers on a globe), SSE transport, `dblclick` behaviors, the typed fluent builder, and stories/draw as React components (both work via the HTML manifest). On clustering: lines and polygons are not clustered by centroid (Point data only), tiled sources (`MVTLayer`/`TileLayer`) do not cluster, and a projected (`crs=`) sheet renders a clustered layer unclustered with a warning. 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 data in a local grid: datum shifts are the standard seven-parameter ones, good to a few metres — correction grids (OSTN15, NTv2) are not shipped — and `configureCrs({ online: false })` does not yet govern the GeoTIFF/Zarr layers' own EPSG lookup. 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).
448
454
 
449
455
  ## Going deeper
450
456
 
@@ -37,6 +37,8 @@ export declare const FILTER_ATTRS: Set<string>;
37
37
  /** `data-emit`-style attribute name → camelCase (shared by om-map's payload reads and om-story's step parsing — both DOM-lane, one regex). */
38
38
  export declare function kebabToCamel(name: string): string;
39
39
  export declare const DASH_ATTRS: Set<string>;
40
+ /** Data in any CRS (docs/design/crs.md) — universal like `visible-zoom-range`: read by the CRS stage in both front-ends, never a deck prop. The raster types also carry `crs` in their own schema, with the same meaning. */
41
+ export declare const CRS_ATTRS: Set<string>;
40
42
  /** 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
43
  export declare const CLASSIFY_ATTRS: Set<string>;
42
44
  /**