@nika-js/onlymap 0.13.3 → 0.13.5
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 +32 -0
- package/README.md +9 -5
- package/dist/actions.d.ts +12 -6
- package/dist/attribute-resolution.d.ts +32 -4
- package/dist/{basemap-5NHR6Gio.js → basemap-CErNEhX6.js} +3 -7
- package/dist/basemap.d.ts +1 -5
- package/dist/bbox-tokens.d.ts +70 -0
- package/dist/{build-DJjheWZ2.js → build-ByNIb4VX.js} +1 -1
- package/dist/{client-0mQmDog8.js → client-xe2E4jg4.js} +2 -2
- package/dist/clip-box-controller.d.ts +0 -17
- package/dist/ctx.d.ts +17 -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-DOhMQl-X.js} +1 -1
- package/dist/{globe-view-BFUa9ksE.js → globe-view-84s_uNZX.js} +1 -1
- package/dist/grid-tiles.d.ts +117 -0
- package/dist/{hillshade-B_CxPhtA.js → hillshade-D8h8CRQq.js} +2 -2
- package/dist/{hillshade-shader-r7GxxjXj.js → hillshade-shader-Bm1O0P76.js} +1 -1
- package/dist/{index-YMu_yLXO.js → index-4Y4Q7RP4.js} +3 -3
- package/dist/{index-DWijIMti.js → index-BG_49YHy.js} +33543 -32098
- package/dist/index-BahtHUrg.js +8458 -0
- package/dist/{index-ChmxbIdj.js → index-DTN2CcOQ.js} +43 -43
- package/dist/{index-BvNxS6dM.js → index-DXxQu9Xi.js} +1 -1
- package/dist/{index-A1FYw2dy.js → index-D_EiGesl.js} +1 -1
- package/dist/{index-CObPGkze.js → index-DrSCLk9i.js} +22 -22
- package/dist/{index-CU7RnKnO.js → index-J_Sj6T0S.js} +32 -32
- package/dist/index-bpdGuZR6.js +478 -0
- package/dist/{index-CgIuV5Oh.js → index-phbljJTZ.js} +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/ir-snapshot.d.ts +2 -0
- package/dist/ir.d.ts +18 -0
- package/dist/layer-registry.d.ts +1 -0
- package/dist/layers/warped-bitmap-layer.d.ts +14 -1
- package/dist/{lerc-Bl4vym9y.js → lerc-DLWS3sYw.js} +1 -1
- package/dist/onlymap.standalone.js +69300 -58870
- package/dist/onlymapjs.js +25 -25
- package/dist/parse-manifest.d.ts +4 -1
- package/dist/plane-gpu/plane-basemap.d.ts +237 -237
- package/dist/plane-vector/plane-mvt-layer.d.ts +237 -237
- 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-CHsD0-oP.js} +1 -1
- package/dist/programmatic.d.ts +21 -1
- package/dist/{raster-1ShXyF12.js → raster-B7ILGg0X.js} +4 -4
- package/dist/{raster-pipeline-BMS54TX2.js → raster-pipeline-avMAbONM.js} +11 -11
- package/dist/react/om-layer.d.ts +4 -0
- package/dist/react.js +67 -65
- package/dist/runtime-core.d.ts +106 -4
- package/dist/serialize/emit.d.ts +2 -0
- package/dist/serialize/index.d.ts +2 -0
- package/dist/{terrain-inspect-Cndlmxig.js → terrain-inspect-FKTVm7nv.js} +1 -1
- package/dist/{text-on-path-QInco4aP.js → text-on-path-CpHM02Fs.js} +19 -18
- package/dist/tile-url.d.ts +84 -16
- package/dist/time-dimension.d.ts +25 -0
- package/dist/vector-style-CPvUSy2F.js +518 -0
- package/dist/vector-style.d.ts +59 -0
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-CYD8fyBe.js → zarr-DpbT4eyF.js} +2 -2
- package/dist/zoom-gates.d.ts +60 -0
- package/docs/cartograph.md +2 -2
- package/llms.txt +4 -3
- package/onlymapjs.attributes.json +17 -0
- package/onlymapjs.html-data.json +56 -0
- package/package.json +5 -2
- package/skills/onlymapjs/SKILL.md +10 -3
- package/skills/onlymapjs/references/syntax.md +64 -7
- package/dist/index-DT5d7kFO.js +0 -459
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-BG_49YHy.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 {};
|
|
@@ -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-BG_49YHy.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-Bm1O0P76.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-BG_49YHy.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,6 +1,6 @@
|
|
|
1
|
-
import { aC as j, aD as S, aE as A, aF as M, aG as L } from "./index-
|
|
2
|
-
import { aH as B, aI as K, aJ as V, aK as X } from "./index-
|
|
3
|
-
import { P as h } from "./post-process-effect-
|
|
1
|
+
import { aC as j, aD as S, aE as A, aF as M, aG as L } from "./index-BG_49YHy.js";
|
|
2
|
+
import { aH as B, aI as K, aJ as V, aK as X } from "./index-BG_49YHy.js";
|
|
3
|
+
import { P as h } from "./post-process-effect-CHsD0-oP.js";
|
|
4
4
|
const O = `
|
|
5
5
|
float omfx_lum(vec3 c) { return dot(c, vec3(0.299, 0.587, 0.114)); }
|
|
6
6
|
float omfx_hash(vec2 p) { return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); }
|