@nika-js/onlymap 0.13.3 → 0.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +8 -4
- package/dist/{basemap-5NHR6Gio.js → basemap-BiC_RwbV.js} +3 -7
- package/dist/basemap.d.ts +1 -5
- package/dist/bbox-tokens.d.ts +70 -0
- package/dist/{build-DJjheWZ2.js → build-DQCmcQE1.js} +1 -1
- package/dist/{client-0mQmDog8.js → client-C0CgEs_P.js} +2 -2
- package/dist/clip-box-controller.d.ts +0 -17
- package/dist/ctx.d.ts +15 -0
- package/dist/data-layer.d.ts +15 -8
- package/dist/dom-tile-layer.d.ts +30 -0
- package/dist/draw-controller.d.ts +1 -1
- package/dist/elements/om-map.d.ts +12 -1
- package/dist/feature-service.d.ts +42 -0
- package/dist/geodesy.d.ts +6 -5
- package/dist/{geoparquet-B_nO2OyP.js → geoparquet-DbVJrJYG.js} +1 -1
- package/dist/{globe-view-BFUa9ksE.js → globe-view-CrGbvqqZ.js} +1 -1
- package/dist/grid-tiles.d.ts +117 -0
- package/dist/{hillshade-B_CxPhtA.js → hillshade-CGY_OBaG.js} +2 -2
- package/dist/{hillshade-shader-r7GxxjXj.js → hillshade-shader-w8tmFgaV.js} +1 -1
- package/dist/{index-CU7RnKnO.js → index-2lD29y87.js} +25 -25
- package/dist/index-BahtHUrg.js +8458 -0
- package/dist/{index-DT5d7kFO.js → index-Bdltig68.js} +1 -1
- package/dist/{index-BvNxS6dM.js → index-ChoEWeXU.js} +1 -1
- package/dist/{index-A1FYw2dy.js → index-Cm2sfhw7.js} +1 -1
- package/dist/{index-DWijIMti.js → index-DrCMvhhr.js} +32340 -31035
- package/dist/{index-CObPGkze.js → index-Dtsf-TPD.js} +22 -22
- package/dist/{index-ChmxbIdj.js → index-GfvWJDX0.js} +36 -36
- package/dist/{index-YMu_yLXO.js → index-QrGqSW_H.js} +3 -3
- package/dist/{index-CgIuV5Oh.js → index-xF9sKoMB.js} +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/layer-registry.d.ts +1 -0
- package/dist/layers/warped-bitmap-layer.d.ts +14 -1
- package/dist/{lerc-Bl4vym9y.js → lerc-DxujwTm7.js} +1 -1
- package/dist/onlymap.standalone.js +68435 -58161
- package/dist/onlymapjs.js +21 -21
- package/dist/parse-manifest.d.ts +4 -1
- package/dist/plane-gpu/plane-basemap.d.ts +158 -158
- package/dist/plane-vector/plane-mvt-layer.d.ts +158 -158
- package/dist/plane-warp.d.ts +14 -1
- package/dist/pmtiles.d.ts +76 -0
- package/dist/{post-process-effect-gFGVlC77.js → post-process-effect-BL9rBDEh.js} +1 -1
- package/dist/programmatic.d.ts +17 -1
- package/dist/{raster-1ShXyF12.js → raster-Bq768NZr.js} +4 -4
- package/dist/{raster-pipeline-BMS54TX2.js → raster-pipeline-C898iYqw.js} +11 -11
- package/dist/runtime-core.d.ts +106 -4
- package/dist/{terrain-inspect-Cndlmxig.js → terrain-inspect-DNZO8z6S.js} +1 -1
- package/dist/{text-on-path-QInco4aP.js → text-on-path-owfh8Ac6.js} +1 -1
- package/dist/tile-url.d.ts +84 -16
- package/dist/time-dimension.d.ts +25 -0
- package/dist/vector-style-BlnKzVND.js +518 -0
- package/dist/vector-style.d.ts +59 -0
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-CYD8fyBe.js → zarr-CMWiR63-.js} +2 -2
- package/docs/cartograph.md +2 -2
- package/llms.txt +3 -3
- package/onlymapjs.attributes.json +15 -0
- package/onlymapjs.html-data.json +40 -0
- package/package.json +5 -2
- package/skills/onlymapjs/SKILL.md +9 -3
- package/skills/onlymapjs/references/syntax.md +36 -6
package/llms.txt
CHANGED
|
@@ -35,13 +35,13 @@ Programmatic/native bridge rule: `MapController.setLayers()` accepts normal func
|
|
|
35
35
|
|
|
36
36
|
## Element vocabulary
|
|
37
37
|
|
|
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, seabed included only to zoom 10 — above it the ocean decodes as 0 m, so a seafloor needs `terrain-max-zoom="10"`; also `mapterhorn` (keyless, land only), `seascape` (keyless bathymetry — Open Waters, GEBCO + regional surveys to z14, land flat, not for navigation), `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; `map.getCamera()` gives the eye's `altitude`, the `targetElevation` under the view centre and the eye's `clearance` above ground, in true metres — a depth gauge reads it, no tile sampling of your own. `camera-target="terrain"` orbits the ground under the view centre (zooming in descends — below sea level over a seabed) and `camera-clearance="15"` keeps the eye 15 m off the ground; never drive the camera height through `map.core`. Several DEMs: `<om-terrain id="survey" src="…" decoder="terrarium" extent="[w,s,e,n]">` children ranked in `terrain="survey, context"` — the first-ranked draws alone inside its extent (no z-fighting; don't doctor tiles to hide an overlap); all but the last need an `extent` (or a `nodata="-32768"`: a source's no-data cells are holes that show the next source, colour and height); `vertical-offset="…"` corrects a vertical datum difference; `npx onlymapjs inspect-terrain page.html` (or `map.inspectTerrain()`) measures the step and finds no-data values — run it rather than guess. Own GeoTIFF DEM: `npx onlymapjs dem-tiles survey.tif --out tiles` (needs geotiff) writes the tiles and prints the `<om-terrain>` line to paste. Imagery sharper than the DEM: `texture-max-zoom="15"` (not a higher `max-zoom`). `terrain-tint="slope"` colours ground by true slope (sand flat → rock steep), `terrain-tint="depth"` shades the seabed pale-to-deep by true depth (`terrain-tint-shallow`/`-deep`/`-max-depth`; land untouched; `"slope depth"` for both); `sea-surface="rgba(…)"` is a translucent sea-level plane; `terrain-texture-mask="land"` keeps a `terrain-texture` on the land only, so imagery shows the coast and the seafloor stays visible (`"sea"` is the reverse). Terrain presets credit themselves like basemaps; credit your own DEM URLs yourself. 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
|
-
- `<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. Aggregation layers (`HeatmapLayer`, `HexagonLayer`, `GridLayer`, `ScreenGridLayer`) take `color-domain="[0, 50]"` to fix the range their colour scale spans (Hexagon/Grid also `elevation-domain`) — otherwise it rescales as the view moves; on `ScreenGridLayer`, which re-aggregates on every camera move, it also skips a per-move GPU readback that stalls panning on a busy map. 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 raster `TileLayer` also fills `{bbox-epsg-3857}` (the tile's Web Mercator extent in metres, minx,miny,maxx,maxy), `{width}`/`{height}` (its `tile-size`) and `{quadkey}`, so a WMS is `type="TileLayer" tile-size="512" data="…/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=…&STYLES=&FORMAT=image/png&TRANSPARENT=true&CRS=EPSG:3857&WIDTH={width}&HEIGHT={height}&BBOX={bbox-epsg-3857}"` (FORMAT=image/… or format=png marks it as imagery; works on projected maps too; other tokens such as `{s}` are a validation error); the service must send Access-Control-Allow-Origin (`*` for file:// pages) and an http:// service is blocked in an https:// page; a failed tile is left empty and each cause (CORS, HTTP status, WMS ServiceException) is reported once per layer on `om-validation-error`; 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).
|
|
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, seabed included only to zoom 10 — above it the ocean decodes as 0 m, so a seafloor needs `terrain-max-zoom="10"`; also `mapterhorn` (keyless, land only), `seascape` (keyless bathymetry — Open Waters, GEBCO + regional surveys to z14, land flat, not for navigation), `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; `map.getCamera()` gives the eye's `altitude`, the `targetElevation` under the view centre and the eye's `clearance` above ground, in true metres — a depth gauge reads it, no tile sampling of your own. `camera-target="terrain"` orbits the ground under the view centre (zooming in descends — below sea level over a seabed) and `camera-clearance="15"` keeps the eye 15 m off the ground; never drive the camera height through `map.core`. Several DEMs: `<om-terrain id="survey" src="…" decoder="terrarium" extent="[w,s,e,n]">` children ranked in `terrain="survey, context"` — the first-ranked draws alone inside its extent (no z-fighting; don't doctor tiles to hide an overlap); all but the last need an `extent` (or a `nodata="-32768"`: a source's no-data cells are holes that show the next source, colour and height); `vertical-offset="…"` corrects a vertical datum difference; `npx onlymapjs inspect-terrain page.html` (or `map.inspectTerrain()`) measures the step and finds no-data values — run it rather than guess. Own GeoTIFF DEM: `npx onlymapjs dem-tiles survey.tif --out tiles` (needs geotiff) writes the tiles and prints the `<om-terrain>` line to paste. Imagery sharper than the DEM: `texture-max-zoom="15"` (not a higher `max-zoom`). `terrain-tint="slope"` colours ground by true slope (sand flat → rock steep), `terrain-tint="depth"` shades the seabed pale-to-deep by true depth (`terrain-tint-shallow`/`-deep`/`-max-depth`; land untouched; `"slope depth"` for both); `sea-surface="rgba(…)"` is a translucent sea-level plane; `terrain-texture-mask="land"` keeps a `terrain-texture` on the land only, so imagery shows the coast and the seafloor stays visible (`"sea"` is the reverse). Terrain presets credit themselves like basemaps; credit your own DEM URLs yourself. 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-layer-error` (`detail = {layerId, severity, cause, status?, host, message, fix}` — a layer's tiles failed, once per cause, validating or not), `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`/`onLayerError`/`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
|
+
- `<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. Aggregation layers (`HeatmapLayer`, `HexagonLayer`, `GridLayer`, `ScreenGridLayer`) take `color-domain="[0, 50]"` to fix the range their colour scale spans (Hexagon/Grid also `elevation-domain`) — otherwise it rescales as the view moves; on `ScreenGridLayer`, which re-aggregates on every camera move, it also skips a per-move GPU readback that stalls panning on a busy map. 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 raster `TileLayer` also fills `{bbox-epsg-3857}` (the tile's Web Mercator extent in metres, minx,miny,maxx,maxy), `{width}`/`{height}` (its `tile-size`) and `{quadkey}`, so a WMS is `type="TileLayer" tile-size="512" data="…/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=…&STYLES=&FORMAT=image/png&TRANSPARENT=true&CRS=EPSG:3857&WIDTH={width}&HEIGHT={height}&BBOX={bbox-epsg-3857}"` (any template that does not ask for a vector format — `.pbf`, `.json`, `f=json` — is imagery, so an extensionless ArcGIS cache `…/MapServer/tile/{z}/{y}/{x}` and a TMS `{-y}` work as written; works on projected maps too); a WMS with no Web Mercator takes `{bbox-epsg-XXXX}` in its own CRS (`CRS=EPSG:25832&BBOX={bbox-epsg-25832}` — each tile's enclosing box there, EPSG axis order, so EPSG:4326 under WMS 1.3.0 is latitude first; the image is warped onto the tile); `{s}` spreads tiles over `subdomains` (default a,b,c); `{time}` is filled from the layer's `time`, stepped by `<om-widget type="time-slider" layer="…" times="2024-01-01/2024-03-01/P1D">` (a WMS-T); a WMTS on a national grid is `data="…/{TileMatrix}/{TileRow}/{TileCol}.png" tile-matrix-set='…'` (the TileMatrixSet JSON from GetCapabilities, an OGC tile matrix set, or `{crs, origin, resolutions, tileSize}`); a PMTiles archive is `data="./tiles.pmtiles"` on an MVTLayer or TileLayer; an MVTLayer draws its publisher's MapLibre style with `vector-style="…/style.json"` (fill/line/circle/fill-extrusion/symbol of one source, Web Mercator; not `style=`, the CSS attribute; `basemap="…/style.json"` for a whole publisher map); a NON-tiled layer with `{bbox-crs84}` (lon,lat — OGC API, ArcGIS) or `{bbox-epsg-4326}` (lat,lon — WFS 2.0) in `data` loads features for the area in view and again when the view settles elsewhere, following WFS/OGC API/ArcGIS paging up to `max-features` (default 10000; GeoJSON responses); the service should send Access-Control-Allow-Origin (`*` for file:// pages) — one that does not (or an http:// one in an https:// page) has its tiles drawn as plain images UNDER the map when they load that way (beneath every other layer, hidden while tilted, not exported; `cors-fallback="off"` leaves it empty); a failed tile is left empty and each cause (CORS, HTTP status, WMS ServiceException) is reported once per layer as an `om-layer-error` event (always; `detail = {layerId, severity, cause, status?, host, message, fix}`) and on `om-validation-error`; 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
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"`) except `basemap="positron"`/`"liberty"`/`"bright"` on any `crs` — OpenFreeMap vector tiles drawn in the plane, preset colours, no labels, auto-credited, no terrain/3D tile layers (`TerrainLayer`, `Tile3DLayer`), no `.pbf` TileLayer (use `MVTLayer`, which works on ANY crs: each tile is cut, projected and triangulated once in a worker, so it pans as fast as in Web Mercator), no `terrain`, no clip box (`clip-box-min`/`max` are placed with Mercator arithmetic and would cut every layer away), 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 `crs` is LIVE — change the attribute on a mounted map, or `set-crs {crs: "EPSG:27700"}` (`{crs: "mercator"}` goes back), and every layer re-projects in place with no reload and the camera untouched; story-steppable and undoable; a CRS that cannot resolve is reported and the map stays as it was. 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
|
-
- `<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.
|
|
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` — `{bounds, zoom, center, metersPerPixel, project}`, `metersPerPixel` measured through the map's own projection, `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.
|
|
45
45
|
- Custom-widget event emission (the #1 custom-widget bug — a widget that renders but does nothing): a widget DRIVES the map ONLY by EMITTING a registered action; it never mutates the map or dispatches its own `CustomEvent`. Two ways: (1) declarative `data-emit="<action>"` + `data-*` payload keys on an element (fires on click, or change for form controls whose `.value` is auto-added; `data-*` values are STRINGS — use `ctx.emit` for numeric/array payloads like a slider's range); (2) `ctx.emit(action, payload)` for typed payloads, wired INSIDE `render` (so `ctx` is in scope) by assigning `.oninput`/`.onclick` — e.g. a day slider: `this.render = (ctx) => { this.$("#day").oninput = e => ctx.emit("filter-layer", { layer: "quakes", field: "day", range: [+e.target.value, +e.target.value] }); }`. Actions + payloads: `filter-layer {layer, field?, range:[min,max]}`, `toggle-layer {layer, visible?}`, `fly-to {center:[lng,lat], zoom?, duration?}`, `zoom-to-feature {layer, featureId}`, `set-basemap {basemap}`, `highlight-feature {layer, featureId}`, `show-overlay`/`hide-overlay {target}`, `story-play`/`story-pause`/`story-seek {story, t?}`, `undo`/`redo`, `zoom-in`/`zoom-out`, `set-widgets-visible {visible}`; register more with `OmMap.registerAction(name, handler)`. NEVER inline `onclick=`/`oninput=` — `ctx` isn't a global and CSP blocks them, so it silently fires nothing (validation errors on it). For a plain value/time slider prefer the built-in `<om-widget type="filter" layer=… field=…>` — it wires `filter-layer` for you; hand-author only for bespoke UI.
|
|
46
46
|
- `<om-overlay id="..." anchor-from="selection">` — rich geo-anchored HTML (≤ ~20 per map). Anchors: `anchor="[lng, lat]"` (static), `anchor-from="selection"` (follows picks), or `anchor-layer="regions" anchor-feature-id="mission"` (anchored to a feature's own geometry — bbox center — no coordinates in markup; `{{field}}` interpolates that feature's attributes). Selection-anchored overlays scope with `layer="…"` (one layer's picks only) and `selection-type="click"|"hover"` (one pick type only) — a popup an `<om-behavior on="click" action="show-overlay">` opens behaves as `selection-type="click"` without the attribute (0.11.8+): hovers neither move, re-template nor close it, and a click elsewhere moves it or (on empty map) dismisses it. Set `selection-type="click"` anyway for pages pinned to an older version, or when the popup is opened some other way; an authored value always wins, and an overlay shown by script, `on="load"` or a hover reacts to every pick unless scoped. `{{field}}` interpolates the picked feature HTML-escaped; `{{{field}}}` is raw (avoid); `{{z}}` is the pick's ELEVATION in meters, present only when a `pickable="3d"` layer ran deck's depth pass for that pick (absent — not `0` — otherwise, so "no elevation" is distinguishable from sea level). `clip-to-map` (opt-in) hides the overlay when its own BOX would spill past the map viewport rather than only when its anchor leaves — for small transient tips that track the cursor; an overhanging absolutely-positioned box inflates the page's scrollable overflow and the scrollbar -> map resize -> reprojection loop shows as view jitter. For labels on many features use `PopupLayer`, not overlays. STYLING: overlay content renders inside a shadow root (style isolation, like widgets) — page stylesheets/classes do NOT reach it; use inline `style="…"` on the content or a `<style>` element INSIDE the overlay (children move into the shadow root wholesale, so it applies there); inheritable props + CSS custom properties pierce. A card with an image or link (`<img src="{{photo}}">`) goes inside a `<template>` child (`<om-overlay …><template>…</template></om-overlay>`, 0.11.1): inert at parse, so the literal `{{photo}}` is never requested; tokens stay blank until a pick fills them.
|
|
47
47
|
- `<om-behavior on="click|hover|drag|load|data-loaded" layer="..." action="...">` — declarative interaction (`pick="point"|"cluster"` narrows it to standalone points or count bubbles on a `cluster="true"` layer). Built-in actions: `show-overlay`, `hide-overlay`, `show-tooltip`, `hide-tooltip`, `toggle-layer`, `set-layer-attribute` (`{layer, name, value}` — write ANY layer attribute at runtime by its kebab-case name, `value: null` removes; the generic on/off switch for a widget button, e.g. `name: "cluster"`), `expand-cluster` (`{feature, layer}` or `{layer, clusterId}` — fly to where a bubble splits), `set-pickable` (`{layer, pickable: true|false|"3d"}` — runtime picking/popup toggle, story-capturable; the per-layer popup on/off switch a viewer-facing export needs), `filter-layer`, `highlight-feature`, `zoom-to-feature`, `set-basemap`, `undo`, `redo`; scene/tool actions `set-lighting`, `set-effect` (`{preset}` — swap a post-process finish; see the effects bullet), `set-terrain`, `set-clip-box` (`{min,max,invert?,highlight?}` / `{clear:true}`), `clip-box-edit` (`{editing}`), `export-region-3d` (`{target?, format?:"glb"|"b3dm"}` — what the draw widget's `export-3d` button emits), the draw actions `draw-mode` (`{target?:"sketch", mode:"point"|"line"|"polygon"|null}` — null exits drawing), `draw-commit`, `draw-cancel`, `draw-delete` (removes the last shape), `draw-clear`, `draw-config` (`{target?, autosave?, fillColor?, lineColor?}`) and `draw-save` (`{target?, format?:"download"|"file-system"|"both"}`) — every one of these drives the same store a `data="draw:<target>"` layer reads, so a custom toolbar can replace `<om-widget type="draw">` entirely; and the measure actions `measure-mode` (`{mode:"distance"|"area"|"volume"|null}`), `measure-units`, `measure-clear`, `measure-config` (`{profile?, baseSurface?, density?, swell?, shrink?, deadband?}`), `measure-flat-target-plane` (`{flat}`). One payload contract everywhere: `{ layer, target, feature, featureId, coordinate }`. A `show-tooltip` popup DISMISSES ITSELF when the selection clears — the pointer leaving the feature for a hover, or a click on empty map for a click — so you never wire `hide-tooltip` by hand for that. A tooltip whose template contains an interactive `[data-emit]` element takes pointer events and so does NOT close when clicked, which is what lets it carry its own close button.
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"classify-scale",
|
|
8
8
|
"clip",
|
|
9
9
|
"color",
|
|
10
|
+
"cors-fallback",
|
|
10
11
|
"crs",
|
|
11
12
|
"crs-def",
|
|
12
13
|
"dash",
|
|
@@ -24,6 +25,7 @@
|
|
|
24
25
|
"id",
|
|
25
26
|
"key",
|
|
26
27
|
"label",
|
|
28
|
+
"max-features",
|
|
27
29
|
"opacity",
|
|
28
30
|
"pickable",
|
|
29
31
|
"refresh",
|
|
@@ -32,9 +34,14 @@
|
|
|
32
34
|
"site-scale",
|
|
33
35
|
"snap",
|
|
34
36
|
"source",
|
|
37
|
+
"subdomains",
|
|
35
38
|
"terrain",
|
|
39
|
+
"tile-matrix-set",
|
|
40
|
+
"time",
|
|
36
41
|
"transition",
|
|
37
42
|
"type",
|
|
43
|
+
"vector-style",
|
|
44
|
+
"vector-style-source",
|
|
38
45
|
"visible",
|
|
39
46
|
"visible-zoom-range"
|
|
40
47
|
],
|
|
@@ -928,6 +935,7 @@
|
|
|
928
935
|
"refinement-strategy",
|
|
929
936
|
"snap",
|
|
930
937
|
"stroked",
|
|
938
|
+
"subdomains",
|
|
931
939
|
"text-background",
|
|
932
940
|
"text-background-padding",
|
|
933
941
|
"text-billboard",
|
|
@@ -945,8 +953,11 @@
|
|
|
945
953
|
"text-size-units",
|
|
946
954
|
"text-word-break",
|
|
947
955
|
"tile-size",
|
|
956
|
+
"time",
|
|
948
957
|
"transitions",
|
|
949
958
|
"unique-id-property",
|
|
959
|
+
"vector-style",
|
|
960
|
+
"vector-style-source",
|
|
950
961
|
"visible",
|
|
951
962
|
"visible-max-zoom",
|
|
952
963
|
"visible-min-zoom",
|
|
@@ -1571,6 +1582,7 @@
|
|
|
1571
1582
|
"color-format",
|
|
1572
1583
|
"coordinate-origin",
|
|
1573
1584
|
"coordinate-system",
|
|
1585
|
+
"cors-fallback",
|
|
1574
1586
|
"debounce-time",
|
|
1575
1587
|
"extensions",
|
|
1576
1588
|
"extent",
|
|
@@ -1591,7 +1603,10 @@
|
|
|
1591
1603
|
"position-format",
|
|
1592
1604
|
"refinement-strategy",
|
|
1593
1605
|
"snap",
|
|
1606
|
+
"subdomains",
|
|
1607
|
+
"tile-matrix-set",
|
|
1594
1608
|
"tile-size",
|
|
1609
|
+
"time",
|
|
1595
1610
|
"transitions",
|
|
1596
1611
|
"visible",
|
|
1597
1612
|
"visible-max-zoom",
|
package/onlymapjs.html-data.json
CHANGED
|
@@ -943,6 +943,42 @@
|
|
|
943
943
|
"name": "site-heading",
|
|
944
944
|
"description": "Georeferencing: bearing in degrees clockwise from true north. On its own, rotates the model where it stands."
|
|
945
945
|
},
|
|
946
|
+
{
|
|
947
|
+
"name": "subdomains",
|
|
948
|
+
"description": "TileLayer/MVTLayer: the hosts a {s} template spreads its tiles across — \"abc\" (Leaflet's form), \"a,b,c\" or a JSON array. Default a, b, c."
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
"name": "time",
|
|
952
|
+
"description": "TileLayer/MVTLayer: what the template's {time} token is filled with (a WMS-T TIME=). Step it with <om-widget type=\"time-slider\" times=\"…\">."
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
"name": "max-features",
|
|
956
|
+
"description": "A data URL filled with the view's extent ({bbox-crs84}, {bbox-epsg-XXXX}): the most features kept per view (default 10000); more are reported, not drawn."
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
"name": "tile-matrix-set",
|
|
960
|
+
"description": "TileLayer: the national grid a {TileMatrix}/{TileRow}/{TileCol} WMTS template addresses — an OGC tile matrix set, the WMTS TileMatrixSet from GetCapabilities, or {crs, origin, resolutions, tileSize}, as JSON."
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
"name": "cors-fallback",
|
|
964
|
+
"description": "TileLayer: when the tile server refuses cross-origin reads, \"auto\" (default) draws its tiles as plain images under the map (beneath every other layer, hidden while tilted, not exported); \"off\" leaves them empty.",
|
|
965
|
+
"values": [
|
|
966
|
+
{
|
|
967
|
+
"name": "auto"
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
"name": "off"
|
|
971
|
+
}
|
|
972
|
+
]
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
"name": "vector-style",
|
|
976
|
+
"description": "MVTLayer: a MapLibre / Mapbox style JSON URL to draw the tiles with — fill, line, circle, fill-extrusion and symbol layers of one source, by the style's own filters and zoom functions. Web Mercator maps."
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
"name": "vector-style-source",
|
|
980
|
+
"description": "MVTLayer with vector-style: which of the style's vector sources these tiles are (default: its first)."
|
|
981
|
+
},
|
|
946
982
|
{
|
|
947
983
|
"name": "site-scale",
|
|
948
984
|
"description": "Georeferencing: uniform scale multiplier (default 1)."
|
|
@@ -2820,6 +2856,10 @@
|
|
|
2820
2856
|
"name": "loop",
|
|
2821
2857
|
"description": "time-slider widget: restart the sweep from the domain start when it completes."
|
|
2822
2858
|
},
|
|
2859
|
+
{
|
|
2860
|
+
"name": "times",
|
|
2861
|
+
"description": "time-slider widget: step a layer's time (its {time} tile token) through these instants instead of filtering a field — a comma list, or a WMS dimension start/end/period (2024-01-01/2024-03-01/P1D)."
|
|
2862
|
+
},
|
|
2823
2863
|
{
|
|
2824
2864
|
"name": "on",
|
|
2825
2865
|
"description": "dynamic-chart widget: the <om-map> event name to listen for (required), e.g. \"om-measure\"."
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nika-js/onlymap",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.4",
|
|
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": {
|
|
@@ -146,7 +146,8 @@
|
|
|
146
146
|
"typecheck:src": "tsc -p tsconfig.json --noEmit",
|
|
147
147
|
"comment:typecheck": "`typecheck` is the full sweep (src + e2e + both cloud workers) for dev and CI; `build` runs only `typecheck:src`, because the e2e suite and the workers are not in the published tarball.",
|
|
148
148
|
"wait-for-publish": "node dev/tools/wait-for-publish.mjs",
|
|
149
|
-
"
|
|
149
|
+
"announce": "node dev/tools/wait-for-publish.mjs && node dev/tools/announce-release.mjs",
|
|
150
|
+
"comment:postpublish": "`npm publish` returns before the version is readable: the packument is CDN-cached for 300s, which is why `npm view` kept reporting the old version and looked like a failed publish. wait-for-publish polls the version-specific endpoint (a different cache key, ~8KB vs ~476KB) and blocks until it answers 200 — so the announce fires against a release that is actually fetchable. When npm answers the publish with 202 (\"being processed\") the wait can run long (0.13.3: 27 min); past its 30-min timeout the hook fails without announcing, and `npm run announce` sends it later."
|
|
150
151
|
},
|
|
151
152
|
"comment:deps": "This library ships a fully self-contained bundle in dist/ (verified: zero external bare imports), so it has NO runtime dependencies — deck.gl, loaders.gl, MapLibre, Arrow, d3, acorn, etc. are build-time-only and get bundled by Vite. Keeping them here (not in dependencies) is what stops every consumer install from pulling ~250 MB it never uses.",
|
|
152
153
|
"devDependencies": {
|
|
@@ -159,10 +160,12 @@
|
|
|
159
160
|
"@deck.gl/mesh-layers": "9.3.5",
|
|
160
161
|
"@developmentseed/deck.gl-geotiff": "^0.7.0",
|
|
161
162
|
"@developmentseed/deck.gl-zarr": "^0.7.0",
|
|
163
|
+
"@loaders.gl/core": "^4.4.3",
|
|
162
164
|
"@loaders.gl/csv": "^4.4.3",
|
|
163
165
|
"@loaders.gl/kml": "^4.4.3",
|
|
164
166
|
"@loaders.gl/shapefile": "^4.4.3",
|
|
165
167
|
"@luma.gl/engine": "9.3.5",
|
|
168
|
+
"@maplibre/maplibre-gl-style-spec": "^24.10.0",
|
|
166
169
|
"@playwright/test": "^1.61.1",
|
|
167
170
|
"@reduxjs/toolkit": "^2.12.0",
|
|
168
171
|
"@types/d3-array": "^3.2.2",
|
|
@@ -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), 3D terrain and bathymetry (a seafloor below sea level, an underwater dive camera, a user's own DEM survey or GeoTIFF over a global grid), a map in a REAL PROJECTION (Albers, state plane, British National Grid, UTM, Lambert — the crs attribute), data in a local grid / eastings and northings / a shapefile .prj in BNG or SVY21 (crs on the layer), a label that FOLLOWS A LINE / curved text / text along a path (a river's name down the river — the TextOnPathLayer), generalizing or ornamenting geometry (simplify, smooth, dot density, a coastal vignette/buffer band, contour lines from a DEM — the <om-transform> pipeline), or EXPORTING A MAP AS SVG / editable vector for Illustrator or a print shop (incl. freezing a cartograph frame to inline vector), a responsive/mobile map whose controls auto-fold on narrow screens, auditing a map's widget layout with the check-layout tool, syncing OnlyMapJS map/camera state into an app state store (Redux, MobX, Zustand, Jotai — the getStore contract), BIM/IFC models (loading .ifc files in the browser, 3D Tiles per-element picking, isolate/hide/ghost, clash detection, model federation), routes and directions (a styled A-to-B route line, OSRM or another routing engine, click-to-route), live vehicle/rider/delivery tracking (a moving marker gliding between GPS fixes with a follow camera), a Remotion map video or programmatic map flyover with overlays (route to the separate @nika-js/onlymap-remotion package), a React Native or Expo mobile map (route to the separate @nika-js/onlymap-native package), or help with OnlyMapJS syntax, validation, widgets, data formats, testing, or publishing examples.
|
|
3
|
+
description: Build, edit, debug, or review OnlyMapJS declarative HTML maps and dashboards, or React maps via the @nika-js/onlymap/react adapter. Use when a user asks for an interactive map, deck.gl-style visualization, geospatial dashboard, live fleet/telemetry map, choropleth, marker clustering / clustered points (count bubbles that split on zoom — the `cluster` toggle), popup/tooltip map, map story/tour, manual drawing/sketch map, 3D map assets, a React map component, a map page shared as a single HTML file (incl. no-JS fallbacks for chat/email previews), a print-ready map sheet / PDF map / atlas (the cartograph entry: mm-based pages, frames, derived legends, scale bars, graticules), a cartograph sheet whose map frame renders BLANK or empty outside the app that made it (frame fallback sources), a styled/post-processed map look (film grain, halftone, duotone, vintage or printed finish, bloom-style passes — the <om-effect> pipeline), shaded relief / hillshade / terrain shading on a flat cartographic map (the HillshadeLayer), 3D terrain and bathymetry (a seafloor below sea level, an underwater dive camera, a user's own DEM survey or GeoTIFF over a global grid), a map in a REAL PROJECTION (Albers, state plane, British National Grid, UTM, Lambert — the crs attribute), data in a local grid / eastings and northings / a shapefile .prj in BNG or SVY21 (crs on the layer), a label that FOLLOWS A LINE / curved text / text along a path (a river's name down the river — the TextOnPathLayer), generalizing or ornamenting geometry (simplify, smooth, dot density, a coastal vignette/buffer band, contour lines from a DEM — the <om-transform> pipeline), or EXPORTING A MAP AS SVG / editable vector for Illustrator or a print shop (incl. freezing a cartograph frame to inline vector), web map services and QGIS exports (WMS in any CRS, WMTS on a national grid, live WFS / OGC API Features / ArcGIS FeatureServer layers, PMTiles archives, vector tiles in their publisher's MapLibre style, tile servers without CORS), a responsive/mobile map whose controls auto-fold on narrow screens, auditing a map's widget layout with the check-layout tool, syncing OnlyMapJS map/camera state into an app state store (Redux, MobX, Zustand, Jotai — the getStore contract), BIM/IFC models (loading .ifc files in the browser, 3D Tiles per-element picking, isolate/hide/ghost, clash detection, model federation), routes and directions (a styled A-to-B route line, OSRM or another routing engine, click-to-route), live vehicle/rider/delivery tracking (a moving marker gliding between GPS fixes with a follow camera), a Remotion map video or programmatic map flyover with overlays (route to the separate @nika-js/onlymap-remotion package), a React Native or Expo mobile map (route to the separate @nika-js/onlymap-native package), or help with OnlyMapJS syntax, validation, widgets, data formats, testing, or publishing examples.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# OnlyMapJS
|
|
@@ -23,7 +23,7 @@ Use OnlyMapJS as a declarative HTML map library. Write custom elements such as `
|
|
|
23
23
|
</script>
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
For no-build CDN pages, use the single-file standalone bundle from a raw-file CDN — `https://unpkg.com/@nika-js/onlymap@0.13.
|
|
26
|
+
For no-build CDN pages, use the single-file standalone bundle from a raw-file CDN — `https://unpkg.com/@nika-js/onlymap@0.13.4` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.13.4/dist/onlymapjs.css">`. Never a rebundling CDN (esm.sh, skypack): re-bundling duplicates the deck.gl/luma.gl runtime and every layer fails shader compilation.
|
|
27
27
|
|
|
28
28
|
## React Projects
|
|
29
29
|
|
|
@@ -83,7 +83,13 @@ Load the smallest reference needed for the task:
|
|
|
83
83
|
- Fly or dive DOWN into terrain (a canyon, a seabed below sea level, a depth gauge) -> `camera-target="terrain"` + `camera-clearance="15"` on `<om-map>` over a terrain (`terrain="seascape"` is keyless bathymetry), and `map.getCamera()` for the depth readout. NOT scripting the camera height through `map.core`/deck — those two attributes are the whole of it (references/syntax.md, `terrain`).
|
|
84
84
|
- A user's own DEM survey over a coarser global grid (a sharp survey, gaps, a datum step) -> `<om-terrain>` children ranked in `terrain="survey, context"`, with `nodata`/`vertical-offset` per source. Run `npx onlymapjs inspect-terrain page.html` before guessing either value; a GeoTIFF becomes tiles with `npx onlymapjs dem-tiles`, which prints the `<om-terrain>` line to paste. NEVER push one DEM down to hide it under the other.
|
|
85
85
|
- Imagery or a basemap on the LAND over a 3D seafloor (a coastline with the seabed showing) -> `terrain-texture="…{z}/{x}/{y}…"` + `terrain-texture-mask="land"` on `<om-map>` (+ `sea-surface` and/or `terrain-tint="depth"` to show the water), NOT `basemap=` (terrain replaces it) and NOT a coastline polygon — the cut is the DEM's own sea level.
|
|
86
|
-
- A WMS (GetMap) or a Bing-style quadkey tile service as a layer -> `type="TileLayer" tile-size="512"` with `CRS=EPSG:3857&FORMAT=image/png&WIDTH={width}&HEIGHT={height}&BBOX={bbox-epsg-3857}` (or `{quadkey}`) in `data`, NOT a plain fetched `data` URL and NOT a basemap. The service must allow CORS; a refused tile is
|
|
86
|
+
- A WMS (GetMap) or a Bing-style quadkey tile service as a layer -> `type="TileLayer" tile-size="512"` with `CRS=EPSG:3857&FORMAT=image/png&WIDTH={width}&HEIGHT={height}&BBOX={bbox-epsg-3857}` (or `{quadkey}`) in `data`, NOT a plain fetched `data` URL and NOT a basemap. An address with no format in it (an ArcGIS cache's `…/MapServer/tile/{z}/{y}/{x}`) or a TMS `{-y}` row is fine as is. The service must allow CORS; a refused tile is announced once per cause as `om-layer-error` (always) and on `om-validation-error`, and the rest of the map draws (references/syntax.md, "Tiled layers").
|
|
87
|
+
- A WMS that offers no Web Mercator (only EPSG:25832, 2056, 28992 …) -> the same `TileLayer` with the service's own CRS and `BBOX={bbox-epsg-25832}`: each tile asks for its enclosing box in that CRS and the image is warped onto it. EPSG:4326 under WMS 1.3.0 is written latitude first automatically. NOT `crs=` on the layer (that converts rows).
|
|
88
|
+
- A WMTS published only on a national grid (swisstopo, PDOK, MML, AdV) -> `type="TileLayer" data="…/{TileMatrix}/{TileRow}/{TileCol}.png"` + `tile-matrix-set='…'` (the TileMatrixSet from GetCapabilities as JSON, or `{"crs":"EPSG:2056","origin":[x,y],"resolutions":[…],"tileSize":256}`). A GoogleMapsCompatible set needs none of this: use `{z}/{y}/{x}`.
|
|
89
|
+
- Live features from WFS / OGC API Features / an ArcGIS FeatureServer for the area in view -> `type="GeoJsonLayer"` with an extent token in `data`: `…/items?bbox={bbox-crs84}&f=json` (OGC API, lon/lat), `…/FeatureServer/0/query?geometry={bbox-crs84}&geometryType=esriGeometryEnvelope&inSR=4326&f=geojson`, or `…?service=WFS&version=2.0.0&request=GetFeature&typeNames=…&outputFormat=application/json&bbox={bbox-epsg-4326},urn:ogc:def:crs:EPSG::4326`. Paging is followed; `max-features` caps it (default 10000). NOT a one-off fetched copy.
|
|
90
|
+
- A PMTiles archive -> `data="./tiles.pmtiles"` on an `MVTLayer` (vector) or `TileLayer` (raster). Nothing else to set.
|
|
91
|
+
- Vector tiles with the publisher's own style -> `type="MVTLayer" vector-style="…/style.json"` (fill/line/circle/extrusion/labels of one source; Web Mercator). For the publisher's whole map as a base, `basemap="…/style.json"` instead. NOT `style=` — that is the element's CSS.
|
|
92
|
+
- Leaflet `{s}` subdomains or a time-enabled WMS (WMS-T) -> keep `{s}` (with `subdomains="abc"` if not a, b, c) / put `TIME={time}` in the template, set `time="…"`, and step it with `<om-widget type="time-slider" layer="…" times="2024-01-01/2024-03-01/P1D">` (or a comma list). A tile server without CORS needs nothing: its tiles show as plain images under the map (see the cost in references/syntax.md).
|
|
87
93
|
- A map in a REAL PROJECTION (an Albers or state-plane sheet, a national grid, "not Web Mercator") -> `crs="EPSG:5070"` on `<om-map>`, with `basemap="none"`. The authored camera STAYS geographic (`center` is lng/lat, `zoom` unchanged), so stories and `seek()` keep working, and `crs` is LIVE (change it, or `set-crs {crs}`; layers re-project in place — between two grids the GPU draws — Transverse Mercator/UTM, Albers, Lambert Conformal Conic, LAEA — nothing is re-projected; polygon fills are only triangulated again). `basemap="positron"`/`"liberty"`/`"bright"` DOES work on any `crs` (OpenFreeMap vector tiles in the plane, preset colours, no labels, auto-credited), and so does `MVTLayer` (each tile cut, projected and triangulated once in a worker). A projected map cannot carry any other MapLibre basemap, `terrain`, `pitch`/`bearing`, a clip box, 3D tile layers, a `.pbf` `TileLayer` (use `MVTLayer`), or H3/S2/geohash/quadkey layers — each is a validation error with a fix. Relief DOES work, and so do IMAGE tiles: for a satellite or OSM backdrop, keep `basemap="none"` and add `<om-layer type="TileLayer" data="…/{z}/{x}/{y}.jpg">` (the validation error for `basemap="satellite"` gives the exact line), then show the tiles' credit yourself with `<om-widget type="attribution" text="…">`. See docs/cartography.md.
|
|
88
94
|
- 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.
|
|
89
95
|
- Data whose coordinates are eastings/northings (a national grid, State Plane, UTM — "it's in SVY21", "the shapefile is in BNG", numbers in the hundreds of thousands) -> leave the data as it is. A shapefile `.prj`, a FlatGeobuf/GeoParquet header or a GeoJSON `crs` member is read automatically; otherwise add `crs="EPSG:<code>"` to the `<om-layer>` (for a CSV: `crs="EPSG:3414" get-position="[$easting, $northing]"`). Do NOT convert the coordinates yourself, and do NOT put this on `<om-map crs>` — that one chooses how the MAP is drawn (syntax.md "Data in a local grid").
|
|
@@ -16,8 +16,8 @@ Vite/npm project:
|
|
|
16
16
|
Static CDN page (raw-file CDNs only — unpkg/jsDelivr; never esm.sh or another rebundling CDN, which duplicates the WebGL runtime and breaks layer shaders):
|
|
17
17
|
|
|
18
18
|
```html
|
|
19
|
-
<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.13.
|
|
20
|
-
<script type="module" src="https://unpkg.com/@nika-js/onlymap@0.13.
|
|
19
|
+
<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.13.4/dist/onlymapjs.css">
|
|
20
|
+
<script type="module" src="https://unpkg.com/@nika-js/onlymap@0.13.4"></script>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Always include `onlymapjs.css` — it carries the MapLibre basemap styles and the no-JS fallback rules (`<om-fallback>` / default banner). For the fallback to work in script-disabled previews it must load without JavaScript: a real `<link rel="stylesheet">` or inlined `<style>` on no-build pages (a bundler-emitted stylesheet is fine in npm projects).
|
|
@@ -89,7 +89,7 @@ Common attributes:
|
|
|
89
89
|
- `widgets-dim="off"` disables collision-dim — by default a widget slot dims (`--om-widget-opacity-dimmed`, 0.35) while an open `<om-overlay>` popup covers it, rather than the popup dodging (attribution/toggle slots never dim).
|
|
90
90
|
- `headless width="800" height="600"` for test harness use
|
|
91
91
|
|
|
92
|
-
Events: `om-map-ready` (boot complete; `await mapEl.ready` is the promise twin), `om-validation-error`, `om-view-changed` — fires once the camera settles after a move (debounced; `detail = {longitude, latitude, zoom, pitch, bearing}`), the hook for persisting the camera — `om-map-point` (`detail = {coordinate: [lng,lat]|null, kind: "click"|"hover"}` — every click/hover map coordinate, including empty-map clicks; the hook for custom capture tools the built-in draw widget doesn't cover),
|
|
92
|
+
Events: `om-map-ready` (boot complete; `await mapEl.ready` is the promise twin), `om-validation-error`, `om-view-changed` — fires once the camera settles after a move (debounced; `detail = {longitude, latitude, zoom, pitch, bearing}`), the hook for persisting the camera — `om-map-point` (`detail = {coordinate: [lng,lat]|null, kind: "click"|"hover"}` — every click/hover map coordinate, including empty-map clicks; the hook for custom capture tools the built-in draw widget doesn't cover), `om-tileset-load` (`detail = {layerId, tileset}` — a `Tile3DLayer`'s live deck `Tileset3D`, for tools needing the real tileset such as region export), and `om-layer-error` (`detail = {layerId, severity, cause, status?, host, message, fix}` — a layer's tiles failed; once per cause, validating or not). `om-attributions-changed` bubbles when a basemap style loads; `mapEl.attributions()` then returns its providers as plain text. `MapController` mirrors these as `onViewChange` / `onMapPoint` / `onTilesetLoad` / `onLayerError` options.
|
|
93
93
|
|
|
94
94
|
`await mapEl.snapshot()` (also on `MapController`) returns a canvas-only PNG dataURL of the scene — basemap + layers composited at device pixels (`{as: "blob"}` for files; `type`/`quality` for jpeg/webp). DOM widgets, overlays, and the provider attribution are NOT in the pixels: exports must render credits themselves. Await `ready` first; headless maps reject.
|
|
95
95
|
|
|
@@ -451,14 +451,44 @@ deck's `TileLayer` and `MVTLayer` take their `data` prop as a `{z}/{x}/{y}` URL
|
|
|
451
451
|
get-line-color="'#38bdf8'" line-width-min-pixels="1"></om-layer>
|
|
452
452
|
```
|
|
453
453
|
|
|
454
|
-
A WMS, or any service addressed by extent rather than tile index, is a raster `TileLayer` too. Besides deck's `{z}` `{x}` `{y}` `{-y}`, a raster `TileLayer` fills `{bbox-epsg-3857}` (each tile's Web Mercator extent in metres, `minx,miny,maxx,maxy` — WMS 1.1.1/1.3.0 axis order for EPSG:3857), `{width}`/`{height}` (the layer's `tile-size`, default 512) and `{quadkey}` (Bing-style). Ask for EPSG:3857 and
|
|
454
|
+
A WMS, or any service addressed by extent rather than tile index, is a raster `TileLayer` too. Besides deck's `{z}` `{x}` `{y}` `{-y}`, a raster `TileLayer` fills `{bbox-epsg-3857}` (each tile's Web Mercator extent in metres, `minx,miny,maxx,maxy` — WMS 1.1.1/1.3.0 axis order for EPSG:3857), `{width}`/`{height}` (the layer's `tile-size`, default 512) and `{quadkey}` (Bing-style). Ask for EPSG:3857 and an image format (`FORMAT=image/png`, or `format=png` on an ArcGIS export). A template counts as imagery unless it asks for a vector format (`.pbf`, `.mvt`, `.json`, `f=json`), so an address with no extension at all (an ArcGIS cache's `…/MapServer/tile/{z}/{y}/{x}`) works as written, and a tile that arrives as GeoJSON anyway is drawn as GeoJSON:
|
|
455
455
|
|
|
456
456
|
```html
|
|
457
457
|
<om-layer id="wms" type="TileLayer" tile-size="512"
|
|
458
458
|
data="https://example.org/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=a,b&STYLES=&FORMAT=image/png&TRANSPARENT=true&CRS=EPSG:3857&WIDTH={width}&HEIGHT={height}&BBOX={bbox-epsg-3857}"></om-layer>
|
|
459
459
|
```
|
|
460
460
|
|
|
461
|
-
It works on a projected (`crs`) map as well: the tiles are Web Mercator tiles warped into the plane.
|
|
461
|
+
It works on a projected (`crs`) map as well: the tiles are Web Mercator tiles warped into the plane.
|
|
462
|
+
|
|
463
|
+
More tokens, for services as QGIS users meet them:
|
|
464
|
+
|
|
465
|
+
- `{bbox-epsg-XXXX}` — a WMS that offers no Web Mercator: ask in its own CRS (`CRS=EPSG:25832&BBOX={bbox-epsg-25832}`). Each tile asks for the box enclosing it in that CRS, written in the CRS's EPSG axis order (latitude first for EPSG:4326 under WMS 1.3.0; a WMS 1.1.1 `SRS=` request is always x,y), and the picture is warped onto the tile. `{bbox-crs84}` is always longitude first.
|
|
466
|
+
- `{s}` — Leaflet's subdomain token, spread across `subdomains` (`"abc"`, `"a,b,c"` or a JSON array; default a, b, c).
|
|
467
|
+
- `{time}` (or WMTS's `{Time}`) — filled from the layer's `time` (a WMS-T `TIME=`, a WMTS time dimension such as swisstopo's `current`); `<om-widget type="time-slider" layer="wms" times="2024-01-01/2024-03-01/P1D">` steps it through a comma list or a WMS dimension's `start/end/period`, with play, scrub and undo.
|
|
468
|
+
- `{TileMatrix}` `{TileRow}` `{TileCol}` — a WMTS on a national grid, with the grid as `tile-matrix-set` (the OGC tile matrix set, the WMTS `TileMatrixSet` from GetCapabilities, or `{crs, origin, resolutions, tileSize, extent?}` — `extent` keeps requests inside the grid — as JSON). The level nearest the view's resolution is chosen and each tile is warped onto the map:
|
|
469
|
+
|
|
470
|
+
```html
|
|
471
|
+
<om-layer id="swiss" type="TileLayer"
|
|
472
|
+
data="https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default/{Time}/2056/{TileMatrix}/{TileCol}/{TileRow}.jpeg" time="current"
|
|
473
|
+
tile-matrix-set='{"crs":"EPSG:2056","origin":[2420000,1350000],"extent":[2420000,1030000,2900000,1350000],"resolutions":[4000,3750,3500,3250,3000,2750,2500,2250,2000,1750,1500,1250,1000,750,650,500,250,100,50,20,10,5,2.5,2,1.5,1,0.5],"tileSize":256,"matrixIds":["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26"]}'></om-layer>
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
A PMTiles archive is a `data` URL like any other — `data="./tiles.pmtiles"` on an `MVTLayer` (vector) or `TileLayer` (raster), read with HTTP Range requests; the archive's zoom range is applied, so deep zooms overzoom.
|
|
477
|
+
|
|
478
|
+
An `MVTLayer` can draw with its publisher's MapLibre style: `vector-style="…/style.json"` (and `vector-style-source` when the style has several vector sources). Its fill, line, circle, fill-extrusion and symbol layers draw in the style's order, by its own filters and zoom functions (MapLibre's expression engine); labels are one per feature, avoiding each other by priority, in the browser's fonts. Background, raster, hillshade and heatmap layers are not drawn (a warning lists them), and it is for Web Mercator maps. For the publisher's whole map as the base, `basemap="…/style.json"`.
|
|
479
|
+
|
|
480
|
+
Any other token (QGIS's `{q}`) is a validation error, since it would be requested literally. The service should send `Access-Control-Allow-Origin` (`*` for a page opened from `file://`). One that does not — or an `http://` service inside an `https://` page — cannot be drawn by WebGL; when its tiles load as plain images, the layer is drawn that way, under the map: beneath every other layer (with a basemap, above it), hidden while the map is tilted or rotated, and left out of snapshots and exports. `cors-fallback="off"` leaves it empty instead. A failed tile is left empty while the rest of the map draws, and each cause — CORS, an HTTP status, a WMS ServiceException (quoted) — is reported once per layer: always as an `om-layer-error` event on the map (`detail = {layerId, severity, cause: "network"|"http"|"service-exception"|"other"|"cors-fallback", status?, host, message, fix}` — what a page uses to tell its readers a layer failed or fell back), and on the validation channel (`om-validation-error`, the on-page panel with `validate`). Changing the layer's `data` withdraws the old template's reports.
|
|
481
|
+
|
|
482
|
+
### Live features for the area in view (WFS, OGC API Features, ArcGIS)
|
|
483
|
+
|
|
484
|
+
An extent token in a NON-tiled layer's `data` makes it a request for the area in view, made again when the view settles somewhere new:
|
|
485
|
+
|
|
486
|
+
```html
|
|
487
|
+
<om-layer id="parcels" type="GeoJsonLayer" max-features="5000"
|
|
488
|
+
data="https://example.org/ogc/collections/parcels/items?bbox={bbox-crs84}&f=json"></om-layer>
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
`{bbox-crs84}` is longitude first (OGC API `bbox=`, an ArcGIS `geometry=…&geometryType=esriGeometryEnvelope&inSR=4326`); `{bbox-epsg-4326}` is latitude first, as a WFS 2.0 `BBOX=…,urn:ogc:def:crs:EPSG::4326` wants; `{bbox-epsg-XXXX}` any other CRS. Paging is followed — WFS `STARTINDEX` in steps of `COUNT`, OGC API `next` links, ArcGIS `resultOffset` while `exceededTransferLimit` — up to `max-features` (default 10000); a view with more is reported, not silently cut. Responses must be GeoJSON (`outputFormat=application/json`, `f=geojson`). Requests are made for a padded view, so a small pan asks nothing; `whenSettled()` waits for them; a failure is an `om-layer-error` like a tile's.
|
|
462
492
|
|
|
463
493
|
`$field` accessors on an `MVTLayer` read the tile feature's `properties`. A tiled layer has no local rows, so `ctx.data()`/`ctx.stats()`/`filter-*` do not apply to it. For a raster `TileLayer` pointing at a non-image endpoint (vector tiles, custom decoding), register a custom layer with your own `renderSubLayers` via `OmMap.registerLayer`.
|
|
464
494
|
|
|
@@ -635,7 +665,7 @@ watched token fires:
|
|
|
635
665
|
- `ctx.dataInViewport(id)`
|
|
636
666
|
- `ctx.stats(id, field, { scope: "viewport" })`
|
|
637
667
|
- `ctx.selection`
|
|
638
|
-
- `ctx.viewport`
|
|
668
|
+
- `ctx.viewport` — `{ bounds, zoom, center, metersPerPixel, project(lngLat) }`; `metersPerPixel` is the ground scale across the view centre, measured through the map's own projection (right on a `crs` map and at any latitude) — use it for anything drawn to scale
|
|
639
669
|
- `ctx.features(layerId)` — the decoded `EXT_structural_metadata` property table of a `pick-features` tileset, one row per element, or `undefined` before the first tile carrying one has landed. This is what a BIM panel groups and counts by; pair it with the `features` watch token, since the table cannot exist on the first render.
|
|
640
670
|
- `ctx.history` — `{ canUndo, canRedo }`; re-render on changes via the `history` watch token
|
|
641
671
|
- `ctx.emit(action, payload)`
|