@nika-js/onlymap 0.11.11 → 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.
- package/README.md +9 -3
- package/dist/attribute-resolution.d.ts +2 -0
- package/dist/{basemap-QT4ua-dL.js → basemap-CtDse0mW.js} +1514 -1462
- package/dist/basemap.d.ts +41 -1
- package/dist/cartograph.js +362 -321
- package/dist/cartograph.standalone.js +1995 -1914
- package/dist/{cityjson-k-z1r6c0.js → cityjson-DMc_dwu1.js} +1 -1
- package/dist/{crs-BzE_KP4M.js → crs-D5FyQfEu.js} +74 -7
- package/dist/{crs-ChglCB3O.js → crs-ZdDBJ2EY.js} +39 -36
- package/dist/data-layer.d.ts +36 -3
- package/dist/elements/om-map.d.ts +2 -1
- package/dist/geoparquet-BTHYX1ET.js +30 -0
- package/dist/geoparquet.d.ts +6 -7
- package/dist/{globe-view-BSGTUqWc.js → globe-view-KrKNOmVs.js} +11 -11
- package/dist/hillshade-CijRdYyU.js +209 -0
- package/dist/html-data.d.ts +1 -1
- package/dist/{ifc-DXwePQRv.js → ifc-sisRo7I7.js} +1 -1
- package/dist/{index-Bxue4Psc.js → index-21KGElDr.js} +9 -9
- package/dist/{index-DjYxw-8H.js → index-A45DtXly.js} +18 -18
- package/dist/{index-Dwc4s3mc.js → index-BPa2CC8T.js} +20 -20
- package/dist/{index-DudIuhJa.js → index-B_Vhebf7.js} +1 -1
- package/dist/{index-DBt_2x-w.js → index-Bfocr1_A.js} +106 -106
- package/dist/{index-CevWTqBO.js → index-DMc81n9B.js} +14362 -13782
- package/dist/{index-D1ZjhP2H.js → index-DS6VUGi6.js} +11 -11
- package/dist/{index-BO7MtTkn.js → index-DoGY-Vgi.js} +3 -3
- package/dist/{index-Bzypgr1v.js → index-eHYe06mM.js} +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/ir.d.ts +6 -0
- package/dist/layer-registry.d.ts +21 -0
- package/dist/layers/warped-bitmap-layer.d.ts +27 -0
- package/dist/{lerc-DQuf93SN.js → lerc-DjrPALEj.js} +1 -1
- package/dist/onlymap.standalone.js +53019 -52455
- package/dist/onlymapjs.js +86 -84
- package/dist/parse-manifest.d.ts +12 -9
- package/dist/{post-process-effect-B3j_nBzy.js → post-process-effect-Be1qa2DD.js} +5 -5
- package/dist/programmatic.d.ts +12 -0
- package/dist/projection.d.ts +44 -1
- package/dist/{raster-pipeline-CusoihQ3.js → raster-pipeline-DspBYxwc.js} +1 -1
- package/dist/{raster-CvAJ-h_g.js → raster-zC3qXBrs.js} +3 -3
- package/dist/react/om-layer.d.ts +4 -0
- package/dist/react/om-map.d.ts +2 -0
- package/dist/react.js +225 -218
- package/dist/runtime-core.d.ts +24 -0
- package/dist/source-crs.d.ts +99 -0
- package/dist/{text-on-path-D9u5SYCo.js → text-on-path-D0_URrD2.js} +1 -1
- package/dist/{zarr-DWb_nikR.js → zarr-DopOhzfY.js} +2 -2
- package/docs/cartography.md +106 -1
- package/llms.txt +2 -1
- package/onlymapjs.attributes.json +2 -0
- package/onlymapjs.html-data.json +26 -4
- package/package.json +1 -1
- package/skills/onlymapjs/SKILL.md +4 -2
- package/skills/onlymapjs/references/syntax.md +16 -1
- package/dist/geoparquet-hOsdfZJa.js +0 -35
- package/dist/hillshade-D2Ps3Nim.js +0 -298
package/dist/runtime-core.d.ts
CHANGED
|
@@ -328,6 +328,14 @@ export declare class RuntimeCore {
|
|
|
328
328
|
/** `<om-map crs>` — set only for a projected map; fixed for the map's life. */
|
|
329
329
|
private crs?;
|
|
330
330
|
private crsDef?;
|
|
331
|
+
/**
|
|
332
|
+
* `projection="globe"` (docs/design/globe.md) — live, unlike `crs`: a globe
|
|
333
|
+
* re-ingests nothing, the data stays lng/lat. Drawn by MapLibre on the
|
|
334
|
+
* basemap path; the deck-only globe (no basemap) is not built yet, so a
|
|
335
|
+
* standalone map ignores it with one console error (validation says so too).
|
|
336
|
+
*/
|
|
337
|
+
private globe;
|
|
338
|
+
private globeStandaloneWarned;
|
|
331
339
|
/**
|
|
332
340
|
* The projected plane, once its projection has resolved. Null on a Mercator
|
|
333
341
|
* map, and null on a projected one until proj4 lands — which is why the Deck
|
|
@@ -457,6 +465,7 @@ export declare class RuntimeCore {
|
|
|
457
465
|
constructor(parent: HTMLElement, initialView: InitialView, callbacks?: RuntimeCoreCallbacks, basemapAttr?: string, headless?: HeadlessOptions, basemapOptions?: BasemapRuntimeOptions, chromeHosts?: MandatedChromeHosts, projected?: {
|
|
458
466
|
crs?: string | null;
|
|
459
467
|
crsDef?: string | null;
|
|
468
|
+
projection?: string | null;
|
|
460
469
|
});
|
|
461
470
|
/** Zoom ±1 about the cursor (shift inverts), animated, tagged "user" — a real gesture, so one burst latch before the transition's programmatic frames. */
|
|
462
471
|
private readonly standaloneDblclick;
|
|
@@ -849,6 +858,11 @@ export declare class RuntimeCore {
|
|
|
849
858
|
* Headless ignores it (no renderer to switch); `om-map-ready` semantics
|
|
850
859
|
* are unaffected (readiness settles once, at initial load).
|
|
851
860
|
*/
|
|
861
|
+
/** Live `projection` switch (docs/design/globe.md). The basemap path changes in place; nothing re-ingests. */
|
|
862
|
+
setProjection(value: string | null): void;
|
|
863
|
+
/** Whether the map is drawing a globe right now — only the basemap path can, so far. */
|
|
864
|
+
isGlobe(): boolean;
|
|
865
|
+
private warnStandaloneGlobe;
|
|
852
866
|
setBasemap(attr: string | null): void;
|
|
853
867
|
private teardownRenderer;
|
|
854
868
|
/**
|
|
@@ -862,6 +876,16 @@ export declare class RuntimeCore {
|
|
|
862
876
|
* own) or on every pass.
|
|
863
877
|
*/
|
|
864
878
|
reconcile(irs: LayerIR[]): void;
|
|
879
|
+
/**
|
|
880
|
+
* An image TileLayer on a projected map (docs/design/crs.md, gap 2) — the
|
|
881
|
+
* relief layer's warp without the shading. Tiles are chosen from the plane's
|
|
882
|
+
* own geography by the plane tileset (deck's own index choice on an
|
|
883
|
+
* orthographic view means nothing in an OSM pyramid) and each is drawn as a
|
|
884
|
+
* subdivided mesh projected per vertex. Memoised per plane so deck sees one
|
|
885
|
+
* `TilesetClass` and one `renderSubLayers` identity, not a restart per frame.
|
|
886
|
+
*/
|
|
887
|
+
private planeRasterTileProps;
|
|
888
|
+
private readonly planeRasterMemo;
|
|
865
889
|
/** Layer ids already told that clustering does not run on a plane — one warning each, not one per rebuild. */
|
|
866
890
|
private readonly clusterPlaneWarned;
|
|
867
891
|
/** How long click-to-expand eases (the `flyTo` default is 0 — an instant cut, which reads as a glitch on a bubble the reader just clicked). Reduced-motion users still get the instant move. */
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data in any CRS (docs/design/crs.md, gap 1).
|
|
3
|
+
*
|
|
4
|
+
* Coordinates enter the map as longitude/latitude. A layer whose source is in
|
|
5
|
+
* a projected grid — eastings and northings in British National Grid, SVY21,
|
|
6
|
+
* State Plane — is converted ONCE, here, in the data stage: after
|
|
7
|
+
* normalisation, before geometry transforms and accessor resolution, so deck,
|
|
8
|
+
* `anchor="surface"`, the legend, ctx, picking and the vector exporter all see
|
|
9
|
+
* one geometry. On a projected map the plane conversion then runs on top, as
|
|
10
|
+
* it does for any lng/lat layer.
|
|
11
|
+
*
|
|
12
|
+
* WHICH CRS. The file's own metadata (a shapefile `.prj`, a FlatGeobuf header,
|
|
13
|
+
* GeoParquet's PROJJSON, a legacy GeoJSON `crs` member) is recorded against
|
|
14
|
+
* the loaded data by the Data Layer; `crs="…"` on the layer overrides it; and
|
|
15
|
+
* a format PLUGIN that reports what it produced (nika-agent's GDAL path says
|
|
16
|
+
* "EPSG:4326") outranks both, because it already honoured the declaration it
|
|
17
|
+
* was handed. Nothing found and coordinates that cannot be degrees → an error
|
|
18
|
+
* that names the fix. Never a guess.
|
|
19
|
+
*
|
|
20
|
+
* TWO CASES, as in `plane-layers.ts`: geometry carried AS data (GeoJSON-shaped
|
|
21
|
+
* rows) is converted into a new array; geometry read THROUGH an accessor
|
|
22
|
+
* (CSV/Arrow x/y columns) has its positional accessors wrapped. Both are
|
|
23
|
+
* memoised so deck's identities and update triggers stay stable.
|
|
24
|
+
*
|
|
25
|
+
* ASYNC ONCE, SYNC AFTER. Resolving a CRS imports proj4 and may ask epsg.io;
|
|
26
|
+
* the first parse of such a layer therefore resolves to the empty placeholder
|
|
27
|
+
* (the same Q6 state a URL-backed layer sits in before its fetch lands — the
|
|
28
|
+
* transform-stage precedent), and the reparse after resolution converts
|
|
29
|
+
* synchronously from the cache.
|
|
30
|
+
*/
|
|
31
|
+
import type { LayerData } from "./ir";
|
|
32
|
+
import type { Shape } from "./expr";
|
|
33
|
+
import { type Projection } from "./projection";
|
|
34
|
+
/** Where a recorded CRS came from: the file's own metadata, or a format plugin reporting what it produced. */
|
|
35
|
+
export type CrsOrigin = "file" | "format";
|
|
36
|
+
interface DataCrs {
|
|
37
|
+
crs: string | object;
|
|
38
|
+
origin: CrsOrigin;
|
|
39
|
+
}
|
|
40
|
+
/** Record the CRS a loaded dataset is in. Lng/lat needs no record and gets none. */
|
|
41
|
+
export declare function setDataCrs(data: LayerData, crs: string | object | null | undefined, origin?: CrsOrigin): void;
|
|
42
|
+
export declare function getDataCrs(data: LayerData): DataCrs | undefined;
|
|
43
|
+
/** Longitude/latitude already: WGS84 and its CRS84 spellings. Other geographic datums still pass through proj4. */
|
|
44
|
+
export declare function isLngLatCrs(crs: string | object): boolean;
|
|
45
|
+
/** The legacy GeoJSON `crs` member (removed by RFC 7946; still written by older GDAL and QGIS). */
|
|
46
|
+
export declare function geoJsonCrsMember(json: unknown): string | undefined;
|
|
47
|
+
/** Resolves once every CRS currently being resolved has settled — tests await this rather than a timeout. */
|
|
48
|
+
export declare function whenCrsSettled(): Promise<void>;
|
|
49
|
+
/** Whether any layer's CRS is still resolving — readiness waits on it like a data fetch. */
|
|
50
|
+
export declare function isCrsPending(): boolean;
|
|
51
|
+
/** Test seam: forget every resolution. */
|
|
52
|
+
export declare function resetSourceCrsForTest(): void;
|
|
53
|
+
export declare function convertFeatures(rows: readonly unknown[], projection: Projection, key: string): unknown[];
|
|
54
|
+
/**
|
|
55
|
+
* Wrap the positional accessors on a resolved prop bag so they return
|
|
56
|
+
* longitude/latitude, and fold the CRS into their update triggers so deck
|
|
57
|
+
* recomputes when the CRS changes. One wrapper per (accessor, projection).
|
|
58
|
+
*/
|
|
59
|
+
export declare function wrapPositionalAccessors(props: Record<string, unknown>, updateTriggers: Record<string, string>, projection: Projection, key: string): void;
|
|
60
|
+
/** Up to SAMPLE coordinate pairs from the data (GeoJSON geometry) or from the positional accessor (rows/columns). */
|
|
61
|
+
export declare function sampleCoordinates(data: LayerData, shape: Shape, getPosition?: unknown): number[][];
|
|
62
|
+
/** True when any sampled coordinate cannot be a longitude/latitude. */
|
|
63
|
+
export declare function cannotBeDegrees(pairs: readonly number[][]): boolean;
|
|
64
|
+
export interface CrsDiagnostic {
|
|
65
|
+
severity: "error" | "warning";
|
|
66
|
+
attribute: "crs" | "data";
|
|
67
|
+
message: string;
|
|
68
|
+
fix: string;
|
|
69
|
+
}
|
|
70
|
+
export interface CrsStageResult {
|
|
71
|
+
/** The data to continue with: converted features, the empty placeholder while resolving, or the input. */
|
|
72
|
+
data: LayerData;
|
|
73
|
+
/** Set when the data reaches positions through accessors: wrap them after attribute resolution. */
|
|
74
|
+
projection?: Projection;
|
|
75
|
+
/** The update-trigger suffix that goes with `projection`. */
|
|
76
|
+
key?: string;
|
|
77
|
+
/** The CRS the conversion is FROM, for messages — present whenever a conversion applies. */
|
|
78
|
+
from?: string;
|
|
79
|
+
/** Still resolving: the data is the empty placeholder and readiness must wait. */
|
|
80
|
+
pending?: boolean;
|
|
81
|
+
diagnostics: CrsDiagnostic[];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The seam both front-ends call. `declared` is the layer's `crs`, `declaredDef`
|
|
85
|
+
* its `crs-def`. Returns the data to continue with plus, for accessor-shaped
|
|
86
|
+
* data, the projection to wrap the resolved positional accessors with.
|
|
87
|
+
*/
|
|
88
|
+
export declare function applyCrsStage(rawData: LayerData, shape: Shape, declared: {
|
|
89
|
+
crs?: string | null;
|
|
90
|
+
crsDef?: string | null;
|
|
91
|
+
}, onReady: () => void): CrsStageResult;
|
|
92
|
+
/**
|
|
93
|
+
* The accessor half, run after attribute resolution: wrap positional
|
|
94
|
+
* accessors (when the stage found a CRS) or, with no CRS anywhere, check that
|
|
95
|
+
* the positions could be degrees at all.
|
|
96
|
+
*/
|
|
97
|
+
export declare function finishCrsStage(stage: CrsStageResult, data: LayerData, shape: Shape, props: Record<string, unknown>, updateTriggers: Record<string, string>): CrsDiagnostic[];
|
|
98
|
+
export declare function logCrsDiagnosticOnce(label: string, d: CrsDiagnostic): void;
|
|
99
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ur, d as lr, R as zt, e as fr, m as dr, p as St, f as hr, k as pr, l as mr } from "./raster-pipeline-
|
|
2
|
-
import { c as gr } from "./index-
|
|
1
|
+
import { A as ur, d as lr, R as zt, e as fr, m as dr, p as St, f as hr, k as pr, l as mr } from "./raster-pipeline-DspBYxwc.js";
|
|
2
|
+
import { c as gr } from "./index-DMc81n9B.js";
|
|
3
3
|
import $t from "./index-CW1n5LdO.js";
|
|
4
4
|
var Et;
|
|
5
5
|
function h(e, t, n) {
|
package/docs/cartography.md
CHANGED
|
@@ -48,13 +48,38 @@ report lng/lat too, not plane metres, which matters because the measure tool
|
|
|
48
48
|
feeds those points to geodesic formulas and a projected metre in a geodesic
|
|
49
49
|
formula returns a confident wrong answer.
|
|
50
50
|
|
|
51
|
+
### Data in a local grid — `crs` on a layer
|
|
52
|
+
|
|
53
|
+
`crs` on `<om-map>` chooses the plane the MAP is drawn in. `crs` on an `<om-layer>` says
|
|
54
|
+
what the layer's DATA is in, and the data is converted to longitude/latitude when it
|
|
55
|
+
loads — so a British National Grid shapefile and an SVY21 CSV can sit on a Mercator map
|
|
56
|
+
or on any projected one. A file that names its CRS needs nothing (a shapefile `.prj`, a
|
|
57
|
+
FlatGeobuf or GeoParquet header, a legacy GeoJSON `crs` member); a declaration overrides
|
|
58
|
+
the file:
|
|
59
|
+
|
|
60
|
+
```html
|
|
61
|
+
<om-map crs="EPSG:27700" basemap="none" center="[-2.5, 53.5]" zoom="5">
|
|
62
|
+
<om-layer id="sites" type="GeoJsonLayer" data="./sites-bng.shp"></om-layer> <!-- .prj read -->
|
|
63
|
+
<om-layer id="wells" type="ScatterplotLayer" data="./wells.csv" crs="EPSG:27700"
|
|
64
|
+
get-position="[$easting, $northing]" radius-units="pixels" get-radius="5"></om-layer>
|
|
65
|
+
</om-map>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The bundled table covers every WGS84, ETRS89, NAD83 and GDA UTM zone and the common
|
|
69
|
+
national grids; any other EPSG code is fetched once from `https://epsg.io/<code>.proj4`
|
|
70
|
+
(`OmMap.configureCrs({ online: false })` turns that off). Coordinates too large to be
|
|
71
|
+
degrees with no CRS anywhere are a diagnostic, not a layer in the ocean. Datum shifts are
|
|
72
|
+
the standard seven-parameter ones — good to a few metres; correction grids such as OSTN15
|
|
73
|
+
are not shipped.
|
|
74
|
+
|
|
51
75
|
### What a projected map cannot do
|
|
52
76
|
|
|
53
77
|
Each is a validation error with a fix, never a silent no-op:
|
|
54
78
|
|
|
55
79
|
| Limit | Why | What to do instead |
|
|
56
80
|
|---|---|---|
|
|
57
|
-
| No MapLibre basemap | it is a second renderer with its own camera | `basemap="none"
|
|
81
|
+
| No MapLibre basemap | it is a second renderer with its own camera | `basemap="none"`, plus an image `TileLayer` for a raster basemap (below) |
|
|
82
|
+
| No vector, terrain or 3D tile layers (`MVTLayer`, `TerrainLayer`, `Tile3DLayer`, a `.pbf` `TileLayer`) | deck indexes their tiles from a Mercator viewport | image tiles and `HillshadeLayer` are taught the plane; for vectors, load the data as GeoJSON |
|
|
58
83
|
| No `terrain` | the 3D surface and its tiles are Mercator throughout | drop it, or use Mercator |
|
|
59
84
|
| No `pitch` / `bearing` | the projected view is planimetric | a print sheet is planimetric; rotate the frame in the layout |
|
|
60
85
|
| No H3 / S2 / geohash / quadkey layers | deck builds their geometry from a token, inside the layer | convert the cells to polygons and use a `GeoJsonLayer` |
|
|
@@ -66,6 +91,25 @@ Mercator tiles from the plane's own geography and draws them as subdivided
|
|
|
66
91
|
warped meshes. Sub-pixel at practical subdivisions — measured at 0.40 output
|
|
67
92
|
pixels for Albers at z=3, falling as 1/N².
|
|
68
93
|
|
|
94
|
+
**Image tiles work too**, so a raster basemap is a layer. Any `TileLayer` whose
|
|
95
|
+
`data` is an image template (`.png`, `.jpg`, `.jpeg`, `.webp`) is re-indexed and
|
|
96
|
+
warped the same way, and lands where the sheet's projection puts it — measured
|
|
97
|
+
within 0.7 px of `map.project()` on British National Grid and Albers sheets:
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<om-map crs="EPSG:27700" basemap="none" center="[-2.5, 54.5]" zoom="5">
|
|
101
|
+
<om-layer id="base" type="TileLayer" tile-size="256" max-zoom="14"
|
|
102
|
+
data="https://tiles.maps.eox.at/wmts/1.0.0/s2cloudless_3857/default/g/{z}/{y}/{x}.jpg"></om-layer>
|
|
103
|
+
<om-widget type="attribution" position="bottom-right"
|
|
104
|
+
text="Sentinel-2 cloudless by EOX IT Services GmbH (contains modified Copernicus Sentinel data 2016 & 2017)"></om-widget>
|
|
105
|
+
</om-map>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The basemap does not switch for you: `basemap="satellite"` on a projected map is
|
|
109
|
+
still an error, and its fix is the preset's own tiles written as this layer.
|
|
110
|
+
**The credit is yours to show.** The map credits only the basemaps it picks; tiles
|
|
111
|
+
you name in a `TileLayer` are credited by you, as above.
|
|
112
|
+
|
|
69
113
|
### Which north does the sun mean?
|
|
70
114
|
|
|
71
115
|
On a projected sheet, geographic north is not sheet-up. Across an Albers CONUS
|
|
@@ -82,6 +126,65 @@ validator says so rather than letting you wonder.
|
|
|
82
126
|
|
|
83
127
|
---
|
|
84
128
|
|
|
129
|
+
## A globe — `projection="globe"` (preview)
|
|
130
|
+
|
|
131
|
+
```html
|
|
132
|
+
<om-map projection="globe" basemap="satellite" center="[-20, 30]" zoom="1.6">
|
|
133
|
+
<om-layer id="cities" type="ScatterplotLayer" data="./cities.json"
|
|
134
|
+
get-position="[$lon, $lat]" get-radius="4" radius-units="pixels"></om-layer>
|
|
135
|
+
<om-overlay anchor="[-0.1278, 51.5074]"><div>London</div></om-overlay>
|
|
136
|
+
</om-map>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Zoomed out, the Earth is a sphere you can spin. Zoom in and it becomes the
|
|
140
|
+
ordinary flat map, with nothing to switch. It is the view for things that span the
|
|
141
|
+
planet — flight routes, global datasets, the poles — which Web Mercator stretches
|
|
142
|
+
out of shape.
|
|
143
|
+
|
|
144
|
+
**Nothing else changes.** Layers are written as for a flat map, data stays
|
|
145
|
+
longitude/latitude, and `center`/`zoom` mean what they always did.
|
|
146
|
+
|
|
147
|
+
**It needs a basemap.** MapLibre draws the sphere and deck.gl draws the layers
|
|
148
|
+
over it, from MapLibre's camera. Measured: the two agree to within half a pixel at
|
|
149
|
+
every zoom, including zoom 10–12, where the globe turns into the flat map.
|
|
150
|
+
|
|
151
|
+
**It is live.** Set or remove `projection` on a mounted map, or use the
|
|
152
|
+
`set-projection` action (`{ projection: "globe" }` / `"mercator"`). Camera and
|
|
153
|
+
layers carry over, and a basemap switch keeps the globe.
|
|
154
|
+
|
|
155
|
+
**What changes for interaction.**
|
|
156
|
+
- **Overlays hide on the far side.** An `<om-overlay>` anchored to a point on the
|
|
157
|
+
far side of the planet hides, rather than floating over the near side.
|
|
158
|
+
- **A click in space has no coordinate.** Clicking the space around the globe
|
|
159
|
+
reports no coordinate (`om-map-point` carries `null`, `unproject()` returns
|
|
160
|
+
`null`). It never reports the edge of the planet.
|
|
161
|
+
- **A globe is flat-on and north-up.** deck.gl's globe camera has no tilt or
|
|
162
|
+
rotation, and a tilted globe put the layers off the basemap. So tilt and rotate
|
|
163
|
+
gestures are off, and the camera levels out when the globe switches on.
|
|
164
|
+
|
|
165
|
+
### What a globe cannot do yet
|
|
166
|
+
|
|
167
|
+
Each is a validation error with a fix:
|
|
168
|
+
|
|
169
|
+
| Limit | Why | What to do instead |
|
|
170
|
+
|---|---|---|
|
|
171
|
+
| No `basemap="none"` | the deck-only globe is not built yet | any basemap preset |
|
|
172
|
+
| No `crs` | a sphere is not a plane | one or the other |
|
|
173
|
+
| No `terrain`, no `TerrainLayer` | deck.gl's globe has no terrain surface | a flat 3D map |
|
|
174
|
+
| No `pitch` / `bearing` | see above | — |
|
|
175
|
+
| No heatmap, hexagon, grid, screen-grid or contour layers | screen-space aggregation has no globe path | pre-aggregate to polygons (H3 cells draw) |
|
|
176
|
+
| No `TextLayer`, `IconLayer`, `TextOnPathLayer`, `PopupLayer` | deck.gl's globe culls glyphs and icons | `<om-overlay>` labels, or the basemap's own |
|
|
177
|
+
| No `ArcLayer` / `GreatCircleLayer` | arcs do not draw on deck.gl's globe | a `PathLayer` through points along the route |
|
|
178
|
+
| Not in a cartograph frame | a frame is a flat, georeferenced sheet | a flat or projected map |
|
|
179
|
+
|
|
180
|
+
Clustered layers draw their bubbles, but not their counts, which are text; the
|
|
181
|
+
validator warns. The measure tool's on-map labels are text too, so they do not
|
|
182
|
+
show on a globe. SVG export already refuses any MapLibre basemap, the globe
|
|
183
|
+
included. Stories are not yet checked on a globe: `seek()` interpolates a flight
|
|
184
|
+
along the flat map's arc, so a recorded flight can differ from the live one.
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
85
188
|
## Geometry transforms — `<om-transform>`
|
|
86
189
|
|
|
87
190
|
Children of an `<om-layer>`, applied in document order, in the **data stage** —
|
|
@@ -327,3 +430,5 @@ must appear in exactly one chunk.
|
|
|
327
430
|
marching pass. The polylines project exactly, so the lines are right; what is
|
|
328
431
|
Mercator is the sampling.
|
|
329
432
|
- **An analytic `buffer`.** A deliberate non-goal — see above.
|
|
433
|
+
- **The globe without a basemap**, and text, icons and arcs on a globe (see
|
|
434
|
+
"What a globe cannot do yet").
|
package/llms.txt
CHANGED
|
@@ -38,7 +38,7 @@ Programmatic/native bridge rule: `MapController.setLayers()` accepts normal func
|
|
|
38
38
|
- `<om-map center="[lng, lat]" zoom="11" pitch="55" bearing="20" basemap="positron">` — the root. Give it a height (`om-map { display:block; height:100vh }` with `html,body{height:100%}`, or a sized container) — a custom element is display:inline by default and collapses to zero size; with none set, the library falls back to display:block + a 400px floor so a bare map still shows (any height you DO set wins over the floor, including one below 400px), and a collapsed map logs a console warning. A map hidden on purpose (`hidden`, or inside a `display:none` panel) stays hidden and does not warn. `basemap` accepts a free preset (`liberty`, `bright`, `positron`, `dark-matter`, `voyager`, `osm`, `satellite` — no keys; `satellite` is keyless imagery — EOX's 2016 Sentinel-2 cloudless mosaic, 10 m so sharp only to about z13–14, commercial use fine with the credit it renders; for sharp current imagery use keyed `maptiler-satellite`; or `maptiler-streets`/`maptiler-dataviz`/`maptiler-satellite` with `basemap-key="…"` or `OmMap.configureBasemap({ maptilerKey })`), `maplibre` (bare demo style), a style URL (e.g. a MapTiler-customized style; any scheme fetch supports, including desktop asset protocols like Tauri's, query strings fine), or `none` (standalone canvas). The attribute is LIVE — writing it switches the basemap in place (camera + layers survive); the `set-basemap {basemap}` action and `<om-widget type="basemap-switcher" options="positron dark-matter osm">` do the same. Register more via `OmMap.registerBasemap(name, { style })`. Required provider attribution renders automatically (`attribution="false"` opts out). `pitch`/`bearing` tilt the initial camera (use for 3D content). Terrain: `terrain="terrarium"` (keyless AWS DEM; also `mapterhorn` — keyless, CARTO Positron drape by default — `maptiler-terrain` with a key, a raw `{z}/{x}/{y}` DEM URL + `terrain-decoder="terrarium|mapbox-rgb|<JSON>"`, or `off`) raises a 3D surface — geographic layers DRAPE onto it automatically (per-layer `terrain="drape|offset|off"` overrides; 3D-model layers sit ON it), `terrain-exaggeration` scales relief, `terrain-texture` drapes imagery; terrain REPLACES an active basemap while on (restored when off); `set-terrain` action, `terrain` watch token, `OmMap.registerTerrain(name, {...})` for more sources. a georeferenced BIM model REQUIRES the map to author `terrain` explicitly — any value including an explicit `terrain="off"` (flat-ground siting); a model that resolves real elevation (IfcMapConversion + OrthogonalHeight) on a map with no `terrain` attribute raises an ERROR through the validation channel at load time (the library never writes attributes for you — no auto-terrain). Scene lighting for 3D content: `lighting="daylight|studio|flat|custom"` (absent = deck defaults) with `lighting-ambient`/`lighting-sun`/`lighting-sun-azimuth`/`lighting-sun-elevation`/`lighting-camera` overrides and `lighting-sun-date` (ISO/epoch — solar-position sun computed at the map center, wins over azimuth/elevation); attribute-backed (undoable, live-editable), story-steppable via the `set-lighting {lighting, sunAzimuth, ...}` action (`lighting="default"` removes the attribute set; a bare preset is a clean reset — stale overrides clear), native UI via `<om-widget type="lighting">` (preset radios + tuning sliders), widget watch token `lighting`. Clip box (issue #34): `clip-box-min="[lng,lat,elev]"` + `clip-box-max="[lng,lat,elev]"` cut a real axis-aligned 3D box through the scene — every layer clipped by default (per-layer `clip="off"` opts out), `clip-box-invert` shows outside instead of inside, `clip-box-highlight` dims clipped-out geometry instead of discarding it; works on ANY layer including georeferenced Tile3DLayer/BIMLayer content; attribute-backed (undoable) via `set-clip-box {min, max, invert?, highlight?}` (`{clear:true}` removes it), native UI `<om-widget type="clip-box">`; v1 axis-aligned only. XY snapping (issue #34 Part A): `snap="vertex edge midpoint"` + `snap-tolerance="12"` (px, default 12) refines a click/hover to the nearest vertex/edge/edge-midpoint of whichever feature deck ALREADY picked under the cursor — not a spatial index, only that one feature's own geometry is searched, on the CPU, when snapping is on. Applies to every layer by default (`snap="off"` on any `<om-layer>` opts it out, mirroring `clip="off"`) and to a `BIMLayer`'s own edge/crease overlay (its real wall corners/edges, converted from the model's local mesh coordinates to real `[lng,lat]` automatically) — the raw triangle MESH itself is not yet a snap target. Vertex beats midpoint beats edge on range conflicts; hold Space to place a point nearby without snapping. GeoJsonLayer extrudes polygons declaratively: `extruded get-elevation="$height"` (+ `wireframe`). `widgets-hidden` attribute (or the `set-widgets-visible {visible}` action / `<om-widget type="widgets-toggle">` button) hides every widget WITHOUT destroying state — attribution never hides (license); transient (not an undo step) but story-steppable, so a step can clear chrome for a cinematic take. Slots auto-dim while an open `<om-overlay>` popup covers them (position stability over the popup dodging; `widgets-dim="off"` disables). `validate` attribute enables live validation + on-page error panel. Include a `map-id="<random UUID>"` on complete pages (identifies the map artifact for usage telemetry — not a visitor id; the page author deletes it to opt out); `telemetry="off"` disables usage telemetry + library-error reporting for the map (global: `OmMap.configureTelemetry({ disabled: true })`; schema: docs/telemetry.md). Free plan limits (HOSTED http(s) pages only — a dev context (localhost, file://, any non-web scheme) lifts every cap while the attribution badge stays; the exemption is technical convenience, not a license grant — commercial deployment incl. packaged apps still requires a key): 5 layers, 25k rows per layer — layers past a limit don't render and validation says why; a `license-key="om_live_…"` attribute (publishable, origin-restricted) or `OmMap.configureLicense(key)` lifts limits and removes the corner badge — removal is a PERMISSION, not a requirement: `keep-badge` (or `OmMap.setKeepBadge(true)`) keeps the badge on a paid plan, rendering the credit WITHOUT the "free for non-commercial use" sentence (which would be false there); no effect on the free plan, where the badge is the license condition. When a user's map exceeds free limits, say so and point at the validation message rather than silently restructuring their data. Events on the element: `om-map-ready` (boot complete; `await mapEl.ready` is the promise twin), `om-validation-error`, `om-view-changed` (camera settled after a move, debounced; `detail = {longitude, latitude, zoom, pitch, bearing, origin}` where `origin` is `"user"` for gesture bursts vs `"programmatic"` for API/story moves — the camera-persistence hook, and the echo-suppression signal when syncing camera state to an app store), `om-map-point` (`detail = {coordinate: [lng,lat]|null, kind}` — every click/hover map coordinate incl. empty-map clicks, for custom capture tools beyond the draw widget), `om-tileset-load` (`detail = {layerId, tileset}` — a Tile3DLayer's live deck Tileset3D, for tools needing the real tileset like region export), `om-tiles-warmed` (`detail = {tilesets, viewports, ms, timedOut}` — a `warm-tiles` pass finished; see the story bullet), `om-route-resolved` (`detail = {layerId, route}` — a Route layer resolved, direct geometry or provider round-trip; `route` carries the normalized geometry/distanceMeters/durationSec/legs/bounds — how a page reads a provider-computed route without re-fetching, re-fired on every re-resolve). `om-attributions-changed` (bubbles; a basemap style loaded — read `mapEl.attributions()`, the providers as plain text). `MapController` mirrors these as `onViewChange`/`onMapPoint`/`onTilesetLoad`/`onRouteResolved` options. `await mapEl.snapshot()` returns a canvas-only PNG dataURL of the scene (basemap + layers at device pixels; `{as:"blob"}` for files) — DOM widgets/overlays/attribution are NOT captured, so exports must render provider credits themselves.
|
|
39
39
|
- `<om-layer id="..." type="ScatterplotLayer" data="./points.json">` — any deck.gl layer class by `type` (41 layer types total: 32 bundled deck.gl core/geo/aggregation/mesh layers, plus the native `COGLayer`/`ZarrLayer` raster types, `ImageOverlay` for georeferenced drone JPEGs, `BIMLayer` for BIM source files, `HillshadeLayer` for shaded relief, `TextOnPathLayer` for a label that follows its line, and `Route`/`Tracking` for routing/live-tracking — see the dedicated bullet below), plus `PopupLayer` (WebGL badges/labels at scale: `layout="badge|pin-label|card"`, `min-zoom`/`max-zoom`). Every type's full attribute list ships in the package's `onlymapjs.html-data.json` — consult it instead of guessing attribute names or reading the minified dist. TextLayer's default font atlas covers ASCII only: set `character-set` when label text carries other glyphs (`—`, `·`, accents) or deck warns and renders them blank. External layer classes register via `OmMap.registerLayer({type, deckClass, props})` — build them on `@nika-js/onlymap/deck` (the bundled `CompositeLayer`/`TileLayer`/… re-exports), never a separately-installed deck.gl (different class hierarchy, breaks in the renderer); function-valued props ride the subclass's `static defaultProps`; register at module top level BEFORE the manifest mounts (see docs/custom-layers.md). Data: `data` URL (JSON, GeoJSON, CSV/TSV `.csv` — parsed to typed columns — Shapefile `.shp` (+`.dbf` attributes) and KML `.kml` as GeoJSON features, GPX `.gpx` (waypoints/tracks/routes → features tagged `_gpxKind`; a `#waypoints`/`#tracks`/`#routes` URL fragment selects one part), FlatGeobuf `.fgb` (cloud-native binary vector, whole-file decode), GeoParquet `.parquet`/`.geoparquet` (cloud-native columnar vector — all-Point files stay columnar like Arrow, lines/polygons become GeoJSON features; requires the file's `geo` metadata with WKB geometry, and CRS84/EPSG:4326 — a projected CRS is a loud error telling you to reproject, not a silent misplacement; snappy/gzip/zstd row-group compression handled), CityJSON `.city.json` / CityJSONSeq `.city.jsonl` (semantic 3D city models — 3DBAG, PLATEAU — decoded to one of two shapes by the `data` URL, no CityJSON layer type: default → extruded footprints, `type="GeoJsonLayer" extruded get-elevation="$roof_height"`; `?om-surfaces=1` → one row PER FACE at its own real per-vertex height so a pitched LoD2.2 roof actually looks pitched, `type="SolidPolygonLayer" get-polygon="$polygon" full3d` (`extruded` stays at its ordinary `false` default) (flat-shaded — deck.gl only lights the `extruded` shader path — each row also carrying `surface_type`: RoofSurface/WallSurface/GroundSurface, and `fill_color`: a ninja-viewer-style default color per surface_type/cityobject_type, verified against cityjson-threejs-loader's own default palette — `get-fill-color` on `SolidPolygonLayer` reads it automatically when left unauthored, no color attribute required, and an authored `get-fill-color` still overrides it); derived properties (both modes) `roof_height` (area-weighted mean roof height above ground), `eaves_height`, `ridge_height`, `ground_height`, `roof_area`, `surface_count`, `lod`, `cityobject_id`, `cityobject_type`, `parent_id` win over same-named source attributes, plus surfaces-mode-only `polygon`/`outline`/`surface_type`/`fill_color` (`outline` is the face's outer ring flattened and closed — bind a companion `type="PathLayer" get-path="$outline"` layer to it for visible face edges, since surfaces mode is flat-shaded and `SolidPolygonLayer`'s own `wireframe` prop is a no-op when unextruded — always pair one, matching `filter-field`/`filter-range` to the fill layer), and a parent Building's attributes are inherited by its BuildingPart rows; national grids NL/CH/DE/JP/AT/SG reproject automatically including axis order, other EPSG codes fail with an error naming the code; highest LoD wins, pin one with `?om-lod=1.2` (combine as `?om-lod=1.2&om-surfaces=1`, cached independently); `.city.jsonl` fills in as it downloads in either mode — see docs/3d-assets.md), or Arrow IPC `.arrow`/`.feather` — large point datasets stay columnar, GeoArrow line/polygon geometry becomes GeoJSON features, zstd-compressed IPC is handled; other formats plug in via `OmMap.registerFormat({match, parse})`; data URLs accept any scheme the runtime's fetch supports — desktop webviews (Tauri, Electron) pass asset-protocol URLs straight in), inline `<script type="application/json">` (row arrays or column-oriented `{"columns": {"lon": [...], "lat": [...]}}`; must be a DIRECT child of the `<om-layer>`, and when present it wins — omit the `data` attribute; NEVER put rows in `data='[…]'` — `data` is always a URL, so that fetches a file named `[…]` and draws nothing, a validation ERROR since 0.11.9; a `data` URL that fails to load is also reported as a diagnostic, `om-layer#<id> [data]`, until it loads), or `wss://` streaming (`key="mmsi"` upserts entities in place, `flush="250ms"` coalesces bursts, `source="name"` selects a `OmMap.registerSource` decoder plugin), or a polled REST snapshot (`refresh="5s"` re-fetches and replaces — for live endpoints that return the full current state). TILED layers: a `{z}/{x}/{y}` `data` template is deck's tile URL for `TileLayer`/`MVTLayer` (NOT rows) — passed through to deck verbatim, never fetched/parsed, so `<om-layer type="TileLayer" data="…/{z}/{x}/{y}.png">` works (raster gets a built-in BitmapLayer sublayer) and `type="MVTLayer" data="…/{z}/{x}/{y}.pbf"` self-renders vector tiles with `get-*` accessors applying to each decoded feature's properties; a tiled layer has no local rows so `ctx.data`/`ctx.stats`/`filter-*` don't apply. Authenticated endpoints: call `OmMap.configureData({ headers: {...} })` in a script — never put tokens in attributes. `$field` accessors work identically on all of them — never write column-index code yourself. One columnar restriction: the `js` full-JS opt-in is not allowed on Arrow/columnar layers (validation will tell you; use `$field` accessors instead). For 3D models use `type="ScenegraphLayer"` with `scenegraph="./model.glb"` (required) and `get-orientation="[0, $heading, 90]"` — the roll of 90 stands Y-up glTF models upright; `color`/`get-color` tint the model as a shader multiply over its own baked texture (default opaque white = no tint; `get-color` is `$field`-driven like other `*Color` accessors, so a fleet recolors by data without swapping model files); see docs/3d-assets.md. 3D Tiles use `type="Tile3DLayer"` with `tileset="…/tileset.json"` (NOT `data`). Any pickable layer can opt into deck's DEPTH-pick pass with `pickable="3d"` instead of a bare `pickable` (issue #34) — the resolved click/hover coordinate then carries a real elevation (`{{z}}` in overlay/tooltip templates, `ctx.selection.coordinate`) instead of the ray∩ground-plane guess, so a click on a building face lands ON the face rather than on the ground behind it; `terrain` sets this on itself. For BIM/photogrammetry, `pickable` alone picks a whole TILE — add `pick-features` to pick an individual ELEMENT (a wall, a window, one IFC product), and the `selection` then carries that element's `featureId`/`properties`/`class` from the tile's own `EXT_mesh_features` + `EXT_structural_metadata` (`feature-id-property` selects the ID set, default `_FEATURE_ID_0`). `feature-styles` recolours/fades/highlights by feature ID — an array indexed BY id of `{color: [r,g,b], strength: 0-1, opacity: 0-1}`, live-settable, uploaded as a small lookup texture (no refetch). Use `strength` below 1 to tint rather than replace, or the model's own texture is hidden. Isolate/hide/ghost are DECLARATIVE and mirror the vector `filter-field`/`filter-categories` pair — `feature-filter-field="component"` names the metadata field, then `isolate-features='["Clock"]'` / `hide-features='["Windows","Skylight"]'` / `ghost-features='["Wall"]'` take JSON value lists matched against the tile's property table (`ghost-opacity` tunes the fade, default 0.18). `isolate-features` is EXCLUSIVE (anything unlisted is hidden); hiding is a shader discard so a hidden element also stops being pickable and whatever is behind it becomes selectable. They compose ONTO `feature-styles` (style table supplies colour, these supply visibility), and being attributes they are undoable and story-steppable — prefer them over computing a style table in page JS. Multi-material/multi-primitive models fan out correctly (glTF allows one material per primitive, so real IFC exports are usually many primitives); only genuinely instanced i3dm tiles stay tile-granularity. Limits to state rather than discover: texture-backed IDs — how photogrammetry classification ships — require `load-options='{"gltf":{"loadBuffers":true,"loadImages":true},"image":{"type":"data"}}'`, and omitting `image.type` makes the tileset take MINUTES to appear (loaders.gl otherwise reads the whole ID texture back through a canvas once per vertex); and `opacity` below 1 currently blanks the model. BIM WIDGETS (all need a `pick-features` layer): `<om-widget type="ifc-browser" layer="clinic" fields="ifcClass material container spatialPath" scale-fields="netVolume" rows="7">` groups the model by a property-table field, counts each value, and gives every row I/H/G buttons that WRITE `isolate-features`/`hide-features`/`ghost-features` (so it is a UI over the attributes — undoable and story-steppable; I is MULTI-SELECT, isolating the union of every pressed row or tree node, since `isolate-features` is a list and the layer matches it as a set) while keeping the companion outline layer's `filter-categories` in step; that same select also offers whichever TREES the file supports — Spatial (`spatialPath`), Type (`typePath`), System (`systemPath`) and Classification (`classificationPath`, built by walking `ReferencedSource`) — each expandable with counts aggregated upward and the same I/H/G on every node, so isolating a storey or a system or a CCS code reaches every element under it. Spatial is NOT privileged (on a real Danish project the classification tree covered 3,415 elements to spatial's 660). A tree is not a separate mode, just a group-by on a hierarchy column — LIST it in `fields` to offer it, or set `field="spatialPath"` to open on it — and `loadIfc` emits a hierarchy column ONLY when the file populates it, so a tree that would render empty is never offered; trees appear automatically when available (no need to list them in `fields`) and `field="spatialPath"` opens straight onto one. ONE browser per layer: `feature-filter-field` and the isolate/hide/ghost attributes are single-valued, so two instances on one layer clobber each other. The widget was renamed from `ifc-legend` (still registered as a deprecated alias) because it is a model browser, not a legend. non-physical classes (IfcSpace, IfcOpeningElement) are hidden unless `show-non-physical`, and `no-color` removes the colour select. `<om-widget type="feature-inspector" fields="ifcClass material container netVolume">` (renamed from `ifc-inspector`, kept as an alias) shows the picked element's properties. `<om-widget type="ifc-loader" layer="ifc" federate>` is a drop zone that parses `.ifc` files IN THE BROWSER and builds both layers itself; `federate` accepts SEVERAL models into one co-registered scene (one drop zone, one layer per model, each with a visibility toggle) rather than one widget per discipline, matching how coordination tools append models; a model that turns out to be georeferenced is AUTO-PLACED (its own coordinates/heading/scale written onto the layers the WIDGET created, camera flown there) — but the widget NEVER writes `<om-map>`'s own scene attributes (`basemap`, `terrain`): those are author-owned, and a georeferenced model on a map with neither raises a structured "no spatial context" warning instead of switching one on. COLOUR BY PROPERTY instead of hand-computing a `feature-styles` table: `feature-color-by` (categorical, `feature-palette` overrides the built-in cycle) or `feature-color-scale` (graduated over a numeric field), with `feature-color-strength` (default 0.85) controlling how hard the colour mixes over the model's own material. Setting NEITHER is the default and is meaningful — the model renders in its own IFC surface colours. A graduated ramp needs the field populated: Revit IFC2x3 exports often carry no `IfcElementQuantity`, so every `netVolume` is 0 and the ramp is flat. Widget scripts read the decoded property table with `ctx.features(layerId)` (undefined until the first tile carrying one lands) and re-render on the `features` watch token. `<om-widget type="ifc-clash" layers="arch mep" tolerance="0">` is the CLASH OVERLAY over two co-registered model layers: it flags element pairs whose bounding boxes interpenetrate, colours both sides via `feature-styles`, and flies to the centre of each overlap. v1 is an axis-aligned box test — fast and serverless, but it over-reports anything diagonal and says nothing about which clashes matter; zones/spaces/openings/proxies and same-class-same-name pairs are excluded as noise. The header carries an overlay on/off switch; an isolation mode select (None/Dim/Hide) sits above the results list and applies once a row is selected (with nothing selected, nothing is hidden), and clicking a row FOCUSES that clash (chosen pair at full strength, every other clashing element dropped to a faint tint, camera flown to the overlap centre) — without that, everything is highlighted and nothing is. Results are GROUPED by the side-A element with a count (one wall crossing four ducts is one row), and the two model selects appear only when more than two models are loaded. It CHECKS co-registration (matching `site-origin`) and says so when it fails, because two mis-registered models report zero clashes exactly like two clean ones. Persisting/sharing results is BCF's job and is out of scope. `<om-layer type="BIMLayer" src="./model.ifc">` is the declarative counterpart to `ifc-loader`/`loadIfc`: point it at a BIM source file (an .ifc today) and it runs the loader itself the moment src resolves — no pre-baked tileset, no site-origin/site-heading/site-scale (the file's own georeference is read and applied automatically; not wired up yet: an authored site-origin on a BIMLayer does not override it), and no separate PathLayer for the outline overlay (added automatically). `pick-features` defaults ON (unlike a plain Tile3DLayer); feature-filter-field/feature-styles/isolate-hide-ghost/feature-color-by/ghost-opacity all work unchanged, since BIMLayer forwards them to a real Tile3DLayer it builds internally. Known gap: the outline overlay does not yet follow isolate/hide/ghost the way the mesh does. Reach for BIMLayer when the model is fixed and known ahead of time; reach for ifc-loader when a visitor picks the file or several models need to federate. IN-BROWSER IFC: `loadIfc(bytes)` parses an `.ifc` with web-ifc (WASM, MPL-2.0, CDN-fetched on first use — NOT a package dependency; `configureIfc({wasmPath})` self-hosts) and returns `{tilesetUrl, edgesUrl, loadOptions, features (rows carry `ifcClass`/`name`/`material`/`container`/`netVolume`/`spatialPath`/`typePath`/`systemPath`/`classificationPath` — hierarchy columns joined by U+001F that the model trees navigate, each emitted only when the file populates it), lonLat, georeferenced, heading, scale, originSource, headingSource, stats, timings, bounds, revoke()}`; the output IS a tileset so picking/styling/`site-*`/isolate-hide-ghost work unchanged. CALL `revoke()` when swapping models — blob URLs are held by the document. FEDERATION: pass the first model's returned `origin` as `LoadIfcOptions.origin` for every later model of the same building, or each is centred on its own bounding box and they drift apart — a clash pass then finds nothing, which looks identical to a clean model. `ifc-loader` shares one origin AND one placement (`site-origin`/`site-heading`/`site-scale`) per map automatically — discipline files routinely declare IfcSite coordinates kilometres apart for the same building, so the first model loaded decides where it goes and the rest follow (`independent` opts out). Every element also carries a tile-local bounding box in the property table (`bboxMinE`/`bboxMinN`/`bboxMinU`/`bboxMaxE`/`bboxMaxN`/`bboxMaxU`). POSITION is read from the file preferring the trustworthy route: `IfcMapConversion` (a surveyed placement into a named projected CRS) WINS over `IfcSite.RefLatitude`/`RefLongitude`, which is very often an authoring default; `originSource` reports which was used, and anything other than `"map-conversion"` raises a structured `"warning"` through the same validation channel other `om-layer` errors use (the on-page panel with `validate` set, `om-validation-error`'s `detail.warnings`) for both `BIMLayer` and `ifc-loader`, once per layer — it never flips `valid` false, only flags the position may be off by tens of metres with no rotation correction applied; override with `site-origin`/`site-heading` or a proper `IfcMapConversion`. Un-projecting a map conversion is supported for WGS84 UTM zones (EPSG:326xx/327xx) and DECLINED with a warning for anything else — a guessed projection lands the model in another country while looking plausible. Eastings/northings are in the target CRS unit, frequently MILLIMETRES. Reading a file correctly and the model being somewhere sensible are SEPARATE problems: all three prepared samples declare placeholders (clinic on Revit's Boston default, which is a 1630 graveyard; duplex on a Chicago city-centre point; bridge — which does carry a real IfcMapConversion — into the mid-Pacific). `headingSource` distinguishes "map-conversion"/"true-north" (read) from "assumed" (file was silent) — report the assumption, never let it read as a measurement. `<om-map>` reads camera attributes ONCE at init, so `setAttribute("center", …)` after mount moves nothing: use `map.flyTo(lonLat, zoom)`. GEOREFERENCING is declarative on `Tile3DLayer` and `PathLayer`: `site-origin="[lng, lat]"` (or `[lng, lat, elevation]`) OVERRIDES the position baked into a tileset's root transform, `site-heading` is a bearing in degrees CLOCKWISE from true north (on its own it rotates the model where it stands), `site-scale` is a uniform multiplier; rotation and scale pivot on the model's own anchor, not the tileset origin. An IFC model is a PAIR of layers — the mesh tileset plus a `PathLayer` outline overlay whose paths are local east/north/up METRES — and both need the same three values or the building separates from its own edges. Never trust a model's declared position without looking at it: authoring tools ship a default project location that is indistinguishable from a survey (the buildingSMART Medical-Dental Clinic sample carries Revit's Boston default, the Duplex a Chicago city-centre point, so both land on occupied downtown blocks at an arbitrary rotation), `IfcMapConversion` is absent from most IFC2x3 exports, and `TrueNorth` is routinely unset. Editing `site-*` on a live Tile3DLayer reloads the tileset (deck.gl only reloads on a URL change); the PathLayer updates as a uniform. GeoTIFF/COG rasters use `type="COGLayer"` with `src="./dem.tif"` (NOT `data` — rasters stream tiles by Range request, they are not parsed rows). COG v2 surface (0.7.0): `bands` selects 1-based bands — one (`bands="4"`, colormap-eligible) or an `[r,g,b]` triple (`bands="[8,4,3]"`, false-color composite); band switches NEVER refetch (the decode is retained; textures re-upload from memory). `min`/`max` set the rescale window — a number broadcasts, a triple pairs per-band with a `bands` triple; `rescale="auto"` reads the window from GDAL statistics tags (coarsest-overview sample fallback, with a warning that the window is data-derived); non-8-bit sources with NO styling attrs auto-stretch automatically now (the "my COG is blank" fix — a dev notice reports the derived window; author min/max for stable styling). `colormap` picks a bundled ramp for single-band sources (gray, viridis, plasma, inferno, magma, cividis, rdylgn, rdbu, spectral, terrain, jet, turbo, ylorrd), `reverse` flips it, `stretch="log|sqrt"` and `gamma="1.8"` shape the display curve, `nodata` overrides the source sentinel (renders transparent). Plain 8-bit RGB COGs need no styling attributes; paletted GeoTIFFs render via their embedded color table and emit a classes legend when few palette entries are used. Every styling change is a GPU uniform (no refetch); the legend derives automatically (authored or auto window). PIXEL IDENTIFY: clicks/hovers over a COGLayer with no vector feature carry the pixel's per-band values through the ordinary selection — overlays/tooltips interpolate `{{value}}`, `{{values}}`, `{{band_1}}`…; `identify="off"` opts out (drops the CPU-retained decode — recommended for memory-tight WebViews; band switches on that layer then refetch tiles instead of re-uploading from memory). Source failures (CORS-refused Range requests, non-COG plain GeoTIFFs, out-of-range bands) surface as structured validation errors with fix strings instead of a silent blank layer. Sources should be Cloud-Optimized (`gdal_translate -of COG`; plain GeoTIFFs render with a warning, re-reading the full image per view).
|
|
40
40
|
- SHADED RELIEF: `<om-layer id="relief" type="HillshadeLayer" src="terrarium">` shades a DEM on the GPU. It is a LAYER, not a mode of `terrain=` — `terrain=` raises a 3D surface, replaces the basemap and means nothing at pitch 0, while relief is a flat raster that composes under your data AND, being inside deck's framebuffer, is captured by `snapshot()` and treated by `<om-effect>` (a MapLibre basemap would not be). `src` is REQUIRED and takes a registered terrain preset (`terrarium`, `mapterhorn` — both keyless and global) or a raw `{z}/{x}/{y}` template plus `decoder="terrarium|mapbox-rgb"|{rScaler,gScaler,bScaler,offset}` JSON; a raw template with no `decoder` is a validation warning, because reading mapbox-encoded heights as terrarium yields smooth plausible relief that is ~25x wrong. Keyless means no key, not no attribute — name the source the way `basemap="positron"` and `terrain="terrarium"` are named. THE SUN IS A LIST: `sun-azimuth="315 45 135"` blends one to four lights (° clockwise from north, `scene-lighting`'s convention — same numbers as `lighting-sun-azimuth`, but NOT coupled to it), `sun-weight="3 1 1"` weights them (normalized for you, equal if omitted). There is deliberately no `multi-directional` boolean: a shorthand must never reach capability the tier below cannot express, and the azimuths want choosing for the terrain. Other knobs: `sun-elevation` (default 45, must be strictly between 0 and 90), `z-factor` (vertical exaggeration), `blend="normal|multiply"` (multiply lets relief read UNDER fills rather than greying them — it needs something beneath it, which is why normal is the default), `opacity`, `max-zoom`, `zoom-offset`. Every illumination knob is a UNIFORM: moving the sun rebuilds no tile and fetches nothing. Correctness the author does not have to think about: tile edges are seamless (each tile is decoded with a one-pixel apron from its eight neighbours — clamping instead collapses the derivative and draws a pale grid over the world), latitude is corrected PER FRAGMENT (Web Mercator metres-per-pixel falls off with cos-phi), tile zoom follows the capture pixel ratio so a 300 dpi plate is not upscaled screen relief, and `terrain-exaggeration` is never read through (display transform vs true ground). DEM tiles must be PNG or LOSSLESS WebP — heights live in the RGB bytes, so a lossy codec invents terrain (one warning per host). The layer + GLSL are a lazy chunk: a map with no relief downloads none of it. SECOND ENTRY POINT — YOUR OWN DEM: `shading="hillshade"` on a `COGLayer`/`ZarrLayer` shades that raster in place with the same `sun-azimuth`/`sun-weight`/`sun-elevation`/`z-factor` attributes. Relief runs LAST in the styling chain, so it MULTIPLIES onto a `colormap` instead of replacing it — `colormap="terrain" shading="hillshade"` is a hypsometric tint with relief through it as ONE layer, not two; with no colormap, relief is drawn alone. It reads ONE band as elevation (the first selected), so a `bands` triple warns. Ground scale comes from the file's own geotransform + CRS units, so UTM metres, state-plane feet and degrees all work — a geographic source is ANISOTROPIC (a longitude degree shrinks with cos-phi, a latitude degree does not) and that is corrected per fragment. CAVEAT: `identify="off"` cannot free memory while shading is on, because the seamless-edge apron reads neighbouring pixels on the CPU — the validator flags the combination rather than letting the flag look like it worked. Deep reference: docs/hillshade.md. Slope/aspect as queryable VALUES stays deliberately out of scope — this ships rendered texture, never an analytic product.
|
|
41
|
-
- CARTOGRAPHY (projections, geometry transforms, vector export): `crs="EPSG:5070"` on `<om-map>` puts the WHOLE renderer in that projection's plane — parallels curve, an equal-area projection is genuinely equal-area. Web Mercator and plate carree 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)`. THE AUTHORED CAMERA STAYS GEOGRAPHIC: `center` is lng/lat and `zoom` means what it always meant, so stories, `seek()` and `getCamera()` are unchanged, and clicks report lng/lat rather than plane metres (a projected metre in a geodesic formula returns a confident wrong distance). Limits are validation ERRORS with fixes, never silent no-ops: no MapLibre basemap (use `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. RELIEF WORKS on a projected sheet both ways: a DEM of your own has no projection tie, and the keyless `HillshadeLayer` re-indexes its Mercator tiles from the plane's own geography and draws them as subdivided warped meshes (sub-pixel — 0.40 output px for Albers at z=3, falling as 1/N^2). `sun-datum="sheet"` (default) keeps apparent light constant across the plate; `"geographic"` is physically true; the swing is 34 degrees across a CONUS sheet and the attribute is inert in Mercator (the validator says so). GEOMETRY TRANSFORMS: `<om-transform type="simplify|smooth|dot-density|buffer|contour">` as 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. Spatial knobs are MILLIMETRES ON PAPER resolved against a declared `reference-scale="1:50000"` (a cartograph frame supplies its own); a millimetre with no scale is an error naming the fix, because geometry runs once at ingest and cannot be re-resolved per frame the way an effect's uniforms can. Ground units (`tolerance="50m"`) need no scale. `simplify` is Douglas-Peucker measured on the GROUND, not in degrees. `smooth` is Chaikin, 1 pass removes the straight-segment look. `dot-density field="population" per="1000"` is seeded, so a recorded story and a live map place the same dots. `buffer distance="0.9mm" repeat="5" fade` is the engraved shoreline of an old chart: N bands are N thresholds of ONE signed distance field, so five cost what one costs and the output CANNOT self-intersect (no polygon arithmetic ever happens); each band carries `_band` and `_bandOpacity`, outermost first. It is an ORNAMENT with a measured half-cell bound (0.042mm at 300dpi), NOT an analytic setback — asking for the latter is an error naming PostGIS. `contour src="terrarium" bounds="[w,s,e,n]" interval="100m"` marches isolines 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, each line carries `elevation` and `index` (true every fifth line), and the interval is a ground height — `interval="2mm"` is an error. Columnar layers are out of scope and say so. A LABEL THAT FOLLOWS ITS LINE is `<om-layer type="TextOnPathLayer" get-path="$path" get-text="$name">` — a river's name down 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. Add `pickable` for clickable labels: a pick reports the label's row (not a glyph), so `{{field}}` popups work (0.11.6+). `get-path` and `get-text` are both REQUIRED (either alone is silently inert, and the validator says so); `get-path` must resolve to a COORDINATE LIST: on GeoJSON that is `get-path="d.geometry.coordinates"`, because a `$field` compiles to `properties.<field>` and `$geometry` yields the geometry OBJECT, dropping every label silently (a `$field` is right only for FLAT rows carrying the list, e.g. `get-path="$path"`); `letter-spacing="1.5"` tracks glyphs out in pixels (the convention for oceans and ranges), `offset="5"` moves the label perpendicular with POSITIVE to the LEFT of the line's direction, `placement="auto"` (the DEFAULT) searches the line for the straightest reach the name fits on rather than pinning it to the midpoint — on real rivers a midpoint label routinely lands on a bend and wraps it; `start|middle|end` opt out when a name belongs somewhere specific. `max-angle="45"` is the legibility limit in degrees between adjacent glyphs (MapLibre's `text-max-angle` default); when no reach satisfies it the label is STRAIGHTENED rather than dropped. `orientation="curve|chord"` — `chord` lays the whole name straight along its span, angled to the line's direction, for data too jagged to follow. `max-labels` caps the glyphs emitted. It READS LEFT TO RIGHT whichever way the line was digitised — a path's direction is an accident of the data, so the layer flips the path and `start`/`end` flip with it. A name that does NOT FIT its line is dropped, not compressed and not run off the end. Placement is computed in SCREEN PIXELS and redone 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. The SVG export emits ONE `<textPath>` per label rather than per-glyph `<text>`. VECTOR EXPORT: `await map.snapshot({format: "svg"})` returns SVG TEXT (`as:"blob"` for a file) — polygons/paths as `<path>`, labels as real `<text>` after a deterministic CPU decluttering pass, and anything whose appearance is pixels as a placed raster `<image>`; consecutive raster layers merge into one band and a vector layer between them keeps them apart. A print finish treats the FINISHED frame, so a sheet carrying one exports as a single band at `effectDpi` (default 600, changes the band's pixel dimensions not its scaling) and reports it through `onNotice`; a decluttering layer does NOT trigger that (the test is a real post-process pass, not "deck has effects"). FREEZE: `await frame.freeze({format: "svg"})` turns a cartograph frame static with an inline `<svg>`, placed by the same `crs`+`corners` — a frozen sheet opens with no runtime, no network and nothing defining its custom elements. Deep reference: docs/cartography.md.
|
|
41
|
+
- CARTOGRAPHY (projections, geometry transforms, vector export): `crs="EPSG:5070"` on `<om-map>` puts the WHOLE renderer in that projection's plane — parallels curve, an equal-area projection is genuinely equal-area. Web Mercator and plate carree 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)`. THE AUTHORED CAMERA STAYS GEOGRAPHIC: `center` is lng/lat and `zoom` means what it always meant, so stories, `seek()` and `getCamera()` are unchanged, and clicks report lng/lat rather than plane metres (a projected metre in a geodesic formula returns a confident wrong distance). Limits are validation ERRORS with fixes, never silent no-ops: no MapLibre basemap (use `basemap="none"`), no vector/terrain/3D tile layers (`MVTLayer`, a `.pbf` TileLayer, `TerrainLayer`, `Tile3DLayer`), 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. RELIEF WORKS on a projected sheet both ways: a DEM of your own has no projection tie, and the keyless `HillshadeLayer` re-indexes its Mercator tiles from the plane's own geography and draws them as subdivided warped meshes (sub-pixel — 0.40 output px for Albers at z=3, falling as 1/N^2). `sun-datum="sheet"` (default) keeps apparent light constant across the plate; `"geographic"` is physically true; the swing is 34 degrees across a CONUS sheet and the attribute is inert in Mercator (the validator says so). A GLOBE is `projection="globe"` on `<om-map>` (preview), NOT a crs: it needs a basemap (`basemap="satellite"` is keyless; MapLibre draws the sphere), zoomed in it becomes the flat map by itself, layers and center/zoom are unchanged, and it switches live (`set-projection {projection: "globe" | "mercator"}`; a basemap switch keeps it). Overlays on the far side hide and a click in space reports `coordinate: null`. A globe is flat-on and north-up (no pitch/bearing). Validation ERRORS, each with a fix: crs, terrain/TerrainLayer, basemap="none", TextLayer/IconLayer/TextOnPathLayer/PopupLayer (labels go in `<om-overlay anchor>`), ArcLayer/GreatCircleLayer (a PathLayer through points along the great circle), Heatmap/Hexagon/Grid/ScreenGrid/Contour (pre-aggregate to polygons), and a globe inside a cartograph frame; a clustered layer WARNS (counts are text and do not draw). IMAGE TILES WORK on a projected sheet too, so a raster basemap is a LAYER: keep `basemap="none"` and add `<om-layer type="TileLayer" data="…/{z}/{x}/{y}.jpg">` (`.png`/`.jpg`/`.jpeg`/`.webp`), warped onto the plane like relief. `basemap="satellite"`/`"osm"` on a projected map stays an error whose fix is that preset's own tiles as this layer — the map never swaps a basemap for you. Credit authored tiles yourself (`<om-widget type="attribution" text="…">`, which the error's fix spells out); the map credits only basemaps it picks. GEOMETRY TRANSFORMS: `<om-transform type="simplify|smooth|dot-density|buffer|contour">` as 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. Spatial knobs are MILLIMETRES ON PAPER resolved against a declared `reference-scale="1:50000"` (a cartograph frame supplies its own); a millimetre with no scale is an error naming the fix, because geometry runs once at ingest and cannot be re-resolved per frame the way an effect's uniforms can. Ground units (`tolerance="50m"`) need no scale. `simplify` is Douglas-Peucker measured on the GROUND, not in degrees. `smooth` is Chaikin, 1 pass removes the straight-segment look. `dot-density field="population" per="1000"` is seeded, so a recorded story and a live map place the same dots. `buffer distance="0.9mm" repeat="5" fade` is the engraved shoreline of an old chart: N bands are N thresholds of ONE signed distance field, so five cost what one costs and the output CANNOT self-intersect (no polygon arithmetic ever happens); each band carries `_band` and `_bandOpacity`, outermost first. It is an ORNAMENT with a measured half-cell bound (0.042mm at 300dpi), NOT an analytic setback — asking for the latter is an error naming PostGIS. `contour src="terrarium" bounds="[w,s,e,n]" interval="100m"` marches isolines 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, each line carries `elevation` and `index` (true every fifth line), and the interval is a ground height — `interval="2mm"` is an error. Columnar layers are out of scope and say so. A LABEL THAT FOLLOWS ITS LINE is `<om-layer type="TextOnPathLayer" get-path="$path" get-text="$name">` — a river's name down 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. Add `pickable` for clickable labels: a pick reports the label's row (not a glyph), so `{{field}}` popups work (0.11.6+). `get-path` and `get-text` are both REQUIRED (either alone is silently inert, and the validator says so); `get-path` must resolve to a COORDINATE LIST: on GeoJSON that is `get-path="d.geometry.coordinates"`, because a `$field` compiles to `properties.<field>` and `$geometry` yields the geometry OBJECT, dropping every label silently (a `$field` is right only for FLAT rows carrying the list, e.g. `get-path="$path"`); `letter-spacing="1.5"` tracks glyphs out in pixels (the convention for oceans and ranges), `offset="5"` moves the label perpendicular with POSITIVE to the LEFT of the line's direction, `placement="auto"` (the DEFAULT) searches the line for the straightest reach the name fits on rather than pinning it to the midpoint — on real rivers a midpoint label routinely lands on a bend and wraps it; `start|middle|end` opt out when a name belongs somewhere specific. `max-angle="45"` is the legibility limit in degrees between adjacent glyphs (MapLibre's `text-max-angle` default); when no reach satisfies it the label is STRAIGHTENED rather than dropped. `orientation="curve|chord"` — `chord` lays the whole name straight along its span, angled to the line's direction, for data too jagged to follow. `max-labels` caps the glyphs emitted. It READS LEFT TO RIGHT whichever way the line was digitised — a path's direction is an accident of the data, so the layer flips the path and `start`/`end` flip with it. A name that does NOT FIT its line is dropped, not compressed and not run off the end. Placement is computed in SCREEN PIXELS and redone 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. The SVG export emits ONE `<textPath>` per label rather than per-glyph `<text>`. VECTOR EXPORT: `await map.snapshot({format: "svg"})` returns SVG TEXT (`as:"blob"` for a file) — polygons/paths as `<path>`, labels as real `<text>` after a deterministic CPU decluttering pass, and anything whose appearance is pixels as a placed raster `<image>`; consecutive raster layers merge into one band and a vector layer between them keeps them apart. A print finish treats the FINISHED frame, so a sheet carrying one exports as a single band at `effectDpi` (default 600, changes the band's pixel dimensions not its scaling) and reports it through `onNotice`; a decluttering layer does NOT trigger that (the test is a real post-process pass, not "deck has effects"). FREEZE: `await frame.freeze({format: "svg"})` turns a cartograph frame static with an inline `<svg>`, placed by the same `crs`+`corners` — a frozen sheet opens with no runtime, no network and nothing defining its custom elements. Deep reference: docs/cartography.md.
|
|
42
42
|
- Geotagged drone JPEGs are the library-owned `ImageOverlay` type, not row `data` and not a raw `BitmapLayer`: `<om-layer type="ImageOverlay" src="./photo.jpg" georeference="exif">`. It reads GPS/relative altitude/camera/focal length plus DJI gimbal metadata through the configured fetch policy, waits before `ready`, bakes yaw/roll, and computes visualization-grade flat-ground bounds. Unknown cameras need `sensor-width-mm` + `sensor-height-mm` (and `focal-length-mm` when EXIF lacks it). For collaborative/saved maps call `OmMap.resolveImageOverlay(fileOrUrl)`, upload its returned `image`, then reconstruct using `src` + the returned explicit `bounds` (no EXIF fetch). Use `COGLayer` for large orthomosaics; see docs/image-overlays.md.
|
|
43
43
|
- Chunked N-dimensional Zarr / GeoZarr rasters (climate/weather grids, datacubes) are the library-owned `ZarrLayer` type (built on `@developmentseed/deck.gl-zarr` + zarrita, a lazy chunk): `<om-layer type="ZarrLayer" src="./x.zarr" variable="temp" select="time=0" colormap="viridis" min="…" max="…">`. `src` not `data` (chunks stream through the layer's reader, never parsed rows). Pick the `variable` and pin EVERY non-spatial dimension in `select` ("init_time=0, lead_time=0, ensemble_member=0"); the two spatial dims are handled for you (a 2-D array needs no select). A GeoZarr-compliant store georeferences itself; a plain Zarr needs manual `bounds="[w,s,e,n]"` + `crs="EPSG:4326"` + `spatial-dims="<yName> <xName>"` (bounds without crs+spatial-dims is a validation error). `min`/`max`/`colormap`/`nodata` and the auto legend reuse the exact COGLayer raster pipeline. Beware store chunking: a dataset chunked coarsely over non-spatial dims (e.g. all forecast steps in one chunk) decodes far more than the pinned frame needs. `src` may be any absolute URL (`https://…/store.zarr`) — an external/remote store works with no server setup (a static host serves Zarr's extensionless chunk keys natively), but zarrita fetches it directly from the browser so the store MUST send CORS headers (`Access-Control-Allow-Origin`), and it must be PUBLIC — authenticated stores are not yet supported (ZarrLayer uses zarrita's own fetch, not `OmMap.configureData`).
|
|
44
44
|
- `<om-widget type="legend|layer-switcher|basemap-switcher|lighting|clip-box|zoom-controls|undo-redo|scale-bar|attribution|filter|vega-lite|dynamic-chart|measure" position="bottom-end">` — static UI panels. `position` takes one of 8 managed slots (logical, RTL-aware: `top-start|top-center|top-end|center-start|center-end|bottom-start|bottom-center|bottom-end`; legacy corners `top-left` etc. alias) — same-slot widgets stack with flush edges and a shared gap (never overlap); provider attribution joins `bottom-end` and the license badge joins `bottom-start` as in-flow members, so required chrome never covers a widget; `order="1"` orders within a slot; adjacent compact button widgets (zoom-controls, undo-redo, widgets-toggle) auto-merge into ONE control group with dividers (`cluster="false"` opts a widget out); `position="manual"` renders a plain block you place with your own CSS (even outside the map). At narrow map widths managed widgets auto-fold into one accessible drawer per map side — at ≤640px when some row (top/center/bottom) has widgets on more than one of its slots, and only at ≤416px when every occupied row is one-sided (a lone legend at center-start keeps the row to itself and survives narrower maps); `fold="never"` exempts an essential widget, `widgets-fold="off"` opts the map out, `--om-widget-fold-breakpoint` changes the threshold. Layout tokens on `<om-map>`: `widget-style="gap:10 opacity:0.9 inset:16"` (keys inset/gap/inset-x/-y/gap-x/-y/opacity/radius/size, px except opacity) or the `--om-widget-inset-x/-y/-gap-x/-gap-y/-opacity/-radius/-fold-breakpoint` custom properties. Built-ins are themeable from page CSS via custom properties (they inherit through the shadow root): `om-map { --om-widget-bg: #111827; --om-widget-fg: #f9fafb; }` — full set: `--om-widget-bg/-fg/-muted/-border/-hover-bg/-accent`; scope to a single widget with an `om-widget[type=legend]` selector instead. `measure` is a geodesic ruler: `modes="distance area volume"` (default `distance area`), `units="metric|imperial|nautical"` — click the map to place points, live per-segment + total labels render on the map, and it dispatches an `om-measure` event; it reuses the draw capture stack (measure/draw mutually exclusive) and its geometry is ephemeral (never saved, not an undo step) — see the dedicated `measure`/`volume` bullet above for the full event shape and the `profile`/`density`/`swell`/`shrink`/`deadband` volume-mode attributes. `scale-bar` now takes the same `units`. `dynamic-chart` is the same Vega-Lite rendering as `vega-lite` but fed by a live DOM event instead of a layer: `on="<event-name>"` (required) + `series-field="<name>"` (default `series`) reads `event.detail[seriesField]` as `data.values` and re-embeds on every event where it's a present array, at a fixed `width`; omitting the field on a later event freezes the chart with no separate pause API — built for a feature (a drawn line's elevation profile) that computes its own series live and has no layer to bind to. No `type` + HTML + `<script type="om/widget">` = custom widget with `ctx` (`ctx.layers`, `ctx.data(id)`, `ctx.dataInViewport(id)`, `ctx.stats(id, field)`, `ctx.viewport`, `ctx.selection`, `ctx.emit(action, payload)`), `this.watch = ['data:<layerId>', 'viewport', 'selection', 'layers', 'history', 'basemap']` (`layers` also fires on visibility/filter changes; `basemap` on basemap switches; `history` on undo/redo availability), `this.$(sel)`, `vegaEmbed`/`d3` as globals.
|
|
@@ -56,6 +56,7 @@ Programmatic/native bridge rule: `MapController.setLayers()` accepts normal func
|
|
|
56
56
|
- Load-paced ("clean") flyby: `<om-story paced>` steps its own clock frame by frame (optionally `paced="60"` story-fps, default 30), drives the camera itself along the fly-to route, and never advances while any 3D tileset is still refining — NO frame ever shows unrefined tiles, at the cost of wall-clock time (playback is not real-time; use for recorded takes or heavy tilesets — Google Photorealistic 3D Tiles — where no pre-warm fits the flight in cache). Per-frame `om-paced-tick` on the story (`detail = {t, waitedMs}`; `waitedMs > 0` = that frame paused for tiles). Composes with `warm-tiles` (warm first → shorter waits). Paced runs: only `fly-to` steps steer the camera (`zoom-to-feature` etc. are skipped with a warning), and user gestures do NOT pause playback — use the player widget or `story-pause`. VIDEO OUTPUT: `npx onlymapjs record map.html --out flyby.mp4` (needs dev-installed playwright; ffmpeg for assembly, else PNG frames + the command to run) plays the story paced in headless Chromium and writes a video where every frame is fully refined — widgets/overlays/attribution included; options `--story/--fps/--width/--height/--scale/--gpu/--keep-frames/--timeout/--max-hold` (`--gpu` = hardware rendering instead of headless software GL — ~3× shorter tile holds on heavy 3D scenes, recommended); frames survive a deadline hit in `<out>.frames/` for salvage. Per-frame tile waits are capped by `paced-max-hold` on `<om-story>` (duration grammar, default 10s; `--max-hold` sets it) — frames that keep hitting the cap may stay slightly blurry; raise it, or set `"none"` (`--max-hold none`) for an absolute gate: guaranteed-sharp takes, only the overall timeout bounds the run. Custom recorders: `storyEl.setPacedCapture(async (tick) => {...})` — awaited per frame BEFORE that frame's om-paced-tick, so capture is race-free and the ended-state tick means all frames captured. Effect verbs (fade/pulse/trace/populate) animate on the STORY clock during paced runs — recorded frames capture traces half-drawn and fades mid-flight exactly as authored (`trace follow` is skipped; the paced route owns the camera).
|
|
57
57
|
- `<om-story id="tour" autoplay loop interrupt="pause|ignore">` — a storyboard of `<om-step>` children. Each step: `action="..."` + payload attributes (same kebab-case rule as behaviors) + `duration`/`delay`/`parallel` timing. Steps REFERENCE layers/overlays by id (`layer=`/`target=`) — a step must NEVER contain elements (validation error). Control: `<om-widget type="player" story="tour">`, the story-play/story-pause/story-seek actions, or `storyEl.play()/pause()/seek(ms)`. Seeking restores initial state then applies steps before T; use declarative payloads (e.g. `action="toggle-layer" visible="true"`, not bare toggles) so scrubbing is deterministic. Scene actions are story-steppable AND scrub-capturable: `set-basemap`, `set-lighting` (a sunset story: steps walking sun-elevation down; a bare preset step is a clean reset), and `set-terrain` all rewind on seek — the story captures the map's scene attributes before first play. Effect verbs as bare step attributes: `<om-step fade layer="regions" duration="1s">` (opacity reveal — start the layer at `opacity="0"`), `pulse` (attention flash), `trace` (progressive draw — whole-layer needs a TripsLayer; add `feature-id="..."` to make ONE polygon/line draw itself on inside any layer, or use it from a click behavior for click-to-trace), `populate` (rows drop in one by one — ordered by the authored filter-field, a payload `field`, or data order).
|
|
58
58
|
- Hover picking & the pointer cursor: hovering a pickable feature shows `cursor: pointer` automatically (the is-this-interactive affordance; `pick-cursor` on `<om-map>` overrides the cursor value, `pick-cursor="none"` disables). Hover GPU picks are REST-DEBOUNCED by default — one pick when the pointer stops moving, none while it sweeps — which eliminates the per-mousemove GPU ReadPixels stall that made hover popups freeze integrated-graphics machines (measured ~1.1s of main-thread stall per move on real layers). `hover-pick` on `<om-map>` tunes it: `"rest"` (default), `"continuous"` (deck-native per-frame — for hover-follow UIs on capable hardware), `"off"` (click picking only), or a throttle interval in ms (leading + trailing). Click picking is never gated.
|
|
59
|
+
- Data in a local grid (eastings/northings: British National Grid, SVY21, State Plane, UTM) is converted to lng/lat at load. A file that names its CRS needs nothing (shapefile `.prj`, FlatGeobuf/GeoParquet header, legacy GeoJSON `crs` member); otherwise declare it on the layer, which also overrides the file: `crs="EPSG:27700"` (or `crs-def="+proj=…"` for a grid with no code). Typical: `<om-layer type="ScatterplotLayer" data="./sites.csv" crs="EPSG:3414" get-position="[$easting, $northing]">`. Never guessed: big coordinates with no CRS → a diagnostic naming the fix; a declared grid on degree data → a warning. 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 (GeoTIFF/Zarr layers make the same lookup), `OmMap.configureCrs({ online: false })` turns that off. `crs` on a LAYER = what the data is in; `crs` on `<om-map>` = the projection the map is drawn in; they combine.
|
|
59
60
|
- Zoom visibility: `visible-zoom-range="[8, 14]"` on ANY layer type — scale-dependent visibility (hidden outside min ≤ zoom < max, the minzoom/maxzoom convention; the tile-only visible-min-zoom/visible-max-zoom deck props remain tile-layer-specific). Composes with `visible`; a zoom-hidden layer stays in the legend/switcher/ctx. For CI that emits om-layer markup, validate attributes per layer type against the shipped `onlymapjs.attributes.json` (generated from the same registry the runtime checks — `universal` + `layers[<type>]`), not the flat per-tag union in the IntelliSense html-data file. Also: a layer whose REQUIRED position accessor resolves undefined for every row (e.g. a TextLayer fed GeoJSON with no get-position) now warns at runtime with the exact fix (`get-position="$geometry.coordinates"`) instead of silently drawing nothing.
|
|
60
61
|
- Clustering: `cluster="true"` on a `ScatterplotLayer`, `GeoJsonLayer` (Point features) or `IconLayer` merges points that would overlap into count bubbles that split as the reader zooms in — a toggle, NOT a separate layer type; the layer keeps its id, data, its own `get-*` symbology for standalone points, picks and actions. Options use MapLibre's names: `cluster-radius` (px, 50), `cluster-max-zoom` (16), `cluster-min-points` (2). `cluster-properties="sum:f,max:f,mean:f,mode:f,first:f"` puts `$sum_f`/`$mode_f`/`$first_f`… on every bubble beside `$count` (`first` = the earliest member's value in data order, any type); style bubbles with `get-cluster-radius` / `get-cluster-fill-color` / `get-cluster-line-color` / `get-cluster-label`, and put an IMAGE on a bubble with `get-cluster-icon="$first_photo"` — a URL draws as a circular thumbnail ringed in the bubble's fill (needs CORS; a loading or failed image leaves the circle), a name draws a glyph from `cluster-icon-atlas`/`cluster-icon-mapping`. Over an image, make the count a badge: `cluster-label-position="top-right"` (or any edge/corner; default `center`) + `cluster-label-background="#111827"` (a pill; absent = a dark halo), with `cluster-label-color`/`cluster-label-size`; `cluster-label="false"` hides it. Every bubble also carries `$count_max` and `$<agg>_max` (the largest at the CURRENT zoom) — divide by them so a ramp stays meaningful at every zoom; the default radius is `scale($count / $count_max, sqrt, [12, 36], domain=[0, 1])`. A click on a bubble flies (eased) to where it splits (`cluster-click="none"` opts out; action `expand-cluster`); bubble picks carry `cluster: true`, `count`, `cluster_id` and the aggregates into overlays — give bubbles and points separate behaviors with `pick="cluster"` / `pick="point"` (a template cannot branch, so one shared card would open half-empty for bubbles); `map.clusterLeaves(layerId, clusterId)` lists the rows inside; `ctx.layers[i].cluster` says whether the toggle is on, and `set-layer-attribute {layer, name: "cluster", value}` flips it from a widget. Point data only (lines/polygons refuse with a structured error); not on projected (`crs=`) sheets. Bubbles far out and icons close in = two layers over the same file with complementary `visible-zoom-range`s (`[0, 12]` clustered with `cluster-max-zoom="11"`, an `IconLayer` on `[12, 24]`).
|
|
61
62
|
- Filtering: `filter-field="magnitude" filter-range="[4, 10]"` on a layer (GPU-side, live-updatable via the `filter-layer` action); pair with `<om-widget type="filter" layer="..." field="...">`. For an epoch-millisecond field, make the slider labels readable with `<om-widget type="filter" layer="quakes" field="time" format="date" date-style="datetime" time-zone="UTC"></om-widget>`. Up to 4 numeric dimensions at once via `filter-fields='[{"field":"magnitude","range":[4,10]},{"field":"time","range":[…]}]'` (JSON array, additive to filter-field/filter-range — wins if both are authored) — one `<om-widget type="filter">` per field, each moves its own dimension independently (filter-layer merges the range onto the matching field rather than replacing the whole filter); a row must pass every active dimension (AND). A dimension can't be added live — the full set is declared up front in filter-fields. Categorical filtering is a SEPARATE mechanism (deck.gl's own discrete keep-list test, not a range) with its own attributes: `filter-category="fuel" filter-categories='["Coal","Gas"]'` (single) or `filter-category-fields='[{"field":"fuel","categories":[...]},...]'` (up to 4); the SAME `<om-widget type="filter">` auto-renders checkboxes instead of a slider when its `field` is declared categorically (mode is inferred from the layer's own filter, never a separate widget attribute) — one checkbox per distinct value present in the data, with its row count. A category dimension with no keep-list is dropped from the active filter (there is no "matches everything" category the way a numeric range has [-Infinity, Infinity]). Numeric and categorical filters on the same layer combine — a row must pass both. `ctx.stats`/`ctx.dataInViewport` respect whichever kind(s) are active by default (`{filtered:false}` opts out). CLASSIFIED SYMBOLOGY: `classify-by="<numeric field>"` (+ `classify-scale="quantile|equal-interval|jenks"`, `classify-classes="2-12"` default 5, `classify-ramp="viridis|plasma|inferno|magma|cividis|turbo|blues|greens|oranges|purples|reds|ylorrd|rdbu|spectral"`) computes class breaks FROM THE DATA at reconcile time, installs the fill-color accessor and the auto classes legend — use it when the user asks for graduated/choropleth styling WITHOUT hand-authoring domains; an authored get-fill-color/color always wins (validation warns on the conflict); URL-backed layers classify when their data arrives. TEMPORAL PLAYBACK: `<om-widget type="time-slider" layer="…" field="<numeric/epoch-ms field>" duration="20s" window="<span in field units>" loop format="date" date-style time-zone>` — play/pause/scrub emitting the ordinary filter-layer action (cumulative from the domain start, or a sliding window with `window`); manifest stays the source of truth so undo/story/external filter edits re-sync the thumb — prefer it over hand-rolling a playback loop.
|
package/onlymapjs.html-data.json
CHANGED
|
@@ -75,6 +75,18 @@
|
|
|
75
75
|
}
|
|
76
76
|
]
|
|
77
77
|
},
|
|
78
|
+
{
|
|
79
|
+
"name": "projection",
|
|
80
|
+
"description": "\"globe\" draws the Earth as a sphere you can spin, turning into a flat map as you zoom in (preview). Needs a basemap — MapLibre draws the sphere. Live: switch it on a mounted map, or with the set-projection action. Absent or \"mercator\" = the flat map. Not with crs, terrain, aggregation layers (heatmap, hexagon, grid, contour), or inside a cartograph frame.",
|
|
81
|
+
"values": [
|
|
82
|
+
{
|
|
83
|
+
"name": "globe"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "mercator"
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
},
|
|
78
90
|
{
|
|
79
91
|
"name": "basemap-key",
|
|
80
92
|
"description": "Provider API key for keyed basemap presets (maptiler-*) — publishable origin-restricted key; or call OmMap.configureBasemap once."
|
|
@@ -614,6 +626,14 @@
|
|
|
614
626
|
"name": "label",
|
|
615
627
|
"description": "Human-readable name shown in the legend and layer list."
|
|
616
628
|
},
|
|
629
|
+
{
|
|
630
|
+
"name": "crs",
|
|
631
|
+
"description": "What the data's coordinates are in, e.g. \"EPSG:27700\" (British National Grid) or \"EPSG:3414\" (SVY21) — converted to longitude/latitude when the data loads. Overrides the file's own CRS (a shapefile .prj, a FlatGeobuf or GeoParquet header, a GeoJSON crs member); absent, the file decides. An unbundled EPSG code is looked up at epsg.io once (OmMap.configureCrs({ online: false }) turns that off)."
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
"name": "crs-def",
|
|
635
|
+
"description": "A +proj= definition for a CRS nothing bundles or registers, beside crs (or alone)."
|
|
636
|
+
},
|
|
617
637
|
{
|
|
618
638
|
"name": "color",
|
|
619
639
|
"description": "Shorthand fill color (hex or CSS color) — also the legend swatch."
|
|
@@ -1528,10 +1548,6 @@
|
|
|
1528
1548
|
"name": "select",
|
|
1529
1549
|
"description": "deck.gl select. Valid on: ZarrLayer."
|
|
1530
1550
|
},
|
|
1531
|
-
{
|
|
1532
|
-
"name": "crs",
|
|
1533
|
-
"description": "deck.gl crs. Valid on: ZarrLayer."
|
|
1534
|
-
},
|
|
1535
1551
|
{
|
|
1536
1552
|
"name": "spatial-dims",
|
|
1537
1553
|
"description": "deck.gl spatialDims. Valid on: ZarrLayer."
|
|
@@ -2418,6 +2434,9 @@
|
|
|
2418
2434
|
{
|
|
2419
2435
|
"name": "set-basemap"
|
|
2420
2436
|
},
|
|
2437
|
+
{
|
|
2438
|
+
"name": "set-projection"
|
|
2439
|
+
},
|
|
2421
2440
|
{
|
|
2422
2441
|
"name": "set-effect"
|
|
2423
2442
|
},
|
|
@@ -3035,6 +3054,9 @@
|
|
|
3035
3054
|
{
|
|
3036
3055
|
"name": "set-basemap"
|
|
3037
3056
|
},
|
|
3057
|
+
{
|
|
3058
|
+
"name": "set-projection"
|
|
3059
|
+
},
|
|
3038
3060
|
{
|
|
3039
3061
|
"name": "set-effect"
|
|
3040
3062
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nika-js/onlymap",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
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, 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), 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), 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
|
|
@@ -80,7 +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
|
-
- 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
|
+
- 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`, vector/3D tile layers, 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
|
+
- 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
|
+
- 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").
|
|
84
86
|
- 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.
|
|
85
87
|
- 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. Add `pickable` to make labels clickable — a pick reports the label's ROW, so `{{name}}` popups work (0.11.6+). Exports as one `<textPath>`. See docs/cartography.md.
|
|
86
88
|
- 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.
|