@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/dist/runtime-core.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { type ClipBoxIR } from "./clip-box";
|
|
|
7
7
|
import { type SnapAgent, type SnapConfig } from "./snapping";
|
|
8
8
|
import type { ViewOrigin } from "./external-store";
|
|
9
9
|
import type { LayerIR } from "./ir";
|
|
10
|
+
import { type TileFailureCause } from "./tile-url";
|
|
10
11
|
import { type PickAtOptions, type PickMode, type PickRect, type PickRectOptions, type Selection } from "./selection";
|
|
11
12
|
import type { ValidationEntry } from "./validation";
|
|
12
13
|
import type { MapViewport } from "./basemap";
|
|
@@ -295,6 +296,20 @@ export interface RuntimeCoreCallbacks {
|
|
|
295
296
|
* consistent error contract regardless of origin.
|
|
296
297
|
*/
|
|
297
298
|
onRuntimeError?: (entry: ValidationEntry) => void;
|
|
299
|
+
/** Runtime errors that no longer hold — a layer's tile failures, once its template changed or it was removed. The same objects `onRuntimeError` received. */
|
|
300
|
+
onRuntimeErrorsRetracted?: (entries: readonly ValidationEntry[]) => void;
|
|
301
|
+
/** A layer's tiles failed, once per cause per template — always, validating or not (the `om-layer-error` event). */
|
|
302
|
+
onLayerError?: (layerId: string, failure: LayerErrorDetail) => void;
|
|
303
|
+
}
|
|
304
|
+
/** What `om-layer-error` and `MapController`'s `onLayerError` carry. */
|
|
305
|
+
export interface LayerErrorDetail {
|
|
306
|
+
severity: "error" | "warning";
|
|
307
|
+
cause: TileFailureCause;
|
|
308
|
+
/** The HTTP status, when the cause is one. */
|
|
309
|
+
status?: number;
|
|
310
|
+
host: string;
|
|
311
|
+
message: string;
|
|
312
|
+
fix: string;
|
|
298
313
|
}
|
|
299
314
|
/**
|
|
300
315
|
* Stable front-end-owned hosts for legally required map chrome. Keeping the
|
|
@@ -864,7 +879,14 @@ export declare class RuntimeCore {
|
|
|
864
879
|
* image overlay, which draw from the network rather than from `data`.
|
|
865
880
|
*/
|
|
866
881
|
hasDrawableContent(): boolean;
|
|
867
|
-
/**
|
|
882
|
+
/**
|
|
883
|
+
* Every layer deck is drawing right now, sublayers included, in either
|
|
884
|
+
* renderer mode; empty before a renderer exists. deck 9's Deck has no public
|
|
885
|
+
* `getLayers()` — the list lives on its LayerManager — so this is the one
|
|
886
|
+
* place that reaches for it.
|
|
887
|
+
*/
|
|
888
|
+
private liveDeckLayers;
|
|
889
|
+
/** deck's own per-layer readiness (async layer/pipeline init, and a TileLayer's visible tiles) — whenSettled gates on this too; a capture before it is stably missing content (issue #37's flaky first frame). Headless/basemap-pending count as ready. */
|
|
868
890
|
layersReady(): boolean;
|
|
869
891
|
/**
|
|
870
892
|
* The map's "done drawing" promise (issue #37) — ONE definition for both
|
|
@@ -1009,12 +1031,92 @@ export declare class RuntimeCore {
|
|
|
1009
1031
|
private templateTileLoader;
|
|
1010
1032
|
private readonly templateLoaders;
|
|
1011
1033
|
/**
|
|
1012
|
-
* A
|
|
1013
|
-
*
|
|
1014
|
-
*
|
|
1034
|
+
* A template as deck takes it: `{time}` filled from the layer's `time`
|
|
1035
|
+
* (a new time is new `data`, so deck reloads its tiles — keeping the old
|
|
1036
|
+
* ones on screen until the new ones land), and `{s}` expanded into one
|
|
1037
|
+
* template per subdomain. The array is kept per template, subdomain list
|
|
1038
|
+
* and time, so deck — which compares `data` by reference — sees the same
|
|
1039
|
+
* one on every rebuild and does not reload its tiles.
|
|
1040
|
+
*/
|
|
1041
|
+
private deckTemplateFor;
|
|
1042
|
+
private readonly subdomainMemo;
|
|
1043
|
+
/**
|
|
1044
|
+
* A PMTiles archive's zoom range, or undefined until its header has been
|
|
1045
|
+
* read — the first ask starts that read and rebuilds the layers when it
|
|
1046
|
+
* lands. A header that cannot be read is not asked for again; the tiles
|
|
1047
|
+
* report why.
|
|
1048
|
+
*/
|
|
1049
|
+
private pmtilesZoom;
|
|
1050
|
+
private readonly pmtilesZooms;
|
|
1051
|
+
/**
|
|
1052
|
+
* A layer's national-grid binding (grid-tiles.ts): null while its tile
|
|
1053
|
+
* matrix set's CRS resolves (the layers rebuild when it lands) or when the
|
|
1054
|
+
* set cannot be used (reported once). One binding per layer and set, so
|
|
1055
|
+
* deck keeps one tileset class; re-pointed at the current plane each build.
|
|
1056
|
+
*/
|
|
1057
|
+
private gridBinding;
|
|
1058
|
+
private readonly gridBindings;
|
|
1059
|
+
/**
|
|
1060
|
+
* A layer's publisher style: null while it loads (the layers rebuild when
|
|
1061
|
+
* it lands), "failed" once it could not be used (reported once; the layer
|
|
1062
|
+
* draws with its own colours).
|
|
1063
|
+
*/
|
|
1064
|
+
private vectorStyleFor;
|
|
1065
|
+
private readonly vectorStyles;
|
|
1066
|
+
/**
|
|
1067
|
+
* Reports about one of a layer's settings (its style, its tile matrix set),
|
|
1068
|
+
* kept so they can be withdrawn when that setting changes or the layer
|
|
1069
|
+
* goes — a fixed attribute must not leave its old diagnostic behind.
|
|
1070
|
+
*/
|
|
1071
|
+
private layerReport;
|
|
1072
|
+
private retractLayerReports;
|
|
1073
|
+
private readonly layerReports;
|
|
1074
|
+
/** An MVTLayer's props for its publisher style: GeoJSON tiles (each feature carrying its layerName), drawn one sublayer per style layer at the map's zoom. */
|
|
1075
|
+
private vectorStyleProps;
|
|
1076
|
+
/** The style module, kept once loaded so renderSubLayers stays synchronous. */
|
|
1077
|
+
private vectorStyleModule?;
|
|
1078
|
+
/** A national-grid TileLayer's props: the grid's tileset, a loader filling the WMTS tokens, and each tile drawn warped from its CRS rectangle. */
|
|
1079
|
+
private gridTileProps;
|
|
1080
|
+
/**
|
|
1081
|
+
* An MVTLayer's `fetch` for a PMTiles archive: the tile's bytes out of the
|
|
1082
|
+
* archive, parsed by the layer's own loaders with the options MVTLayer
|
|
1083
|
+
* prepared (tile index, coordinate mode). No tile there is an empty tile.
|
|
1084
|
+
*/
|
|
1085
|
+
private readonly pmtilesVectorFetch;
|
|
1086
|
+
/**
|
|
1087
|
+
* A layer's tile failures: each cause (CORS, an HTTP status, a WMS error)
|
|
1088
|
+
* reported once per layer and template, as `om-layer-error` always and on
|
|
1089
|
+
* the runtime-error channel for validation. A new template retracts the old
|
|
1090
|
+
* one's reports — they described a URL the layer no longer asks for — and a
|
|
1091
|
+
* fixed data= that fails the same way is reported again.
|
|
1015
1092
|
*/
|
|
1016
1093
|
private tileErrorReporter;
|
|
1094
|
+
/** Forget a layer's tile reporter and withdraw what it reported. */
|
|
1095
|
+
private retractTileErrors;
|
|
1017
1096
|
private readonly tileErrorReporters;
|
|
1097
|
+
/**
|
|
1098
|
+
* Layers drawn as plain images under the canvas because their server
|
|
1099
|
+
* refuses cross-origin reads (dom-tile-layer.ts), by layer id, for the
|
|
1100
|
+
* template that was refused — a new template tries WebGL again.
|
|
1101
|
+
*/
|
|
1102
|
+
private readonly domFallbacks;
|
|
1103
|
+
private domFallbackFrame;
|
|
1104
|
+
private domFallbackKey;
|
|
1105
|
+
/** The same question about the layer as it is NOW — what a reporter memoised across rebuilds must ask. */
|
|
1106
|
+
private domFallbackAllowedFor;
|
|
1107
|
+
/** Can this layer fall back to plain images? A flat Web Mercator raster template whose tiles are the tile itself, not asked to stay empty. */
|
|
1108
|
+
private domFallbackAllowed;
|
|
1109
|
+
/**
|
|
1110
|
+
* Drop the plain-image layers that no longer apply — the layer is gone, has
|
|
1111
|
+
* a new template (WebGL gets another try), or is cors-fallback="off" now,
|
|
1112
|
+
* whose failure is then reported afresh as the network error it is. Runs
|
|
1113
|
+
* BEFORE the build, so that build hands deck a fresh error reporter.
|
|
1114
|
+
*/
|
|
1115
|
+
private pruneDomFallbacks;
|
|
1116
|
+
/** Mount the plain-image layers after a rebuild, and run their frame loop while any exist. */
|
|
1117
|
+
private syncDomFallbacks;
|
|
1118
|
+
/** Re-place the plain-image tiles when the view has changed since the last frame. */
|
|
1119
|
+
private layoutDomFallbacks;
|
|
1018
1120
|
/**
|
|
1019
1121
|
* An image TileLayer on a projected map (docs/design/crs.md, gap 2) — the
|
|
1020
1122
|
* relief layer's warp without the shading. Tiles are chosen from the plane's
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a3 as p, a4 as w, a5 as E, a6 as P, a7 as D, a8 as T, a9 as b, aa as k } from "./index-
|
|
1
|
+
import { a3 as p, a4 as w, a5 as E, a6 as P, a7 as D, a8 as T, a9 as b, aa as k } from "./index-DrCMvhhr.js";
|
|
2
2
|
const v = [-11e3, 9e3], A = 126, x = 24, R = 32, S = 1;
|
|
3
3
|
async function H(e, i) {
|
|
4
4
|
const a = p(e), o = a.flatMap((t, n) => t.extent ? a.slice(n + 1).map((h) => [t, h]) : []), [r, s] = await Promise.all([
|
package/dist/tile-url.d.ts
CHANGED
|
@@ -1,17 +1,53 @@
|
|
|
1
|
+
import { type BboxProjector, type CrsBox, type LngLatExtent } from "./bbox-tokens";
|
|
1
2
|
/** Every token a raster TileLayer template may carry. */
|
|
2
|
-
export declare const TILE_TOKENS: readonly ["z", "x", "y", "-y", "bbox-epsg-3857", "width", "height", "quadkey"];
|
|
3
|
-
/** The tokens deck fills on its own — the only ones an MVTLayer
|
|
4
|
-
export declare const DECK_TILE_TOKENS: readonly ["z", "x", "y", "-y"];
|
|
3
|
+
export declare const TILE_TOKENS: readonly ["z", "x", "y", "-y", "s", "time", "bbox-epsg-3857", "width", "height", "quadkey"];
|
|
4
|
+
/** The tokens deck fills on its own, with `{s}` expanded into one template per subdomain and `{time}` filled from the layer's `time` — the only ones an MVTLayer can use. */
|
|
5
|
+
export declare const DECK_TILE_TOKENS: readonly ["z", "x", "y", "-y", "s", "time"];
|
|
5
6
|
/** The tokens only OnlyMapJS fills, for a raster TileLayer. */
|
|
6
7
|
export declare const EXTENDED_TILE_TOKENS: readonly ["bbox-epsg-3857", "width", "height", "quadkey"];
|
|
8
|
+
/** Leaflet's default subdomains for `{s}`. */
|
|
9
|
+
export declare const DEFAULT_SUBDOMAINS: string[];
|
|
10
|
+
/**
|
|
11
|
+
* A layer's `subdomains`: a JSON array (`["t0","t1"]`), a comma list
|
|
12
|
+
* (`a,b,c`), or Leaflet's string of single letters (`abc`). Absent or empty
|
|
13
|
+
* means Leaflet's default, a, b and c.
|
|
14
|
+
*/
|
|
15
|
+
export declare function parseSubdomains(raw: unknown): string[];
|
|
16
|
+
/**
|
|
17
|
+
* A `{s}` template as one template per subdomain, which deck takes as its
|
|
18
|
+
* `data` and spreads tiles across (deck picks among several templates by a
|
|
19
|
+
* hash of the tile, so a tile always asks the same host and stays cached).
|
|
20
|
+
* A template without `{s}` comes back unchanged.
|
|
21
|
+
*/
|
|
22
|
+
export declare function expandSubdomains(template: string, subdomains: readonly string[]): string | string[];
|
|
7
23
|
/**
|
|
8
24
|
* The `{token}` names in a template, in order, duplicates kept. Only
|
|
9
25
|
* identifier-like names count: `{"rasterFunction":"Hillshade"}` in an ArcGIS
|
|
10
26
|
* query string is JSON the service reads, not a token.
|
|
11
27
|
*/
|
|
12
28
|
export declare function templateTokens(template: string): string[];
|
|
29
|
+
/** An extent token in any CRS: `{bbox-epsg-XXXX}`, `{bbox-crs84}`. */
|
|
30
|
+
export declare function isBboxToken(token: string): boolean;
|
|
31
|
+
/** A token only OnlyMapJS fills, for a raster TileLayer: bbox in any CRS, size, quadkey. */
|
|
32
|
+
export declare function isExtendedToken(token: string): boolean;
|
|
13
33
|
/** Does the template carry a token deck cannot fill (bbox, size, quadkey)? */
|
|
14
34
|
export declare function hasExtendedTokens(template: string | string[] | null | undefined): boolean;
|
|
35
|
+
/** A Web Mercator tile's extent in longitude/latitude: west, south, east, north. */
|
|
36
|
+
export declare function tileLngLatExtent(x: number, y: number, z: number): LngLatExtent;
|
|
37
|
+
/**
|
|
38
|
+
* A tile image in ANOTHER CRS than the tile: what a `{bbox-epsg-XXXX}`
|
|
39
|
+
* request returns — the picture of the box enclosing the tile in that CRS.
|
|
40
|
+
* Drawn warped (runtime-core's raster default): the mesh covers the tile,
|
|
41
|
+
* and each point samples the image where `texCoordOf` says.
|
|
42
|
+
*/
|
|
43
|
+
export interface CrsTileImage {
|
|
44
|
+
image: ImageBitmap | object;
|
|
45
|
+
box: CrsBox;
|
|
46
|
+
projector: BboxProjector;
|
|
47
|
+
/** Lng/lat → image (u east, v south), one function per tile so deck sees a stable prop. */
|
|
48
|
+
texCoordOf: (lngLat: [number, number]) => [number, number];
|
|
49
|
+
}
|
|
50
|
+
export declare function isCrsTileImage(data: unknown): data is CrsTileImage;
|
|
15
51
|
/** A tile's Web Mercator bounds in metres: [minx, miny, maxx, maxy]. */
|
|
16
52
|
export declare function tileBboxEpsg3857(x: number, y: number, z: number): [number, number, number, number];
|
|
17
53
|
/** A tile's quadkey: one base-4 digit per zoom level, most significant first ("" at z0). */
|
|
@@ -35,18 +71,40 @@ export declare function fillExtendedTokens(url: string, index: {
|
|
|
35
71
|
}, tileSize?: number): string;
|
|
36
72
|
/**
|
|
37
73
|
* A tile template, passed to deck as its `data` rather than fetched as a
|
|
38
|
-
* document: tile-indexed (`{z}`, `{x}` and `{y}`
|
|
39
|
-
* (`{bbox-epsg-3857}`, a WMS), or
|
|
74
|
+
* document: tile-indexed (`{z}`, `{x}` and `{y}`, or `{-y}` for a TMS row
|
|
75
|
+
* counted from the south), extent-addressed (`{bbox-epsg-3857}`, a WMS), or
|
|
76
|
+
* quadkey-addressed (`{quadkey}`).
|
|
40
77
|
*/
|
|
41
78
|
export declare function isTileTemplateUrl(url: string): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* What a layer's `data` URL is as a tile source: the template itself, or for
|
|
81
|
+
* a PMTiles archive the `<archive>#{z}/{x}/{y}` template its tiles are read
|
|
82
|
+
* through — or undefined for a document to fetch.
|
|
83
|
+
*/
|
|
84
|
+
export declare function tileTemplateOf(url: string): string | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* A tile template that names a vector format: a `.pbf`, `.mvt` or JSON
|
|
87
|
+
* extension on the path, or a format parameter asking for one (`f=json`,
|
|
88
|
+
* `outputFormat=application/json`, `format=pbf`).
|
|
89
|
+
*/
|
|
90
|
+
export declare function isVectorTileTemplate(url: string): boolean;
|
|
42
91
|
/**
|
|
43
92
|
* A tile template whose tiles are IMAGES — what a bare TileLayer draws as
|
|
44
93
|
* bitmaps, and the one tiled source a projected map can warp into its plane.
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
94
|
+
* Every template counts unless it names a vector format: imagery is what tile
|
|
95
|
+
* services overwhelmingly serve, and many say nothing about it in the address
|
|
96
|
+
* (an ArcGIS cache's `…/MapServer/tile/{z}/{y}/{x}`, Google's
|
|
97
|
+
* `…/vt/lyrs=s&x={x}&y={y}&z={z}`). One predicate, shared by the renderer and
|
|
98
|
+
* the validator. A tile that arrives as something other than an image is still
|
|
99
|
+
* drawn as GeoJSON on a Web Mercator map (runtime-core's raster default).
|
|
48
100
|
*/
|
|
49
101
|
export declare function isImageTileTemplate(url: string | null | undefined): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Did a tile load as a picture? What deck's image loading yields (an
|
|
104
|
+
* ImageBitmap, an <img>, a canvas, ImageData, or loaders.gl's
|
|
105
|
+
* `{data, width, height}`), as opposed to parsed JSON.
|
|
106
|
+
*/
|
|
107
|
+
export declare function isTileImage(data: unknown): boolean;
|
|
50
108
|
/**
|
|
51
109
|
* The request options a layer's `load-options` give deck's own tile fetch
|
|
52
110
|
* (loaders.gl reads `fetch`, or `core.fetch`): headers, credentials, mode. A
|
|
@@ -62,11 +120,13 @@ export declare class TileLoadError extends Error {
|
|
|
62
120
|
constructor(message: string, url: string, kind: "network" | "http" | "service-exception" | "not-an-image", status?: number | undefined);
|
|
63
121
|
}
|
|
64
122
|
/**
|
|
65
|
-
* getTileData for a
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
123
|
+
* getTileData for a raster TileLayer's template. Fetches the filled URL and
|
|
124
|
+
* decides by what comes BACK, not by the address: an image is decoded (an
|
|
125
|
+
* ImageBitmap, what deck's own image loading yields); GeoJSON is returned
|
|
126
|
+
* parsed, for the GeoJSON fallback to draw. Anything else — a WMS
|
|
127
|
+
* ServiceException is XML served with status 200, an ArcGIS error is JSON —
|
|
128
|
+
* throws a TileLoadError naming the cause and carrying the status, rather
|
|
129
|
+
* than failing to decode; deck then leaves that tile empty.
|
|
70
130
|
*/
|
|
71
131
|
export declare function templateTileLoader(template: string | string[], tileSize: number, init?: RequestInit): (tile: {
|
|
72
132
|
index: {
|
|
@@ -76,14 +136,21 @@ export declare function templateTileLoader(template: string | string[], tileSize
|
|
|
76
136
|
};
|
|
77
137
|
signal?: AbortSignal;
|
|
78
138
|
url?: string | null;
|
|
79
|
-
}) => Promise<ImageBitmap>;
|
|
139
|
+
}) => Promise<ImageBitmap | object | null>;
|
|
80
140
|
/**
|
|
81
141
|
* A failed tile as a runtime diagnostic: what went wrong and how to fix it.
|
|
82
142
|
* `key` groups failures of the same kind, so a layer reports each cause once
|
|
83
143
|
* rather than once per tile.
|
|
84
144
|
*/
|
|
85
|
-
|
|
145
|
+
/** Why a layer's tiles failed: `network` (no response at all — usually CORS or mixed content), `service-exception` (an error page instead of an image), `http` (a status), or `other` (a response that would not draw). */
|
|
146
|
+
export type TileFailureCause = "network" | "service-exception" | "http" | "other" | "cors-fallback";
|
|
147
|
+
export interface TileFailure {
|
|
148
|
+
/** Groups failures of the same kind: a layer reports each once. */
|
|
86
149
|
key: string;
|
|
150
|
+
cause: TileFailureCause;
|
|
151
|
+
status?: number;
|
|
152
|
+
/** The tile server's host, or "the tile server" when the failure names no URL. */
|
|
153
|
+
host: string;
|
|
87
154
|
entry: {
|
|
88
155
|
severity: "error" | "warning";
|
|
89
156
|
element: string;
|
|
@@ -91,4 +158,5 @@ export declare function describeTileError(layerId: string, error: unknown): {
|
|
|
91
158
|
message: string;
|
|
92
159
|
fix: string;
|
|
93
160
|
};
|
|
94
|
-
}
|
|
161
|
+
}
|
|
162
|
+
export declare function describeTileError(layerId: string, error: unknown): TileFailure | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A WMS time dimension as GetCapabilities publishes it, and the `{time}` token.
|
|
3
|
+
*
|
|
4
|
+
* A dimension is a comma-separated list whose items are single instants
|
|
5
|
+
* (`2024-01-01`) or ISO 8601 intervals `start/end/period`
|
|
6
|
+
* (`2024-01-01/2024-03-01/P1D`) — WMS 1.3.0 Annex C. QGIS reads the same
|
|
7
|
+
* string from the capabilities document, so it can be passed through as is.
|
|
8
|
+
*/
|
|
9
|
+
/** The most instants one dimension expands to: a slider beyond this is not a control a person can use. */
|
|
10
|
+
export declare const MAX_TIME_STEPS = 2000;
|
|
11
|
+
/**
|
|
12
|
+
* Every instant in a time dimension, in order, as the strings a `{time}`
|
|
13
|
+
* template should carry. An interval keeps its start's precision (a date-only
|
|
14
|
+
* start steps in dates). Unreadable items are skipped; at most
|
|
15
|
+
* `MAX_TIME_STEPS` instants come back.
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseTimeDimension(text: string | null | undefined, max?: number): string[];
|
|
18
|
+
/**
|
|
19
|
+
* A template with `{time}` filled. The value is URL-encoded except for the
|
|
20
|
+
* characters ISO 8601 and WMS lists use (`:` `,` `/`), which servers expect
|
|
21
|
+
* as written. A template without the token comes back unchanged; with no time
|
|
22
|
+
* set, `{time}` is filled with nothing, which most services read as "the
|
|
23
|
+
* default time".
|
|
24
|
+
*/
|
|
25
|
+
export declare function fillTimeToken(template: string, time: unknown): string;
|