aviation-chart 0.1.21 → 0.1.22
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/dist/aviation-chart.umd.js +2 -2
- package/dist/index.cjs +3 -3
- package/dist/index.js +95 -114
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import jt from "maplibre-gl";
|
|
2
|
-
var vt, Rt,
|
|
2
|
+
var vt, Rt, Pt;
|
|
3
3
|
function Ot(o, r) {
|
|
4
4
|
if (!vt)
|
|
5
5
|
vt = r;
|
|
@@ -7,7 +7,7 @@ function Ot(o, r) {
|
|
|
7
7
|
Rt = r;
|
|
8
8
|
else {
|
|
9
9
|
var d = "var sharedChunk = {}; (" + vt + ")(sharedChunk); (" + Rt + ")(sharedChunk);", y = {};
|
|
10
|
-
vt(y),
|
|
10
|
+
vt(y), Pt = r(y), typeof window < "u" && (Pt.workerUrl = window.URL.createObjectURL(
|
|
11
11
|
new Blob([d], { type: "text/javascript" })
|
|
12
12
|
));
|
|
13
13
|
}
|
|
@@ -144,52 +144,52 @@ Ot(["exports"], function(o) {
|
|
|
144
144
|
const a = i / (e.width - 1);
|
|
145
145
|
let l, s, c, m, f, h;
|
|
146
146
|
const u = {}, _ = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
|
|
147
|
-
function P
|
|
148
|
-
|
|
147
|
+
function M(P, I, R) {
|
|
148
|
+
P[0] === 0 ? R(a * (h - 1), a * (f - g(c, I, l))) : P[0] === 2 ? R(a * h, a * (f - g(m, I, s))) : P[1] === 0 ? R(a * (h - g(s, I, l)), a * (f - 1)) : R(a * (h - g(m, I, c)), a * f);
|
|
149
149
|
}
|
|
150
150
|
for (f = 1 - n; f < e.height + n; f++) {
|
|
151
151
|
s = e.get(0, f - 1), m = e.get(0, f);
|
|
152
|
-
let
|
|
152
|
+
let P = Math.min(s, m), I = Math.max(s, m);
|
|
153
153
|
for (h = 1 - n; h < e.width + n; h++) {
|
|
154
154
|
l = s, c = m, s = e.get(h, f - 1), m = e.get(h, f);
|
|
155
|
-
const R =
|
|
156
|
-
if (
|
|
155
|
+
const R = P, V = I;
|
|
156
|
+
if (P = Math.min(s, m), I = Math.max(s, m), isNaN(l) || isNaN(s) || isNaN(m) || isNaN(c))
|
|
157
157
|
continue;
|
|
158
|
-
const dt = Math.min(R,
|
|
158
|
+
const dt = Math.min(R, P), pt = Math.max(V, I), X = Math.ceil(dt / t) * t, ot = Math.floor(pt / t) * t;
|
|
159
159
|
for (let C = X; C <= ot; C += t) {
|
|
160
|
-
const
|
|
161
|
-
for (const bt of d[(
|
|
162
|
-
let
|
|
163
|
-
|
|
160
|
+
const kt = l > C, q = s > C, nt = c > C, _t = m > C;
|
|
161
|
+
for (const bt of d[(kt ? 8 : 0) | (q ? 4 : 0) | (_t ? 2 : 0) | (nt ? 1 : 0)]) {
|
|
162
|
+
let H = _.get(C);
|
|
163
|
+
H || _.set(C, H = /* @__PURE__ */ new Map());
|
|
164
164
|
let lt = F.get(C);
|
|
165
165
|
lt || F.set(C, lt = /* @__PURE__ */ new Map());
|
|
166
|
-
const
|
|
166
|
+
const At = bt[0], zt = bt[1], yt = y(e.width, h, f, At), st = y(e.width, h, f, zt);
|
|
167
167
|
let G, Tt;
|
|
168
168
|
if (G = lt.get(yt))
|
|
169
|
-
if (lt.delete(yt), Tt =
|
|
170
|
-
if (
|
|
171
|
-
if (
|
|
169
|
+
if (lt.delete(yt), Tt = H.get(st))
|
|
170
|
+
if (H.delete(st), G === Tt) {
|
|
171
|
+
if (M(zt, C, G.append), !G.isEmpty()) {
|
|
172
172
|
let rt = u[C];
|
|
173
173
|
rt || (u[C] = rt = []), rt.push(G.lineString());
|
|
174
174
|
}
|
|
175
175
|
} else
|
|
176
176
|
G.appendFragment(Tt), lt.set(G.end = Tt.end, G);
|
|
177
177
|
else
|
|
178
|
-
|
|
179
|
-
else if (G =
|
|
180
|
-
|
|
178
|
+
M(zt, C, G.append), lt.set(G.end = st, G);
|
|
179
|
+
else if (G = H.get(st))
|
|
180
|
+
H.delete(st), M(At, C, G.prepend), H.set(G.start = yt, G);
|
|
181
181
|
else {
|
|
182
182
|
const rt = new r(yt, st);
|
|
183
|
-
|
|
183
|
+
M(At, C, rt.append), M(zt, C, rt.append), H.set(yt, rt), lt.set(st, rt);
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
for (const [
|
|
189
|
+
for (const [P, I] of _.entries()) {
|
|
190
190
|
let R = null;
|
|
191
191
|
for (const V of I.values())
|
|
192
|
-
V.isEmpty() || (R == null && (R = u[
|
|
192
|
+
V.isEmpty() || (R == null && (R = u[P] || (u[P] = [])), R.push(V.lineString()));
|
|
193
193
|
}
|
|
194
194
|
return u;
|
|
195
195
|
}
|
|
@@ -203,7 +203,7 @@ Ot(["exports"], function(o) {
|
|
|
203
203
|
function O(t) {
|
|
204
204
|
return Object.fromEntries(t.split("~").map((e) => e.split("*").map(Number)).map(([e, ...i]) => [e, i]));
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function A({ thresholds: t, ...e }) {
|
|
207
207
|
return b({ thresholds: S(t), ...e }).map(([i, n]) => `${encodeURIComponent(i)}=${encodeURIComponent(n)}`).join("&");
|
|
208
208
|
}
|
|
209
209
|
function z(t) {
|
|
@@ -247,7 +247,7 @@ Ot(["exports"], function(o) {
|
|
|
247
247
|
return e && (a = new Float32Array(i.length), a.set(i)), { ...n, data: a, transferrables: [a.buffer] };
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function k(t) {
|
|
251
251
|
return t.then(({ arrayBuffer: e }) => {
|
|
252
252
|
const i = T(e);
|
|
253
253
|
return {
|
|
@@ -261,7 +261,7 @@ Ot(["exports"], function(o) {
|
|
|
261
261
|
return j == null && (j = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") && typeof createImageBitmap == "function"), j || !1;
|
|
262
262
|
}
|
|
263
263
|
let tt = null;
|
|
264
|
-
function
|
|
264
|
+
function Y() {
|
|
265
265
|
if (tt == null && (tt = !1, ct() && typeof VideoFrame < "u")) {
|
|
266
266
|
const i = new OffscreenCanvas(5, 5).getContext("2d", { willReadFrequently: !0 });
|
|
267
267
|
if (i) {
|
|
@@ -391,7 +391,7 @@ Ot(["exports"], function(o) {
|
|
|
391
391
|
self instanceof WorkerGlobalScope
|
|
392
392
|
);
|
|
393
393
|
}
|
|
394
|
-
const It =
|
|
394
|
+
const It = Y() ? xt : ct() ? at : ee() ? te : qt;
|
|
395
395
|
function Gt(t, e, i, n) {
|
|
396
396
|
if (i.width = t.width, i.height = t.height, !n)
|
|
397
397
|
throw new Error("failed to get context");
|
|
@@ -421,7 +421,7 @@ Ot(["exports"], function(o) {
|
|
|
421
421
|
if (a <= 1)
|
|
422
422
|
return this;
|
|
423
423
|
const s = 0.5 - 1 / (2 * a), c = (m, f) => {
|
|
424
|
-
const h = m / a - s, u = f / a - s, _ = Math.floor(h), F = Math.floor(u),
|
|
424
|
+
const h = m / a - s, u = f / a - s, _ = Math.floor(h), F = Math.floor(u), M = this.get(_, F), P = this.get(_ + 1, F), I = this.get(_, F + 1), R = this.get(_ + 1, F + 1), V = h - _, dt = u - F, pt = l(M, P, V), X = l(I, R, V);
|
|
425
425
|
return l(pt, X, dt);
|
|
426
426
|
};
|
|
427
427
|
return new $(this.width * a, this.height * a, c);
|
|
@@ -488,12 +488,12 @@ Ot(["exports"], function(o) {
|
|
|
488
488
|
}
|
|
489
489
|
return (F ? -1 : 1) * s * Math.pow(2, l - n);
|
|
490
490
|
}, Et.write = function(t, e, i, n, a, l) {
|
|
491
|
-
var s, c, m, f = l * 8 - a - 1, h = (1 << f) - 1, u = h >> 1, _ = a === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, F = n ? 0 : l - 1,
|
|
492
|
-
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (c = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (m = Math.pow(2, -s)) < 1 && (s--, m *= 2), s + u >= 1 ? e += _ / m : e += _ * Math.pow(2, 1 - u), e * m >= 2 && (s++, m /= 2), s + u >= h ? (c = 0, s = h) : s + u >= 1 ? (c = (e * m - 1) * Math.pow(2, a), s = s + u) : (c = e * Math.pow(2, u - 1) * Math.pow(2, a), s = 0)); a >= 8; t[i + F] = c & 255, F +=
|
|
491
|
+
var s, c, m, f = l * 8 - a - 1, h = (1 << f) - 1, u = h >> 1, _ = a === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, F = n ? 0 : l - 1, M = n ? 1 : -1, P = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
|
|
492
|
+
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (c = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (m = Math.pow(2, -s)) < 1 && (s--, m *= 2), s + u >= 1 ? e += _ / m : e += _ * Math.pow(2, 1 - u), e * m >= 2 && (s++, m /= 2), s + u >= h ? (c = 0, s = h) : s + u >= 1 ? (c = (e * m - 1) * Math.pow(2, a), s = s + u) : (c = e * Math.pow(2, u - 1) * Math.pow(2, a), s = 0)); a >= 8; t[i + F] = c & 255, F += M, c /= 256, a -= 8)
|
|
493
493
|
;
|
|
494
|
-
for (s = s << a | c, f += a; f > 0; t[i + F] = s & 255, F +=
|
|
494
|
+
for (s = s << a | c, f += a; f > 0; t[i + F] = s & 255, F += M, s /= 256, f -= 8)
|
|
495
495
|
;
|
|
496
|
-
t[i + F -
|
|
496
|
+
t[i + F - M] |= P * 128;
|
|
497
497
|
};
|
|
498
498
|
var ne = v, gt = Et;
|
|
499
499
|
function v(t) {
|
|
@@ -877,13 +877,13 @@ Ot(["exports"], function(o) {
|
|
|
877
877
|
for (const n of i.keys)
|
|
878
878
|
e.writeStringField(3, n);
|
|
879
879
|
for (const n of i.values)
|
|
880
|
-
e.writeMessage(4,
|
|
880
|
+
e.writeMessage(4, Ae, n);
|
|
881
881
|
}
|
|
882
882
|
function Fe(t, e) {
|
|
883
883
|
const i = t.feature;
|
|
884
884
|
if (!i || !e)
|
|
885
885
|
throw new Error();
|
|
886
|
-
e.writeMessage(2, Se, t), e.writeVarintField(3, i.type), e.writeMessage(4,
|
|
886
|
+
e.writeMessage(2, Se, t), e.writeVarintField(3, i.type), e.writeMessage(4, ke, i);
|
|
887
887
|
}
|
|
888
888
|
function Se(t, e) {
|
|
889
889
|
const i = t.feature;
|
|
@@ -908,7 +908,7 @@ Ot(["exports"], function(o) {
|
|
|
908
908
|
function Vt(t) {
|
|
909
909
|
return t << 1 ^ t >> 31;
|
|
910
910
|
}
|
|
911
|
-
function
|
|
911
|
+
function ke(t, e) {
|
|
912
912
|
if (!e)
|
|
913
913
|
throw new Error();
|
|
914
914
|
const i = t.geometry, n = t.type;
|
|
@@ -925,7 +925,7 @@ Ot(["exports"], function(o) {
|
|
|
925
925
|
n === ht.POLYGON && e.writeVarint(St(7, 1));
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
|
-
function
|
|
928
|
+
function Ae(t, e) {
|
|
929
929
|
if (!e)
|
|
930
930
|
throw new Error();
|
|
931
931
|
typeof t == "string" ? e.writeStringField(1, t) : typeof t == "boolean" ? e.writeBooleanField(7, t) : typeof t == "number" && (t % 1 !== 0 ? e.writeDoubleField(3, t) : t < 0 ? e.writeSVarintField(6, t) : e.writeVarintField(5, t));
|
|
@@ -934,11 +934,11 @@ Ot(["exports"], function(o) {
|
|
|
934
934
|
constructor(e, i, n, a, l) {
|
|
935
935
|
this.loaded = Promise.resolve(), this.decodeImage = It, this.fetchAndParseTile = (s, c, m, f, h) => {
|
|
936
936
|
const u = this, _ = this.demUrlPattern.replace("{z}", s.toString()).replace("{x}", c.toString()).replace("{y}", m.toString());
|
|
937
|
-
return h == null || h.useTile(_), this.parsedCache.get(_, async (F,
|
|
938
|
-
const
|
|
939
|
-
if (B(
|
|
937
|
+
return h == null || h.useTile(_), this.parsedCache.get(_, async (F, M) => {
|
|
938
|
+
const P = await u.fetchTile(s, c, m, M, h);
|
|
939
|
+
if (B(M))
|
|
940
940
|
throw new Error("canceled");
|
|
941
|
-
const I = u.decodeImage(
|
|
941
|
+
const I = u.decodeImage(P.data, u.encoding, M), R = h == null ? void 0 : h.marker("decode"), V = await I;
|
|
942
942
|
return R == null || R(), V;
|
|
943
943
|
}, f);
|
|
944
944
|
}, this.tileCache = new Z(i), this.parsedCache = new Z(i), this.contourCache = new Z(i), this.timeoutMs = l, this.demUrlPattern = e, this.encoding = n, this.maxzoom = a;
|
|
@@ -967,11 +967,11 @@ Ot(["exports"], function(o) {
|
|
|
967
967
|
return $.fromRawDem(_).split(m, i % f, n % f);
|
|
968
968
|
}
|
|
969
969
|
fetchContourTile(e, i, n, a, l, s) {
|
|
970
|
-
const { levels: c, multiplier: m = 1, buffer: f = 1, extent: h = 4096, contourLayer: u = "contours", elevationKey: _ = "ele", levelKey: F = "level", subsampleBelow:
|
|
970
|
+
const { levels: c, multiplier: m = 1, buffer: f = 1, extent: h = 4096, contourLayer: u = "contours", elevationKey: _ = "ele", levelKey: F = "level", subsampleBelow: M = 100 } = a;
|
|
971
971
|
if (!c || c.length === 0)
|
|
972
972
|
return Promise.resolve({ arrayBuffer: new ArrayBuffer(0) });
|
|
973
|
-
const
|
|
974
|
-
return this.contourCache.get(
|
|
973
|
+
const P = [e, i, n, p(a)].join("/");
|
|
974
|
+
return this.contourCache.get(P, async (I, R) => {
|
|
975
975
|
const V = 1 << e, dt = [];
|
|
976
976
|
for (let q = n - 1; q <= n + 1; q++)
|
|
977
977
|
for (let nt = i - 1; nt <= i + 1; nt++)
|
|
@@ -981,15 +981,15 @@ Ot(["exports"], function(o) {
|
|
|
981
981
|
if (!X || B(R))
|
|
982
982
|
return { arrayBuffer: new Uint8Array().buffer };
|
|
983
983
|
const ot = s == null ? void 0 : s.marker("isoline");
|
|
984
|
-
if (X.width >=
|
|
984
|
+
if (X.width >= M)
|
|
985
985
|
X = X.materialize(2);
|
|
986
986
|
else
|
|
987
|
-
for (; X.width <
|
|
987
|
+
for (; X.width < M; )
|
|
988
988
|
X = X.subsamplePixelCenters(2).materialize(2);
|
|
989
989
|
X = X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);
|
|
990
990
|
const C = w(c[0], X, h, f);
|
|
991
991
|
ot == null || ot();
|
|
992
|
-
const
|
|
992
|
+
const kt = De({
|
|
993
993
|
extent: h,
|
|
994
994
|
layers: {
|
|
995
995
|
[u]: {
|
|
@@ -1000,26 +1000,26 @@ Ot(["exports"], function(o) {
|
|
|
1000
1000
|
geometry: nt,
|
|
1001
1001
|
properties: {
|
|
1002
1002
|
[_]: _t,
|
|
1003
|
-
[F]: Math.max(...c.map((bt,
|
|
1003
|
+
[F]: Math.max(...c.map((bt, H) => _t % bt === 0 ? H : 0))
|
|
1004
1004
|
}
|
|
1005
1005
|
};
|
|
1006
1006
|
})
|
|
1007
1007
|
}
|
|
1008
1008
|
}
|
|
1009
1009
|
});
|
|
1010
|
-
return ot == null || ot(), { arrayBuffer:
|
|
1010
|
+
return ot == null || ot(), { arrayBuffer: kt.buffer };
|
|
1011
1011
|
}, l);
|
|
1012
1012
|
}
|
|
1013
1013
|
}
|
|
1014
1014
|
const Q = typeof performance < "u" ? performance : void 0, Ce = Q ? Q.timeOrigin || (/* @__PURE__ */ new Date()).getTime() - Q.now() : (/* @__PURE__ */ new Date()).getTime();
|
|
1015
|
-
function
|
|
1015
|
+
function Me(t) {
|
|
1016
1016
|
var e;
|
|
1017
1017
|
return JSON.parse(JSON.stringify(((e = Q == null ? void 0 : Q.getEntriesByName) === null || e === void 0 ? void 0 : e.call(Q, t)) || []));
|
|
1018
1018
|
}
|
|
1019
1019
|
function Ut() {
|
|
1020
1020
|
return Q ? Q.now() : (/* @__PURE__ */ new Date()).getTime();
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1022
|
+
function Pe(t) {
|
|
1023
1023
|
const e = [];
|
|
1024
1024
|
for (const i of t)
|
|
1025
1025
|
e.push(...i);
|
|
@@ -1040,7 +1040,7 @@ Ot(["exports"], function(o) {
|
|
|
1040
1040
|
marks: this.marks,
|
|
1041
1041
|
resources: [
|
|
1042
1042
|
...this.resources,
|
|
1043
|
-
...
|
|
1043
|
+
...Pe(this.fetched.map(Me))
|
|
1044
1044
|
],
|
|
1045
1045
|
duration: a,
|
|
1046
1046
|
fetch: l,
|
|
@@ -1131,21 +1131,21 @@ Ot(["exports"], function(o) {
|
|
|
1131
1131
|
}), L(this.timeoutMs, c, n);
|
|
1132
1132
|
}
|
|
1133
1133
|
}
|
|
1134
|
-
o.A = Le, o.H = $, o.L = Re, o.T = Wt, o.a = z, o.b = w, o.c = Dt, o.d = It, o.e =
|
|
1134
|
+
o.A = Le, o.H = $, o.L = Re, o.T = Wt, o.a = z, o.b = w, o.c = Dt, o.d = It, o.e = A, o.f = k, o.g = x, o.p = D;
|
|
1135
1135
|
});
|
|
1136
1136
|
Ot(["./shared"], function(o) {
|
|
1137
1137
|
const r = (g) => Promise.reject(new Error(`No manager registered for ${g}`));
|
|
1138
1138
|
class d {
|
|
1139
1139
|
constructor() {
|
|
1140
|
-
this.managers = {}, this.init = (w, b) => (this.managers[w.managerId] = new o.L(w.demUrlPattern, w.cacheSize, w.encoding, w.maxzoom, w.timeoutMs), Promise.resolve()), this.fetchTile = (w, b, S, O,
|
|
1140
|
+
this.managers = {}, this.init = (w, b) => (this.managers[w.managerId] = new o.L(w.demUrlPattern, w.cacheSize, w.encoding, w.maxzoom, w.timeoutMs), Promise.resolve()), this.fetchTile = (w, b, S, O, A, z) => {
|
|
1141
1141
|
var p;
|
|
1142
|
-
return ((p = this.managers[w]) === null || p === void 0 ? void 0 : p.fetchTile(b, S, O,
|
|
1143
|
-
}, this.fetchAndParseTile = (w, b, S, O,
|
|
1142
|
+
return ((p = this.managers[w]) === null || p === void 0 ? void 0 : p.fetchTile(b, S, O, A, z)) || r(w);
|
|
1143
|
+
}, this.fetchAndParseTile = (w, b, S, O, A, z) => {
|
|
1144
1144
|
var p;
|
|
1145
|
-
return o.p(((p = this.managers[w]) === null || p === void 0 ? void 0 : p.fetchAndParseTile(b, S, O,
|
|
1146
|
-
}, this.fetchContourTile = (w, b, S, O,
|
|
1145
|
+
return o.p(((p = this.managers[w]) === null || p === void 0 ? void 0 : p.fetchAndParseTile(b, S, O, A, z)) || r(w), !0);
|
|
1146
|
+
}, this.fetchContourTile = (w, b, S, O, A, z, p) => {
|
|
1147
1147
|
var x;
|
|
1148
|
-
return o.f(((x = this.managers[w]) === null || x === void 0 ? void 0 : x.fetchContourTile(b, S, O,
|
|
1148
|
+
return o.f(((x = this.managers[w]) === null || x === void 0 ? void 0 : x.fetchContourTile(b, S, O, A, z, p)) || r(w));
|
|
1149
1149
|
};
|
|
1150
1150
|
}
|
|
1151
1151
|
}
|
|
@@ -1168,14 +1168,14 @@ Ot(["./shared"], function(o) {
|
|
|
1168
1168
|
return d;
|
|
1169
1169
|
}
|
|
1170
1170
|
class b {
|
|
1171
|
-
constructor(x, T, D,
|
|
1172
|
-
this.fetchTile = (
|
|
1171
|
+
constructor(x, T, D, k, j, ct) {
|
|
1172
|
+
this.fetchTile = (Y, L, U, B, E) => this.actor.send("fetchTile", [], B, E, this.managerId, Y, L, U), this.fetchAndParseTile = (Y, L, U, B, E) => this.actor.send("fetchAndParseTile", [], B, E, this.managerId, Y, L, U), this.fetchContourTile = (Y, L, U, B, E, Z) => this.actor.send("fetchContourTile", [], E, Z, this.managerId, Y, L, U, B);
|
|
1173
1173
|
const tt = this.managerId = ++y;
|
|
1174
1174
|
this.actor = ct || w(), this.loaded = this.actor.send("init", [], new AbortController(), void 0, {
|
|
1175
1175
|
cacheSize: T,
|
|
1176
1176
|
demUrlPattern: x,
|
|
1177
1177
|
encoding: D,
|
|
1178
|
-
maxzoom:
|
|
1178
|
+
maxzoom: k,
|
|
1179
1179
|
managerId: tt,
|
|
1180
1180
|
timeoutMs: j
|
|
1181
1181
|
});
|
|
@@ -1184,9 +1184,9 @@ Ot(["./shared"], function(o) {
|
|
|
1184
1184
|
Blob.prototype.arrayBuffer || (Blob.prototype.arrayBuffer = function() {
|
|
1185
1185
|
return new Promise((x, T) => {
|
|
1186
1186
|
const D = new FileReader();
|
|
1187
|
-
D.onload = (
|
|
1187
|
+
D.onload = (k) => {
|
|
1188
1188
|
var j;
|
|
1189
|
-
return x((j =
|
|
1189
|
+
return x((j = k.target) === null || j === void 0 ? void 0 : j.result);
|
|
1190
1190
|
}, D.onerror = T, D.readAsArrayBuffer(this);
|
|
1191
1191
|
});
|
|
1192
1192
|
});
|
|
@@ -1195,11 +1195,11 @@ Ot(["./shared"], function(o) {
|
|
|
1195
1195
|
return p(x, T);
|
|
1196
1196
|
{
|
|
1197
1197
|
const D = new AbortController();
|
|
1198
|
-
return p(x, D).then((
|
|
1198
|
+
return p(x, D).then((k) => T(void 0, k.data, k.cacheControl, k.expires), (k) => T(k)), { cancel: () => D.abort() };
|
|
1199
1199
|
}
|
|
1200
1200
|
}, O = /* @__PURE__ */ new Set();
|
|
1201
|
-
class
|
|
1202
|
-
constructor({ url: x, cacheSize: T = 100, id: D = "dem", encoding:
|
|
1201
|
+
class A {
|
|
1202
|
+
constructor({ url: x, cacheSize: T = 100, id: D = "dem", encoding: k = "terrarium", maxzoom: j = 12, worker: ct = !0, timeoutMs: tt = 1e4, actor: Y }) {
|
|
1203
1203
|
this.timingCallbacks = [], this.onTiming = (E) => {
|
|
1204
1204
|
this.timingCallbacks.push(E);
|
|
1205
1205
|
}, this.setupMaplibre = (E) => {
|
|
@@ -1236,19 +1236,19 @@ Ot(["./shared"], function(o) {
|
|
|
1236
1236
|
L = D + U++;
|
|
1237
1237
|
O.add(L), this.sharedDemProtocolId = `${L}-shared`, this.contourProtocolId = `${L}-contour`, this.sharedDemProtocolUrl = `${this.sharedDemProtocolId}://{z}/{x}/{y}`, this.contourProtocolUrlBase = `${this.contourProtocolId}://{z}/{x}/{y}`;
|
|
1238
1238
|
const B = ct ? b : o.L;
|
|
1239
|
-
this.manager = new B(x, T,
|
|
1239
|
+
this.manager = new B(x, T, k, j, tt, Y);
|
|
1240
1240
|
}
|
|
1241
|
-
getDemTile(x, T, D,
|
|
1242
|
-
return this.manager.fetchAndParseTile(x, T, D,
|
|
1241
|
+
getDemTile(x, T, D, k) {
|
|
1242
|
+
return this.manager.fetchAndParseTile(x, T, D, k || new AbortController());
|
|
1243
1243
|
}
|
|
1244
1244
|
parseUrl(x) {
|
|
1245
|
-
const [, T, D,
|
|
1246
|
-
return [Number(T), Number(D), Number(
|
|
1245
|
+
const [, T, D, k] = /\/\/(\d+)\/(\d+)\/(\d+)/.exec(x) || [];
|
|
1246
|
+
return [Number(T), Number(D), Number(k)];
|
|
1247
1247
|
}
|
|
1248
1248
|
}
|
|
1249
1249
|
return {
|
|
1250
1250
|
generateIsolines: o.b,
|
|
1251
|
-
DemSource:
|
|
1251
|
+
DemSource: A,
|
|
1252
1252
|
HeightTile: o.H,
|
|
1253
1253
|
LocalDemManager: o.L,
|
|
1254
1254
|
decodeParsedImage: o.c,
|
|
@@ -1260,7 +1260,7 @@ Ot(["./shared"], function(o) {
|
|
|
1260
1260
|
}
|
|
1261
1261
|
};
|
|
1262
1262
|
});
|
|
1263
|
-
var Be =
|
|
1263
|
+
var Be = Pt;
|
|
1264
1264
|
function Xe(o) {
|
|
1265
1265
|
return o;
|
|
1266
1266
|
}
|
|
@@ -1269,8 +1269,8 @@ function Ne(o) {
|
|
|
1269
1269
|
var r, d, y = o.scale[0], g = o.scale[1], w = o.translate[0], b = o.translate[1];
|
|
1270
1270
|
return function(S, O) {
|
|
1271
1271
|
O || (r = d = 0);
|
|
1272
|
-
var
|
|
1273
|
-
for (p[0] = (r += S[0]) * y + w, p[1] = (d += S[1]) * g + b;
|
|
1272
|
+
var A = 2, z = S.length, p = new Array(z);
|
|
1273
|
+
for (p[0] = (r += S[0]) * y + w, p[1] = (d += S[1]) * g + b; A < z; ) p[A] = S[A], ++A;
|
|
1274
1274
|
return p;
|
|
1275
1275
|
};
|
|
1276
1276
|
}
|
|
@@ -1308,11 +1308,11 @@ function Ue(o, r) {
|
|
|
1308
1308
|
function O(z) {
|
|
1309
1309
|
return z.map(S);
|
|
1310
1310
|
}
|
|
1311
|
-
function
|
|
1311
|
+
function A(z) {
|
|
1312
1312
|
var p = z.type, x;
|
|
1313
1313
|
switch (p) {
|
|
1314
1314
|
case "GeometryCollection":
|
|
1315
|
-
return { type: p, geometries: z.geometries.map(
|
|
1315
|
+
return { type: p, geometries: z.geometries.map(A) };
|
|
1316
1316
|
case "Point":
|
|
1317
1317
|
x = w(z.coordinates);
|
|
1318
1318
|
break;
|
|
@@ -1336,7 +1336,7 @@ function Ue(o, r) {
|
|
|
1336
1336
|
}
|
|
1337
1337
|
return { type: p, coordinates: x };
|
|
1338
1338
|
}
|
|
1339
|
-
return
|
|
1339
|
+
return A(r);
|
|
1340
1340
|
}
|
|
1341
1341
|
const We = {
|
|
1342
1342
|
airspaceStroke: "#AAB7B8",
|
|
@@ -1491,13 +1491,6 @@ function je() {
|
|
|
1491
1491
|
source: o,
|
|
1492
1492
|
"source-layer": "controlled-fill",
|
|
1493
1493
|
minzoom: 4,
|
|
1494
|
-
filter: [
|
|
1495
|
-
"all",
|
|
1496
|
-
["!=", ["get", "CODE_TYPE"], "CTA"],
|
|
1497
|
-
["!=", ["get", "CODE_TYPE"], "ARSA"],
|
|
1498
|
-
["!=", ["get", "CODE_TYPE"], "TCA"],
|
|
1499
|
-
["!=", ["get", "CODE_TYPE"], "TRSA"]
|
|
1500
|
-
],
|
|
1501
1494
|
paint: {
|
|
1502
1495
|
"fill-color": r.controlledFill,
|
|
1503
1496
|
"fill-opacity": [
|
|
@@ -1520,12 +1513,6 @@ function je() {
|
|
|
1520
1513
|
type: "line",
|
|
1521
1514
|
source: o,
|
|
1522
1515
|
"source-layer": "controlled",
|
|
1523
|
-
filter: [
|
|
1524
|
-
"all",
|
|
1525
|
-
["!=", ["get", "CODE_TYPE"], "ARSA"],
|
|
1526
|
-
["!=", ["get", "CODE_TYPE"], "TCA"],
|
|
1527
|
-
["!=", ["get", "CODE_TYPE"], "TRSA"]
|
|
1528
|
-
],
|
|
1529
1516
|
paint: {
|
|
1530
1517
|
"line-color": r.controlledStroke,
|
|
1531
1518
|
"line-width": 1,
|
|
@@ -1538,12 +1525,6 @@ function je() {
|
|
|
1538
1525
|
},
|
|
1539
1526
|
{
|
|
1540
1527
|
id: "controlled-label",
|
|
1541
|
-
filter: [
|
|
1542
|
-
"all",
|
|
1543
|
-
["!=", ["get", "CODE_TYPE"], "ARSA"],
|
|
1544
|
-
["!=", ["get", "CODE_TYPE"], "TCA"],
|
|
1545
|
-
["!=", ["get", "CODE_TYPE"], "TRSA"]
|
|
1546
|
-
],
|
|
1547
1528
|
type: "symbol",
|
|
1548
1529
|
source: o,
|
|
1549
1530
|
"source-layer": "controlled",
|
|
@@ -2506,7 +2487,7 @@ const ut = {
|
|
|
2506
2487
|
light: { id: "light", label: "日间", background: "#EAF2F8", build: je },
|
|
2507
2488
|
dark: { id: "dark", label: "夜间", background: "#000000", build: Ke }
|
|
2508
2489
|
};
|
|
2509
|
-
function
|
|
2490
|
+
function Ht(o = "light") {
|
|
2510
2491
|
return (ut[o] ?? ut.light).build();
|
|
2511
2492
|
}
|
|
2512
2493
|
const Ct = {
|
|
@@ -2521,7 +2502,7 @@ const Ct = {
|
|
|
2521
2502
|
ndb: ["ndb-symbol"],
|
|
2522
2503
|
airport: ["airport-circle", "airport-label"],
|
|
2523
2504
|
runway: ["runway-line", "runway-line-amm", "runway-label"]
|
|
2524
|
-
},
|
|
2505
|
+
}, He = {
|
|
2525
2506
|
/** 机场边界(淡暖灰垫底,在纯白底上显现轮廓) */
|
|
2526
2507
|
airport: "#e2e8f0",
|
|
2527
2508
|
/** 跑道面(中深灰,作为白底上的绝对重心) */
|
|
@@ -2547,8 +2528,8 @@ const Ct = {
|
|
|
2547
2528
|
/** 事故易发区(深橙色) */
|
|
2548
2529
|
hotspot: "#ea580c"
|
|
2549
2530
|
};
|
|
2550
|
-
function
|
|
2551
|
-
const r =
|
|
2531
|
+
function Ye(o = "amm") {
|
|
2532
|
+
const r = He;
|
|
2552
2533
|
return [
|
|
2553
2534
|
// ── 机场边界轮廓(z11+)
|
|
2554
2535
|
{
|
|
@@ -3163,8 +3144,8 @@ function qe(o = "amm") {
|
|
|
3163
3144
|
}
|
|
3164
3145
|
];
|
|
3165
3146
|
}
|
|
3166
|
-
function
|
|
3167
|
-
return r === "dark" ? Je(o) : r === "neutral" ? qe(o) :
|
|
3147
|
+
function Yt(o = "amm", r = "light") {
|
|
3148
|
+
return r === "dark" ? Je(o) : r === "neutral" ? qe(o) : Ye(o);
|
|
3168
3149
|
}
|
|
3169
3150
|
const oi = {
|
|
3170
3151
|
ammAirport: ["amm-airport-fill", "amm-airport-stroke"],
|
|
@@ -3207,7 +3188,7 @@ const oi = {
|
|
|
3207
3188
|
"#9c6b3f",
|
|
3208
3189
|
4500,
|
|
3209
3190
|
"#f2efe9"
|
|
3210
|
-
],
|
|
3191
|
+
], Mt = [
|
|
3211
3192
|
"amm-airport-fill",
|
|
3212
3193
|
"amm-airport-stroke",
|
|
3213
3194
|
"amm-runway-fill",
|
|
@@ -3268,10 +3249,10 @@ class ri {
|
|
|
3268
3249
|
period: b = null,
|
|
3269
3250
|
layers: S = {},
|
|
3270
3251
|
center: O = [104, 36],
|
|
3271
|
-
zoom:
|
|
3252
|
+
zoom: A = 4,
|
|
3272
3253
|
terrainUrl: z = null
|
|
3273
3254
|
} = r;
|
|
3274
|
-
return this._apiUrl = g.replace(/\/$/, ""), this._spriteUrl = (w ?? g).replace(/\/$/, ""), this._terrainUrl = z ?? `${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`, this._theme = y, this._period = b, this._center = O, this._zoom =
|
|
3255
|
+
return this._apiUrl = g.replace(/\/$/, ""), this._spriteUrl = (w ?? g).replace(/\/$/, ""), this._terrainUrl = z ?? `${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`, this._theme = y, this._period = b, this._center = O, this._zoom = A, this._ready = !1, this._layerVisible = {
|
|
3275
3256
|
// aviation groups — all visible by default
|
|
3276
3257
|
adiz: !0,
|
|
3277
3258
|
fir: !0,
|
|
@@ -3293,8 +3274,8 @@ class ri {
|
|
|
3293
3274
|
}, this._initMap(d), new Proxy(this, {
|
|
3294
3275
|
get(p, x) {
|
|
3295
3276
|
if (typeof x == "symbol" || Reflect.has(p, x)) {
|
|
3296
|
-
const
|
|
3297
|
-
return typeof
|
|
3277
|
+
const k = p[x];
|
|
3278
|
+
return typeof k == "function" ? k.bind(p) : k;
|
|
3298
3279
|
}
|
|
3299
3280
|
const T = p._map;
|
|
3300
3281
|
if (!T) return;
|
|
@@ -3455,9 +3436,9 @@ class ri {
|
|
|
3455
3436
|
"text-halo-width": 1
|
|
3456
3437
|
}
|
|
3457
3438
|
}), this._layerVisible.terrain && this._map.setTerrain({ source: "terrain", exaggeration: 4 });
|
|
3458
|
-
for (const y of
|
|
3439
|
+
for (const y of Ht(this._theme))
|
|
3459
3440
|
this._map.getLayer(y.id) || this._map.addLayer(y);
|
|
3460
|
-
for (const y of
|
|
3441
|
+
for (const y of Yt("amm", this._theme))
|
|
3461
3442
|
this._map.getLayer(y.id) || this._map.addLayer(y, "fir-line");
|
|
3462
3443
|
}
|
|
3463
3444
|
_applyVisibility() {
|
|
@@ -3467,7 +3448,7 @@ class ri {
|
|
|
3467
3448
|
this._map.getLayer(S) && this._map.setLayoutProperty(S, "visibility", b);
|
|
3468
3449
|
}
|
|
3469
3450
|
const r = this._layerVisible.amm !== !1 ? "visible" : "none";
|
|
3470
|
-
for (const g of
|
|
3451
|
+
for (const g of Mt)
|
|
3471
3452
|
this._map.getLayer(g) && this._map.setLayoutProperty(g, "visibility", r);
|
|
3472
3453
|
const d = this._layerVisible.terrain ? "visible" : "none";
|
|
3473
3454
|
for (const g of Zt)
|
|
@@ -3502,13 +3483,13 @@ class ri {
|
|
|
3502
3483
|
"landLaye",
|
|
3503
3484
|
"boundary",
|
|
3504
3485
|
...Object.values(Ct).flat(),
|
|
3505
|
-
...
|
|
3486
|
+
...Mt
|
|
3506
3487
|
];
|
|
3507
3488
|
for (const g of y)
|
|
3508
3489
|
this._map.getLayer(g) && this._map.removeLayer(g);
|
|
3509
|
-
for (const g of
|
|
3490
|
+
for (const g of Ht(this._theme))
|
|
3510
3491
|
this._map.addLayer(g);
|
|
3511
|
-
for (const g of
|
|
3492
|
+
for (const g of Yt("amm", this._theme))
|
|
3512
3493
|
this._map.getLayer(g.id) || this._map.addLayer(g, "fir-line");
|
|
3513
3494
|
this._applyVisibility();
|
|
3514
3495
|
}
|
|
@@ -3539,7 +3520,7 @@ class ri {
|
|
|
3539
3520
|
}
|
|
3540
3521
|
if (r === "amm") {
|
|
3541
3522
|
const w = d ? "visible" : "none";
|
|
3542
|
-
for (const b of
|
|
3523
|
+
for (const b of Mt)
|
|
3543
3524
|
this._map.getLayer(b) && this._map.setLayoutProperty(b, "visibility", w);
|
|
3544
3525
|
return;
|
|
3545
3526
|
}
|