@nika-js/onlymap 0.13.1 → 0.13.3
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 +3 -2
- package/bin/dem-tiles.mjs +270 -0
- package/bin/onlymapjs.mjs +138 -34
- package/dist/{basemap-zG1-omic.js → basemap-5NHR6Gio.js} +2 -2
- package/dist/{build-Bbi4SleC.js → build-DJjheWZ2.js} +10 -10
- package/dist/camera-altitude.d.ts +29 -0
- package/dist/{client-CIH6ToMI.js → client-0mQmDog8.js} +2 -2
- package/dist/color.d.ts +15 -0
- package/dist/credit-chrome.d.ts +11 -0
- package/dist/data-layer.d.ts +7 -15
- package/dist/elements/om-map.d.ts +41 -1
- package/dist/geodesy.d.ts +2 -0
- package/dist/{geoparquet-CyWsYt9S.js → geoparquet-B_nO2OyP.js} +3 -3
- package/dist/{globe-view-Xelgj_KW.js → globe-view-BFUa9ksE.js} +1 -1
- package/dist/ground-controller.d.ts +39 -0
- package/dist/{hillshade-Zbg50lm6.js → hillshade-B_CxPhtA.js} +61 -64
- package/dist/{hillshade-shader-DI2uLSNU.js → hillshade-shader-r7GxxjXj.js} +12 -11
- package/dist/hillshade-shader.d.ts +2 -2
- package/dist/hillshade.d.ts +0 -29
- package/dist/{index-JFuN4DCn.js → index-A1FYw2dy.js} +1 -1
- package/dist/{index-BbVnkgld.js → index-BvNxS6dM.js} +38 -38
- package/dist/{index-ClAPAqcm.js → index-CObPGkze.js} +38 -38
- package/dist/{index-BL_YCKiW.js → index-CU7RnKnO.js} +62 -62
- package/dist/{index-6eeSlSqN.js → index-CgIuV5Oh.js} +3 -3
- package/dist/{index-DnCmvLuC.js → index-ChmxbIdj.js} +61 -61
- package/dist/{index-BwtXeP_F.js → index-DT5d7kFO.js} +1 -1
- package/dist/{index-CpFNIkOO.js → index-DWijIMti.js} +22217 -20712
- package/dist/{index-BtRsa5oc.js → index-YMu_yLXO.js} +18 -18
- package/dist/index.d.ts +1 -1
- package/dist/{lerc-C3SKC6CU.js → lerc-Bl4vym9y.js} +1 -1
- package/dist/onlymap.standalone.js +39073 -37485
- package/dist/onlymapjs.js +49 -49
- package/dist/plane-gpu/plane-basemap.d.ts +0 -14
- package/dist/{post-process-effect-C3P9VwC9.js → post-process-effect-gFGVlC77.js} +1 -1
- package/dist/programmatic.d.ts +3 -1
- package/dist/{raster-BgCnz9-Z.js → raster-1ShXyF12.js} +4 -4
- package/dist/{raster-pipeline-CKdpKgFo.js → raster-pipeline-BMS54TX2.js} +11 -11
- package/dist/runtime-core.d.ts +147 -0
- package/dist/sea-surface.d.ts +18 -0
- package/dist/terrain-derive.d.ts +39 -0
- package/dist/terrain-ground.d.ts +31 -0
- package/dist/terrain-heightfield.d.ts +17 -9
- package/dist/terrain-inspect-Cndlmxig.js +96 -0
- package/dist/terrain-inspect.d.ts +34 -0
- package/dist/terrain-nodata.d.ts +50 -0
- package/dist/terrain-priority.d.ts +92 -0
- package/dist/terrain-sample.d.ts +6 -0
- package/dist/terrain-skirt.d.ts +6140 -0
- package/dist/terrain-texture-mask.d.ts +40 -0
- package/dist/terrain-tint.d.ts +61 -0
- package/dist/terrain.d.ts +132 -8
- package/dist/{text-on-path-BpVLX8Yt.js → text-on-path-QInco4aP.js} +1 -1
- package/dist/tile-url.d.ts +94 -0
- package/dist/version.d.ts +1 -1
- package/dist/viewport-filter.d.ts +9 -0
- package/dist/volumetrics.d.ts +11 -0
- package/dist/{zarr-Cur_pzNa.js → zarr-CYD8fyBe.js} +2 -2
- package/docs/cartograph.md +2 -2
- package/llms.txt +2 -2
- package/onlymapjs.html-data.json +163 -3
- package/package.json +2 -1
- package/skills/onlymapjs/SKILL.md +6 -2
- package/skills/onlymapjs/references/syntax.md +12 -3
package/dist/onlymapjs.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c5 as e, c6 as r, c7 as t, ai as o, C as c, c8 as d, c as i, c9 as n, ca as l, cb as S, cc as E, aH as g, cd as L, ce as T, cf as _, cg as A, ch as p, ci as m, cj as I, ck as u, L as D, g as M, cl as y, cm as f, cn as O, co as P, cp as R, bV as C, cq as N, ac as F, cr as h, aR as v, cs as B, W as b, ct as x, aQ as G, cu as w, cv as U, cw as W, cx as H, cy as Y, cz as k, cA as X, cB as K, cC as z, cD as V, cE as j, cF as J, cG as q, cH as Q, cI as Z, cJ as $, cK as aa, aK as sa, cL as ea, cM as ra, cN as ta, cO as oa, cP as ca, cQ as da, cR as ia, cS as na, cT as la, cU as Sa, cV as Ea, cW as ga, af as La, cX as Ta, cY as _a, aE as Aa, cZ as pa, c_ as ma, c$ as Ia, d0 as ua, d1 as Da, d2 as Ma, d3 as ya, d4 as fa, d5 as Oa, d6 as Pa, d7 as Ra, d8 as Ca, d9 as Na, da as Fa, db as ha, dc as va, dd as Ba, de as ba, df as xa, dg as Ga, dh as wa, di as Ua, dj as Wa, dk as Ha, dl as Ya, dm as ka, dn as Xa, dp as Ka, dq as za, dr as Va, aS as ja, ds as Ja, dt as qa, du as Qa, dv as Za, dw as $a, dx as as, dy as ss, dz as es, dA as rs, dB as ts, dC as os, dD as cs, dE as ds, dF as is, dG as ns, dH as ls, dI as Ss } from "./index-DWijIMti.js";
|
|
2
2
|
export {
|
|
3
3
|
e as ALL_POSITION_VALUES,
|
|
4
4
|
r as AUDIT_EXEMPTIONS,
|
|
5
5
|
t as AccessorCache,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
o as BitmapLayer,
|
|
7
|
+
c as COORDINATE_SYSTEM,
|
|
8
|
+
d as CompileError,
|
|
9
|
+
i as CompositeLayer,
|
|
10
10
|
n as DEFAULT_AUDIT_WIDTHS,
|
|
11
11
|
l as DEFAULT_FOLD_BREAKPOINT_PX,
|
|
12
12
|
S as DRONE_SENSOR_DATABASE,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
E as EDGE_TOLERANCE_PX,
|
|
14
|
+
g as EFFECT_PRESET_NAMES,
|
|
15
15
|
L as FOLD_BOTTOM_CLEARANCE_PX,
|
|
16
16
|
T as FOLD_HYSTERESIS_PX,
|
|
17
17
|
_ as FOLD_SIDES,
|
|
@@ -20,8 +20,8 @@ export {
|
|
|
20
20
|
m as IconLayer,
|
|
21
21
|
I as LEGACY_POSITION_ALIASES,
|
|
22
22
|
u as LIGHTING_PRESET_NAMES,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
D as Layer,
|
|
24
|
+
M as LayerExtension,
|
|
25
25
|
y as MANAGED_SLOTS,
|
|
26
26
|
f as MapController,
|
|
27
27
|
O as OmMap,
|
|
@@ -29,43 +29,43 @@ export {
|
|
|
29
29
|
R as ScenegraphLayer,
|
|
30
30
|
C as SimpleMeshLayer,
|
|
31
31
|
N as Tile3DLayer,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
F as TileLayer,
|
|
33
|
+
h as UNIT_SYSTEMS,
|
|
34
34
|
v as WGS84_MEAN_RADIUS_M,
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
B as WIDGET_STYLE_KEY_NAMES,
|
|
36
|
+
b as WebMercatorViewport,
|
|
37
37
|
x as arrowTableToColumnar,
|
|
38
38
|
G as asRows,
|
|
39
39
|
w as auditLayout,
|
|
40
40
|
U as badgeMode,
|
|
41
41
|
W as bottomEndLiftPx,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
H as compileExpression,
|
|
43
|
+
Y as compileFullJsAccessorBlockInSandbox,
|
|
44
|
+
k as computeTimeline,
|
|
45
45
|
X as configureBasemap,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
K as configureCrs,
|
|
47
|
+
z as configureData,
|
|
48
|
+
V as configureIfc,
|
|
49
49
|
j as configureLicense,
|
|
50
|
-
|
|
50
|
+
J as configureTelemetry,
|
|
51
51
|
q as descriptorToIR,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
Q as destroySandbox,
|
|
53
|
+
Z as distanceMeters,
|
|
54
|
+
$ as effectiveFoldBreakpointPx,
|
|
55
55
|
aa as evaluateInSandbox,
|
|
56
56
|
sa as expandPreset,
|
|
57
57
|
ea as foldDrawerStyle,
|
|
58
58
|
ra as foldPanelStyle,
|
|
59
59
|
ta as foldSideForSlot,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
oa as foldToggleSlot,
|
|
61
|
+
ca as foldToggleStyle,
|
|
62
|
+
da as formatArea,
|
|
63
|
+
ia as formatLength,
|
|
64
64
|
na as getBasemap,
|
|
65
65
|
la as getEntitlements,
|
|
66
66
|
Sa as getLayerSchema,
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
Ea as getMeasureRadiusMeters,
|
|
68
|
+
ga as getRoutingProvider,
|
|
69
69
|
La as getTerrain,
|
|
70
70
|
Ta as isBrowser,
|
|
71
71
|
_a as isColumnar,
|
|
@@ -74,8 +74,8 @@ export {
|
|
|
74
74
|
ma as lineStringLengthMeters,
|
|
75
75
|
Ia as loadIfc,
|
|
76
76
|
ua as loadRasterModule,
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
Da as midpoint,
|
|
78
|
+
Ma as mountForTest,
|
|
79
79
|
ya as niceNumber,
|
|
80
80
|
fa as normalizeData,
|
|
81
81
|
Oa as parseDurationMs,
|
|
@@ -83,38 +83,38 @@ export {
|
|
|
83
83
|
Ra as parseUnitSystem,
|
|
84
84
|
Ca as parseWidgetStyle,
|
|
85
85
|
Na as pathLengthMeters,
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
Fa as registerAction,
|
|
87
|
+
ha as registerBasemap,
|
|
88
88
|
va as registerCrs,
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
Ba as registerFormat,
|
|
90
|
+
ba as registerLayer,
|
|
91
91
|
xa as registerRoutingProvider,
|
|
92
92
|
Ga as registerSource,
|
|
93
93
|
wa as registerTerrain,
|
|
94
94
|
Ua as registerWidget,
|
|
95
95
|
Wa as registeredCrsCodes,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
Ha as releaseDataOwner,
|
|
97
|
+
Ya as resolveCrs,
|
|
98
|
+
ka as resolveFoldBreakpointPx,
|
|
99
99
|
Xa as resolveImageOverlay,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
Ka as resolveLighting,
|
|
101
|
+
za as resolveProjection,
|
|
102
|
+
Va as resolveSlot,
|
|
103
103
|
ja as ringAreaMeters2,
|
|
104
|
-
|
|
104
|
+
Ja as ringEnclosesPole,
|
|
105
105
|
qa as ringPerimeterMeters,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
Qa as rowAt,
|
|
107
|
+
Za as sandboxHtml,
|
|
108
|
+
$a as scaleBarStep,
|
|
109
109
|
as as setKeepBadge,
|
|
110
110
|
ss as setMeasureRadiusMeters,
|
|
111
111
|
es as settleLayout,
|
|
112
112
|
rs as shouldFoldAtWidth,
|
|
113
113
|
ts as slotContainerStyle,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
os as slotLayout,
|
|
115
|
+
cs as snapshotDescriptorIR,
|
|
116
|
+
ds as snapshotIR,
|
|
117
|
+
is as solarAzElDegrees,
|
|
118
118
|
ns as subscribeLicense,
|
|
119
119
|
ls as validateManifest,
|
|
120
120
|
Ss as validateManifestString
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GPU projection, phase 5 (docs/design/gpu-projection.md): the keyless vector
|
|
3
|
-
* basemap on a projected map. `basemap="positron"` (or `liberty`, `bright`) on
|
|
4
|
-
* a map whose plane the shader draws renders OpenFreeMap's vector tiles —
|
|
5
|
-
* the same tiles those presets draw through MapLibre in Web Mercator —
|
|
6
|
-
* through the plane's own vector-tile path, styled by OnlyMap's approximation
|
|
7
|
-
* of each preset.
|
|
8
|
-
*
|
|
9
|
-
* Geometry only: land cover, water, aeroways, buildings, roads, rail and
|
|
10
|
-
* boundaries. No labels — text on a projected map would need live
|
|
11
|
-
* decluttering, which the library does not have (`declutter` is the SVG
|
|
12
|
-
* exporter's). A MapLibre style renderer is out of scope; each preset is a
|
|
13
|
-
* palette taken from its own style (tiles.openfreemap.org/styles/<name>).
|
|
14
|
-
*/
|
|
15
1
|
import { type Layer } from "@deck.gl/core";
|
|
16
2
|
import type { MVTLayer } from "@deck.gl/geo-layers";
|
|
17
3
|
import { PlaneMVTLayer } from "../plane-vector/plane-mvt-layer";
|
package/dist/programmatic.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Effect } from "@deck.gl/core";
|
|
2
|
-
import { type CameraOptions, type MandatedChromeHosts } from "./runtime-core";
|
|
2
|
+
import { type Camera, type CameraOptions, type MandatedChromeHosts } from "./runtime-core";
|
|
3
3
|
import type { HoverPickMode } from "./hover-pick";
|
|
4
4
|
import { type LightingIR, type LightingOptions } from "./scene-lighting";
|
|
5
5
|
import type { TerrainIR } from "./terrain";
|
|
@@ -373,6 +373,8 @@ export declare class MapController {
|
|
|
373
373
|
flyToBounds(bounds: [[number, number], [number, number]], padding?: number, opts?: CameraOptions): void;
|
|
374
374
|
setView(partial: Partial<CameraState>, opts?: CameraOptions): void;
|
|
375
375
|
getViewState(): CameraState;
|
|
376
|
+
/** The camera with its eye's `altitude`, the `targetElevation` under the view centre and the eye's `clearance` above the ground — true metres; see `<om-map>.getCamera()`. */
|
|
377
|
+
getCamera(): Camera;
|
|
376
378
|
/**
|
|
377
379
|
* Pause descriptor-owned live transports while retaining canonical map state.
|
|
378
380
|
* `retain` because this pause is meant to be reversed: `resume()` repaints the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as se, t as $e, i as Ct, a as ke, s as Lt, C as It, b as Gt, F as vt, A as Et, d as Ft, R as ye, e as At, p as jt, m as Rt, f as Mt, g as We, h as Ut, r as le, j as Ot, k as xt, l as Kt, n as Dt } from "./raster-pipeline-
|
|
1
|
+
import { c as se, t as $e, i as Ct, a as ke, s as Lt, C as It, b as Gt, F as vt, A as Et, d as Ft, R as ye, e as At, p as jt, m as Rt, f as Mt, g as We, h as Ut, r as le, j as Ot, k as xt, l as Kt, n as Dt } from "./raster-pipeline-BMS54TX2.js";
|
|
2
2
|
import { N as Nt, c as zt } from "./hillshade-apron-Bem3DWyJ.js";
|
|
3
|
-
import { r as Bt } from "./hillshade-shader-
|
|
4
|
-
import {
|
|
3
|
+
import { r as Bt } from "./hillshade-shader-r7GxxjXj.js";
|
|
4
|
+
import { c0 as _t, c1 as $t } from "./index-DWijIMti.js";
|
|
5
5
|
import we from "./index-CW1n5LdO.js";
|
|
6
6
|
function kt(e, t) {
|
|
7
7
|
const n = e.length / 3, r = new Uint8ClampedArray(n * 4), o = 0, i = n, a = n * 2;
|
|
@@ -1072,7 +1072,7 @@ j.set(f.Zstd, () => import("./zstd-jXobGRcq.js").then((e) => e.decode));
|
|
|
1072
1072
|
j.set(f.Jpeg, () => Promise.resolve(ce));
|
|
1073
1073
|
j.set(f.Jpeg6, () => Promise.resolve(ce));
|
|
1074
1074
|
j.set(f.Webp, () => Promise.resolve(ce));
|
|
1075
|
-
j.set(f.Lerc, () => import("./lerc-
|
|
1075
|
+
j.set(f.Lerc, () => import("./lerc-Bl4vym9y.js").then((e) => e.decode));
|
|
1076
1076
|
async function ue(e, t, n) {
|
|
1077
1077
|
const r = j.get(t);
|
|
1078
1078
|
if (!r)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { w as he } from "./mgrs-BY9bIvp4.js";
|
|
2
|
-
import {
|
|
3
|
-
import { p as ye, a as Le, h as we } from "./hillshade-shader-
|
|
2
|
+
import { am as de, bU as fe, bV as re, c as oe, bW as me, G as pe, bX as ge, a_ as Z, bY as ve, N as be, bZ as xe, b_ as Pe, b$ as Te, ac as ie } from "./index-DWijIMti.js";
|
|
3
|
+
import { p as ye, a as Le, h as we } from "./hillshade-shader-r7GxxjXj.js";
|
|
4
4
|
function Oe(n, e, t) {
|
|
5
5
|
const { projectedCorners: s } = e, { topLeft: r, topRight: o, bottomRight: i, bottomLeft: a } = s, c = t(r[0], r[1]), u = t(o[0], o[1]), l = t(i[0], i[1]), d = t(a[0], a[1]), f = [
|
|
6
6
|
c,
|
|
@@ -742,7 +742,7 @@ const J = 512, qe = [
|
|
|
742
742
|
// right edge
|
|
743
743
|
[0.5, 1]
|
|
744
744
|
// bottom edge
|
|
745
|
-
]), E = 6378137, S = 2 * Math.PI * E, K = S / 2,
|
|
745
|
+
]), E = 6378137, S = 2 * Math.PI * E, K = S / 2, _ = 85.05112877980659;
|
|
746
746
|
class z {
|
|
747
747
|
/** Index across a row */
|
|
748
748
|
x;
|
|
@@ -906,7 +906,7 @@ function Ge(n, e) {
|
|
|
906
906
|
const [r, o] = n(t, s);
|
|
907
907
|
if (Number.isFinite(r) && Number.isFinite(o))
|
|
908
908
|
return [r, o];
|
|
909
|
-
const [i, a] = e(t, s), u = Math.max(-
|
|
909
|
+
const [i, a] = e(t, s), u = Math.max(-_, Math.min(_, a)) * Math.PI / 180, l = i * Math.PI * E / 180, d = Math.log(Math.tan(Math.PI / 4 + u / 2)) * E;
|
|
910
910
|
return [l, d];
|
|
911
911
|
};
|
|
912
912
|
}
|
|
@@ -926,7 +926,7 @@ function Je([n, e]) {
|
|
|
926
926
|
];
|
|
927
927
|
}
|
|
928
928
|
const Ke = 100;
|
|
929
|
-
function
|
|
929
|
+
function _e(n) {
|
|
930
930
|
const { descriptor: e, viewport: t, datasetWgs84Bounds: s } = n, r = e.levels[0], o = [];
|
|
931
931
|
if (r.matrixWidth * r.matrixHeight <= Ke) {
|
|
932
932
|
for (let m = 0; m < r.matrixHeight; m++)
|
|
@@ -948,7 +948,7 @@ function Qe(n) {
|
|
|
948
948
|
o.push(new z(p, m, 0, { descriptor: e }));
|
|
949
949
|
return o;
|
|
950
950
|
}
|
|
951
|
-
function
|
|
951
|
+
function Qe(n, e) {
|
|
952
952
|
const { viewport: t, maxZ: s, zRange: r, wgs84Bounds: o, pixelRatio: i = 1 } = e, a = e.boundingVolumeCache ?? new ce();
|
|
953
953
|
a.sweep();
|
|
954
954
|
const c = t instanceof pe && t.resolution ? t.projectPosition : null, u = Object.values(t.getFrustumPlanes()).map(({ normal: O, distance: B }) => new ge(O.clone().negate(), B)), l = new ve(u), d = t.distanceScales.unitsPerMeter[2], f = r && r[0] * d || 0, h = r && r[1] * d || 0, m = 0, [p, g, P, b] = o, x = Z([p, g]), v = Z([P, b]), T = [
|
|
@@ -956,7 +956,7 @@ function _e(n, e) {
|
|
|
956
956
|
x[1],
|
|
957
957
|
v[0],
|
|
958
958
|
v[1]
|
|
959
|
-
], w =
|
|
959
|
+
], w = _e({
|
|
960
960
|
descriptor: n,
|
|
961
961
|
viewport: t,
|
|
962
962
|
datasetWgs84Bounds: o
|
|
@@ -1062,7 +1062,7 @@ class ot extends Te {
|
|
|
1062
1062
|
const { viewport: t, minZoom: s } = e;
|
|
1063
1063
|
if (typeof s == "number" && t.zoom < s)
|
|
1064
1064
|
return [];
|
|
1065
|
-
const r = this.descriptor.levels.length - 1, o = typeof e.maxZoom == "number" ? Math.min(e.maxZoom, r) : r, i =
|
|
1065
|
+
const r = this.descriptor.levels.length - 1, o = typeof e.maxZoom == "number" ? Math.min(e.maxZoom, r) : r, i = Qe(this.descriptor, {
|
|
1066
1066
|
viewport: t,
|
|
1067
1067
|
maxZ: o,
|
|
1068
1068
|
zRange: e.zRange ?? null,
|
|
@@ -1142,7 +1142,7 @@ class ot extends Te {
|
|
|
1142
1142
|
};
|
|
1143
1143
|
}
|
|
1144
1144
|
}
|
|
1145
|
-
const N = 512, it = 40075016686e-3,
|
|
1145
|
+
const N = 512, it = 40075016686e-3, Q = N / it, at = {
|
|
1146
1146
|
...ie.defaultProps,
|
|
1147
1147
|
maxError: 0.125,
|
|
1148
1148
|
debug: !1,
|
|
@@ -1275,12 +1275,12 @@ class St extends oe {
|
|
|
1275
1275
|
coordinateOrigin: [N / 2, N / 2, 0],
|
|
1276
1276
|
// biome-ignore format: array
|
|
1277
1277
|
modelMatrix: [
|
|
1278
|
-
|
|
1278
|
+
Q,
|
|
1279
1279
|
0,
|
|
1280
1280
|
0,
|
|
1281
1281
|
0,
|
|
1282
1282
|
0,
|
|
1283
|
-
|
|
1283
|
+
Q,
|
|
1284
1284
|
0,
|
|
1285
1285
|
0,
|
|
1286
1286
|
0,
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -96,7 +96,35 @@ export interface InitialView {
|
|
|
96
96
|
interface ViewState extends InitialView {
|
|
97
97
|
pitch: number;
|
|
98
98
|
bearing: number;
|
|
99
|
+
/**
|
|
100
|
+
* deck's frame lift — the view state's `position`, [0, 0, z] metres. deck's
|
|
101
|
+
* controller hands it back on every gesture (with its other viewport props),
|
|
102
|
+
* so the runtime's copy carries it; nothing authored ever does, which is why
|
|
103
|
+
* `getViewState()` returns the five camera fields only.
|
|
104
|
+
*/
|
|
105
|
+
position?: [number, number, number];
|
|
99
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* The camera, with where its eye is (docs/design/underwater-terrain.md):
|
|
109
|
+
* `altitude` is the eye's height against sea level, `targetElevation` the
|
|
110
|
+
* ground under the view centre, `clearance` the eye's height above the ground
|
|
111
|
+
* beneath it — TRUE metres all three (an exaggerated terrain's scene heights
|
|
112
|
+
* divided back). `altitude` is null on a projected map (no 3D camera);
|
|
113
|
+
* `targetElevation`/`clearance` are null with no terrain, and until the DEM
|
|
114
|
+
* tile under the point has loaded.
|
|
115
|
+
*/
|
|
116
|
+
export interface Camera {
|
|
117
|
+
longitude: number;
|
|
118
|
+
latitude: number;
|
|
119
|
+
zoom: number;
|
|
120
|
+
pitch: number;
|
|
121
|
+
bearing: number;
|
|
122
|
+
altitude: number | null;
|
|
123
|
+
targetElevation: number | null;
|
|
124
|
+
clearance: number | null;
|
|
125
|
+
}
|
|
126
|
+
/** Where the camera orbits: a point at sea level (deck's own camera), or the ground under the view centre. */
|
|
127
|
+
export type CameraTarget = "sea-level" | "terrain";
|
|
100
128
|
/** Animated-camera options (spec: "Map Stories / Animation primitives"). Omit `duration` (or 0) for an instant move. */
|
|
101
129
|
export interface CameraOptions {
|
|
102
130
|
duration?: number;
|
|
@@ -404,6 +432,30 @@ export declare class RuntimeCore {
|
|
|
404
432
|
*/
|
|
405
433
|
private terrain;
|
|
406
434
|
private terrainGeneration;
|
|
435
|
+
/** The terrain presets' credit in the map's attribution slot (showTerrainCredit). */
|
|
436
|
+
private terrainCredit;
|
|
437
|
+
/** The ground under the camera, for `getCamera()` — one per terrain, dropped when it changes. */
|
|
438
|
+
private ground;
|
|
439
|
+
/** `sea-surface`: the plane's RGB(A), or null for none (sea-surface.ts). */
|
|
440
|
+
private seaSurface;
|
|
441
|
+
/** `camera-target`: what the camera orbits (see followTo). */
|
|
442
|
+
private cameraTarget;
|
|
443
|
+
/** deck's camera transition (a flight, inertia) is running — the follow holds still (see followTo). */
|
|
444
|
+
private cameraInTransition;
|
|
445
|
+
/** The scheduled follow frame, and the origin of the move it continues. */
|
|
446
|
+
private followFrame;
|
|
447
|
+
private followOrigin;
|
|
448
|
+
/** `sea-level` (or no terrain) arrived mid-flight: the lift drops when the flight ends, not by cancelling it. */
|
|
449
|
+
private liftDropPending;
|
|
450
|
+
/** The terrain's height range in scene metres, widened as its tiles load — draped TILED layers cull against it (applyTerrain). */
|
|
451
|
+
private terrainZRange;
|
|
452
|
+
private terrainZRangeQueued;
|
|
453
|
+
/**
|
|
454
|
+
* What the ground-aware controller reads (ground-controller.ts) — one
|
|
455
|
+
* object for the runtime's life, updated in place, so handing it to deck
|
|
456
|
+
* again never rebuilds the controller.
|
|
457
|
+
*/
|
|
458
|
+
private readonly groundFollow;
|
|
407
459
|
/**
|
|
408
460
|
* Clip box (spec: issue #34 §"Cutting / Clipping") — the retained box IR.
|
|
409
461
|
* Non-null patches every opted-in layer with `ClipBoxExtension` in
|
|
@@ -948,6 +1000,21 @@ export declare class RuntimeCore {
|
|
|
948
1000
|
* own) or on every pass.
|
|
949
1001
|
*/
|
|
950
1002
|
reconcile(irs: LayerIR[]): void;
|
|
1003
|
+
/**
|
|
1004
|
+
* A layer's loader for a template deck cannot fill on its own. One per layer
|
|
1005
|
+
* id, replaced when its template, tile size or fetch options change — so
|
|
1006
|
+
* deck sees a stable getTileData across rebuilds, and a story stepping a
|
|
1007
|
+
* WMS TIME= parameter holds one loader, not one per step.
|
|
1008
|
+
*/
|
|
1009
|
+
private templateTileLoader;
|
|
1010
|
+
private readonly templateLoaders;
|
|
1011
|
+
/**
|
|
1012
|
+
* A layer's tile failures on the runtime-error channel: each cause (CORS, an
|
|
1013
|
+
* HTTP status, a WMS error) reported once per layer and template — a fixed
|
|
1014
|
+
* data= that fails the same way is reported again.
|
|
1015
|
+
*/
|
|
1016
|
+
private tileErrorReporter;
|
|
1017
|
+
private readonly tileErrorReporters;
|
|
951
1018
|
/**
|
|
952
1019
|
* An image TileLayer on a projected map (docs/design/crs.md, gap 2) — the
|
|
953
1020
|
* relief layer's warp without the shading. Tiles are chosen from the plane's
|
|
@@ -1056,6 +1123,8 @@ export declare class RuntimeCore {
|
|
|
1056
1123
|
private isInCartographFrame;
|
|
1057
1124
|
/** The basemap's attribution as plain text — empty with no basemap. See MapLibreBasemapAdapter.attributions(). */
|
|
1058
1125
|
attributions(): string[];
|
|
1126
|
+
/** The terrain's credit in the attribution slot — as the basemap's, so not with attribution="false" or inside a cartograph frame (the sheet prints it). */
|
|
1127
|
+
private showTerrainCredit;
|
|
1059
1128
|
/** Make `name` the plane basemap (or none): a recolour in place when one is already up, so its tile cache survives. */
|
|
1060
1129
|
private setPlaneBasemap;
|
|
1061
1130
|
/** The CRS this map is projected into, or null for a Web Mercator map. */
|
|
@@ -1092,6 +1161,84 @@ export declare class RuntimeCore {
|
|
|
1092
1161
|
*/
|
|
1093
1162
|
injectPick(selection: Selection | null, pickType?: "hover" | "click"): void;
|
|
1094
1163
|
getViewState(): Readonly<ViewState>;
|
|
1164
|
+
/**
|
|
1165
|
+
* The camera, with its eye and the ground under it — see `Camera`.
|
|
1166
|
+
* `request: false` reads only DEM tiles already held and fetches nothing:
|
|
1167
|
+
* the settle event's detail, which every terrain map fires, must not start
|
|
1168
|
+
* fetching ground for a map whose author never asked for it.
|
|
1169
|
+
*/
|
|
1170
|
+
getCamera({ request }?: {
|
|
1171
|
+
request?: boolean;
|
|
1172
|
+
}): Camera;
|
|
1173
|
+
/** The drawn viewport's size — the host's before deck's first frame (getViewports asserts until then). */
|
|
1174
|
+
private viewportSize;
|
|
1175
|
+
private groundCache;
|
|
1176
|
+
/**
|
|
1177
|
+
* A terrain tile landed: widen the terrain's known height range (deck's own
|
|
1178
|
+
* rule — it only grows), rounded out to 100 m so the draped tiled layers
|
|
1179
|
+
* that cull against it are rebuilt on a real change, not per tile.
|
|
1180
|
+
*/
|
|
1181
|
+
private readonly onTerrainTileLoad;
|
|
1182
|
+
/**
|
|
1183
|
+
* `camera-target`. "terrain" orbits the ground under the view centre
|
|
1184
|
+
* instead of the point at sea level beneath it, so zooming in descends
|
|
1185
|
+
* toward the ground — down into a canyon, below sea level over a seabed.
|
|
1186
|
+
* Mechanically deck's frame lift (the view state's `position` z) follows
|
|
1187
|
+
* the ground height: zoom keeps meaning scale at the target, so tile
|
|
1188
|
+
* selection, zoom gates and saved views are unchanged. Back to
|
|
1189
|
+
* "sea-level", the lift returns to zero.
|
|
1190
|
+
*/
|
|
1191
|
+
setCameraTarget(target: CameraTarget): void;
|
|
1192
|
+
/**
|
|
1193
|
+
* `camera-clearance`: the eye never comes closer than this many true metres
|
|
1194
|
+
* to the ground beneath it — a zoom past it is held by the controller
|
|
1195
|
+
* (gestures and flights) and by every instant move. null for no floor.
|
|
1196
|
+
*/
|
|
1197
|
+
setCameraClearance(metres: number | null): void;
|
|
1198
|
+
/** `sea-surface`: a translucent plane at sea level, standalone maps only (sea-surface.ts); null removes it. */
|
|
1199
|
+
setSeaSurface(rgba: number[] | null): void;
|
|
1200
|
+
private refreshController;
|
|
1201
|
+
/** `vs` zoomed out just enough that the eye keeps its clearance — the same bound the controller holds gestures to. */
|
|
1202
|
+
private clearOfGround;
|
|
1203
|
+
/** A terrain-following camera with something to follow, on a renderer that can lift its frame. */
|
|
1204
|
+
private followActive;
|
|
1205
|
+
/** Follow or clearance: the camera answers to the ground. */
|
|
1206
|
+
private groundActive;
|
|
1207
|
+
private groundCameraPossible;
|
|
1208
|
+
/** The ground under the view centre as a frame lift (scene metres), or null until its tile has loaded. */
|
|
1209
|
+
private groundLift;
|
|
1210
|
+
/**
|
|
1211
|
+
* `vs` with its frame lift moved toward the ground under its centre —
|
|
1212
|
+
* eased (a gesture's frames, so the scene does not bob on every DEM texel)
|
|
1213
|
+
* or all the way (an instant move, and always under the determinism
|
|
1214
|
+
* switch: a captured frame must be a function of the view). The same object
|
|
1215
|
+
* back when there is nothing to do, so callers can tell.
|
|
1216
|
+
*/
|
|
1217
|
+
private followTo;
|
|
1218
|
+
/**
|
|
1219
|
+
* Keep the camera answering to the ground on animation frames — the lift
|
|
1220
|
+
* easing to it after a gesture stops, and the clearance floor re-taken
|
|
1221
|
+
* when a tile lands under an eye that arrived before its ground did.
|
|
1222
|
+
*/
|
|
1223
|
+
private scheduleFollow;
|
|
1224
|
+
/**
|
|
1225
|
+
* whenSettled's view of the ground camera (follow and clearance): no tile
|
|
1226
|
+
* it is waiting for is still coming — under the view centre for the
|
|
1227
|
+
* follow, under the eye for the clearance — and neither would move the
|
|
1228
|
+
* camera any further. A captured frame (record, seek) is then final: the
|
|
1229
|
+
* clearance had re-taken the zoom after settling, a frame too late.
|
|
1230
|
+
*/
|
|
1231
|
+
private followSettled;
|
|
1232
|
+
/** Back to deck's own camera: no frame lift — after a flight in progress, which a view-state write would cancel. */
|
|
1233
|
+
private dropLift;
|
|
1234
|
+
/** The camera on the ground: the lift moved toward it (eased, for a gesture's continuation; else snapped) and the eye held clear of it. The same object when there is nothing to do. */
|
|
1235
|
+
private placeOnGround;
|
|
1236
|
+
/**
|
|
1237
|
+
* The one camera write outside deck's own echo (onViewStateChange): the
|
|
1238
|
+
* runtime's copy, deck, the zoom gates, the listeners — every path that
|
|
1239
|
+
* moves the camera itself goes through here, so none skips a step.
|
|
1240
|
+
*/
|
|
1241
|
+
private commitView;
|
|
1095
1242
|
/**
|
|
1096
1243
|
* Sketch capture (spec: "Manual Drawing", D4) — while a draw tool is active,
|
|
1097
1244
|
* disable the map's double-click-zoom so double-clicking to close a
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sea-surface` (docs/design/underwater-terrain.md, Phase D): a translucent
|
|
3
|
+
* plane at sea level over a seabed. Land above sea level hides it (the depth
|
|
4
|
+
* test) and the seabed below shows through it. A camera that dives below it
|
|
5
|
+
* sees it only where the view rises above the horizon (max-pitch past 60).
|
|
6
|
+
*
|
|
7
|
+
* Drawn as one quad per tile of a TileLayer rather than one world-sized
|
|
8
|
+
* polygon: a polygon reaching 180° away from a zoom-19 view has vertices so
|
|
9
|
+
* far off screen that rasterising across it loses precision; a tile's quad
|
|
10
|
+
* is always about a screen across.
|
|
11
|
+
*/
|
|
12
|
+
import type { Layer } from "@deck.gl/core";
|
|
13
|
+
export declare const SEA_SURFACE_LAYER_ID = "__onlymapjs-sea-surface";
|
|
14
|
+
/** A colour given without alpha is this translucent (0–255) — an opaque sea would hide the seabed it is for. */
|
|
15
|
+
export declare const SEA_SURFACE_DEFAULT_ALPHA = 90;
|
|
16
|
+
/** The plane's colour, 0–255 RGBA: the authored one, or its RGB at the default translucency. */
|
|
17
|
+
export declare function seaSurfaceRgba(rgba: number[]): number[];
|
|
18
|
+
export declare function buildSeaSurfaceLayer(rgba: number[]): Layer;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DEM tiles past a source's max zoom (docs/design/underwater-terrain.md,
|
|
3
|
+
* Phase I, piece 5). A terrain tile's TEXTURE is fetched at the tile's zoom,
|
|
4
|
+
* so a source capped at z10 (the regional grid; `terrarium` held to z10 for
|
|
5
|
+
* its seabed) drapes ~150 m imagery however close the camera comes. With
|
|
6
|
+
* `texture-max-zoom`, the tiles keep subdividing to the imagery's zoom; a
|
|
7
|
+
* tile past the DEM's own `max-zoom` gets its heights from its ancestor at
|
|
8
|
+
* that zoom — the quarter (eighth, …) it covers, resampled to a full tile.
|
|
9
|
+
* No new relief: the same ground, meshed finer, with sharp imagery on it.
|
|
10
|
+
*
|
|
11
|
+
* Resampled in HEIGHTS, not colour: Terrarium and Mapbox RGB carry between
|
|
12
|
+
* channels, so interpolating R, G and B separately is wrong. Decoded with
|
|
13
|
+
* the source's own decoder (vertical offset included), interpolated with
|
|
14
|
+
* no-data corners skipped, and re-encoded in the same positional encoding,
|
|
15
|
+
* so the layer's own (exaggerated) decoder reads it back exactly.
|
|
16
|
+
*/
|
|
17
|
+
import type { ElevationDecoder } from "./terrain";
|
|
18
|
+
/** A positional RGB encoding — Terrarium (256, 1, 1/256) and Mapbox RGB (6553.6, 25.6, 0.1) are: R is 65,536 steps, G 256, B one. */
|
|
19
|
+
export declare function isPositional(d: ElevationDecoder): boolean;
|
|
20
|
+
/** One height back to the RGB a positional decoder reads as it (clamped to the encodable range). */
|
|
21
|
+
export declare function encodeHeight(d: ElevationDecoder, height: number): [number, number, number];
|
|
22
|
+
export interface AncestorDem {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
/** Decoded heights, row-major; NaN where the tile says no data. */
|
|
26
|
+
heights: Float32Array;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The heights of the tile `levels` zooms below `ancestor` at (dx, dy) inside
|
|
30
|
+
* it (0 ≤ dx, dy < 2^levels), resampled to `size`² (bilinear, centre-aligned,
|
|
31
|
+
* no-data corners skipped; all-no-data stays NaN). Edges clamp to the
|
|
32
|
+
* ancestor: neighbours from different ancestors meet within a pixel, and the
|
|
33
|
+
* skirts close what is left.
|
|
34
|
+
*/
|
|
35
|
+
export declare function deriveHeights(ancestor: AncestorDem, levels: number, dx: number, dy: number, size?: number): Float32Array;
|
|
36
|
+
/** Decode an RGBA image's pixels into heights; `noData` (± 0.5 m) becomes NaN. */
|
|
37
|
+
export declare function decodeHeights(rgba: Uint8ClampedArray, width: number, height: number, d: ElevationDecoder, noData?: number): AncestorDem;
|
|
38
|
+
/** Heights to an opaque RGBA buffer in the decoder's own encoding; NaN as the no-data value (or the encoding's floor). */
|
|
39
|
+
export declare function encodeHeights(heights: Float32Array, d: ElevationDecoder, noData?: number): Uint8ClampedArray<ArrayBuffer>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ground under a point, synchronously — what the camera asks every frame
|
|
3
|
+
* (docs/design/underwater-terrain.md, Phase C). The height field's loaders
|
|
4
|
+
* are batch and async (a profile, a volume); a camera cannot await. So this
|
|
5
|
+
* keeps the DEM tiles it has been asked about, answers from them at once, and
|
|
6
|
+
* fetches a missing tile in the background, answering `null` until it lands
|
|
7
|
+
* and calling `onArrive` when it does.
|
|
8
|
+
*
|
|
9
|
+
* Tiles come from the same URL template, zoom and decoder the terrain draws,
|
|
10
|
+
* so the browser's cache serves most of them. Heights are TRUE metres (the
|
|
11
|
+
* decoder's), never exaggerated.
|
|
12
|
+
*/
|
|
13
|
+
import type { LngLat } from "./geodesy";
|
|
14
|
+
import { type TerrainIR } from "./terrain";
|
|
15
|
+
/**
|
|
16
|
+
* The ground across every drawn terrain source, as it is DRAWN (the ranking
|
|
17
|
+
* is `firstHeight`'s): the next source answers only where one has no data,
|
|
18
|
+
* and while the answering tile is still LOADING the answer is null rather
|
|
19
|
+
* than the next source's height, which would jump the camera from one
|
|
20
|
+
* dataset to the other and back.
|
|
21
|
+
*/
|
|
22
|
+
export declare class GroundCache {
|
|
23
|
+
private readonly sources;
|
|
24
|
+
private readonly grounds;
|
|
25
|
+
constructor(terrain: TerrainIR, onArrive: () => void);
|
|
26
|
+
/** True metres at `lngLat`, or null while its tile loads (or where no source has data). */
|
|
27
|
+
at(lngLat: LngLat, request?: boolean): number | null;
|
|
28
|
+
/** True while the tile that will answer for `lngLat` is being fetched. */
|
|
29
|
+
isLoading(lngLat: LngLat): boolean;
|
|
30
|
+
dispose(): void;
|
|
31
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LngLat } from "./geodesy";
|
|
2
|
-
import type
|
|
3
|
-
import { type HeightfieldTiles } from "./volumetrics";
|
|
2
|
+
import { type TerrainIR, type TerrainSourceIR } from "./terrain";
|
|
3
|
+
import { type HeightfieldTiles, type HeightfieldTile } from "./volumetrics";
|
|
4
4
|
/** A resolved, in-memory set of DEM tiles — `elevationAt` never touches the network. */
|
|
5
5
|
export interface TerrainHeightfield {
|
|
6
6
|
/** Ground elevation (meters) at `lngLat` — bilinear-interpolated, seam-correct — or `null` if no covering tile loaded/decoded. Ignores `terrain.exaggeration`, same as `sampleTerrainElevation`. */
|
|
@@ -8,6 +8,8 @@ export interface TerrainHeightfield {
|
|
|
8
8
|
/** The raw decoded tile set — the transferable form volumetrics.ts (and its worker) consume directly. */
|
|
9
9
|
tiles: HeightfieldTiles;
|
|
10
10
|
}
|
|
11
|
+
/** One DEM tile, decoded, or null (failed or timed out). Exported for the camera's ground lookup (terrain-ground.ts). */
|
|
12
|
+
export declare function fetchHeightTile(x: number, y: number, zoom: number, terrain: Pick<TerrainSourceIR, "elevationData">): Promise<HeightfieldTile | null>;
|
|
11
13
|
/**
|
|
12
14
|
* Resolves every DEM tile `points` touches — INCLUDING the neighbor tiles a
|
|
13
15
|
* bilinear read at a tile-edge point spills into (the seam case: a point
|
|
@@ -19,15 +21,21 @@ export interface TerrainHeightfield {
|
|
|
19
21
|
* "treat as no terrain" contract as `sampleTerrainElevation`) without
|
|
20
22
|
* affecting other tiles.
|
|
21
23
|
*/
|
|
24
|
+
/** One source's ground at `points` (at `zoom`, the source's max by default) — the inspector reads sources one at a time. */
|
|
25
|
+
export declare function loadSourceHeightfield(points: LngLat[], terrain: TerrainSourceIR, zoom?: number): Promise<TerrainHeightfield>;
|
|
26
|
+
/**
|
|
27
|
+
* The ground at `points`, across every terrain source, as it is DRAWN: each
|
|
28
|
+
* point reads the first-ranked source whose extent holds it, and falls to the
|
|
29
|
+
* next only where that source has no data — a no-data cell or a tile that
|
|
30
|
+
* failed, where what is drawn IS the next source (the backfill shows through,
|
|
31
|
+
* Phase H; the height map ranks it, Phase I). One source is exactly the
|
|
32
|
+
* single-DEM loader. `tiles` is the first source's.
|
|
33
|
+
*/
|
|
22
34
|
export declare function loadHeightfield(points: LngLat[], terrain: TerrainIR): Promise<TerrainHeightfield>;
|
|
23
35
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* Starts at the provider's `maxZoom` and steps down until the cover fits
|
|
28
|
-
* `MAX_BOUNDS_TILES` — the returned `tiles.zoom` records what was actually
|
|
29
|
-
* used, and the integrator derives its GSD (and error model) from that, so
|
|
30
|
-
* a coarsened cover is REPORTED coarser, never silently pretended finer.
|
|
36
|
+
* The ground covering a bounding box — ONE source, because the volume grid
|
|
37
|
+
* integrates a single regular grid: the first-ranked source whose extent
|
|
38
|
+
* holds the whole box (or that has no extent), else the last.
|
|
31
39
|
*/
|
|
32
40
|
export declare function loadHeightfieldForBounds(bounds: {
|
|
33
41
|
west: number;
|