@nika-js/onlymap 0.13.0 → 0.13.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 +29 -0
- package/README.md +2 -2
- package/bin/dem-tiles.mjs +270 -0
- package/bin/onlymapjs.mjs +138 -34
- package/dist/{basemap-BxqFTBzX.js → basemap-CdSCIWCl.js} +473 -443
- package/dist/basemap.d.ts +16 -3
- package/dist/{build-D4iI8O9b.js → build-CUx4yR_O.js} +10 -10
- package/dist/camera-altitude.d.ts +29 -0
- package/dist/{client-BYFePLZV.js → client-DVkMuuPp.js} +2 -2
- package/dist/color.d.ts +15 -0
- package/dist/credit-chrome.d.ts +11 -0
- package/dist/elements/om-map.d.ts +41 -1
- package/dist/geodesy.d.ts +2 -0
- package/dist/{geoparquet-BV32P0nI.js → geoparquet-DuCEsCOu.js} +3 -3
- package/dist/{globe-view-B_X6obse.js → globe-view-BWNfn-Sx.js} +1 -1
- package/dist/ground-controller.d.ts +39 -0
- package/dist/{hillshade-9VS_t-Ks.js → hillshade-DyfYxqNm.js} +61 -64
- package/dist/{hillshade-shader-DI2uLSNU.js → hillshade-shader-BWA0USDQ.js} +12 -11
- package/dist/hillshade-shader.d.ts +2 -2
- package/dist/hillshade.d.ts +0 -29
- package/dist/{index-IDWDfgTC.js → index-BfHaNHyY.js} +20687 -19351
- package/dist/{index-JewSBOjJ.js → index-CCj9Z5yt.js} +38 -38
- package/dist/{index-D40H3fpl.js → index-Cc3huYsW.js} +62 -62
- package/dist/{index-Bct9VWxi.js → index-DRGcZmBm.js} +1 -1
- package/dist/{index-eSuCj2Bn.js → index-DYrgHprN.js} +61 -61
- package/dist/{index-D3P6Cfbr.js → index-DabUE8w3.js} +38 -38
- package/dist/{index-CbFw6P0B.js → index-DfzI_j0D.js} +1 -1
- package/dist/{index-Di1LK4JT.js → index-DiDoH_BG.js} +3 -3
- package/dist/{index-BR_5FIN1.js → index-dUoVyYIW.js} +18 -18
- package/dist/index.d.ts +1 -1
- package/dist/{lerc-C42a0ISa.js → lerc-CUV0h9Ci.js} +1 -1
- package/dist/onlymap.standalone.js +37891 -36442
- package/dist/onlymapjs.js +49 -49
- package/dist/plane-gpu/plane-basemap.d.ts +0 -14
- package/dist/{post-process-effect-ktcgAjmv.js → post-process-effect-DPrpqybM.js} +1 -1
- package/dist/programmatic.d.ts +3 -1
- package/dist/{raster-CIxg_M_1.js → raster-CrRQNJE7.js} +4 -4
- package/dist/{raster-pipeline-BODPC9vJ.js → raster-pipeline-D9g8RAo4.js} +11 -11
- package/dist/runtime-core.d.ts +132 -0
- package/dist/sea-surface.d.ts +18 -0
- package/dist/terrain-derive.d.ts +39 -0
- package/dist/terrain-ground.d.ts +31 -0
- package/dist/terrain-heightfield.d.ts +17 -9
- package/dist/terrain-inspect-GowNVtMZ.js +96 -0
- package/dist/terrain-inspect.d.ts +34 -0
- package/dist/terrain-nodata.d.ts +50 -0
- package/dist/terrain-priority.d.ts +92 -0
- package/dist/terrain-sample.d.ts +6 -0
- package/dist/terrain-skirt.d.ts +6140 -0
- package/dist/terrain-texture-mask.d.ts +40 -0
- package/dist/terrain-tint.d.ts +61 -0
- package/dist/terrain.d.ts +132 -8
- package/dist/{text-on-path-LZL6NfwZ.js → text-on-path-BoFbm-tl.js} +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/viewport-filter.d.ts +9 -0
- package/dist/volumetrics.d.ts +11 -0
- package/dist/{zarr-D19fNIZt.js → zarr-C8CU8LXU.js} +2 -2
- package/docs/cartograph.md +2 -2
- package/llms.txt +1 -1
- package/onlymapjs.html-data.json +162 -2
- package/package.json +2 -1
- package/skills/onlymapjs/SKILL.md +5 -2
- package/skills/onlymapjs/references/syntax.md +3 -3
package/onlymapjs.html-data.json
CHANGED
|
@@ -21,6 +21,64 @@
|
|
|
21
21
|
"name": "bearing",
|
|
22
22
|
"description": "Initial bearing in degrees."
|
|
23
23
|
},
|
|
24
|
+
{
|
|
25
|
+
"name": "camera-target",
|
|
26
|
+
"description": "What the camera orbits: \"sea-level\" (default) or \"terrain\" — the ground under the view centre, so zooming in descends toward it, below sea level over a seabed. Needs terrain; not on a projected (crs) map.",
|
|
27
|
+
"values": [
|
|
28
|
+
{
|
|
29
|
+
"name": "sea-level"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "terrain"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "terrain-tint",
|
|
38
|
+
"description": "Colour the terrain by its shape — \"slope\", \"depth\", or both (\"slope depth\"). slope: by TRUE slope (exaggeration divided out), flat ground terrain-tint-flat, steep ground terrain-tint-steep, blended 15°–35°. depth: the seabed as if seen through water, terrain-tint-shallow at the coast fading to terrain-tint-deep by terrain-tint-max-depth (true metres, square-root ramp); land untouched. Applied before lighting, so it also tints a terrain-texture.",
|
|
39
|
+
"values": [
|
|
40
|
+
{
|
|
41
|
+
"name": "slope"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "depth"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "slope depth"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "none"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "terrain-tint-flat",
|
|
56
|
+
"description": "terrain-tint=\"slope\": the colour of flat ground (default sediment, #d8c9a3)."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "terrain-tint-steep",
|
|
60
|
+
"description": "terrain-tint=\"slope\": the colour of steep ground (default rock, #7d7266)."
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "terrain-tint-shallow",
|
|
64
|
+
"description": "terrain-tint=\"depth\": the tint just below sea level (default #c4e2e8)."
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "terrain-tint-deep",
|
|
68
|
+
"description": "terrain-tint=\"depth\": the colour the seabed fades to with depth (default #26426e)."
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "terrain-tint-max-depth",
|
|
72
|
+
"description": "terrain-tint=\"depth\": the TRUE depth in metres where the seabed is fully the deep colour (default 3000)."
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "sea-surface",
|
|
76
|
+
"description": "A translucent plane at sea level, as a CSS colour (no alpha = ~35%): the seabed shows through it, land above sea level hides it. Not with a MapLibre basemap or crs."
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "camera-clearance",
|
|
80
|
+
"description": "The closest the camera's eye may come to the ground beneath it, in true metres (exaggeration divided out): a zoom past it is held, by gestures, flights and the zoom buttons alike. Needs terrain. Absent = no floor."
|
|
81
|
+
},
|
|
24
82
|
{
|
|
25
83
|
"name": "max-pitch",
|
|
26
84
|
"description": "Cap how far the user can tilt, in degrees. Applied to the controller, so an over-tilt is refused rather than clamped back. Absent = the renderer's default (60)."
|
|
@@ -183,7 +241,7 @@
|
|
|
183
241
|
},
|
|
184
242
|
{
|
|
185
243
|
"name": "terrain",
|
|
186
|
-
"description": "3D elevation surface: a registered terrain preset, a {z}/{x}/{y} DEM URL (needs terrain-decoder), or \"off\". Replaces an active basemap while on. Geographic layers drape by default (per-layer terrain attribute overrides).",
|
|
244
|
+
"description": "3D elevation surface: a registered terrain preset, a {z}/{x}/{y} DEM URL (needs terrain-decoder), or \"off\". Replaces an active basemap while on. Geographic layers drape by default (per-layer terrain attribute overrides). terrarium carries the seabed only to zoom 10 (the ocean decodes as 0 m above it): set terrain-max-zoom=\"10\" for a seafloor.",
|
|
187
245
|
"values": [
|
|
188
246
|
{
|
|
189
247
|
"name": "off"
|
|
@@ -196,6 +254,9 @@
|
|
|
196
254
|
},
|
|
197
255
|
{
|
|
198
256
|
"name": "mapterhorn"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"name": "seascape"
|
|
199
260
|
}
|
|
200
261
|
]
|
|
201
262
|
},
|
|
@@ -215,14 +276,41 @@
|
|
|
215
276
|
"name": "terrain-exaggeration",
|
|
216
277
|
"description": "Vertical relief multiplier, applied in the DEM decoder; 1 = true relief."
|
|
217
278
|
},
|
|
279
|
+
{
|
|
280
|
+
"name": "terrain-nodata",
|
|
281
|
+
"description": "The height a single DEM's tiles use where they have NO data (e.g. -32768): the mesh ends there instead of plunging to it. On <om-terrain> sources, nodata=\"…\"."
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"name": "terrain-vertical-offset",
|
|
285
|
+
"description": "Metres added to every height of a single DEM, before exaggeration (a vertical datum difference). On <om-terrain> sources, vertical-offset=\"…\"."
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"name": "terrain-texture-max-zoom",
|
|
289
|
+
"description": "The terrain-texture's own highest zoom when it is sharper than a single DEM: tiles subdivide for the imagery, heights rebuilt from the DEM's max zoom. On <om-terrain> sources, texture-max-zoom=\"…\"."
|
|
290
|
+
},
|
|
218
291
|
{
|
|
219
292
|
"name": "terrain-max-zoom",
|
|
220
|
-
"description": "DEM tileset zoom cap — the provider's REAL limit (a too-high cap requests 404 tiles and blanks the terrain)."
|
|
293
|
+
"description": "DEM tileset zoom cap — the provider's REAL limit (a too-high cap requests 404 tiles and blanks the terrain). Also a source's useful limit: terrarium's seabed ends at 10."
|
|
221
294
|
},
|
|
222
295
|
{
|
|
223
296
|
"name": "terrain-texture",
|
|
224
297
|
"description": "Optional {z}/{x}/{y} imagery template draped over the surface (satellite, etc.)."
|
|
225
298
|
},
|
|
299
|
+
{
|
|
300
|
+
"name": "terrain-texture-mask",
|
|
301
|
+
"description": "Draw the terrain texture on one side of sea level only: \"land\" (imagery on the land, the seabed bare — tinted by terrain-tint if set) or \"sea\" (the reverse). Read from the DEM's own heights, every source's texture. Draped layers are never masked.",
|
|
302
|
+
"values": [
|
|
303
|
+
{
|
|
304
|
+
"name": "land"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"name": "sea"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"name": "none"
|
|
311
|
+
}
|
|
312
|
+
]
|
|
313
|
+
},
|
|
226
314
|
{
|
|
227
315
|
"name": "clip-box-min",
|
|
228
316
|
"description": "3D clip box corner \"[lng, lat, elevation]\" — with clip-box-max, cuts every layer (opt out per-layer with clip=\"off\") down to what's inside the box. Axis-aligned."
|
|
@@ -332,6 +420,78 @@
|
|
|
332
420
|
}
|
|
333
421
|
]
|
|
334
422
|
},
|
|
423
|
+
{
|
|
424
|
+
"name": "om-terrain",
|
|
425
|
+
"description": "One DEM of a multi-source terrain: name several in the map's terrain attribute, first-ranked first (terrain=\"survey, context\"). Where extents overlap the first-ranked source alone draws — a sharp survey over a regional grid, no z-fighting, no doctored tiles.",
|
|
426
|
+
"attributes": [
|
|
427
|
+
{
|
|
428
|
+
"name": "id",
|
|
429
|
+
"description": "The name terrain=\"…\" ranks it by."
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"name": "src",
|
|
433
|
+
"description": "A terrain preset (\"terrarium\") or a {z}/{x}/{y} DEM URL (needs decoder).",
|
|
434
|
+
"values": [
|
|
435
|
+
{
|
|
436
|
+
"name": "terrarium"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"name": "maptiler-terrain"
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"name": "mapterhorn"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"name": "seascape"
|
|
446
|
+
}
|
|
447
|
+
]
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"name": "decoder",
|
|
451
|
+
"description": "DEM RGB decoder for a raw URL: \"terrarium\", \"mapbox-rgb\", or {rScaler,gScaler,bScaler,offset} JSON.",
|
|
452
|
+
"values": [
|
|
453
|
+
{
|
|
454
|
+
"name": "terrarium"
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"name": "mapbox-rgb"
|
|
458
|
+
}
|
|
459
|
+
]
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"name": "extent",
|
|
463
|
+
"description": "[west, south, east, north] — where this source draws. Required on every source but the last-ranked, or it hides everything below it."
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"name": "min-zoom",
|
|
467
|
+
"description": "Lowest zoom this source's tiles exist at."
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"name": "max-zoom",
|
|
471
|
+
"description": "The source's real highest zoom (a too-high cap requests 404 tiles)."
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"name": "texture",
|
|
475
|
+
"description": "{z}/{x}/{y} imagery draped on this source; the map's terrain-texture when absent."
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"name": "mesh-max-error",
|
|
479
|
+
"description": "Mesh simplification tolerance in metres (default 0.5)."
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"name": "nodata",
|
|
483
|
+
"description": "The height this source's tiles use where they have NO data (e.g. -32768): the mesh ends at the last measured cell instead of plunging to it, and the next-ranked source shows through the hole. With nodata, a source needs no extent to sit above others."
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"name": "texture-max-zoom",
|
|
487
|
+
"description": "The texture's own highest zoom, when it is sharper than the DEM (e.g. 15 for EOX imagery over a z10 grid): tiles keep subdividing for their imagery, their heights rebuilt from the DEM's max-zoom — no new relief, sharp imagery."
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"name": "vertical-offset",
|
|
491
|
+
"description": "Metres added to every height of this source, before exaggeration — a vertical datum difference between datasets (MLLW vs MSL), not a way to hide a bad join."
|
|
492
|
+
}
|
|
493
|
+
]
|
|
494
|
+
},
|
|
335
495
|
{
|
|
336
496
|
"name": "om-effect",
|
|
337
497
|
"description": "One entry in deck's effects array, as markup — a post-process pass over the rendered frame. Document order is pipeline order. Declare exactly one of: preset (a named look), op (one named operation), or an inline <script type=\"application/json\"> luma ShaderModule for raw GLSL.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nika-js/onlymap",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.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": {
|
|
@@ -106,6 +106,7 @@
|
|
|
106
106
|
"files": [
|
|
107
107
|
".vscode/onlymap.code-snippets",
|
|
108
108
|
"bin/onlymapjs.mjs",
|
|
109
|
+
"bin/dem-tiles.mjs",
|
|
109
110
|
"dist",
|
|
110
111
|
"README.md",
|
|
111
112
|
"CHANGELOG.md",
|
|
@@ -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, marker clustering / clustered points (count bubbles that split on zoom — the `cluster` toggle), 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 cartograph sheet whose map frame renders BLANK or empty outside the app that made it (frame fallback sources), 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), data in a local grid / eastings and northings / a shapefile .prj in BNG or SVY21 (crs on the layer), 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.
|
|
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, marker clustering / clustered points (count bubbles that split on zoom — the `cluster` toggle), 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 cartograph sheet whose map frame renders BLANK or empty outside the app that made it (frame fallback sources), 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), 3D terrain and bathymetry (a seafloor below sea level, an underwater dive camera, a user's own DEM survey or GeoTIFF over a global grid), a map in a REAL PROJECTION (Albers, state plane, British National Grid, UTM, Lambert — the crs attribute), data in a local grid / eastings and northings / a shapefile .prj in BNG or SVY21 (crs on the layer), 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.13.
|
|
26
|
+
For no-build CDN pages, use the single-file standalone bundle from a raw-file CDN — `https://unpkg.com/@nika-js/onlymap@0.13.2` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.13.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
|
|
|
@@ -80,6 +80,9 @@ Load the smallest reference needed for the task:
|
|
|
80
80
|
- 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.
|
|
81
81
|
- 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.
|
|
82
82
|
- 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.
|
|
83
|
+
- Fly or dive DOWN into terrain (a canyon, a seabed below sea level, a depth gauge) -> `camera-target="terrain"` + `camera-clearance="15"` on `<om-map>` over a terrain (`terrain="seascape"` is keyless bathymetry), and `map.getCamera()` for the depth readout. NOT scripting the camera height through `map.core`/deck — those two attributes are the whole of it (references/syntax.md, `terrain`).
|
|
84
|
+
- A user's own DEM survey over a coarser global grid (a sharp survey, gaps, a datum step) -> `<om-terrain>` children ranked in `terrain="survey, context"`, with `nodata`/`vertical-offset` per source. Run `npx onlymapjs inspect-terrain page.html` before guessing either value; a GeoTIFF becomes tiles with `npx onlymapjs dem-tiles`, which prints the `<om-terrain>` line to paste. NEVER push one DEM down to hide it under the other.
|
|
85
|
+
- Imagery or a basemap on the LAND over a 3D seafloor (a coastline with the seabed showing) -> `terrain-texture="…{z}/{x}/{y}…"` + `terrain-texture-mask="land"` on `<om-map>` (+ `sea-surface` and/or `terrain-tint="depth"` to show the water), NOT `basemap=` (terrain replaces it) and NOT a coastline polygon — the cut is the DEM's own sea level.
|
|
83
86
|
- 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, and `crs` is LIVE (change it, or `set-crs {crs}`; layers re-project in place — between two grids the GPU draws — Transverse Mercator/UTM, Albers, Lambert Conformal Conic, LAEA — nothing is re-projected; polygon fills are only triangulated again). `basemap="positron"`/`"liberty"`/`"bright"` DOES work on any `crs` (OpenFreeMap vector tiles in the plane, preset colours, no labels, auto-credited), and so does `MVTLayer` (each tile cut, projected and triangulated once in a worker). A projected map cannot carry any other MapLibre basemap, `terrain`, `pitch`/`bearing`, a clip box, 3D tile layers, a `.pbf` `TileLayer` (use `MVTLayer`), or H3/S2/geohash/quadkey layers — each is a validation error with a fix. Relief DOES work, and so do IMAGE tiles: for a satellite or OSM backdrop, keep `basemap="none"` and add `<om-layer type="TileLayer" data="…/{z}/{x}/{y}.jpg">` (the validation error for `basemap="satellite"` gives the exact line), then show the tiles' credit yourself with `<om-widget type="attribution" text="…">`. See docs/cartography.md.
|
|
84
87
|
- A GLOBE ("show it on a globe", flight routes, polar or whole-world data) -> `projection="globe"` on `<om-map>` WITH a basemap (`basemap="satellite"` is keyless). Layers and `center`/`zoom` are unchanged; it switches live (`set-projection` action). No `pitch`/`bearing`, `terrain`, `crs`, TextLayer/IconLayer/TextOnPathLayer/PopupLayer, ArcLayer, or heatmap/hexagon/grid/contour layers on a globe — each is a validation error with a fix. Put labels in `<om-overlay anchor="[lng,lat]">` (they hide on the far side) and draw routes as a PathLayer through points along the great circle. Preview.
|
|
85
88
|
- Data whose coordinates are eastings/northings (a national grid, State Plane, UTM — "it's in SVY21", "the shapefile is in BNG", numbers in the hundreds of thousands) -> leave the data as it is. A shapefile `.prj`, a FlatGeobuf/GeoParquet header or a GeoJSON `crs` member is read automatically; otherwise add `crs="EPSG:<code>"` to the `<om-layer>` (for a CSV: `crs="EPSG:3414" get-position="[$easting, $northing]"`). Do NOT convert the coordinates yourself, and do NOT put this on `<om-map crs>` — that one chooses how the MAP is drawn (syntax.md "Data in a local grid").
|
|
@@ -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.13.
|
|
20
|
-
<script type="module" src="https://unpkg.com/@nika-js/onlymap@0.13.
|
|
19
|
+
<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.13.2/dist/onlymapjs.css">
|
|
20
|
+
<script type="module" src="https://unpkg.com/@nika-js/onlymap@0.13.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).
|
|
@@ -42,7 +42,7 @@ Common attributes:
|
|
|
42
42
|
- `map-id="<random UUID>"` — identifies the map artifact for usage telemetry (not a visitor id). Include one on new complete pages, freshly generated — never copied from an example; deleting it is the opt-out.
|
|
43
43
|
- `telemetry="off"` disables usage telemetry for this map (global: `OmMap.configureTelemetry({ disabled: true })`)
|
|
44
44
|
- `license-key="om_live_…"` — lifts the free-plan limits (5 layers, 25k rows per layer — a layer past the layer cap doesn't render, a layer past the row cap renders its first 25k rows plus a dismissible on-map notice; caps apply only on HOSTED http(s) pages — localhost/file:// and other dev contexts run uncapped, badge stays) and removes the corner badge; publishable origin-restricted token, safe in page source (or `OmMap.configureLicense(key)` once). Free-plan violations don't break the map: the offending layer isn't rendered and validation names the limit. Badge removal is a permission, not a requirement — `keep-badge` on `<om-map>` (or `OmMap.setKeepBadge(true)`) keeps it on a paid plan, rendering the credit without the free-tier license sentence; on the free plan it changes nothing. The preference is page-level and live (editable after boot), and a sheet's foot credit follows it; `<om-cartograph keep-badge>` opts one in on its own, for a static sheet with no map runtime. A map mounted INSIDE a cartograph frame carries no badge of its own — the sheet is the published artefact and credits the whole page once, so N frames do not mean N badges.
|
|
45
|
-
- `terrain="terrarium|<preset>|<{z}/{x}/{y} DEM URL>|off"` — 3D elevation surface. `terrarium` is keyless (AWS); `mapterhorn` is also keyless
|
|
45
|
+
- `terrain="terrarium|<preset>|<{z}/{x}/{y} DEM URL>|off"` — 3D elevation surface. `terrarium` is keyless (AWS; it carries the seabed only to zoom 10 — above it the ocean decodes as 0 m, so a seafloor needs `terrain-max-zoom="10"`); `mapterhorn` is also keyless (land only — its sea is flat); `seascape` is keyless BATHYMETRY (Open Waters: GEBCO worldwide, regional surveys to zoom 14, land a flat +2 m, not for navigation) — the preset for a seafloor; `maptiler-terrain` needs `basemap-key`/`configureBasemap`; raw DEM URLs need `terrain-decoder` (`terrarium`, `mapbox-rgb`, or `{rScaler,gScaler,bScaler,offset}` JSON). `terrain-exaggeration` scales relief (1 = true); `terrain-max-zoom` = the provider's REAL tileset cap; `terrain-texture` drapes a `{z}/{x}/{y}` imagery template. Geographic layers drape automatically; per-layer `terrain="drape|offset|off"` overrides (3D-model layers default to `offset`). Terrain REPLACES an active basemap while on (restored when off) — validation warns. Register presets with `OmMap.registerTerrain(name, {...})`; `set-terrain` action + `terrain` watch token; attribute-backed (undoable). **BIM requires explicit terrain**: a model that resolves real elevation on a map with no `terrain` attribute raises an ERROR through the validation channel at load time — the library never writes `terrain` for you; author a preset (`mapterhorn`, keyless) or an explicit `terrain="off"` for flat-ground siting. To read where the camera is — a depth or altitude gauge — call `map.getCamera()` (`altitude`, `targetElevation`, `clearance`, true metres, null until the DEM tile under the point loads); poll it from `requestAnimationFrame`, never by re-reading the DEM tiles yourself. To fly DOWN into terrain — a canyon, a seabed — set `camera-target="terrain"` (the camera orbits the ground under the view centre, so zooming in descends; needs `basemap="none"`, which terrain forces anyway; error on a `crs` map) and `camera-clearance="<metres>"` (the eye never comes closer to the ground; held for gestures, flights and buttons alike). Never script the camera height through `map.core`/deck — these two attributes are the whole of it. SEVERAL DEMs (a sharp survey over a coarse regional grid): `<om-terrain id="survey" src="…/{z}/{x}/{y}.png" decoder="terrarium" extent="[w,s,e,n]" max-zoom="14">` children, ranked in `terrain="survey, context"` — first-ranked wins inside its extent, the ground is partitioned (no z-fighting, never push one DEM down to hide it); every source but the last needs an `extent`; at most 4; `terrain-exaggeration` stays on the map. A survey with GAPS: `nodata="-32768"` (the value its tiles use where there is no data) — the mesh ends at the last measured cell and the next-ranked source shows through, colour and height (offset markers stand on it); with nodata a source needs no `extent`. Never use `nodata="0"` (sea-level ground becomes holes). Datasets on different vertical datums: `vertical-offset="-0.8"` (metres, before exaggeration) on the source — not a way to hide a bad join. Single DEM: `terrain-nodata` / `terrain-vertical-offset` on the map. To CHECK a user's own sources, run `npx onlymapjs inspect-terrain page.html` (or `await map.inspectTerrain()`): it samples the tiles along each extent edge and reports a step (steady → the `vertical-offset` to set; uneven → the data disagree) and no-data-like heights (→ the `nodata` to set). Run it before guessing either value. A user's own DEM as a GeoTIFF: `npx onlymapjs dem-tiles survey.tif --out tiles` (needs `npm i -D geotiff`; `--crs EPSG:xxxx` if the file declares none) writes Terrarium tiles with no-data as -32768 and PRINTS the `<om-terrain …>` line (src, decoder, nodata, extent, zooms) — paste that line, do not hand-write the extent or zooms. Imagery sharper than the DEM (a z10 grid under z15 satellite tiles): `texture-max-zoom="15"` on the `<om-terrain>` (`terrain-texture-max-zoom` for one DEM) — tiles keep subdividing for the texture, heights rebuilt from the DEM's max-zoom; never raise `max-zoom` past the DEM's real limit to get there (404s blank the terrain). `terrain-tint="slope"` (+ optional `terrain-tint-flat`/`terrain-tint-steep` colours) shades ground by TRUE slope, 15°–35° blend — never bake slope colour into textures; `terrain-tint="depth"` (+ optional `terrain-tint-shallow`/`terrain-tint-deep` colours, `terrain-tint-max-depth` true metres, default 3000) shades the SEABED as if through water — shallow tint at the coast, fading to the deep colour on a square-root ramp; land is untouched, so it marks the water without `sea-surface`; `terrain-tint="slope depth"` applies both; `sea-surface="rgba(40,110,160,0.3)"` is a translucent plane at sea level (standalone maps only). Imagery on the LAND over a visible seafloor (a coast with its towns, the seabed bare): `terrain-texture="…{z}/{x}/{y}…"` plus `terrain-texture-mask="land"` — cut at the DEM's own sea level, every source's texture, the bare seabed tinted by `terrain-tint` if set; `"sea"` is the reverse (a chart on the seabed). Never a MapLibre `basemap` for this (terrain replaces it) and never a hand-drawn coastline polygon; draped layers are never masked. Terrain PRESETS credit themselves (on the map, in `attributions()`, on cartograph sheets); a raw DEM URL is the author's to credit — add a credit line yourself for your own survey tiles.
|
|
46
46
|
- `lighting="daylight|studio|flat|custom"` — scene lighting for 3D content (extruded polygons, models); absent = deck defaults. Preset seeds values; `lighting-ambient`, `lighting-sun` (intensity; 0 removes the sun), `lighting-sun-azimuth` (° CW from north), `lighting-sun-elevation` (° above horizon), `lighting-camera` (model-inspection fill) override individual fields; `lighting-sun-date` (ISO 8601 or epoch ms) computes the sun from solar position at the map center and wins over azimuth/elevation. Attribute-backed: changes are undoable, and the `set-lighting {lighting, sunAzimuth, …}` action makes lighting story-steppable (`lighting="default"` removes the whole attribute set; a bare preset is a clean reset). `<om-widget type="lighting">` is the native UI. Widget scripts can `watch = ["lighting"]`.
|
|
47
47
|
- POST-PROCESS FINISHES (core `<om-map>`, no extra entry point needed) are `<om-effect>` children of `<om-map>`, which ARE deck's `effects` array (document order = pipeline order). Exactly one lane per element:
|
|
48
48
|
- `preset="vintage|engraved|night|blueprint|riso|newsprint|muted"` — a named look. Override one knob with `<op>-<param>` (`grain-amount="0.02"`); get the preset as editable markup with `OmMap.expandPreset(name)`.
|