@nika-js/onlymap 0.9.1 → 0.10.1

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 (79) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +27 -3
  3. package/dist/{basemap-DL0mk9Bf.js → basemap-DzQBuqBn.js} +3882 -3980
  4. package/dist/cartograph/elements/om-frame.d.ts +67 -1
  5. package/dist/cartograph/georef.d.ts +18 -4
  6. package/dist/cartograph/schema.d.ts +11 -0
  7. package/dist/cartograph.js +1480 -1311
  8. package/dist/cartograph.standalone.js +1808 -1615
  9. package/dist/{cityjson-D_V5GY8b.js → cityjson-k-z1r6c0.js} +1 -1
  10. package/dist/{crs-DsDQ4Q4i.js → crs-BzE_KP4M.js} +25 -2
  11. package/dist/{crs-Ciu7Xs7a.js → crs-ChglCB3O.js} +39 -16
  12. package/dist/elements/om-map.d.ts +10 -0
  13. package/dist/{geoparquet-DJxZA0if.js → geoparquet-BlFSeNwf.js} +10 -10
  14. package/dist/globe-view-qTt7YaiC.js +104 -0
  15. package/dist/hillshade-Ds0pONmA.js +298 -0
  16. package/dist/{hillshade-shader-n_zManfZ.js → hillshade-shader-DI2uLSNU.js} +15 -10
  17. package/dist/hillshade-shader.d.ts +18 -2
  18. package/dist/hillshade.d.ts +30 -0
  19. package/dist/{ifc-Dc-TdSJr.js → ifc-DXwePQRv.js} +131 -131
  20. package/dist/{index-vLXZuog4.js → index-B9kwlhFA.js} +1 -1
  21. package/dist/index-BCTAq6uy.js +65 -0
  22. package/dist/{index-DdTZSuAb.js → index-BK99wPf_.js} +106 -106
  23. package/dist/index-BSwEOxkR.js +322 -0
  24. package/dist/{index-BjcPjICh.js → index-Bpk1EipB.js} +59 -59
  25. package/dist/index-C2VK-Is6.js +641 -0
  26. package/dist/index-C4oddUIX.js +459 -0
  27. package/dist/{index-oY3XHIux.js → index-CBYDP-_0.js} +18178 -16943
  28. package/dist/{index-CvuDsvnk.js → index-oL_18WvP.js} +47 -47
  29. package/dist/index.d.ts +4 -0
  30. package/dist/layer-registry.d.ts +27 -0
  31. package/dist/{lerc-Bph62dCb.js → lerc-xM89n_hR.js} +1 -1
  32. package/dist/onlymap.standalone.js +48211 -45574
  33. package/dist/onlymapjs.js +77 -74
  34. package/dist/parse-manifest.d.ts +6 -0
  35. package/dist/plane-camera.d.ts +59 -0
  36. package/dist/plane-layers.d.ts +56 -0
  37. package/dist/plane-tiles.d.ts +99 -0
  38. package/dist/plane-tileset.d.ts +31 -0
  39. package/dist/plane-warp.d.ts +91 -0
  40. package/dist/post-process-effect-CNMzoP-h.js +197 -0
  41. package/dist/programmatic.d.ts +16 -1
  42. package/dist/projection.d.ts +118 -0
  43. package/dist/{raster-pipeline-BlOnMPJe.js → raster-pipeline-B_gY9-5f.js} +4 -3
  44. package/dist/{raster-D-eTzCE3.js → raster-yVRqHYLH.js} +4 -4
  45. package/dist/runtime-core.d.ts +140 -1
  46. package/dist/serialize/clip.d.ts +50 -0
  47. package/dist/serialize/declutter.d.ts +44 -0
  48. package/dist/serialize/emit.d.ts +60 -0
  49. package/dist/serialize/index.d.ts +64 -0
  50. package/dist/serialize/strategy.d.ts +30 -0
  51. package/dist/serialize/style.d.ts +77 -0
  52. package/dist/snapshot.d.ts +46 -0
  53. package/dist/surface-anchor.d.ts +6 -0
  54. package/dist/text-on-path-D-fhYDqa.js +146 -0
  55. package/dist/text-on-path.d.ts +157 -0
  56. package/dist/transform/buffer.d.ts +63 -0
  57. package/dist/transform/contour.d.ts +37 -0
  58. package/dist/transform/dot-density.d.ts +19 -0
  59. package/dist/transform/field.d.ts +80 -0
  60. package/dist/transform/geometry.d.ts +20 -0
  61. package/dist/transform/index.d.ts +29 -0
  62. package/dist/transform/simplify.d.ts +10 -0
  63. package/dist/transform/smooth.d.ts +12 -0
  64. package/dist/transform-stage.d.ts +92 -0
  65. package/dist/version.d.ts +1 -1
  66. package/dist/{zarr-BGDoEtFb.js → zarr-BPeWy3ro.js} +2 -2
  67. package/docs/cartograph.md +12 -4
  68. package/docs/cartography.md +328 -0
  69. package/docs/design/arrows.md +182 -0
  70. package/docs/design/carto-substrate.md +1055 -0
  71. package/docs/design/extensions.md +250 -0
  72. package/llms.txt +3 -2
  73. package/onlymapjs.attributes.json +18 -0
  74. package/onlymapjs.html-data.json +169 -19
  75. package/package.json +1 -1
  76. package/skills/onlymapjs/SKILL.md +6 -2
  77. package/skills/onlymapjs/references/syntax.md +22 -2
  78. package/dist/hillshade-DR3TxO1a.js +0 -186
  79. package/dist/index-DO_w0tqR.js +0 -514
@@ -29,6 +29,10 @@
29
29
  "name": "min-zoom",
30
30
  "description": "Floor how far the user can zoom OUT. Applied to the controller, so a zoom-out past it is refused rather than clamped back. Absent = the renderer's default (0)."
31
31
  },
32
+ {
33
+ "name": "reference-scale",
34
+ "description": "The scale millimetre-authored <om-transform> knobs resolve against — \"1:50000\", or the ground metres one millimetre of paper stands for (\"50m\"). A cartograph frame supplies its own; a live map has no sheet to ask, so millimetre knobs are a validation error without this."
35
+ },
32
36
  {
33
37
  "name": "basemap",
34
38
  "description": "Basemap: a registered preset name, \"maplibre\" (demo style), a style URL, or \"none\" (standalone canvas).",
@@ -579,6 +583,9 @@
579
583
  {
580
584
  "name": "TextLayer"
581
585
  },
586
+ {
587
+ "name": "TextOnPathLayer"
588
+ },
582
589
  {
583
590
  "name": "Tile3DLayer"
584
591
  },
@@ -1056,7 +1063,7 @@
1056
1063
  },
1057
1064
  {
1058
1065
  "name": "get-text",
1059
- "description": "Accessor for deck.gl getText — expression language: $field, scale(), formatDate(), arithmetic. Valid on: GeoJsonLayer, MVTLayer, PopupLayer, TextLayer."
1066
+ "description": "Accessor for deck.gl getText — expression language: $field, scale(), formatDate(), arithmetic. Valid on: GeoJsonLayer, MVTLayer, PopupLayer, TextLayer, TextOnPathLayer."
1060
1067
  },
1061
1068
  {
1062
1069
  "name": "get-text-angle",
@@ -1136,11 +1143,11 @@
1136
1143
  },
1137
1144
  {
1138
1145
  "name": "get-color",
1139
- "description": "Accessor for deck.gl getColor — expression language: $field, scale(), formatDate(), arithmetic. Valid on: IconLayer, LineLayer, PathLayer, PointCloudLayer, PopupLayer, ScenegraphLayer, SimpleMeshLayer, TextLayer, TripsLayer."
1146
+ "description": "Accessor for deck.gl getColor — expression language: $field, scale(), formatDate(), arithmetic. Valid on: IconLayer, LineLayer, PathLayer, PointCloudLayer, PopupLayer, ScenegraphLayer, SimpleMeshLayer, TextLayer, TextOnPathLayer, TripsLayer."
1140
1147
  },
1141
1148
  {
1142
1149
  "name": "get-size",
1143
- "description": "Accessor for deck.gl getSize — expression language: $field, scale(), formatDate(), arithmetic. Valid on: IconLayer, PopupLayer, TextLayer."
1150
+ "description": "Accessor for deck.gl getSize — expression language: $field, scale(), formatDate(), arithmetic. Valid on: IconLayer, PopupLayer, TextLayer, TextOnPathLayer."
1144
1151
  },
1145
1152
  {
1146
1153
  "name": "layout",
@@ -1458,6 +1465,10 @@
1458
1465
  "name": "decoder",
1459
1466
  "description": "deck.gl decoder. Valid on: HillshadeLayer."
1460
1467
  },
1468
+ {
1469
+ "name": "sun-datum",
1470
+ "description": "deck.gl sunDatum. Valid on: HillshadeLayer."
1471
+ },
1461
1472
  {
1462
1473
  "name": "blend",
1463
1474
  "description": "deck.gl blend. Valid on: HillshadeLayer."
@@ -1466,6 +1477,34 @@
1466
1477
  "name": "zoom-offset",
1467
1478
  "description": "deck.gl zoomOffset. Valid on: HillshadeLayer, MVTLayer, TerrainLayer, TileLayer."
1468
1479
  },
1480
+ {
1481
+ "name": "get-path",
1482
+ "description": "Accessor for deck.gl getPath — expression language: $field, scale(), formatDate(), arithmetic. Valid on: PathLayer, TextOnPathLayer, TripsLayer."
1483
+ },
1484
+ {
1485
+ "name": "font-family",
1486
+ "description": "deck.gl fontFamily. Valid on: TextLayer, TextOnPathLayer."
1487
+ },
1488
+ {
1489
+ "name": "font-weight",
1490
+ "description": "deck.gl fontWeight. Valid on: TextLayer, TextOnPathLayer."
1491
+ },
1492
+ {
1493
+ "name": "letter-spacing",
1494
+ "description": "deck.gl letterSpacing. Valid on: TextOnPathLayer."
1495
+ },
1496
+ {
1497
+ "name": "offset",
1498
+ "description": "deck.gl offset. Valid on: ColumnLayer, GridCellLayer, TextOnPathLayer."
1499
+ },
1500
+ {
1501
+ "name": "placement",
1502
+ "description": "deck.gl placement. Valid on: TextOnPathLayer."
1503
+ },
1504
+ {
1505
+ "name": "max-labels",
1506
+ "description": "deck.gl maxLabels. Valid on: TextOnPathLayer."
1507
+ },
1469
1508
  {
1470
1509
  "name": "get-source-position",
1471
1510
  "description": "Accessor for deck.gl getSourcePosition — expression language: $field, scale(), formatDate(), arithmetic. Valid on: ArcLayer, GreatCircleLayer, LineLayer."
@@ -1534,10 +1573,6 @@
1534
1573
  "name": "angle",
1535
1574
  "description": "deck.gl angle. Valid on: ColumnLayer, GridCellLayer."
1536
1575
  },
1537
- {
1538
- "name": "offset",
1539
- "description": "deck.gl offset. Valid on: ColumnLayer, GridCellLayer."
1540
- },
1541
1576
  {
1542
1577
  "name": "coverage",
1543
1578
  "description": "deck.gl coverage. Valid on: ColumnLayer, GridCellLayer, GridLayer, H3HexagonLayer, HexagonLayer."
@@ -1582,10 +1617,6 @@
1582
1617
  "name": "_path-type",
1583
1618
  "description": "deck.gl _pathType. Valid on: PathLayer, TripsLayer."
1584
1619
  },
1585
- {
1586
- "name": "get-path",
1587
- "description": "Accessor for deck.gl getPath — expression language: $field, scale(), formatDate(), arithmetic. Valid on: PathLayer, TripsLayer."
1588
- },
1589
1620
  {
1590
1621
  "name": "get-normal",
1591
1622
  "description": "Accessor for deck.gl getNormal — expression language: $field, scale(), formatDate(), arithmetic. Valid on: PointCloudLayer."
@@ -1626,14 +1657,6 @@
1626
1657
  "name": "character-set",
1627
1658
  "description": "deck.gl characterSet. Valid on: TextLayer."
1628
1659
  },
1629
- {
1630
- "name": "font-family",
1631
- "description": "deck.gl fontFamily. Valid on: TextLayer."
1632
- },
1633
- {
1634
- "name": "font-weight",
1635
- "description": "deck.gl fontWeight. Valid on: TextLayer."
1636
- },
1637
1660
  {
1638
1661
  "name": "line-height",
1639
1662
  "description": "deck.gl lineHeight. Valid on: TextLayer."
@@ -1928,6 +1951,133 @@
1928
1951
  }
1929
1952
  ]
1930
1953
  },
1954
+ {
1955
+ "name": "om-transform",
1956
+ "description": "A geometry transform on its parent <om-layer>'s line or polygon data — geometry the source doesn't contain. Runs in the data stage, so deck, anchor=\"surface\", the legend and the vector export all see the same shape. Document order is chain order. Spatial knobs are millimetres on paper, resolved against <om-map reference-scale>; ground units (m, km, ft) need no scale.",
1957
+ "attributes": [
1958
+ {
1959
+ "name": "type",
1960
+ "description": "Which transform.",
1961
+ "values": [
1962
+ {
1963
+ "name": "simplify"
1964
+ },
1965
+ {
1966
+ "name": "smooth"
1967
+ },
1968
+ {
1969
+ "name": "dot-density"
1970
+ },
1971
+ {
1972
+ "name": "buffer"
1973
+ },
1974
+ {
1975
+ "name": "contour"
1976
+ }
1977
+ ]
1978
+ },
1979
+ {
1980
+ "name": "tolerance",
1981
+ "description": "simplify: Douglas-Peucker tolerance, e.g. \"0.15mm\" (paper) or \"50m\" (ground). No vertex moves further than this."
1982
+ },
1983
+ {
1984
+ "name": "iterations",
1985
+ "description": "smooth: Chaikin corner-cutting passes, 0-6. One removes the straight-segment look; past three the shape stops being the shape.",
1986
+ "values": [
1987
+ {
1988
+ "name": "1"
1989
+ },
1990
+ {
1991
+ "name": "2"
1992
+ },
1993
+ {
1994
+ "name": "3"
1995
+ }
1996
+ ]
1997
+ },
1998
+ {
1999
+ "name": "distance",
2000
+ "description": "buffer: band width, e.g. \"1.2mm\" (paper) or \"500m\" (ground). Negative buffers inward. A cartographic ornament — grid-accurate, not an exact setback."
2001
+ },
2002
+ {
2003
+ "name": "repeat",
2004
+ "description": "buffer: how many bands, 1-12. Each is another threshold of ONE distance field, so five bands cost no more than one. Five with fade is the engraved shoreline of an old chart."
2005
+ },
2006
+ {
2007
+ "name": "fade",
2008
+ "description": "buffer: fade the bands' opacity outward, as a _bandOpacity property each feature carries. Needs repeat> 1."
2009
+ },
2010
+ {
2011
+ "name": "quality",
2012
+ "description": "buffer: cells across one band width (default 8). The whole error budget is one cell; raising it costs memory quadratically for accuracy linearly."
2013
+ },
2014
+ {
2015
+ "name": "letter-spacing",
2016
+ "description": "TextOnPathLayer: extra tracking between glyphs, in pixels. Letter-spaced names are a cartographic convention — an ocean or a range is conventionally tracked out across its own extent."
2017
+ },
2018
+ {
2019
+ "name": "placement",
2020
+ "description": "TextOnPathLayer: where along the line the label sits.",
2021
+ "values": [
2022
+ {
2023
+ "name": "start"
2024
+ },
2025
+ {
2026
+ "name": "middle"
2027
+ },
2028
+ {
2029
+ "name": "end"
2030
+ }
2031
+ ]
2032
+ },
2033
+ {
2034
+ "name": "max-labels",
2035
+ "description": "TextOnPathLayer: ceiling on emitted glyphs, so one enormous label set cannot wedge a frame."
2036
+ },
2037
+ {
2038
+ "name": "src",
2039
+ "description": "contour: DEM source — a terrain preset (\"terrarium\") or a {z}/{x}/{y} template."
2040
+ },
2041
+ {
2042
+ "name": "bounds",
2043
+ "description": "contour: the extent to contour, \"[west,south,east,north]\". DECLARED, not taken from the camera — a transform runs once at ingest, and a camera changes on every pan."
2044
+ },
2045
+ {
2046
+ "name": "interval",
2047
+ "description": "contour: vertical spacing between lines, e.g. \"100m\". A ground height, never paper millimetres — an elevation is not on the page."
2048
+ },
2049
+ {
2050
+ "name": "zoom",
2051
+ "description": "contour: DEM tile zoom (default 10). Higher is sharper and quadratically more tiles."
2052
+ },
2053
+ {
2054
+ "name": "decoder",
2055
+ "description": "contour: elevation encoding for a raw tile URL — \"terrarium\" or \"mapbox-rgb\". Implied by a preset."
2056
+ },
2057
+ {
2058
+ "name": "field",
2059
+ "description": "dot-density: the row property holding the count to scatter."
2060
+ },
2061
+ {
2062
+ "name": "per",
2063
+ "description": "dot-density: units of that field per dot, e.g. per=\"1000\" for one dot per thousand people."
2064
+ },
2065
+ {
2066
+ "name": "seed",
2067
+ "description": "dot-density: scatter seed. Fixed by default, so a recorded story and a live map place the same dots."
2068
+ },
2069
+ {
2070
+ "name": "max",
2071
+ "description": "dot-density: ceiling on dots per feature (default 20000), so one bad row cannot emit a million points."
2072
+ }
2073
+ ],
2074
+ "references": [
2075
+ {
2076
+ "name": "README",
2077
+ "url": "https://github.com/NikaGeospatial/onlymapjs/blob/main/README.md"
2078
+ }
2079
+ ]
2080
+ },
1931
2081
  {
1932
2082
  "name": "om-overlay",
1933
2083
  "description": "Rich HTML anchored to the map: a static coordinate, the current selection, or a feature's own geometry.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nika-js/onlymap",
3
- "version": "0.9.1",
3
+ "version": "0.10.1",
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": {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: onlymapjs
3
- description: Build, edit, debug, or review OnlyMapJS declarative HTML maps and dashboards, or React maps via the @nika-js/onlymap/react adapter. Use when a user asks for an interactive map, deck.gl-style visualization, geospatial dashboard, live fleet/telemetry map, choropleth, popup/tooltip map, map story/tour, manual drawing/sketch map, 3D map assets, a React map component, a map page shared as a single HTML file (incl. no-JS fallbacks for chat/email previews), a print-ready map sheet / PDF map / atlas (the cartograph entry: mm-based pages, frames, derived legends, scale bars, graticules), a styled/post-processed map look (film grain, halftone, duotone, vintage or printed finish, bloom-style passes — the <om-effect> pipeline), shaded relief / hillshade / terrain shading on a flat cartographic map (the HillshadeLayer), a responsive/mobile map whose controls auto-fold on narrow screens, auditing a map's widget layout with the check-layout tool, syncing OnlyMapJS map/camera state into an app state store (Redux, MobX, Zustand, Jotai — the getStore contract), BIM/IFC models (loading .ifc files in the browser, 3D Tiles per-element picking, isolate/hide/ghost, clash detection, model federation), routes and directions (a styled A-to-B route line, OSRM or another routing engine, click-to-route), live vehicle/rider/delivery tracking (a moving marker gliding between GPS fixes with a follow camera), a Remotion map video or programmatic map flyover with overlays (route to the separate @nika-js/onlymap-remotion package), a React Native or Expo mobile map (route to the separate @nika-js/onlymap-native package), or help with OnlyMapJS syntax, validation, widgets, data formats, testing, or publishing examples.
3
+ description: Build, edit, debug, or review OnlyMapJS declarative HTML maps and dashboards, or React maps via the @nika-js/onlymap/react adapter. Use when a user asks for an interactive map, deck.gl-style visualization, geospatial dashboard, live fleet/telemetry map, choropleth, popup/tooltip map, map story/tour, manual drawing/sketch map, 3D map assets, a React map component, a map page shared as a single HTML file (incl. no-JS fallbacks for chat/email previews), a print-ready map sheet / PDF map / atlas (the cartograph entry: mm-based pages, frames, derived legends, scale bars, graticules), a styled/post-processed map look (film grain, halftone, duotone, vintage or printed finish, bloom-style passes — the <om-effect> pipeline), shaded relief / hillshade / terrain shading on a flat cartographic map (the HillshadeLayer), a map in a REAL PROJECTION (Albers, state plane, British National Grid, UTM, Lambert — the crs attribute), a label that FOLLOWS A LINE / curved text / text along a path (a river's name down the river — the TextOnPathLayer), generalizing or ornamenting geometry (simplify, smooth, dot density, a coastal vignette/buffer band, contour lines from a DEM — the <om-transform> pipeline), or EXPORTING A MAP AS SVG / editable vector for Illustrator or a print shop (incl. freezing a cartograph frame to inline vector), a responsive/mobile map whose controls auto-fold on narrow screens, auditing a map's widget layout with the check-layout tool, syncing OnlyMapJS map/camera state into an app state store (Redux, MobX, Zustand, Jotai — the getStore contract), BIM/IFC models (loading .ifc files in the browser, 3D Tiles per-element picking, isolate/hide/ghost, clash detection, model federation), routes and directions (a styled A-to-B route line, OSRM or another routing engine, click-to-route), live vehicle/rider/delivery tracking (a moving marker gliding between GPS fixes with a follow camera), a Remotion map video or programmatic map flyover with overlays (route to the separate @nika-js/onlymap-remotion package), a React Native or Expo mobile map (route to the separate @nika-js/onlymap-native package), or help with OnlyMapJS syntax, validation, widgets, data formats, testing, or publishing examples.
4
4
  ---
5
5
 
6
6
  # OnlyMapJS
@@ -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.9.1` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.9.1/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.
26
+ For no-build CDN pages, use the single-file standalone bundle from a raw-file CDN — `https://unpkg.com/@nika-js/onlymap@0.10.1` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.10.1/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
 
@@ -79,6 +79,10 @@ Load the smallest reference needed for the task:
79
79
  - Keep mobile chrome usable -> rely on the default map-width auto-fold into per-side drawers; mark only essential controls `fold="never"`. Use `widgets-fold="off"` only when the user explicitly wants fixed wide-layout chrome.
80
80
  - Group adjacent map buttons (zoom + undo + toggle into one control group) -> just place compact button widgets in the same `position` slot; they auto-cluster. `cluster="false"` opts one out. Do NOT build a wrapper widget.
81
81
  - Shaded relief / hillshade / terrain shading on a FLAT map (a cartographic relief base, Swiss-style multi-directional relief) -> `<om-layer type="HillshadeLayer" src="terrarium">`, NOT `terrain=` (that raises a 3D surface and means nothing at pitch 0). `sun-azimuth` takes a LIST of one to four azimuths (`"315 45 135"`) — there is no `multi-directional` boolean. `src` is required even though `terrarium` is keyless. See references/syntax.md and docs/hillshade.md.
82
+ - A map in a REAL PROJECTION (an Albers or state-plane sheet, a national grid, "not Web Mercator") -> `crs="EPSG:5070"` on `<om-map>`, with `basemap="none"`. The authored camera STAYS geographic (`center` is lng/lat, `zoom` unchanged), so stories and `seek()` keep working. A projected map cannot carry a MapLibre basemap, `terrain`, `pitch`/`bearing`, or H3/S2/geohash/quadkey layers — each is a validation error with a fix. Relief DOES work. See docs/cartography.md.
83
+ - Generalizing or ornamenting geometry (smooth a jagged coastline, thin a dense one, scatter dots for population, an engraved coastal vignette, contour lines) -> `<om-transform type="simplify|smooth|dot-density|buffer|contour">` as a CHILD of the `<om-layer>`. Spatial knobs are millimetres on paper and need `reference-scale` on `<om-map>`; ground units (`tolerance="50m"`) need none. `buffer` is a cartographic ORNAMENT with a measured half-cell bound — for a setback somebody will act on, say so and point at PostGIS/turf. See docs/cartography.md.
84
+ - A label that FOLLOWS a line (curved text, text on a path, "the river's name should run along the river") -> `<om-layer type="TextOnPathLayer" get-path="$path" get-text="$name">`. deck has no such layer; this is a composite emitting one text instance per glyph. `letter-spacing` tracks names out (the convention for oceans and ranges), `offset` moves it off the line, `placement="start|middle|end"` picks where. It reads left-to-right whichever way the line was digitised, and a name that does not fit is DROPPED rather than squeezed. Exports as one `<textPath>`. See docs/cartography.md.
85
+ - Exporting a map as EDITABLE VECTOR (SVG for Illustrator, a print shop, "not a screenshot") -> `await map.snapshot({ format: "svg" })`, which returns SVG text. Labels come out as real `<text>`; rasters and 3D come out as placed `<image>` bands. A `<om-effect>` print finish forces the whole frame to one raster band — say that BEFORE the user builds a sheet around both. `frame.freeze({format: "svg"})` does the same inside a cartograph frame. See docs/cartography.md.
82
86
  - GeoTIFF/COG raster (DEM, satellite imagery, NDVI) -> `<om-layer type="COGLayer" src="…tif">` with `min`/`max`/`colormap` for single-band data (see syntax.md — `src`, not `data`).
83
87
  - Zarr / GeoZarr raster (chunked N-D arrays — climate/weather grids, datacubes) -> `<om-layer type="ZarrLayer" src="…​.zarr" variable="…" select="time=0">` with `min`/`max`/`colormap` (same raster styling as COGLayer). Pick the `variable` and pin every non-spatial dim in `select`. A GeoZarr store georeferences itself; a plain Zarr needs manual `bounds` + `crs` + `spatial-dims`. `src`, not `data` — and it can be any absolute URL to a remote store, which needs no server setup but must be CORS-enabled (fetched in the browser) and public (authenticated stores are a follow-up). See syntax.md.
84
88
  - BIM model / .ifc file / 3D Tiles with per-element picking -> `<om-layer type="BIMLayer" src="…​.ifc" pickable>` (parses the IFC in-browser; web-ifc WASM is CDN-fetched on first use) or `type="Tile3DLayer" tileset="…" pick-features` for a pre-built tileset. Author `terrain` explicitly (`terrain="mapterhorn"`, or `terrain="off"` for flat ground) — a model that resolves real elevation (IfcMapConversion + OrthogonalHeight) on a terrain-less map raises an error through the validation channel at load time, and the library never writes attributes for you. Style by property with `feature-color-by`/`feature-color-scale` (+ `feature-palette`); isolate/hide/ghost elements declaratively with `feature-filter-field` + `isolate-features`/`hide-features`/`ghost-features` (undoable, story-steppable). See syntax.md.
@@ -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.9.1/dist/onlymapjs.css">
20
- <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.9.1"></script>
19
+ <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.10.1/dist/onlymapjs.css">
20
+ <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.10.1"></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).
@@ -49,6 +49,26 @@ Common attributes:
49
49
  - `op="tint|levels|saturation|posterize|vignette|grain|edges|blur|sharpen|halftone"` — one operation, its knobs as attributes.
50
50
  - an inline `<script type="application/json">` luma ShaderModule — raw GLSL, multi-pass, passed to deck untouched.
51
51
  Spatial knobs are MILLIMETRES (`size="0.12mm"`): they resolve against the live pixel density so a look keeps its physical size at print DPI, and a pixel value is a validation error. A preset is literally a saved op list. `set-effect {preset}` swaps it live and writes the document; `<om-widget type="effects">` renders that as preset radios (plus Off) and mirrors the document rather than holding state. With a MapLibre basemap the basemap is composited underneath and stays untreated — the validator warns.
52
+ - A REAL PROJECTION is `crs` on `<om-map>`: `<om-map crs="EPSG:5070" basemap="none" center="[-98,39]" zoom="4">`. The whole renderer draws in that plane — parallels curve, an equal-area projection is genuinely equal-area. Web Mercator and plate carrée need nothing; national grids and UTM zones resolve through proj4, loaded only when a map asks; anything else takes `crs-def="+proj=…"` or `OmMap.registerCrs(code, defOrFunctions)`.
53
+ - THE AUTHORED CAMERA STAYS GEOGRAPHIC. `center` is lng/lat and `zoom` means what it always meant, so stories, `seek()`, `getCamera()` and state bridges are unchanged. Clicks report lng/lat, not plane metres.
54
+ - Limits, each a validation ERROR with a fix, never a silent no-op: no MapLibre basemap (`basemap="none"`), no `terrain`, no `pitch`/`bearing` (the view is planimetric), no H3/S2/geohash/quadkey layers (deck builds their geometry from a token inside the layer — convert the cells to polygons), and the CRS is fixed for the map's life.
55
+ - Relief DOES work on a projected sheet, both routes. `sun-datum="sheet"` (default) keeps the apparent light constant across the plate; `"geographic"` is physically true. The swing is 34° across a CONUS sheet; the attribute is inert in Mercator and the validator says so.
56
+ - `reference-scale="1:50000"` (or `"50m"`) is what millimetre-authored `<om-transform>` knobs resolve against.
57
+ - GEOMETRY TRANSFORMS are `<om-transform>` CHILDREN of an `<om-layer>`, applied in document order, in the DATA stage — so deck, `anchor="surface"`, the legend and the vector exporter all see the same geometry.
58
+ - `type="simplify" tolerance="0.15mm"` — Douglas–Peucker, measured on the GROUND rather than in degrees (a longitude degree is 111 km at the equator and 56 km at 60°N).
59
+ - `type="smooth" iterations="2"` — Chaikin, 1–6. One pass removes the straight-segment look, which is the loudest "web map" tell there is.
60
+ - `type="dot-density" field="population" per="1000"` — seeded (`seed=`, `max=`), so a recorded story and a live map place the same dots. Replaces the row set with points carrying the source row's properties.
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
+ - `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
+ - 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.
65
+ - `get-path` and `get-text` are both REQUIRED — either alone is silently inert, and the validator says so.
66
+ - `letter-spacing="1.5"` tracks the glyphs out (pixels). A convention for oceans and ranges, not a flourish. `offset="5"` moves the label perpendicular; POSITIVE is to the LEFT of the line's direction. `placement="start|middle|end"` picks where along the line it sits (default `middle`). `max-labels` caps the glyphs emitted.
67
+ - It READS LEFT TO RIGHT whichever way the line was digitised — a path's direction is an accident of the data, and a label following a right-to-left line would come out upside down, so the layer flips the path (and `start`/`end` flip with it, because they mean a place on the line rather than a direction).
68
+ - A name that does NOT FIT its line is dropped, not compressed and not run off the end.
69
+ - Placement is computed in SCREEN PIXELS and re-done when the camera moves, because a glyph advance is pixels while a path is world distance. On a print sheet the camera is fixed, so it resolves once.
70
+ - The SVG export emits ONE `<textPath>` per label rather than per-glyph `<text>` — the one place the exporter produces better output than the screen.
71
+ - VECTOR EXPORT is `await map.snapshot({ format: "svg" })`, returning SVG TEXT (`as: "blob"` for a file, `effectDpi` for the raster bands, `onNotice` for dev notices). Polygons and paths become `<path>`, labels become real `<text>` after a deterministic CPU decluttering pass, and anything whose appearance is pixels becomes a placed `<image>` band. Consecutive raster layers merge into one band; a vector layer between them keeps them apart. A `<om-effect>` print finish treats the FINISHED frame, so a sheet carrying one exports as a single raster band at `effectDpi` (default 600) and says so — tell the user that before they build a sheet around both. A decluttering layer does NOT trigger it. `await frame.freeze({format: "svg"})` stores that SVG inline in a cartograph frame, placed by the same `crs` + `corners`; the frozen sheet opens with no runtime and nothing defining its custom elements.
52
72
  - SHADED RELIEF is a LAYER, not a mode of `terrain=`: `<om-layer id="relief" type="HillshadeLayer" src="terrarium">`. Reach for it whenever the map is FLAT (pitch 0, a print sheet) and wants terrain texture; reach for `terrain=` only when you want a real 3D surface the camera can tilt over. Being a layer is what puts relief inside deck's framebuffer, so `snapshot()` captures it and `<om-effect>` treats it (a MapLibre basemap composites underneath and would not be).
53
73
  - `src` (REQUIRED) — a registered terrain preset (`terrarium`, `mapterhorn`; both keyless and global) or a raw `{z}/{x}/{y}` DEM template. Keyless means no key, not no attribute — name it the way `basemap="positron"` is named.
54
74
  - `decoder="terrarium|mapbox-rgb"` or `{rScaler,gScaler,bScaler,offset}` JSON — REQUIRED with a raw template. Omitting it warns, because mapbox-encoded heights read as terrarium give smooth plausible relief that is ~25x wrong.
@@ -1,186 +0,0 @@
1
- import { C as S, T as b, g as z, D as p, B as w, f as L, d as T } from "./index-oY3XHIux.js";
2
- import { N as F, c as M } from "./hillshade-apron-Bem3DWyJ.js";
3
- import { p as $, h as E, m as H, a as D } from "./hillshade-shader-n_zManfZ.js";
4
- const O = 64, u = /* @__PURE__ */ new Map();
5
- function g(t) {
6
- const e = u.get(t);
7
- if (e) return e;
8
- const r = L(t);
9
- if (u.set(t, r), u.size > O) {
10
- const i = u.keys().next().value;
11
- i !== void 0 && u.delete(i);
12
- }
13
- return r;
14
- }
15
- function x(t, e, r, i) {
16
- return t.replace("{z}", String(i)).replace("{x}", String(e)).replace("{y}", String(r));
17
- }
18
- async function P(t, e, r) {
19
- const i = await g(x(t, r.x, r.y, r.z));
20
- if (!i) return null;
21
- const l = (o) => ({
22
- width: o.width,
23
- height: o.height,
24
- at: (n, s) => {
25
- const a = (s * o.width + n) * 4;
26
- return T(e, o.data[a], o.data[a + 1], o.data[a + 2]);
27
- }
28
- }), d = 2 ** r.z, h = /* @__PURE__ */ new Map();
29
- return await Promise.all(
30
- F.map(async ({ dx: o, dy: n }) => {
31
- const s = r.y + n;
32
- if (s < 0 || s >= d) return;
33
- const a = ((r.x + o) % d + d) % d;
34
- h.set(`${o},${n}`, await g(x(t, a, s, r.z)));
35
- })
36
- ), M(l(i), (o, n) => {
37
- const s = h.get(`${o},${n}`);
38
- return s ? l(s) : null;
39
- });
40
- }
41
- const N = {
42
- blendColorSrcFactor: "dst",
43
- blendColorDstFactor: "zero",
44
- blendAlphaSrcFactor: "zero",
45
- blendAlphaDstFactor: "one"
46
- };
47
- class C extends w {
48
- static layerName = "HillshadeBitmapLayer";
49
- getShaders() {
50
- const e = super.getShaders();
51
- return { ...e, modules: [...e.modules, D] };
52
- }
53
- draw(e) {
54
- const r = this.props, i = { ...r.hillshadeUniforms, hillshadeHeights: r.image };
55
- for (const l of this.getModels()) l.shaderInputs.setProps({ hillshade: i });
56
- super.draw(e);
57
- }
58
- }
59
- function R(t, e) {
60
- if (!t) return e;
61
- if (typeof t != "string") return t;
62
- if (t in p) return p[t];
63
- try {
64
- const r = JSON.parse(t);
65
- if ([r?.rScaler, r?.gScaler, r?.bScaler, r?.offset].every((i) => typeof i == "number" && Number.isFinite(i))) return r;
66
- } catch {
67
- }
68
- return console.warn(`[onlymapjs] HillshadeLayer: decoder="${t}" is not "terrarium", "mapbox-rgb" or {rScaler,gScaler,bScaler,offset} JSON — using terrarium.`), e;
69
- }
70
- function U(t) {
71
- const e = z(t.src);
72
- return e ? e.requiresKey ? (console.warn(`[onlymapjs] HillshadeLayer: src="${t.src}" needs a ${e.requiresKey} key, which this layer does not plumb — use a keyless source such as "terrarium".`), null) : {
73
- template: e.elevationData,
74
- decoder: typeof e.decoder == "string" ? p[e.decoder] : e.decoder,
75
- maxZoom: t.maxZoom ?? e.maxZoom
76
- } : !t.src || !t.src.includes("{z}") ? (console.warn(`[onlymapjs] HillshadeLayer: src="${t.src}" is neither a registered terrain preset nor a {z}/{x}/{y} DEM URL template.`), null) : { template: t.src, decoder: R(t.decoder, p.terrarium), maxZoom: t.maxZoom ?? 14 };
77
- }
78
- function Z(t, e) {
79
- return !Number.isFinite(t) || !Number.isFinite(e) || e <= 0 ? 0 : Math.max(0, Math.round(Math.log2(Math.max(1, t / e))));
80
- }
81
- class j extends S {
82
- static layerName = "OmHillshadeLayer";
83
- static defaultProps = {
84
- src: { type: "string", value: "terrarium" },
85
- decoder: { type: "string", value: null, optional: !0 },
86
- sunAzimuth: { type: "string", value: "315" },
87
- sunWeight: { type: "string", value: null, optional: !0 },
88
- sunElevation: { type: "number", value: 45 },
89
- zFactor: { type: "number", value: 1 },
90
- blend: { type: "string", value: "normal" },
91
- maxZoom: { type: "number", value: null, optional: !0 },
92
- zoomOffset: { type: "number", value: 0 }
93
- };
94
- renderLayers() {
95
- const e = U(this.props);
96
- if (!e) return null;
97
- const { azimuths: r, weights: i } = $(this.props.sunAzimuth, this.props.sunWeight), l = this.props.blend === "multiply", d = this.context.device, h = d?.canvasContext?.cssToDeviceRatio?.() ?? 1, o = typeof devicePixelRatio == "number" && devicePixelRatio > 0 ? devicePixelRatio : 1, n = this.state.textures;
98
- return new b(
99
- this.getSubLayerProps({ id: "tiles" }),
100
- {
101
- data: e.template,
102
- tileSize: 256,
103
- maxZoom: e.maxZoom,
104
- zoomOffset: (this.props.zoomOffset ?? 0) + Z(h, o),
105
- // deck compares FUNCTION props by their update triggers, never by
106
- // identity — inline closures would otherwise invalidate everything on
107
- // every render. So anything a closure captures is invisible to deck
108
- // unless it is declared here, which is why moving the sun with no
109
- // trigger produced a byte-identical frame.
110
- //
111
- // The split is exactly the one we want. `getTileData` names only what
112
- // changes the HEIGHTS, so a new decoder or source refetches; the
113
- // illumination names `renderSubLayers`, which regenerates the draw
114
- // calls and refetches nothing — moving the sun costs no network at
115
- // all, because every knob below is a uniform.
116
- updateTriggers: {
117
- getTileData: [e.template, JSON.stringify(e.decoder)],
118
- renderSubLayers: [r.join(","), i.join(","), this.props.sunElevation, this.props.zFactor, l]
119
- },
120
- getTileData: async (s) => {
121
- const a = await P(e.template, e.decoder, s.index);
122
- if (!a || !d) return null;
123
- const c = `${s.index.z}/${s.index.x}/${s.index.y}`;
124
- n.get(c)?.destroy();
125
- const m = d.createTexture({
126
- data: a.data,
127
- format: "r32float",
128
- width: a.width + 2,
129
- height: a.height + 2,
130
- // NEAREST, because linear filtering of a float texture needs
131
- // OES_texture_float_linear, which is not universal (the same
132
- // constraint raster-pipeline.ts documents).
133
- sampler: { minFilter: "nearest", magFilter: "nearest", addressModeU: "clamp-to-edge", addressModeV: "clamp-to-edge" }
134
- });
135
- return n.set(c, m), { texture: m, width: a.width, height: a.height, key: c };
136
- },
137
- onTileUnload: (s) => {
138
- const a = `${s.index.z}/${s.index.x}/${s.index.y}`;
139
- n.get(a)?.destroy(), n.delete(a);
140
- },
141
- renderSubLayers: (s) => {
142
- const a = s.data;
143
- if (!a) return null;
144
- const c = s.tile, [[m, y], [v, f]] = c.boundingBox;
145
- return new C(s, {
146
- id: `${s.id}-bitmap`,
147
- data: void 0,
148
- image: a.texture,
149
- bounds: [m, y, v, f],
150
- multiply: l,
151
- parameters: l ? N : {},
152
- hillshadeUniforms: E({
153
- width: a.width,
154
- height: a.height,
155
- // Web Mercator: one scale for both axes, stated at the equator
156
- // and given its cos-phi falloff per fragment by the shader.
157
- ...H(c.index.z, a.width, a.height),
158
- north: f,
159
- south: y,
160
- azimuths: r,
161
- weights: i,
162
- sunElevation: this.props.sunElevation ?? 45,
163
- zFactor: this.props.zFactor ?? 1,
164
- // A multiply-blended layer multiplies the shade into the
165
- // FRAMEBUFFER; a normal one draws relief as its own image.
166
- composite: l
167
- })
168
- });
169
- }
170
- }
171
- );
172
- }
173
- initializeState() {
174
- this.setState({ textures: /* @__PURE__ */ new Map() });
175
- }
176
- finalizeState() {
177
- for (const e of this.state.textures.values()) e.destroy();
178
- this.state.textures.clear();
179
- }
180
- }
181
- export {
182
- j as OmHillshadeLayer,
183
- P as buildPaddedHeights,
184
- Z as captureZoomOffset,
185
- U as resolveHillshadeSource
186
- };