@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/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,26 @@ 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
|
+
|
|
11
31
|
## 0.13.3 — 2026-11-02
|
|
12
32
|
|
|
13
33
|
### Added
|
package/README.md
CHANGED
|
@@ -133,7 +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
|
|
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"` |
|
|
137
141
|
| **Draw store** | `data="draw:sketch"` | live in-memory GeoJSON feature store written by `<om-widget type="draw" target="sketch">` |
|
|
138
142
|
|
|
139
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.
|
|
@@ -411,8 +415,8 @@ Two things it gets right that hand-rolled hillshades usually don't. **Tile edges
|
|
|
411
415
|
|
|
412
416
|
- **`OmMap.*`** — `validate`, `snapshotIR`, `snapshotDescriptorIR`, `resolveImageOverlay`, `registerLayer`, `registerWidget`, `registerAction`, `registerSource`, `registerFormat`, `registerBasemap`, `configureBasemap`, `configureData`, `configureTelemetry`, `configureLicense`, `getLayerSchema`
|
|
413
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)
|
|
414
|
-
- **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
|
|
415
|
-
- **`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
|
|
416
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)
|
|
417
421
|
- **Testing** — `mountForTest`, and imports are SSR-safe (importing in Node/jsdom never touches browser globals)
|
|
418
422
|
|
|
@@ -451,7 +455,7 @@ The library reports one **deployment-scoped** usage snapshot per map per page lo
|
|
|
451
455
|
|
|
452
456
|
## Not implemented yet (honestly)
|
|
453
457
|
|
|
454
|
-
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)
|
|
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).
|
|
455
459
|
|
|
456
460
|
## Going deeper
|
|
457
461
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as iy } from "./globe-view-
|
|
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)
|
|
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)
|
|
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-
|
|
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-
|
|
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-
|
|
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. */
|
package/dist/data-layer.d.ts
CHANGED
|
@@ -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
|
|
@@ -185,15 +188,19 @@ export declare function setDrawData(url: string, features: readonly unknown[]):
|
|
|
185
188
|
/** Current snapshot for a draw store (autosave / save-to-file read the source of truth here). */
|
|
186
189
|
export declare function getDrawData(url: string): LayerData;
|
|
187
190
|
/**
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
* Data"), or binds a `draw:` sketch store (spec: "Manual Drawing") — on first
|
|
192
|
-
* call for a given URL, and invokes `onLoaded` on every resolution/flush (the
|
|
193
|
-
* 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).
|
|
194
194
|
*/
|
|
195
|
-
|
|
196
|
-
|
|
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;
|
|
197
204
|
export declare function dataLoadError(url: string, opts?: StreamOptions): string | null;
|
|
198
205
|
export declare function getData(url: string, onLoaded: () => void, opts?: StreamOptions, owner?: DataTransportOwner): LayerData;
|
|
199
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 (
|
|
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.
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* exact
|
|
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 { 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-
|
|
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;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tiles on a national grid (WMTS / OGC Two Dimensional Tile Matrix Sets):
|
|
3
|
+
* swisstopo's EPSG:2056, PDOK's 28992, MML's 3067, AdV's 25832 — pyramids
|
|
4
|
+
* whose tiles are rectangles in THEIR CRS, with their own origin and
|
|
5
|
+
* resolutions, not Web Mercator's.
|
|
6
|
+
*
|
|
7
|
+
* A raster TileLayer with `tile-matrix-set` selects tiles from that grid —
|
|
8
|
+
* the level whose resolution is nearest the view's, and the columns and rows
|
|
9
|
+
* covering the view's box in the grid's CRS — fills `{TileMatrix}`,
|
|
10
|
+
* `{TileRow}`, `{TileCol}`, and draws each tile as a mesh whose vertices are
|
|
11
|
+
* its rectangle projected to the map (Web Mercator or a plane). The tileset
|
|
12
|
+
* subclasses deck's `Tileset2D` through its public interface, as
|
|
13
|
+
* plane-tileset.ts does, so caching, loading and parent fallback are deck's.
|
|
14
|
+
*
|
|
15
|
+
* Accepted descriptions (JSON):
|
|
16
|
+
* - OGC TMS 2.0: `{crs, orderedAxes?, tileMatrices: [{id, scaleDenominator
|
|
17
|
+
* | cellSize, pointOfOrigin, cornerOfOrigin?, tileWidth, tileHeight,
|
|
18
|
+
* matrixWidth, matrixHeight}]}`
|
|
19
|
+
* - WMTS 1.0 as parsed from capabilities (what QGIS holds):
|
|
20
|
+
* `{supportedCRS | crs, tileMatrix | tileMatrices: [{identifier,
|
|
21
|
+
* scaleDenominator, topLeftCorner, tileWidth, tileHeight, matrixWidth,
|
|
22
|
+
* matrixHeight}]}` (either capitalisation)
|
|
23
|
+
* - Short form: `{crs, origin: [x, y], resolutions: [...], tileSize,
|
|
24
|
+
* matrixIds?, extent?}` — origin is the top-left corner, x then y;
|
|
25
|
+
* `extent` ([minx, miny, maxx, maxy]) bounds each level's columns and rows,
|
|
26
|
+
* so nothing outside the grid is asked for.
|
|
27
|
+
*/
|
|
28
|
+
import { _Tileset2D as Tileset2D } from "@deck.gl/geo-layers";
|
|
29
|
+
import type { BboxProjector, CrsBox } from "./bbox-tokens";
|
|
30
|
+
import type { LngLatPair, PlaneFrame } from "./projection";
|
|
31
|
+
export interface GridLevel {
|
|
32
|
+
id: string;
|
|
33
|
+
/** CRS units per image pixel. */
|
|
34
|
+
resolution: number;
|
|
35
|
+
/** Top-left corner, x then y. */
|
|
36
|
+
originX: number;
|
|
37
|
+
originY: number;
|
|
38
|
+
tileWidth: number;
|
|
39
|
+
tileHeight: number;
|
|
40
|
+
matrixWidth?: number;
|
|
41
|
+
matrixHeight?: number;
|
|
42
|
+
}
|
|
43
|
+
export interface TileGrid {
|
|
44
|
+
crs: string;
|
|
45
|
+
/** Coarsest first. */
|
|
46
|
+
levels: GridLevel[];
|
|
47
|
+
}
|
|
48
|
+
/** An EPSG code out of the spellings capabilities use: `EPSG:2056`, `urn:ogc:def:crs:EPSG::2056`, `http://www.opengis.net/def/crs/EPSG/0/2056`. */
|
|
49
|
+
export declare function normalizeGridCrs(raw: unknown): string | null;
|
|
50
|
+
/** A level whose resolution waits on the CRS's units (`scaleDenominator`), or is given (`cellSize`). */
|
|
51
|
+
interface RawLevel {
|
|
52
|
+
id: string;
|
|
53
|
+
scaleDenominator?: number;
|
|
54
|
+
cellSize?: number;
|
|
55
|
+
origin: [number, number];
|
|
56
|
+
tileWidth: number;
|
|
57
|
+
tileHeight: number;
|
|
58
|
+
matrixWidth?: number;
|
|
59
|
+
matrixHeight?: number;
|
|
60
|
+
}
|
|
61
|
+
export interface ParsedTileMatrixSet {
|
|
62
|
+
crs: string;
|
|
63
|
+
levels: RawLevel[];
|
|
64
|
+
/** The origin was written latitude/northing first and must be swapped once the CRS is known to be geographic (WMTS writes CRS axis order). */
|
|
65
|
+
originAxisOrder: "xy" | "crs";
|
|
66
|
+
}
|
|
67
|
+
/** Read a tile matrix set description; a string says what is wrong with it. */
|
|
68
|
+
export declare function parseTileMatrixSet(raw: unknown): ParsedTileMatrixSet | string;
|
|
69
|
+
/** A parsed set made concrete for its CRS: resolutions in CRS units, origins x then y, coarsest level first. */
|
|
70
|
+
export declare function resolveTileGrid(parsed: ParsedTileMatrixSet, crs: {
|
|
71
|
+
geographic: boolean;
|
|
72
|
+
metresPerUnit: number;
|
|
73
|
+
}): TileGrid;
|
|
74
|
+
/** A tile's rectangle in the grid's CRS. */
|
|
75
|
+
export declare function gridTileBox(level: GridLevel, col: number, row: number): CrsBox;
|
|
76
|
+
/** The level whose resolution is nearest (in log terms) the view's, in CRS units per CSS pixel; capped by `maxLevel`. */
|
|
77
|
+
export declare function gridLevelFor(grid: TileGrid, unitsPerPixel: number, maxLevel?: number, minLevel?: number): number;
|
|
78
|
+
/** The tiles of a level that meet a box in the grid's CRS, at most `budget` (null when there are more). */
|
|
79
|
+
export declare function gridCover(level: GridLevel, box: CrsBox, budget: number): {
|
|
80
|
+
col: number;
|
|
81
|
+
row: number;
|
|
82
|
+
}[] | null;
|
|
83
|
+
/** Fill a WMTS template's `{TileMatrix}`, `{TileRow}`, `{TileCol}` (and `{z}`/`{x}`/`{y}` as level index, column and row). */
|
|
84
|
+
export declare function fillGridTemplate(template: string, level: GridLevel, levelIndex: number, col: number, row: number): string;
|
|
85
|
+
/** Does the template address WMTS tiles by matrix, row and column? */
|
|
86
|
+
export declare function isGridTemplate(url: string): boolean;
|
|
87
|
+
interface ViewportLike {
|
|
88
|
+
width: number;
|
|
89
|
+
height: number;
|
|
90
|
+
isGeospatial?: boolean;
|
|
91
|
+
unproject(xy: number[]): number[];
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The grid, its CRS and the map's plane (null on Web Mercator) a layer's
|
|
95
|
+
* tileset selects with — re-pointable under a live tileset, for the reason
|
|
96
|
+
* PlaneTilesetBinding gives: deck builds the class once per layer.
|
|
97
|
+
*/
|
|
98
|
+
export declare class GridTilesetBinding {
|
|
99
|
+
grid: TileGrid;
|
|
100
|
+
projector: BboxProjector;
|
|
101
|
+
frame: PlaneFrame | null;
|
|
102
|
+
readonly TilesetClass: typeof Tileset2D;
|
|
103
|
+
constructor(grid: TileGrid, projector: BboxProjector, frame: PlaneFrame | null);
|
|
104
|
+
/** Screen pixel → lng/lat, through the plane when there is one. */
|
|
105
|
+
toLngLat(viewport: ViewportLike, xy: [number, number]): LngLatPair | null;
|
|
106
|
+
/** A tile rectangle's extent where deck culls: lng/lat on Web Mercator, plane units on a plane. */
|
|
107
|
+
extentOf(box: CrsBox): {
|
|
108
|
+
lngLat: {
|
|
109
|
+
west: number;
|
|
110
|
+
south: number;
|
|
111
|
+
east: number;
|
|
112
|
+
north: number;
|
|
113
|
+
};
|
|
114
|
+
bbox: Record<string, number>;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
export {};
|