@nika-js/onlymap 0.13.2 → 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.
Files changed (61) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +8 -3
  3. package/dist/{basemap-CdSCIWCl.js → basemap-BiC_RwbV.js} +3 -7
  4. package/dist/basemap.d.ts +1 -5
  5. package/dist/bbox-tokens.d.ts +70 -0
  6. package/dist/{build-CUx4yR_O.js → build-DQCmcQE1.js} +1 -1
  7. package/dist/{client-DVkMuuPp.js → client-C0CgEs_P.js} +2 -2
  8. package/dist/clip-box-controller.d.ts +0 -17
  9. package/dist/ctx.d.ts +15 -0
  10. package/dist/data-layer.d.ts +22 -23
  11. package/dist/dom-tile-layer.d.ts +30 -0
  12. package/dist/draw-controller.d.ts +1 -1
  13. package/dist/elements/om-map.d.ts +12 -1
  14. package/dist/feature-service.d.ts +42 -0
  15. package/dist/geodesy.d.ts +6 -5
  16. package/dist/{geoparquet-DuCEsCOu.js → geoparquet-DbVJrJYG.js} +1 -1
  17. package/dist/{globe-view-BWNfn-Sx.js → globe-view-CrGbvqqZ.js} +1 -1
  18. package/dist/grid-tiles.d.ts +117 -0
  19. package/dist/{hillshade-DyfYxqNm.js → hillshade-CGY_OBaG.js} +2 -2
  20. package/dist/{hillshade-shader-BWA0USDQ.js → hillshade-shader-w8tmFgaV.js} +1 -1
  21. package/dist/{index-Cc3huYsW.js → index-2lD29y87.js} +25 -25
  22. package/dist/index-BahtHUrg.js +8458 -0
  23. package/dist/{index-DRGcZmBm.js → index-Bdltig68.js} +1 -1
  24. package/dist/{index-DabUE8w3.js → index-ChoEWeXU.js} +1 -1
  25. package/dist/{index-DfzI_j0D.js → index-Cm2sfhw7.js} +1 -1
  26. package/dist/{index-BfHaNHyY.js → index-DrCMvhhr.js} +32928 -31454
  27. package/dist/{index-CCj9Z5yt.js → index-Dtsf-TPD.js} +22 -22
  28. package/dist/{index-DYrgHprN.js → index-GfvWJDX0.js} +36 -36
  29. package/dist/{index-dUoVyYIW.js → index-QrGqSW_H.js} +3 -3
  30. package/dist/{index-DiDoH_BG.js → index-xF9sKoMB.js} +3 -3
  31. package/dist/index.d.ts +1 -1
  32. package/dist/layer-registry.d.ts +1 -0
  33. package/dist/layers/warped-bitmap-layer.d.ts +14 -1
  34. package/dist/{lerc-CUV0h9Ci.js → lerc-DxujwTm7.js} +1 -1
  35. package/dist/onlymap.standalone.js +71944 -61501
  36. package/dist/onlymapjs.js +21 -21
  37. package/dist/parse-manifest.d.ts +4 -1
  38. package/dist/plane-gpu/plane-basemap.d.ts +158 -158
  39. package/dist/plane-vector/plane-mvt-layer.d.ts +158 -158
  40. package/dist/plane-warp.d.ts +14 -1
  41. package/dist/pmtiles.d.ts +76 -0
  42. package/dist/{post-process-effect-DPrpqybM.js → post-process-effect-BL9rBDEh.js} +1 -1
  43. package/dist/programmatic.d.ts +17 -1
  44. package/dist/{raster-CrRQNJE7.js → raster-Bq768NZr.js} +4 -4
  45. package/dist/{raster-pipeline-D9g8RAo4.js → raster-pipeline-C898iYqw.js} +11 -11
  46. package/dist/runtime-core.d.ts +118 -1
  47. package/dist/{terrain-inspect-GowNVtMZ.js → terrain-inspect-DNZO8z6S.js} +1 -1
  48. package/dist/{text-on-path-BoFbm-tl.js → text-on-path-owfh8Ac6.js} +1 -1
  49. package/dist/tile-url.d.ts +162 -0
  50. package/dist/time-dimension.d.ts +25 -0
  51. package/dist/vector-style-BlnKzVND.js +518 -0
  52. package/dist/vector-style.d.ts +59 -0
  53. package/dist/version.d.ts +1 -1
  54. package/dist/{zarr-C8CU8LXU.js → zarr-CMWiR63-.js} +2 -2
  55. package/docs/cartograph.md +2 -2
  56. package/llms.txt +3 -3
  57. package/onlymapjs.attributes.json +15 -0
  58. package/onlymapjs.html-data.json +41 -1
  59. package/package.json +5 -2
  60. package/skills/onlymapjs/SKILL.md +9 -2
  61. package/skills/onlymapjs/references/syntax.md +43 -4
package/CHANGELOG.md CHANGED
@@ -8,6 +8,34 @@ Note: npm collapsed a few closely-spaced releases — the GPX/FlatGeobuf (0.5.4)
8
8
  and GeoParquet (0.5.5) work shipped to npm together as **0.5.6**, so npm's
9
9
  version list jumps 0.5.3 → 0.5.6. Each logical version is listed here regardless.
10
10
 
11
+ ## 0.13.4 — 2026-11-03
12
+
13
+ ### Added
14
+ - **WMS layers in any coordinate system.** A WMS that offers no Web Mercator works with `{bbox-epsg-XXXX}` in its own CRS (`CRS=EPSG:25832&BBOX={bbox-epsg-25832}`): each tile asks for the area it covers there, with the axis order the request version expects, and the picture is warped into place.
15
+ - **WMTS on national grids.** Tiles published only on a national grid (swisstopo, PDOK, MML, AdV) draw with `{TileMatrix}/{TileRow}/{TileCol}` and a `tile-matrix-set` — the TileMatrixSet JSON from the service's capabilities works as is — on Web Mercator and projected maps.
16
+ - **Live features from WFS, OGC API Features and ArcGIS FeatureServer.** Put `{bbox-crs84}` (or `{bbox-epsg-4326}`) in a GeoJSON layer's `data` and it loads the features in view, again when the map moves elsewhere, following each service's paging up to `max-features`.
17
+ - **PMTiles.** `data="./tiles.pmtiles"` reads a single-file tile archive, vector or raster.
18
+ - **Vector tiles in their publisher's style.** `vector-style="…/style.json"` on an MVTLayer draws it with the style's colours, line widths, filters, zoom rules and labels.
19
+ - **Leaflet `{s}` subdomains and time-enabled WMS.** `{s}` spreads tiles across `subdomains`; `{time}` is filled from the layer's `time`, which the `time-slider` widget's new `times` mode steps through, play and scrub included.
20
+ - **Tile servers without cross-origin permission still show.** When a server refuses cross-origin reads but its tiles load as plain images, they are drawn that way under the map (`cors-fallback="off"` opts out).
21
+ - **A layer error event.** `om-layer-error` fires whenever a layer's tiles or features fail — validating or not — so a page can tell its readers a layer is missing; `MapController` has the `onLayerError` twin.
22
+
23
+ ### Fixed
24
+ - Tile services whose addresses carry no file extension (ArcGIS caches, Google-style URLs) now draw; they used to load and show nothing.
25
+ - `{-y}` (TMS) tile addresses now load.
26
+ - The scale bar showed distances twice too long; it now measures the map's own projection, on projected maps too.
27
+ - `whenSettled()` now waits for tiles to finish drawing, so captures, prints and thumbnails no longer miss them.
28
+ - Clicking a cluster bubble now zooms exactly to where it splits, and the `expand-cluster` action works again.
29
+ - A layer's old tile errors are withdrawn once its `data` is fixed.
30
+
31
+ ## 0.13.3 — 2026-11-02
32
+
33
+ ### Added
34
+ - **WMS layers as tiles.** A raster `TileLayer` now fills `{bbox-epsg-3857}` (each tile's Web Mercator extent), `{width}` and `{height}` (its `tile-size`), so a WMS GetMap request works as a tiled layer: `data="…/wms?…&FORMAT=image/png&CRS=EPSG:3857&WIDTH={width}&HEIGHT={height}&BBOX={bbox-epsg-3857}"`. It works on projected maps too, and in cartograph frames.
35
+ - **Quadkey tile services.** `{quadkey}` addresses Bing-style tiles.
36
+ - **Tile failures reach the page.** A tile that fails is left empty while the rest of the map draws, and the cause is reported once per layer on `om-validation-error`: a server that refuses cross-origin requests, an HTTP error, or a WMS error message, quoted.
37
+ - **Tile templates are checked.** Validation names any token the map cannot fill, such as Leaflet's `{s}` or QGIS's `{q}`, which used to be requested literally.
38
+
11
39
  ## 0.13.2 — 2026-10-20
12
40
 
13
41
  ### Added
package/README.md CHANGED
@@ -133,6 +133,11 @@ Numeric timestamps are always epoch **milliseconds**, never guessed as seconds.
133
133
  | **WebSocket stream** | `data="wss://feed" key="id" flush="250ms" source="myFormat"` | upsert-by-key, burst coalescing, auto-reconnect; shared while active and closed after the final descriptor owner releases it |
134
134
  | **Polled REST snapshot** | `data="/api/fleet.json" refresh="5s"` | full-snapshot replace per poll; outages keep the last good data; removal/disposal stops polling |
135
135
  | **Tiled layer (XYZ / vector)** | `<om-layer type="TileLayer" data="…/{z}/{x}/{y}.png">` or `type="MVTLayer"` | a `{z}/{x}/{y}` `data` template is deck's tile URL — passed through, never fetched as rows; raster `TileLayer` gets a built-in `BitmapLayer` renderer, `MVTLayer` self-renders vector tiles (`get-*` accessors apply to tile features) |
136
+ | **WMS / quadkey tiles** | `<om-layer type="TileLayer" tile-size="512" data="…/wms?…&FORMAT=image/png&CRS=EPSG:3857&WIDTH={width}&HEIGHT={height}&BBOX={bbox-epsg-3857}">` | a raster `TileLayer` also fills `{bbox-epsg-3857}` (each tile's Web Mercator extent in metres, `minx,miny,maxx,maxy`), `{width}`/`{height}` (its `tile-size`) and `{quadkey}`, so a WMS GetMap or a Bing-style service works as tiles, on Mercator and projected maps alike. A WMS with no Web Mercator takes `{bbox-epsg-XXXX}` in its own CRS (`CRS=EPSG:25832&BBOX={bbox-epsg-25832}`): each tile asks for the box enclosing it there, in that CRS's axis order (latitude first for EPSG:4326 under WMS 1.3.0), and the image is warped onto the tile. `{s}` spreads tiles across `subdomains` (default a, b, c); `{time}` is filled from the layer's `time`, which `<om-widget type="time-slider" layer="…" times="2024-01-01/2024-03-01/P1D">` steps (a WMS-T). Any template that does not ask for a vector format (`.pbf`, `.json`, `f=json`) is read as imagery, so addresses with no extension work too (an ArcGIS cache's `…/MapServer/tile/{z}/{y}/{x}`), as does a TMS `{-y}` row. A server that sends no `Access-Control-Allow-Origin` (or an `http://` one in an `https://` page) cannot be drawn by WebGL; when its tiles load as plain images they are shown that way, under the map (beneath every other layer, hidden while tilted or rotated, left out of exports — `cors-fallback="off"` leaves them empty instead). A failed tile is left empty and the rest draws; each cause (CORS, an HTTP status, a WMS ServiceException) is reported once per layer as an `om-layer-error` event (`detail = {layerId, severity, cause, status?, host, message, fix}`, always on) and through the validation channel (`om-validation-error`) |
137
+ | **WMTS on a national grid** | `<om-layer type="TileLayer" data="…/{TileMatrix}/{TileRow}/{TileCol}.png" tile-matrix-set='{"crs":"EPSG:2056", …}'>` | tiles published only on a national grid (swisstopo 2056, PDOK 28992, MML 3067, AdV 25832) — `tile-matrix-set` takes the OGC tile matrix set, the WMTS `TileMatrixSet` as GetCapabilities states it, or `{crs, origin, resolutions, tileSize}`; the level nearest the view's resolution is chosen and each tile is warped onto the map, Web Mercator or projected |
138
+ | **PMTiles archive** | `<om-layer type="MVTLayer" data="./tiles.pmtiles">` (or `type="TileLayer"` for raster) | one-file tile pyramids read with HTTP Range requests (`pmtiles://https://…` works too); the archive's zoom range is applied, so deep zooms overzoom; gzip-compressed archives are read, brotli and zstd are not (no browser decoder) |
139
+ | **Live WFS / OGC API Features / ArcGIS FeatureServer** | `<om-layer type="GeoJsonLayer" data="…/collections/roads/items?bbox={bbox-crs84}&f=json">` | an extent token in a non-tiled layer's `data` asks the service for the area in view, again when the view settles somewhere new (`{bbox-crs84}` is lon,lat — OGC API, ArcGIS `geometry=` with `inSR=4326`; `{bbox-epsg-4326}` is latitude first, as WFS 2.0 wants); WFS `STARTINDEX`, OGC API `next` links and ArcGIS `resultOffset` paging are followed up to `max-features` (default 10000; more is reported, not drawn); responses must be GeoJSON; `whenSettled()` waits for them |
140
+ | **Vector tiles in their publisher's style** | `<om-layer type="MVTLayer" data="…/{z}/{x}/{y}.pbf" vector-style="…/style.json">` | the style's fill, line, circle, fill-extrusion and symbol layers for its vector source (`vector-style-source` picks one), evaluated by MapLibre's own expression engine — filters, zoom functions, data expressions; labels are placed one per feature, avoiding each other by priority, in the browser's fonts. Background, raster, hillshade and heatmap layers are not drawn (reported). Web Mercator maps; for the publisher's whole map as they draw it, `basemap="…/style.json"` |
136
141
  | **Draw store** | `data="draw:sketch"` | live in-memory GeoJSON feature store written by `<om-widget type="draw" target="sketch">` |
137
142
 
138
143
  **Data in a local grid** — eastings/northings in British National Grid, SVY21, State Plane or any UTM zone — is converted to longitude/latitude when it loads. A file that names its CRS (a shapefile `.prj`, a FlatGeobuf or GeoParquet header, a legacy GeoJSON `crs` member) needs nothing; otherwise declare it on the layer, which also overrides the file: `<om-layer type="ScatterplotLayer" data="./sites.csv" crs="EPSG:3414" get-position="[$easting, $northing]">`. Coordinates that cannot be degrees with no CRS anywhere are a diagnostic naming the fix, never a silent layer in the ocean. The UTM zones and common national grids are bundled; any other EPSG code is fetched once from `https://epsg.io/<code>.proj4` by the reader's browser — the GeoTIFF/Zarr layers make the same lookup for their own CRS — and `OmMap.configureCrs({ online: false })` turns that off.
@@ -410,8 +415,8 @@ Two things it gets right that hand-rolled hillshades usually don't. **Tile edges
410
415
 
411
416
  - **`OmMap.*`** — `validate`, `snapshotIR`, `snapshotDescriptorIR`, `resolveImageOverlay`, `registerLayer`, `registerWidget`, `registerAction`, `registerSource`, `registerFormat`, `registerBasemap`, `configureBasemap`, `configureData`, `configureTelemetry`, `configureLicense`, `getLayerSchema`
412
417
  - **`@nika-js/onlymap/deck`** — the bundled deck.gl classes (`CompositeLayer`, `TileLayer`, …) for building custom layer types: shims must extend the same class hierarchy the core renders with, not a second installed deck.gl copy. Recipe: [docs/custom-layers.md](docs/custom-layers.md)
413
- - **On a `<om-map>` element** — `ready` (promise), `flyTo(coords, zoom?)`, `getCamera()` (the camera plus where its eye is: `altitude` against sea level, `targetElevation` — the ground under the view centre — and `clearance` above the ground beneath the eye, true metres, cheap enough for every animation frame; also on `MapController`, and in the `om-view-changed` detail, which reads only DEM tiles already held — null there until a `getCamera()` call has fetched them), `setLayerVisible(id, bool)`, `getLayers()`, `emit(action, payload)`, `snapshot(opts?)` (canvas-only PNG of basemap + layers at device pixels — DOM widgets/overlays and provider attribution are NOT captured, so exports must render credits themselves; `{as: "blob"}` for files, default dataURL); `attributions()` (the basemap's providers as plain text — what an export must credit; the bubbling `om-attributions-changed` event fires when a style loads); the `om-view-changed` event fires once the camera settles (debounced; `detail` = `{longitude, latitude, zoom, pitch, bearing, origin}`, where `origin` is `"user"` for gesture-driven bursts vs `"programmatic"` for API/story moves — the echo-suppression signal for state sync) — the camera-persistence hook; the `om-map-point` event (`detail = {coordinate: [lng,lat]|null, kind: "click"|"hover"}`) fires on every click/hover with the map coordinate, including empty-map clicks picks discard — the hook for custom capture tools the built-in draw widget doesn't cover; the `om-tileset-load` event (`detail = {layerId, tileset}`) surfaces a `Tile3DLayer`'s live deck `Tileset3D` for tools that need the real tileset (e.g. region export), not the IR; `pickAt([x, y])` / `pickRect({x, y, width, height})` ask what is under a pixel or inside a screen rectangle and `unproject([x, y])` / `project([lng, lat])` convert between pixels and coordinates — queries that leave the selection, `om-map-point` and behaviors alone, with a `pickMode` property (`"authored"` | `"all"`) that lets a picker tool reach layers the author did not make `pickable` without editing the document; a `diagnostics` property that makes the map report its validation problems as `om-validation-error` events (and `getDiagnostics()` for the latest) without a `validate` attribute or panel, `data-layer` on legend and layer-switcher rows, and an overlay's `templateSource` (its template with `{{fields}}` intact) — what a host's picker reads without editing the document (0.11.7+); `document.querySelector("om-map")` is fully typed
414
- - **`MapController`** — the framework-grade programmatic front-end (typed `LayerDescriptor`s → the same reconcile core, no DOM manifest): `setLayers`, `watch`, `emit`, camera methods, `injectPick`, `ready`, `snapshot`, `setEffects` (deck `Effect` instances, 1:1 — takes precedence over the document's `<om-effect>` chain while set; `null` hands the chain back), `suspend`/`resume`, an `onViewChange(view, origin)` option (the `om-view-changed` twin), plus `onMapPoint` / `onTilesetLoad` options (the `om-map-point` / `om-tileset-load` twins). Active descriptors own reference-counted fetch/poll/socket handles: layer removal, transport-option change, suspend, and destroy release them. Accessor props normally take functions; schema-declared accessors also accept restricted expression strings such as `getPosition: "[$lon, $lat]"`, which makes the descriptor JSON-safe for native/cross-process bridges. `snapshotDescriptorIR(descriptors)` resolves that lane without fetching URL data. The same `pickAt`/`pickRect`/`unproject`/`pickMode` the element has are on the controller. The React adapter rides the function form; vanilla/native hosts may use either
418
+ - **On a `<om-map>` element** — `ready` (promise), `flyTo(coords, zoom?)`, `getCamera()` (the camera plus where its eye is: `altitude` against sea level, `targetElevation` — the ground under the view centre — and `clearance` above the ground beneath the eye, true metres, cheap enough for every animation frame; also on `MapController`, and in the `om-view-changed` detail, which reads only DEM tiles already held — null there until a `getCamera()` call has fetched them), `setLayerVisible(id, bool)`, `getLayers()`, `emit(action, payload)`, `snapshot(opts?)` (canvas-only PNG of basemap + layers at device pixels — DOM widgets/overlays and provider attribution are NOT captured, so exports must render credits themselves; `{as: "blob"}` for files, default dataURL); `attributions()` (the basemap's providers as plain text — what an export must credit; the bubbling `om-attributions-changed` event fires when a style loads); the `om-view-changed` event fires once the camera settles (debounced; `detail` = `{longitude, latitude, zoom, pitch, bearing, origin}`, where `origin` is `"user"` for gesture-driven bursts vs `"programmatic"` for API/story moves — the echo-suppression signal for state sync) — the camera-persistence hook; the `om-map-point` event (`detail = {coordinate: [lng,lat]|null, kind: "click"|"hover"}`) fires on every click/hover with the map coordinate, including empty-map clicks picks discard — the hook for custom capture tools the built-in draw widget doesn't cover; the `om-tileset-load` event (`detail = {layerId, tileset}`) surfaces a `Tile3DLayer`'s live deck `Tileset3D` for tools that need the real tileset (e.g. region export), not the IR; the `om-layer-error` event (`detail = {layerId, severity, cause, status?, host, message, fix}`) fires once per cause when a layer's tiles fail, validating or not, so a page can tell its readers a layer is missing; `pickAt([x, y])` / `pickRect({x, y, width, height})` ask what is under a pixel or inside a screen rectangle and `unproject([x, y])` / `project([lng, lat])` convert between pixels and coordinates — queries that leave the selection, `om-map-point` and behaviors alone, with a `pickMode` property (`"authored"` | `"all"`) that lets a picker tool reach layers the author did not make `pickable` without editing the document; a `diagnostics` property that makes the map report its validation problems as `om-validation-error` events (and `getDiagnostics()` for the latest) without a `validate` attribute or panel, `data-layer` on legend and layer-switcher rows, and an overlay's `templateSource` (its template with `{{fields}}` intact) — what a host's picker reads without editing the document (0.11.7+); `document.querySelector("om-map")` is fully typed
419
+ - **`MapController`** — the framework-grade programmatic front-end (typed `LayerDescriptor`s → the same reconcile core, no DOM manifest): `setLayers`, `watch`, `emit`, camera methods, `injectPick`, `ready`, `snapshot`, `setEffects` (deck `Effect` instances, 1:1 — takes precedence over the document's `<om-effect>` chain while set; `null` hands the chain back), `suspend`/`resume`, an `onViewChange(view, origin)` option (the `om-view-changed` twin), plus `onMapPoint` / `onTilesetLoad` / `onLayerError` options (the `om-map-point` / `om-tileset-load` / `om-layer-error` twins). Active descriptors own reference-counted fetch/poll/socket handles: layer removal, transport-option change, suspend, and destroy release them. Accessor props normally take functions; schema-declared accessors also accept restricted expression strings such as `getPosition: "[$lon, $lat]"`, which makes the descriptor JSON-safe for native/cross-process bridges. `snapshotDescriptorIR(descriptors)` resolves that lane without fetching URL data. The same `pickAt`/`pickRect`/`unproject`/`pickMode` the element has are on the controller. The React adapter rides the function form; vanilla/native hosts may use either
415
420
  - **`getStore(token)`** — the external-store contract: per-token `{subscribe, getSnapshot}` stores (`viewport`/`selection`/`layers`/`data:<id>`) with cached immutable plain-data snapshots and `origin` tagging — directly consumable by `useSyncExternalStore` (the React adapter's own hooks ride it), MobX autoruns, Redux listeners, Zustand mirrors. ~20-line integration-tested recipes for Redux Toolkit, MobX/mobx-keystone, Zustand, and Jotai: [docs/external-stores.md](docs/external-stores.md)
416
421
  - **Testing** — `mountForTest`, and imports are SSR-safe (importing in Node/jsdom never touches browser globals)
417
422
 
@@ -450,7 +455,7 @@ The library reports one **deployment-scoped** usage snapshot per map per page lo
450
455
 
451
456
  ## Not implemented yet (honestly)
452
457
 
453
- Mapbox GL basemaps, depth-interleaved 3D compositing, a globe without a basemap (and text, icon and arc layers on a globe), SSE transport, `dblclick` behaviors, the typed fluent builder, and stories/draw as React components (both work via the HTML manifest). On clustering: lines and polygons are not clustered by centroid (Point data only), tiled sources (`MVTLayer`/`TileLayer`) do not cluster, and a projected (`crs=`) sheet renders a clustered layer unclustered with a warning. On cartography: relief cannot be masked to land (clipping one layer to another's geometry is layer-extension work), `contour` marches in the DEM's Mercator grid even on a projected sheet (the polylines project exactly; the sampling is what is Mercator), and native-CRS tile pyramids are deferred until asked for. On data in a local grid: datum shifts are the standard seven-parameter ones, good to a few metres — correction grids (OSTN15, NTv2) are not shipped — and `configureCrs({ online: false })` does not yet govern the GeoTIFF/Zarr layers' own EPSG lookup. On React Native (`@nika-js/onlymap-native`): stories, draw, widgets, and overlays as native components (build native UI beside the map instead), and bare (non-Expo) React Native until its `0.2.0`. On `pick-features`: instanced (i3dm) tiles keep tile-granularity picking, and `feature-styles`' `opacity` below 1 is still being validated. On BIM: clash detection is bounding-box only (no mesh-level test, and it cannot tell a resolved penetration from a collision), there is no BCF export, no equivalent of Navisworks' Auto Reveal, and prepared tilesets converted before the `bbox*` columns existed cannot take part in a clash pass — `strength` tinting and `opacity: 0` (hide, a shader discard) work. On the measure widget's `volume` mode: the per-cell grid integration measures against the map's active terrain DEM only — measuring against an imported design surface or a previous survey (period-over-period reconciliation) and a cut/fill heat-map overlay are not implemented yet, and a snapped footprint vertex takes the matched feature's horizontal position only — its exact elevation is not threaded through (see **XY snapping** above).
458
+ Mapbox GL basemaps, depth-interleaved 3D compositing, a globe without a basemap (and text, icon and arc layers on a globe), SSE transport, `dblclick` behaviors, the typed fluent builder, and stories/draw as React components (both work via the HTML manifest). On clustering: lines and polygons are not clustered by centroid (Point data only), tiled sources (`MVTLayer`/`TileLayer`) do not cluster, and a projected (`crs=`) sheet renders a clustered layer unclustered with a warning. On cartography: relief cannot be masked to land (clipping one layer to another's geometry is layer-extension work), `contour` marches in the DEM's Mercator grid even on a projected sheet (the polylines project exactly; the sampling is what is Mercator). On data in a local grid: datum shifts are the standard seven-parameter ones, good to a few metres — correction grids (OSTN15, NTv2) are not shipped — and `configureCrs({ online: false })` does not yet govern the GeoTIFF/Zarr layers' own EPSG lookup. On React Native (`@nika-js/onlymap-native`): stories, draw, widgets, and overlays as native components (build native UI beside the map instead), and bare (non-Expo) React Native until its `0.2.0`. On `pick-features`: instanced (i3dm) tiles keep tile-granularity picking, and `feature-styles`' `opacity` below 1 is still being validated. On BIM: clash detection is bounding-box only (no mesh-level test, and it cannot tell a resolved penetration from a collision), there is no BCF export, no equivalent of Navisworks' Auto Reveal, and prepared tilesets converted before the `bbox*` columns existed cannot take part in a clash pass — `strength` tinting and `opacity: 0` (hide, a shader discard) work. On the measure widget's `volume` mode: the per-cell grid integration measures against the map's active terrain DEM only — measuring against an imported design surface or a previous survey (period-over-period reconciliation) and a cut/fill heat-map overlay are not implemented yet, and a snapped footprint vertex takes the matched feature's horizontal position only — its exact elevation is not threaded through (see **XY snapping** above).
454
459
 
455
460
  ## Going deeper
456
461
 
@@ -1,5 +1,5 @@
1
- import { aZ as Y_, N as Ou, H as Id, k as K_, a_ as J_, a$ as Q_, D as Yf, Z as ey, b0 as ty } from "./index-BfHaNHyY.js";
2
- import { a as iy } from "./globe-view-BWNfn-Sx.js";
1
+ import { b1 as Y_, N as Ou, H as Id, k as K_, b2 as J_, b3 as Q_, D as Yf, Z as ey, b4 as ty } from "./index-DrCMvhhr.js";
2
+ import { a as iy } from "./globe-view-CrGbvqqZ.js";
3
3
  const ry = /* @__PURE__ */ new Set(["tile.openstreetmap.org", "a.tile.openstreetmap.org", "b.tile.openstreetmap.org", "c.tile.openstreetmap.org"]);
4
4
  function ny(Me) {
5
5
  let Q;
@@ -25095,7 +25095,7 @@ class by {
25095
25095
  markBusy() {
25096
25096
  this.idleLatch = !1;
25097
25097
  }
25098
- /** The overlay's internal Deck instance — the hover-pick gate wraps its pointermove handler (issue #31); same exact-pin `_deck` seam as getDeckLayers below. */
25098
+ /** The overlay's internal Deck instance — the hover-pick gate wraps its pointermove handler (issue #31), and RuntimeCore reads its live layers off it. */
25099
25099
  getOverlayDeckInternal() {
25100
25100
  return this.overlay._deck;
25101
25101
  }
@@ -25111,10 +25111,6 @@ class by {
25111
25111
  getCanvasElement() {
25112
25112
  return this.map.getCanvas();
25113
25113
  }
25114
- /** The overlay deck's live layers — whenSettled's readiness gate (issue #37). */
25115
- getDeckLayers() {
25116
- return this.overlay._deck?.getLayers?.();
25117
- }
25118
25114
  /** One forced draw of both canvases (no capture) — whenSettled's "at least one completed render" guarantee (issue #37). */
25119
25115
  forceRepaint() {
25120
25116
  this.overlay._deck?.redraw("onlymapjs-settle"), this.map.triggerRepaint();
package/dist/basemap.d.ts CHANGED
@@ -80,7 +80,7 @@ export declare class MapLibreBasemapAdapter {
80
80
  isIdle(): boolean;
81
81
  /** Camera writes from OUR side must clear the latch immediately — the map's own movestart fires a tick later, and a settle read in that gap would see stale idle. */
82
82
  private markBusy;
83
- /** The overlay's internal Deck instance — the hover-pick gate wraps its pointermove handler (issue #31); same exact-pin `_deck` seam as getDeckLayers below. */
83
+ /** The overlay's internal Deck instance — the hover-pick gate wraps its pointermove handler (issue #31), and RuntimeCore reads its live layers off it. */
84
84
  getOverlayDeckInternal(): unknown;
85
85
  /**
86
86
  * Programmatic picking (docs/design/pick-api.md) — the overlay forwards
@@ -90,10 +90,6 @@ export declare class MapLibreBasemapAdapter {
90
90
  getPickerInternal(): Pick<MapboxOverlay, "pickObject" | "pickMultipleObjects" | "pickObjects"> | undefined;
91
91
  /** The MapLibre canvas — the pick-cursor affordance writes its cursor style (issue #33). */
92
92
  getCanvasElement(): HTMLElement;
93
- /** The overlay deck's live layers — whenSettled's readiness gate (issue #37). */
94
- getDeckLayers(): {
95
- isLoaded: boolean;
96
- }[] | undefined;
97
93
  /** One forced draw of both canvases (no capture) — whenSettled's "at least one completed render" guarantee (issue #37). */
98
94
  forceRepaint(): void;
99
95
  /** Snapshot capture queue for the overlay's deck canvas — see captureComposite. */
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Extent tokens in a URL template: `{bbox-epsg-XXXX}` (any EPSG code) and
3
+ * `{bbox-crs84}`, filled with an extent given in longitude/latitude.
4
+ *
5
+ * A box in another CRS is the ENCLOSING box of the extent's boundary,
6
+ * densified and projected: a Mercator tile's edges are curves in a national
7
+ * grid, so its four corners alone would cut the image short.
8
+ *
9
+ * Axis order follows the request's own rules, which are the reason this is
10
+ * more than a projection:
11
+ * - `{bbox-epsg-XXXX}` is written in the CRS's EPSG axis order, as WMS 1.3.0
12
+ * and WFS 1.1/2.0 require: latitude first for a geographic CRS
13
+ * (EPSG:4326 → minLat,minLon,maxLat,maxLon), easting first for a
14
+ * projected one. Except in a WMS 1.1.1 or WFS 1.0.0 request, which is
15
+ * always x,y (`SRS=` gives 1.1.1 away).
16
+ * - `{bbox-crs84}` is always longitude first — what OGC API Features `bbox=`
17
+ * and an ArcGIS `geometry=` with `inSR=4326` read.
18
+ * (`{bbox-epsg-3857}` for a tile is filled exactly from the tile index in
19
+ * tile-url.ts; here it is the view's extent in Web Mercator metres.)
20
+ */
21
+ import { type LngLatPair } from "./projection";
22
+ /**
23
+ * A fresh extent-token pattern per use. A shared `/g` RegExp carries
24
+ * `lastIndex` between calls — `.test()` leaves it past a match and
25
+ * `matchAll` starts from it — so one caller's test made the next caller miss
26
+ * the token.
27
+ */
28
+ export declare const bboxTokenPattern: () => RegExp;
29
+ /** A lng/lat extent: west, south, east, north. */
30
+ export type LngLatExtent = [number, number, number, number];
31
+ /** A box in some CRS's own units, x then y: minx, miny, maxx, maxy. */
32
+ export type CrsBox = [number, number, number, number];
33
+ /** The CRS codes a template's extent tokens name, e.g. ["EPSG:2056", "CRS:84"]. */
34
+ export declare function bboxTokenCodes(template: string): string[];
35
+ /** Does the template carry an extent token other than the tile-exact `{bbox-epsg-3857}`? */
36
+ export declare function hasCrsBboxTokens(template: string | string[] | null | undefined): boolean;
37
+ /** A WMS 1.1.1 or WFS 1.0.0 request, whose boxes are x,y whatever the CRS. */
38
+ export declare function legacyAxisOrder(template: string): boolean;
39
+ export interface BboxProjector {
40
+ code: string;
41
+ /** Degrees on both axes: written latitude first in EPSG order. */
42
+ geographic: boolean;
43
+ forward(lngLat: LngLatPair): [number, number];
44
+ inverse(xy: [number, number]): LngLatPair;
45
+ }
46
+ /** The projector for a code (EPSG:XXXX or CRS:84), resolved once per page — proj4 definitions may be fetched. */
47
+ export declare function bboxProjector(code: string): Promise<BboxProjector | null>;
48
+ /** Every projector a template needs, or the codes that could not be resolved. */
49
+ export declare function bboxProjectorsFor(template: string): Promise<{
50
+ projectors: Map<string, BboxProjector>;
51
+ missing: string[];
52
+ }>;
53
+ /**
54
+ * The enclosing box, in the projector's CRS, of a lng/lat extent: its
55
+ * boundary densified (`samples` points per edge) and projected. Points the
56
+ * projection cannot place are skipped; null when none can be.
57
+ */
58
+ export declare function enclosingBox(projector: BboxProjector, extent: LngLatExtent, samples?: number): CrsBox | null;
59
+ /** A box written for a request: EPSG axis order (latitude first for geographic) unless the request is x,y. */
60
+ export declare function formatBox(box: CrsBox, projector: BboxProjector, xyOrder: boolean): string;
61
+ /**
62
+ * Fill every extent token in a template from a lng/lat extent. Tokens whose
63
+ * projector is missing are left as they are (the caller reports why).
64
+ * Returns the filled URL and, per code, the box it used — what a warp needs
65
+ * to place the image the service returns.
66
+ */
67
+ export declare function fillBboxTokens(template: string, extent: LngLatExtent, projectors: ReadonlyMap<string, BboxProjector>): {
68
+ url: string;
69
+ boxes: Map<string, CrsBox>;
70
+ };
@@ -1,4 +1,4 @@
1
- import { aq as q, ar as T, as as B, at as E, au as j } from "./index-BfHaNHyY.js";
1
+ import { aq as q, ar as T, as as B, at as E, au as j } from "./index-DrCMvhhr.js";
2
2
  const N = (l) => Number.isFinite(l[0]) && Number.isFinite(l[1]);
3
3
  function O(l, t, s) {
4
4
  const o = T(s.x, s.y, s.z), i = 8, n = [];
@@ -1,4 +1,4 @@
1
- import { aB as _ } from "./index-BfHaNHyY.js";
1
+ import { aB as _ } from "./index-DrCMvhhr.js";
2
2
  const c = `function Ie(t) {
3
3
  t("EPSG:4326", "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"), t("EPSG:4269", "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"), t("EPSG:3857", "+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");
4
4
  for (var i = 1; i <= 60; ++i)
@@ -6869,7 +6869,7 @@ async function E(e, t, n, i) {
6869
6869
  });
6870
6870
  }
6871
6871
  async function f(e, t, n, i) {
6872
- const { buildPlaneTile: s } = await import("./build-CUx4yR_O.js");
6872
+ const { buildPlaneTile: s } = await import("./build-DQCmcQE1.js");
6873
6873
  return s(e, t, n, (a, r) => i.toPlane([a, r]), (a, r) => i.fromPlane([a, r]));
6874
6874
  }
6875
6875
  export {
@@ -1,20 +1,3 @@
1
- /**
2
- * Clip box controller (spec: issue #34 §"Cutting / Clipping" — visible,
3
- * draggable box). `clip-box.ts` owns the pure shader/patch math; this file
4
- * owns the DOM-touching half: a wireframe box + 6 face-handle gizmos so the
5
- * box is something you can SEE and GRAB, not just type numbers into. Same
6
- * architecture as `measure-controller.ts`'s volume-mode height gizmo (real
7
- * `<om-layer>` elements driven by `core.patchAnimatedProps` on the per-frame
8
- * channel) — generalized from that gizmo's one hardcoded vertical axis to 6
9
- * axis-constrained handles (one per box face), since a face can move along
10
- * lng, lat, OR elevation depending on which one it is.
11
- *
12
- * Owned per `<om-map>` (the draw/measure precedent) and kept alive for as
13
- * long as a clip box is configured, independent of whether the `clip-box`
14
- * widget is even mounted — set clip-box-min/max programmatically and the
15
- * wireframe still shows up, the same way the box itself still clips content
16
- * with no widget present.
17
- */
18
1
  import type { PickingInfo } from "@deck.gl/core";
19
2
  import type { RuntimeCore, GizmoDragEvent } from "./runtime-core";
20
3
  export declare class ClipBoxController {
package/dist/ctx.d.ts CHANGED
@@ -9,6 +9,7 @@ import type { LayerIR, LayerFilter, LayerCategoryFilter } from "./ir";
9
9
  import type { RuntimeCore } from "./runtime-core";
10
10
  import type { Selection } from "./selection";
11
11
  import { type Stats } from "./stats";
12
+ import type { MapViewport } from "./basemap";
12
13
  import type { LegendSpec } from "./legend-spec";
13
14
  export interface LayerMetaSnapshot {
14
15
  id: string;
@@ -23,6 +24,8 @@ export interface LayerMetaSnapshot {
23
24
  filter?: LayerFilter;
24
25
  /** The layer's active categorical filter, if any — independent of `filter`, read by the built-in `filter` widget's categorical mode. */
25
26
  categoryFilter?: LayerCategoryFilter;
27
+ /** The layer's `time` — what its `{time}` tile token is filled with — read by the `time-slider` widget's `times` mode. */
28
+ time?: string;
26
29
  /** `cluster="true"` is on (docs/design/clustering.md) — the legend adds a bubble row so the count circles are explained. */
27
30
  cluster?: boolean;
28
31
  }
@@ -36,6 +39,8 @@ export interface RuntimeContext {
36
39
  bounds: [[number, number], [number, number]];
37
40
  zoom: number;
38
41
  center: [number, number];
42
+ /** Ground metres per CSS pixel across the view centre, measured through the map's own projection (any crs, any latitude) — what a scale bar draws. */
43
+ metersPerPixel: number;
39
44
  project(lngLat: [number, number]): [number, number];
40
45
  };
41
46
  selection: Selection | null;
@@ -70,6 +75,16 @@ export interface BuildCtxDeps {
70
75
  }
71
76
  /** `ctx.viewport.bounds` / the `viewport` external-store snapshot — one bounds derivation (incl. the world-extent fallback) for both (spec: "External-Store Contract"). */
72
77
  export declare function viewportBounds(viewport: ReturnType<RuntimeCore["getViewport"]>): [[number, number], [number, number]];
78
+ /**
79
+ * Ground metres per CSS pixel across the view centre: the geodesic distance
80
+ * between two screen points either side of it, so it holds on a projected
81
+ * sheet, a globe and at any latitude. Falls back to Web Mercator's formula
82
+ * before there is a viewport, or when the centre row leaves the ground.
83
+ */
84
+ export declare function centreMetersPerPixel(viewport: MapViewport | undefined, viewState: {
85
+ latitude: number;
86
+ zoom: number;
87
+ }): number;
73
88
  /** `ctx.layers` / the `layers` external store — one builder for both (spec: "External-Store Contract"). */
74
89
  export declare function buildLayerMetas(layerIRs: ReadonlyMap<string, LayerIR>): LayerMetaSnapshot[];
75
90
  /** Built fresh on every widget-render invocation — never mutated, never reused. */
@@ -1,3 +1,4 @@
1
+ import type { LngLatExtent } from "./bbox-tokens";
1
2
  import type { Shape, ColumnarData, LayerData } from "./ir";
2
3
  export declare function isColumnar(data: LayerData): data is ColumnarData;
3
4
  /** `Array` as-is, or a FeatureCollection's `.features`, or a lone object wrapped in an array. */
@@ -140,6 +141,8 @@ export interface StreamOptions {
140
141
  refresh?: string;
141
142
  /** The layer's declared `crs`, handed to a format's `parse` (docs/design/crs.md §3.4). */
142
143
  crs?: string;
144
+ /** A view-filled feature request's cap (`max-features`; feature-service.ts). */
145
+ maxFeatures?: number;
143
146
  }
144
147
  /**
145
148
  * Request configuration for every `data` URL the Data Layer fetches
@@ -166,22 +169,14 @@ export declare function assertFetchSizeWithinEntitlement(response: Response): vo
166
169
  export declare function isDrawUrl(url: string): boolean;
167
170
  /**
168
171
  * A tile URL template (spec: "Tiled layers"). deck's `TileLayer`/`MVTLayer`
169
- * (and any `TileLayer` subclass) take their `data` prop as a `{z}/{x}/{y}`
170
- * template STRING — a template deck expands per tile, NOT a document to fetch
171
- * and parse into rows. OnlyMapJS otherwise routes every `data` attribute
172
- * through getData() (fetch → parse), so a template would be fetched literally
173
- * (`…/{z}/{x}/{y}.png`) and 404; this classifier lets the parser pass it
174
- * through to deck untouched instead. Same `{z}/{x}/{y}` convention terrain and
175
- * basemap tile URLs already use.
172
+ * take their `data` prop as a template STRING it expands per tile, NOT a
173
+ * document to fetch and parse into rows. OnlyMapJS otherwise routes every
174
+ * `data` attribute through getData() (fetch → parse), so a template would be
175
+ * fetched literally and 404; this classifier lets the parser pass it through
176
+ * to deck untouched instead. Both predicates live in tile-url.ts with the
177
+ * token filler, so what is recognised and what is filled cannot disagree.
176
178
  */
177
- export declare function isTileTemplateUrl(url: string): boolean;
178
- /**
179
- * A tile template whose tiles are IMAGES (`…/{z}/{x}/{y}.png`) — what a bare
180
- * `TileLayer` draws as bitmaps, and the one tiled source a projected map can
181
- * warp into its plane (docs/design/crs.md, gap 2). One predicate, shared by the
182
- * renderer and the validator, so they cannot disagree about which layers work.
183
- */
184
- export declare function isImageTileTemplate(url: string | null | undefined): boolean;
179
+ export { isTileTemplateUrl, isImageTileTemplate } from "./tile-url";
185
180
  /**
186
181
  * Push a new sketch snapshot into a `draw:<name>` store (the draw widget's
187
182
  * DrawSession.onChange calls this). A FRESH array reference is stored so
@@ -193,15 +188,19 @@ export declare function setDrawData(url: string, features: readonly unknown[]):
193
188
  /** Current snapshot for a draw store (autosave / save-to-file read the source of truth here). */
194
189
  export declare function getDrawData(url: string): LayerData;
195
190
  /**
196
- * Returns the currently-known data for `url` (synchronously) — an empty
197
- * array if not yet loaded (the Q6 "empty placeholder" pattern). Kicks off a
198
- * fetch — or, for `ws:`/`wss:` URLs, a live stream (spec: "Live & Streaming
199
- * Data"), or binds a `draw:` sketch store (spec: "Manual Drawing") — on first
200
- * call for a given URL, and invokes `onLoaded` on every resolution/flush (the
201
- * caller re-reconciles from there).
191
+ * The map's settled view, in lng/lat — every view-filled source the map owns
192
+ * re-requests if the view has left what it fetched. Called by the map when
193
+ * its camera settles (and once it has a viewport).
202
194
  */
203
- /** Why the first load of `url` (with these live options) failed, or null —
204
- * read on every reconcile so a fixed URL stops reporting. */
195
+ export declare function setDataView(owner: DataTransportOwner, extent: LngLatExtent): void;
196
+ /** Resolves once every view-filled request the map has in flight has landed (whenSettled waits on it). */
197
+ export declare function viewDataIdle(owner: DataTransportOwner): Promise<void>;
198
+ /** A view-filled source's state for diagnostics: its last failure, and whether the view held more than its cap. */
199
+ export declare function viewDataState(url: string, opts: StreamOptions, owner?: DataTransportOwner): {
200
+ error?: unknown;
201
+ capped: boolean;
202
+ maxFeatures: number;
203
+ } | null;
205
204
  export declare function dataLoadError(url: string, opts?: StreamOptions): string | null;
206
205
  export declare function getData(url: string, onLoaded: () => void, opts?: StreamOptions, owner?: DataTransportOwner): LayerData;
207
206
  /**
@@ -0,0 +1,30 @@
1
+ export interface DomTileOptions {
2
+ template: string | string[];
3
+ tileSize: number;
4
+ minZoom: number;
5
+ maxZoom: number;
6
+ opacity: number;
7
+ visible: boolean;
8
+ }
9
+ interface ViewportLike {
10
+ width: number;
11
+ height: number;
12
+ project(lngLat: number[]): number[];
13
+ getBounds(): number[];
14
+ }
15
+ export declare class DomTileLayer {
16
+ readonly root: HTMLDivElement;
17
+ private readonly images;
18
+ /**
19
+ * No z-index: the canvas has none either, so painting follows document
20
+ * order, and the runtime inserts these roots before the canvas, in layer
21
+ * order. Any positive z-index would lift a layer above every deck layer.
22
+ */
23
+ constructor();
24
+ /** Lay out the tiles for a view; `hidden` hides the layer (tilted, rotated, or switched off). */
25
+ update(viewport: ViewportLike, zoom: number, opts: DomTileOptions, hidden: boolean): void;
26
+ destroy(): void;
27
+ }
28
+ /** Does an `<img>` with no crossOrigin load this URL? What decides whether a CORS-refused tile service can be shown at all. */
29
+ export declare function loadsAsPlainImage(url: string, timeoutMs?: number): Promise<boolean>;
30
+ export {};
@@ -115,7 +115,7 @@ export declare class DrawController {
115
115
  point(coord: [number, number] | null, kind: "click" | "hover", pointerType?: string): void;
116
116
  /** Drop a queued hover-coalesced render (a following immediate render already supersedes it). */
117
117
  private cancelHoverRaf;
118
- /** `CLOSE_GUARD_PIXELS` converted to real meters at the current zoom/latitude (standard Web Mercator meters-per-pixel). */
118
+ /** `CLOSE_GUARD_PIXELS` converted to real meters at the current zoom/latitude (geodesy.ts's Web Mercator meters-per-pixel). */
119
119
  private closeGuardMeters;
120
120
  /** Close the in-progress line/polygon — from the double-click DOM event or Enter. */
121
121
  commit(): void;
@@ -1,5 +1,5 @@
1
1
  import { HTMLElementBase } from "../env";
2
- import { RuntimeCore, type Camera } from "../runtime-core";
2
+ import { RuntimeCore, type Camera, type LayerErrorDetail } from "../runtime-core";
3
3
  import { type RuntimeContext } from "../ctx";
4
4
  import { type LightingIR } from "../scene-lighting";
5
5
  import { type ClipBoxIR } from "../clip-box";
@@ -85,6 +85,10 @@ export declare class OmMapElement extends HTMLElementBase {
85
85
  private resolveReady;
86
86
  readonly ready: Promise<void>;
87
87
  private readonly viewSettle;
88
+ /** Hand the settled view to this map's view-filled feature layers (feature-service.ts): those whose rows no longer cover it re-request. */
89
+ private pushDataView;
90
+ /** View-data failures already announced as om-layer-error, so each is announced once while it stands. */
91
+ private viewDataErrorsAnnounced;
88
92
  private firstReconcileDone;
89
93
  private rendererLoadPending;
90
94
  private loadDispatched;
@@ -605,6 +609,13 @@ declare global {
605
609
  layerId: string;
606
610
  tileset: unknown;
607
611
  }>;
612
+ /** A layer's tiles failed — once per cause (no response / CORS, an HTTP
613
+ * status, a service error page) per layer and template, whether or not
614
+ * the map is validating. The failed tiles are left empty; the rest of
615
+ * the layer draws. */
616
+ "om-layer-error": CustomEvent<{
617
+ layerId: string;
618
+ } & LayerErrorDetail>;
608
619
  /** A Route layer finished resolving its route (direct geometry or a
609
620
  * RoutingProvider round-trip) — detail carries the authored layer id and
610
621
  * the normalized route (geometry/distanceMeters/durationSec/legs/bounds),
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Live features from a service, for the area in view: a WFS GetFeature, an
3
+ * OGC API Features `items` request or an ArcGIS FeatureServer/MapServer
4
+ * `query`, addressed by an extent token (`{bbox-crs84}`, `{bbox-epsg-XXXX}`
5
+ * — bbox-tokens.ts) and re-requested when the view settles somewhere new.
6
+ *
7
+ * Each service pages its own way, and this follows it to `maxFeatures`:
8
+ * - WFS 2.0: `STARTINDEX` in steps of the request's `COUNT`.
9
+ * - OGC API Features: the response's `rel="next"` link.
10
+ * - ArcGIS: `resultOffset` in steps of `resultRecordCount` while the
11
+ * response says `exceededTransferLimit`.
12
+ * Anything else is one request. Responses must be GeoJSON (ask the service:
13
+ * `outputFormat=application/json`, `f=geojson`, `f=json` on OGC API).
14
+ */
15
+ import { type LngLatExtent } from "./bbox-tokens";
16
+ export type FeatureServiceKind = "wfs" | "ogcapi" | "arcgis" | "plain";
17
+ /** Is this a feature request addressed by the view's extent (not a tile template)? */
18
+ export declare function isViewTemplateUrl(url: string | null | undefined): boolean;
19
+ export declare function featureServiceKind(url: string): FeatureServiceKind;
20
+ /** The default most features a view keeps — enough for a dense city view, few enough to stay smooth. */
21
+ export declare const DEFAULT_MAX_FEATURES = 10000;
22
+ export interface FeatureFetch {
23
+ features: unknown[];
24
+ /** True when the service had more than `maxFeatures` for this view. */
25
+ capped: boolean;
26
+ url: string;
27
+ }
28
+ /** One view's features: the template filled for `extent`, paged per its service, up to `maxFeatures`. */
29
+ export declare function fetchViewFeatures(template: string, extent: LngLatExtent, opts?: {
30
+ maxFeatures?: number;
31
+ init?: RequestInit;
32
+ signal?: AbortSignal;
33
+ }): Promise<FeatureFetch>;
34
+ /** A failed feature request as a diagnostic — the same causes, and the same event detail, as a failed tile. */
35
+ export declare function describeFeatureError(error: unknown): {
36
+ severity: "error";
37
+ cause: "network" | "http" | "service-exception";
38
+ status?: number;
39
+ host: string;
40
+ message: string;
41
+ fix: string;
42
+ };
package/dist/geodesy.d.ts CHANGED
@@ -27,11 +27,12 @@ export declare function distanceMeters(a: LngLat, b: LngLat, radius?: number): n
27
27
  export declare function pathLengthMeters(points: LngLat[], radius?: number): number;
28
28
  /**
29
29
  * Web Mercator ground resolution — meters per screen pixel at a latitude and
30
- * zoom. The one formula four controllers used to carry inline (draw close
31
- * guard, clip-box handle radius, measure hover tolerance, filter histogram).
32
- * `minCosLat` clamps the cosine near the poles (the clip-box gizmo needs a
33
- * floor so handle hit radii stay finite above ~84°); the default 0 keeps the
34
- * exact classic formula.
30
+ * zoom. deck and MapLibre size the world at 512 px at zoom 0, so this is the
31
+ * equator's circumference over 512·2^zoom (78,271.5 m at z0) — not the
32
+ * 156,543 of the 256 px tile convention, which reads every distance twice too
33
+ * long. `minCosLat` clamps the cosine near the poles; the default 0 keeps the
34
+ * exact formula. A measured value (`centreMetersPerPixel` in ctx.ts) is
35
+ * better wherever a viewport exists: it holds on a projected map too.
35
36
  */
36
37
  export declare function metersPerPixel(latitude: number, zoom: number, minCosLat?: number): number;
37
38
  export interface PathSample {
@@ -1,4 +1,4 @@
1
- import { an as i, ao as m, ap as p } from "./index-BfHaNHyY.js";
1
+ import { an as i, ao as m, ap as p } from "./index-DrCMvhhr.js";
2
2
  function y(e) {
3
3
  if (e == null) return !0;
4
4
  const t = e, o = t.id?.code;
@@ -1,4 +1,4 @@
1
- import { d as L, j as x, av as A, aw as E, ax as d, ay as h, az as u, aA as z, p as V, W as Z, G as D } from "./index-BfHaNHyY.js";
1
+ import { d as L, j as x, av as A, aw as E, ax as d, ay as h, az as u, aA as z, p as V, W as Z, G as D } from "./index-DrCMvhhr.js";
2
2
  const c = Math.PI / 180, G = 180 / Math.PI;
3
3
  function w(l, t = 0) {
4
4
  const a = Math.min(180, l) * c;