@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.
- package/CHANGELOG.md +28 -0
- package/README.md +8 -3
- package/dist/{basemap-CdSCIWCl.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-CUx4yR_O.js → build-DQCmcQE1.js} +1 -1
- package/dist/{client-DVkMuuPp.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 +22 -23
- 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-DuCEsCOu.js → geoparquet-DbVJrJYG.js} +1 -1
- package/dist/{globe-view-BWNfn-Sx.js → globe-view-CrGbvqqZ.js} +1 -1
- package/dist/grid-tiles.d.ts +117 -0
- package/dist/{hillshade-DyfYxqNm.js → hillshade-CGY_OBaG.js} +2 -2
- package/dist/{hillshade-shader-BWA0USDQ.js → hillshade-shader-w8tmFgaV.js} +1 -1
- package/dist/{index-Cc3huYsW.js → index-2lD29y87.js} +25 -25
- package/dist/index-BahtHUrg.js +8458 -0
- package/dist/{index-DRGcZmBm.js → index-Bdltig68.js} +1 -1
- package/dist/{index-DabUE8w3.js → index-ChoEWeXU.js} +1 -1
- package/dist/{index-DfzI_j0D.js → index-Cm2sfhw7.js} +1 -1
- package/dist/{index-BfHaNHyY.js → index-DrCMvhhr.js} +32928 -31454
- package/dist/{index-CCj9Z5yt.js → index-Dtsf-TPD.js} +22 -22
- package/dist/{index-DYrgHprN.js → index-GfvWJDX0.js} +36 -36
- package/dist/{index-dUoVyYIW.js → index-QrGqSW_H.js} +3 -3
- package/dist/{index-DiDoH_BG.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-CUV0h9Ci.js → lerc-DxujwTm7.js} +1 -1
- package/dist/onlymap.standalone.js +71944 -61501
- 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-DPrpqybM.js → post-process-effect-BL9rBDEh.js} +1 -1
- package/dist/programmatic.d.ts +17 -1
- package/dist/{raster-CrRQNJE7.js → raster-Bq768NZr.js} +4 -4
- package/dist/{raster-pipeline-D9g8RAo4.js → raster-pipeline-C898iYqw.js} +11 -11
- package/dist/runtime-core.d.ts +118 -1
- package/dist/{terrain-inspect-GowNVtMZ.js → terrain-inspect-DNZO8z6S.js} +1 -1
- package/dist/{text-on-path-BoFbm-tl.js → text-on-path-owfh8Ac6.js} +1 -1
- package/dist/tile-url.d.ts +162 -0
- 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-C8CU8LXU.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 +41 -1
- package/package.json +5 -2
- package/skills/onlymapjs/SKILL.md +9 -2
- package/skills/onlymapjs/references/syntax.md +43 -4
|
@@ -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 {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as w, ab as F, ac as M, ad as B, ae as H, af as $, ag as b, ah as E, ai as _, aj as S, ak as D, aa as O } from "./index-
|
|
1
|
+
import { c as w, ab as F, ac as M, ad as B, ae as H, af as $, ag as b, ah as E, ai as _, aj as S, ak as D, aa as O } from "./index-DrCMvhhr.js";
|
|
2
2
|
import { N as P, c as C } from "./hillshade-apron-Bem3DWyJ.js";
|
|
3
|
-
import { p as N, h as R, m as Z, a as U } from "./hillshade-shader-
|
|
3
|
+
import { p as N, h as R, m as Z, a as U } from "./hillshade-shader-w8tmFgaV.js";
|
|
4
4
|
const A = 64, f = /* @__PURE__ */ new Map();
|
|
5
5
|
function L(t) {
|
|
6
6
|
const e = f.get(t);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { al as d } from "./index-
|
|
1
|
+
import { al as d } from "./index-DrCMvhhr.js";
|
|
2
2
|
const u = 110574, m = 111320, o = Math.PI / 180, f = { none: 0, mercator: 1, geographic: 2 };
|
|
3
3
|
function E(e, a, s = "HillshadeLayer") {
|
|
4
4
|
const h = (l) => l == null || l === "" ? [] : typeof l == "number" ? Number.isFinite(l) ? [l] : [] : String(l).split(/[\s,]+/).filter(Boolean).map(Number).filter((r) => Number.isFinite(r));
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { b5 as E, b6 as x, b7 as N, b8 as R, b9 as h, ba as b, bb as O, bc as W, bd as I, be as S, bf as B, bg as P, bh as _, bi as k, bj as z, bk as $, bl as C, bm as F, bn as v, bo as M, bp as w, bq as D } from "./index-DrCMvhhr.js";
|
|
2
|
+
import { br as ze, bs as $e, bt as Ce, bu as ve, bv as Me, bw as De, bx as Ue, by as je, bz as Je, bA as qe, bB as Ge, bC as He, bD as Ve, bE as Ke, bF as Qe, bG as Xe, bH as Ye, bI as Ze, bJ as et, bK as tt, bL as nt, bM as rt, bN as at, bO as st, bP as ot } from "./index-DrCMvhhr.js";
|
|
3
3
|
import { g as U, i as j } from "./table-accessors-CYWTzpQI.js";
|
|
4
4
|
async function J(t, e, n = {}, r = {}) {
|
|
5
5
|
const a = E(t), s = x.getWorkerFarm(n), { source: o } = n, c = { name: a, source: o };
|
|
6
|
-
o || (c.url =
|
|
6
|
+
o || (c.url = N(t, n));
|
|
7
7
|
const i = s.getWorkerPool(c), u = n.jobName || t.name, d = await i.startJob(
|
|
8
8
|
u,
|
|
9
9
|
// eslint-disable-next-line
|
|
10
10
|
q.bind(null, r)
|
|
11
|
-
), y =
|
|
11
|
+
), y = R(n);
|
|
12
12
|
return d.postMessage("process", { input: e, options: y }), (await d.result).result;
|
|
13
13
|
}
|
|
14
14
|
async function q(t, e, n, r) {
|
|
@@ -158,7 +158,7 @@ async function Q(t) {
|
|
|
158
158
|
}
|
|
159
159
|
function xe(t, e, n, r) {
|
|
160
160
|
!Array.isArray(e) && !b(e) && (r = void 0, n = e, e = void 0), n = n || {};
|
|
161
|
-
const s =
|
|
161
|
+
const s = O(e, r), o = W(t, s, n);
|
|
162
162
|
if (!o)
|
|
163
163
|
return null;
|
|
164
164
|
const c = I(n, o, s), i = S(t), u = () => {
|
|
@@ -167,7 +167,7 @@ function xe(t, e, n, r) {
|
|
|
167
167
|
return r = B({ url: i, _parseSync: u, _parse: u, loaders: e }, c, r || null), X(o, t, c, r);
|
|
168
168
|
}
|
|
169
169
|
function X(t, e, n, r) {
|
|
170
|
-
if (e =
|
|
170
|
+
if (e = P(e, t), t.parseTextSync && typeof e == "string")
|
|
171
171
|
return t.parseTextSync(e, n);
|
|
172
172
|
if (t.parseSync && e instanceof ArrayBuffer)
|
|
173
173
|
return t.parseSync(e, n, r);
|
|
@@ -179,7 +179,7 @@ function Y(t) {
|
|
|
179
179
|
async function l(t, e, n, r) {
|
|
180
180
|
const a = Array.isArray(e) ? e : void 0;
|
|
181
181
|
!Array.isArray(e) && !b(e) && (r = void 0, n = e, e = void 0), t = await t, n = n || {};
|
|
182
|
-
const s = S(t), o = await
|
|
182
|
+
const s = S(t), o = await _(t, e, n);
|
|
183
183
|
if (!o)
|
|
184
184
|
return [];
|
|
185
185
|
const c = I(n, o, a, s);
|
|
@@ -206,7 +206,7 @@ async function Z(t, e, n, r) {
|
|
|
206
206
|
return o(a);
|
|
207
207
|
}
|
|
208
208
|
async function ee(t, e, n, r) {
|
|
209
|
-
const a = await
|
|
209
|
+
const a = await z(e, n), s = await re(a, n?.core?.transforms || []);
|
|
210
210
|
return t.parseInBatches ? t.parseInBatches(s, n, r) : te(s, t, n, r);
|
|
211
211
|
}
|
|
212
212
|
async function* te(t, e, n, r) {
|
|
@@ -282,7 +282,7 @@ function oe(t) {
|
|
|
282
282
|
return [{ ...t, start: 0, end: t.length }];
|
|
283
283
|
}
|
|
284
284
|
async function Be(t, e, n) {
|
|
285
|
-
const a = { ...
|
|
285
|
+
const a = { ...M(), ...n };
|
|
286
286
|
return e.encodeURLtoURL ? ue(e, t, a) : G(e, a) ? await J(e, t, a) : await e.encode(t, a);
|
|
287
287
|
}
|
|
288
288
|
function ce(t, e, n) {
|
|
@@ -330,7 +330,7 @@ async function ue(t, e, n) {
|
|
|
330
330
|
const r = T("input");
|
|
331
331
|
await new K(r, "w").write(e);
|
|
332
332
|
const s = T("output"), o = await ie(r, s, t, n);
|
|
333
|
-
return (await
|
|
333
|
+
return (await D(o)).arrayBuffer();
|
|
334
334
|
}
|
|
335
335
|
function fe(t) {
|
|
336
336
|
return [{ ...t, start: 0, end: t.length }];
|
|
@@ -388,7 +388,7 @@ function Ee(t, e) {
|
|
|
388
388
|
}
|
|
389
389
|
);
|
|
390
390
|
}
|
|
391
|
-
const L = "4.4.3",
|
|
391
|
+
const L = "4.4.3", Ne = {
|
|
392
392
|
dataType: null,
|
|
393
393
|
batchType: null,
|
|
394
394
|
name: "Null loader",
|
|
@@ -402,7 +402,7 @@ const L = "4.4.3", Re = {
|
|
|
402
402
|
options: {
|
|
403
403
|
null: {}
|
|
404
404
|
}
|
|
405
|
-
},
|
|
405
|
+
}, Re = {
|
|
406
406
|
dataType: null,
|
|
407
407
|
batchType: null,
|
|
408
408
|
name: "Null loader",
|
|
@@ -425,7 +425,7 @@ const L = "4.4.3", Re = {
|
|
|
425
425
|
function m(t, e, n) {
|
|
426
426
|
return null;
|
|
427
427
|
}
|
|
428
|
-
async function
|
|
428
|
+
async function Oe(t, e, n = () => {
|
|
429
429
|
}, r = () => {
|
|
430
430
|
}) {
|
|
431
431
|
if (t = await t, !t.ok)
|
|
@@ -458,7 +458,7 @@ async function A(t, e, n, r, a, s, o) {
|
|
|
458
458
|
t.error(c), o(c);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
class
|
|
461
|
+
class We {
|
|
462
462
|
_fetch;
|
|
463
463
|
files = {};
|
|
464
464
|
lowerCaseFiles = {};
|
|
@@ -534,19 +534,19 @@ class Oe {
|
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
export {
|
|
537
|
-
|
|
537
|
+
ze as FetchError,
|
|
538
538
|
ge as JSONLoader,
|
|
539
|
-
|
|
540
|
-
|
|
539
|
+
Re as NullLoader,
|
|
540
|
+
Ne as NullWorkerLoader,
|
|
541
541
|
$e as RequestScheduler,
|
|
542
|
-
|
|
543
|
-
|
|
542
|
+
We as _BrowserFileSystem,
|
|
543
|
+
Oe as _fetchProgress,
|
|
544
544
|
Ae as _selectSource,
|
|
545
545
|
Ce as _unregisterLoaders,
|
|
546
546
|
ve as assert,
|
|
547
547
|
$ as concatenateArrayBuffersAsync,
|
|
548
|
-
|
|
549
|
-
|
|
548
|
+
Me as createDataSource,
|
|
549
|
+
De as document,
|
|
550
550
|
Be as encode,
|
|
551
551
|
Le as encodeInBatches,
|
|
552
552
|
ce as encodeSync,
|
|
@@ -556,9 +556,9 @@ export {
|
|
|
556
556
|
ke as encodeText,
|
|
557
557
|
Fe as encodeTextSync,
|
|
558
558
|
ie as encodeURLtoURL,
|
|
559
|
-
|
|
559
|
+
D as fetchFile,
|
|
560
560
|
Ue as forEach,
|
|
561
|
-
|
|
561
|
+
M as getLoaderOptions,
|
|
562
562
|
je as getPathPrefix,
|
|
563
563
|
Je as global,
|
|
564
564
|
qe as isAsyncIterable,
|
|
@@ -585,8 +585,8 @@ export {
|
|
|
585
585
|
Te as readArrayBuffer,
|
|
586
586
|
nt as registerLoaders,
|
|
587
587
|
w as resolvePath,
|
|
588
|
-
|
|
589
|
-
|
|
588
|
+
_ as selectLoader,
|
|
589
|
+
W as selectLoaderSync,
|
|
590
590
|
rt as self,
|
|
591
591
|
at as setLoaderOptions,
|
|
592
592
|
st as setPathPrefix,
|