aviation-chart 0.1.16 → 0.1.18
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 +88 -89
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -142,16 +142,16 @@ Mt(["exports"], function(o) {
|
|
|
142
142
|
if (!t)
|
|
143
143
|
return {};
|
|
144
144
|
const r = i / (e.width - 1);
|
|
145
|
-
let l, s, c, m,
|
|
145
|
+
let l, s, c, m, f, h;
|
|
146
146
|
const d = {}, w = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
|
|
147
147
|
function P(O, I, R) {
|
|
148
|
-
O[0] === 0 ? R(r * (
|
|
148
|
+
O[0] === 0 ? R(r * (h - 1), r * (f - y(c, I, l))) : O[0] === 2 ? R(r * h, r * (f - y(m, I, s))) : O[1] === 0 ? R(r * (h - y(s, I, l)), r * (f - 1)) : R(r * (h - y(m, I, c)), r * f);
|
|
149
149
|
}
|
|
150
|
-
for (
|
|
151
|
-
s = e.get(0,
|
|
150
|
+
for (f = 1 - n; f < e.height + n; f++) {
|
|
151
|
+
s = e.get(0, f - 1), m = e.get(0, f);
|
|
152
152
|
let O = Math.min(s, m), I = Math.max(s, m);
|
|
153
|
-
for (
|
|
154
|
-
l = s, c = m, s = e.get(
|
|
153
|
+
for (h = 1 - n; h < e.width + n; h++) {
|
|
154
|
+
l = s, c = m, s = e.get(h, f - 1), m = e.get(h, f);
|
|
155
155
|
const R = O, V = I;
|
|
156
156
|
if (O = Math.min(s, m), I = Math.max(s, m), isNaN(l) || isNaN(s) || isNaN(m) || isNaN(c))
|
|
157
157
|
continue;
|
|
@@ -163,7 +163,7 @@ Mt(["exports"], function(o) {
|
|
|
163
163
|
Y || w.set(C, Y = /* @__PURE__ */ new Map());
|
|
164
164
|
let lt = F.get(C);
|
|
165
165
|
lt || F.set(C, lt = /* @__PURE__ */ new Map());
|
|
166
|
-
const kt = bt[0], zt = bt[1], yt = g(e.width,
|
|
166
|
+
const kt = bt[0], zt = bt[1], yt = g(e.width, h, f, kt), st = g(e.width, h, f, zt);
|
|
167
167
|
let L, Tt;
|
|
168
168
|
if (L = lt.get(yt))
|
|
169
169
|
if (lt.delete(yt), Tt = Y.get(st))
|
|
@@ -311,19 +311,19 @@ Mt(["exports"], function(o) {
|
|
|
311
311
|
if (l)
|
|
312
312
|
l.lastUsed = ++E, l.waiting++;
|
|
313
313
|
else {
|
|
314
|
-
const
|
|
314
|
+
const f = new AbortController(), h = n(i, f);
|
|
315
315
|
l = {
|
|
316
|
-
abortController:
|
|
317
|
-
item:
|
|
316
|
+
abortController: f,
|
|
317
|
+
item: h,
|
|
318
318
|
lastUsed: ++E,
|
|
319
319
|
waiting: 1
|
|
320
320
|
}, this.items.set(i, l), this.prune();
|
|
321
321
|
}
|
|
322
|
-
const s = this.items, c = l.item.then((
|
|
322
|
+
const s = this.items, c = l.item.then((f) => f, (f) => (s.delete(i), Promise.reject(f)));
|
|
323
323
|
let m = !1;
|
|
324
324
|
return U(r, () => {
|
|
325
|
-
var
|
|
326
|
-
l && l.abortController && !m && (m = !0, --l.waiting <= 0 && ((
|
|
325
|
+
var f;
|
|
326
|
+
l && l.abortController && !m && (m = !0, --l.waiting <= 0 && ((f = l.abortController) === null || f === void 0 || f.abort(), s.delete(i)));
|
|
327
327
|
}), c;
|
|
328
328
|
}, this.clear = () => this.items.clear(), this.maxSize = e, this.items = /* @__PURE__ */ new Map();
|
|
329
329
|
}
|
|
@@ -355,8 +355,8 @@ Mt(["exports"], function(o) {
|
|
|
355
355
|
try {
|
|
356
356
|
if (!(((n = c == null ? void 0 : c.format) === null || n === void 0 ? void 0 : n.startsWith("BGR")) || ((r = c == null ? void 0 : c.format) === null || r === void 0 ? void 0 : r.startsWith("RGB"))))
|
|
357
357
|
throw new Error(`Unrecognized format: ${c == null ? void 0 : c.format}`);
|
|
358
|
-
const
|
|
359
|
-
if (await c.copyTo(d),
|
|
358
|
+
const f = (l = c == null ? void 0 : c.format) === null || l === void 0 ? void 0 : l.startsWith("BGR"), h = c.allocationSize(), d = new Uint8ClampedArray(h);
|
|
359
|
+
if (await c.copyTo(d), f)
|
|
360
360
|
for (let w = 0; w < d.length; w += 4) {
|
|
361
361
|
const F = d[w];
|
|
362
362
|
d[w] = d[w + 2], d[w + 2] = F;
|
|
@@ -414,30 +414,30 @@ Mt(["exports"], function(o) {
|
|
|
414
414
|
this.split = (r, l, s) => {
|
|
415
415
|
if (r === 0)
|
|
416
416
|
return this;
|
|
417
|
-
const c = 1 << r, m = l * this.width / c,
|
|
418
|
-
return new $(this.width / c, this.height / c, (
|
|
417
|
+
const c = 1 << r, m = l * this.width / c, f = s * this.height / c;
|
|
418
|
+
return new $(this.width / c, this.height / c, (h, d) => this.get(h + m, d + f));
|
|
419
419
|
}, this.subsamplePixelCenters = (r) => {
|
|
420
|
-
const l = (m,
|
|
420
|
+
const l = (m, f, h) => isNaN(m) ? f : isNaN(f) ? m : m + (f - m) * h;
|
|
421
421
|
if (r <= 1)
|
|
422
422
|
return this;
|
|
423
|
-
const s = 0.5 - 1 / (2 * r), c = (m,
|
|
424
|
-
const
|
|
423
|
+
const s = 0.5 - 1 / (2 * r), c = (m, f) => {
|
|
424
|
+
const h = m / r - s, d = f / r - s, w = Math.floor(h), F = Math.floor(d), P = this.get(w, F), O = this.get(w + 1, F), I = this.get(w, F + 1), R = this.get(w + 1, F + 1), V = h - w, dt = d - F, pt = l(P, O, V), X = l(I, R, V);
|
|
425
425
|
return l(pt, X, dt);
|
|
426
426
|
};
|
|
427
427
|
return new $(this.width * r, this.height * r, c);
|
|
428
428
|
}, this.averagePixelCentersToGrid = (r = 1) => new $(this.width + 1, this.height + 1, (l, s) => {
|
|
429
|
-
let c = 0, m = 0,
|
|
430
|
-
for (let
|
|
429
|
+
let c = 0, m = 0, f = 0;
|
|
430
|
+
for (let h = l - r; h < l + r; h++)
|
|
431
431
|
for (let d = s - r; d < s + r; d++)
|
|
432
|
-
isNaN(
|
|
432
|
+
isNaN(f = this.get(h, d)) || (m++, c += f);
|
|
433
433
|
return m === 0 ? NaN : c / m;
|
|
434
434
|
}), this.scaleElevation = (r) => r === 1 ? this : new $(this.width, this.height, (l, s) => this.get(l, s) * r), this.materialize = (r = 2) => {
|
|
435
435
|
const l = this.width + 2 * r, s = new Float32Array(l * (this.height + 2 * r));
|
|
436
436
|
let c = 0;
|
|
437
437
|
for (let m = -r; m < this.height + r; m++)
|
|
438
|
-
for (let
|
|
439
|
-
s[c++] = this.get(
|
|
440
|
-
return new $(this.width, this.height, (m,
|
|
438
|
+
for (let f = -r; f < this.width + r; f++)
|
|
439
|
+
s[c++] = this.get(f, m);
|
|
440
|
+
return new $(this.width, this.height, (m, f) => s[(f + r) * l + m + r]);
|
|
441
441
|
}, this.get = n, this.width = e, this.height = i;
|
|
442
442
|
}
|
|
443
443
|
/** Construct a height tile from raw DEM pixel values */
|
|
@@ -474,24 +474,24 @@ Mt(["exports"], function(o) {
|
|
|
474
474
|
var Et = {};
|
|
475
475
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
476
476
|
Et.read = function(t, e, i, n, r) {
|
|
477
|
-
var l, s, c = r * 8 - n - 1, m = (1 << c) - 1,
|
|
478
|
-
for (d += w, l = F & (1 << -
|
|
477
|
+
var l, s, c = r * 8 - n - 1, m = (1 << c) - 1, f = m >> 1, h = -7, d = i ? r - 1 : 0, w = i ? -1 : 1, F = t[e + d];
|
|
478
|
+
for (d += w, l = F & (1 << -h) - 1, F >>= -h, h += c; h > 0; l = l * 256 + t[e + d], d += w, h -= 8)
|
|
479
479
|
;
|
|
480
|
-
for (s = l & (1 << -
|
|
480
|
+
for (s = l & (1 << -h) - 1, l >>= -h, h += n; h > 0; s = s * 256 + t[e + d], d += w, h -= 8)
|
|
481
481
|
;
|
|
482
482
|
if (l === 0)
|
|
483
|
-
l = 1 -
|
|
483
|
+
l = 1 - f;
|
|
484
484
|
else {
|
|
485
485
|
if (l === m)
|
|
486
486
|
return s ? NaN : (F ? -1 : 1) * (1 / 0);
|
|
487
|
-
s = s + Math.pow(2, n), l = l -
|
|
487
|
+
s = s + Math.pow(2, n), l = l - f;
|
|
488
488
|
}
|
|
489
489
|
return (F ? -1 : 1) * s * Math.pow(2, l - n);
|
|
490
490
|
}, Et.write = function(t, e, i, n, r, l) {
|
|
491
|
-
var s, c, m,
|
|
492
|
-
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (c = isNaN(e) ? 1 : 0, s =
|
|
491
|
+
var s, c, m, f = l * 8 - r - 1, h = (1 << f) - 1, d = h >> 1, w = r === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, F = n ? 0 : l - 1, P = n ? 1 : -1, O = 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 + d >= 1 ? e += w / m : e += w * Math.pow(2, 1 - d), e * m >= 2 && (s++, m /= 2), s + d >= h ? (c = 0, s = h) : s + d >= 1 ? (c = (e * m - 1) * Math.pow(2, r), s = s + d) : (c = e * Math.pow(2, d - 1) * Math.pow(2, r), s = 0)); r >= 8; t[i + F] = c & 255, F += P, c /= 256, r -= 8)
|
|
493
493
|
;
|
|
494
|
-
for (s = s << r | c,
|
|
494
|
+
for (s = s << r | c, f += r; f > 0; t[i + F] = s & 255, F += P, s /= 256, f -= 8)
|
|
495
495
|
;
|
|
496
496
|
t[i + F - P] |= O * 128;
|
|
497
497
|
};
|
|
@@ -642,16 +642,16 @@ Mt(["exports"], function(o) {
|
|
|
642
642
|
return this.length = this.pos, this.pos = 0, this.buf.subarray(0, this.length);
|
|
643
643
|
},
|
|
644
644
|
writeFixed32: function(t) {
|
|
645
|
-
this.realloc(4),
|
|
645
|
+
this.realloc(4), ft(this.buf, t, this.pos), this.pos += 4;
|
|
646
646
|
},
|
|
647
647
|
writeSFixed32: function(t) {
|
|
648
|
-
this.realloc(4),
|
|
648
|
+
this.realloc(4), ft(this.buf, t, this.pos), this.pos += 4;
|
|
649
649
|
},
|
|
650
650
|
writeFixed64: function(t) {
|
|
651
|
-
this.realloc(8),
|
|
651
|
+
this.realloc(8), ft(this.buf, t & -1, this.pos), ft(this.buf, Math.floor(t * Gt), this.pos + 4), this.pos += 8;
|
|
652
652
|
},
|
|
653
653
|
writeSFixed64: function(t) {
|
|
654
|
-
this.realloc(8),
|
|
654
|
+
this.realloc(8), ft(this.buf, t & -1, this.pos), ft(this.buf, Math.floor(t * Gt), this.pos + 4), this.pos += 8;
|
|
655
655
|
},
|
|
656
656
|
writeVarint: function(t) {
|
|
657
657
|
if (t = +t || 0, t > 268435455 || t < 0) {
|
|
@@ -695,7 +695,7 @@ Mt(["exports"], function(o) {
|
|
|
695
695
|
this.writeTag(t, T.Bytes), this.writeRawMessage(e, i);
|
|
696
696
|
},
|
|
697
697
|
writePackedVarint: function(t, e) {
|
|
698
|
-
e.length && this.writeMessage(t,
|
|
698
|
+
e.length && this.writeMessage(t, he, e);
|
|
699
699
|
},
|
|
700
700
|
writePackedSVarint: function(t, e) {
|
|
701
701
|
e.length && this.writeMessage(t, de, e);
|
|
@@ -770,12 +770,12 @@ Mt(["exports"], function(o) {
|
|
|
770
770
|
var i, n;
|
|
771
771
|
if (t >= 0 ? (i = t % 4294967296 | 0, n = t / 4294967296 | 0) : (i = ~(-t % 4294967296), n = ~(-t / 4294967296), i ^ 4294967295 ? i = i + 1 | 0 : (i = 0, n = n + 1 | 0)), t >= 18446744073709552e3 || t < -18446744073709552e3)
|
|
772
772
|
throw new Error("Given varint doesn't fit into 10 bytes");
|
|
773
|
-
e.realloc(10), me(i, n, e),
|
|
773
|
+
e.realloc(10), me(i, n, e), fe(n, e);
|
|
774
774
|
}
|
|
775
775
|
function me(t, e, i) {
|
|
776
776
|
i.buf[i.pos++] = t & 127 | 128, t >>>= 7, i.buf[i.pos++] = t & 127 | 128, t >>>= 7, i.buf[i.pos++] = t & 127 | 128, t >>>= 7, i.buf[i.pos++] = t & 127 | 128, t >>>= 7, i.buf[i.pos] = t & 127;
|
|
777
777
|
}
|
|
778
|
-
function
|
|
778
|
+
function fe(t, e) {
|
|
779
779
|
var i = (t & 7) << 4;
|
|
780
780
|
e.buf[e.pos++] |= i | ((t >>>= 3) ? 128 : 0), t && (e.buf[e.pos++] = t & 127 | ((t >>>= 7) ? 128 : 0), t && (e.buf[e.pos++] = t & 127 | ((t >>>= 7) ? 128 : 0), t && (e.buf[e.pos++] = t & 127 | ((t >>>= 7) ? 128 : 0), t && (e.buf[e.pos++] = t & 127 | ((t >>>= 7) ? 128 : 0), t && (e.buf[e.pos++] = t & 127)))));
|
|
781
781
|
}
|
|
@@ -784,7 +784,7 @@ Mt(["exports"], function(o) {
|
|
|
784
784
|
i.realloc(n);
|
|
785
785
|
for (var r = i.pos - 1; r >= t; r--) i.buf[r + n] = i.buf[r];
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function he(t, e) {
|
|
788
788
|
for (var i = 0; i < t.length; i++) e.writeVarint(t[i]);
|
|
789
789
|
}
|
|
790
790
|
function de(t, e) {
|
|
@@ -814,7 +814,7 @@ Mt(["exports"], function(o) {
|
|
|
814
814
|
function wt(t, e) {
|
|
815
815
|
return (t[e] | t[e + 1] << 8 | t[e + 2] << 16) + t[e + 3] * 16777216;
|
|
816
816
|
}
|
|
817
|
-
function
|
|
817
|
+
function ft(t, e, i) {
|
|
818
818
|
t[i] = e, t[i + 1] = e >>> 8, t[i + 2] = e >>> 16, t[i + 3] = e >>> 24;
|
|
819
819
|
}
|
|
820
820
|
function Nt(t, e) {
|
|
@@ -824,8 +824,8 @@ Mt(["exports"], function(o) {
|
|
|
824
824
|
for (var n = "", r = e; r < i; ) {
|
|
825
825
|
var l = t[r], s = null, c = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1;
|
|
826
826
|
if (r + c > i) break;
|
|
827
|
-
var m,
|
|
828
|
-
c === 1 ? l < 128 && (s = l) : c === 2 ? (m = t[r + 1], (m & 192) === 128 && (s = (l & 31) << 6 | m & 63, s <= 127 && (s = null))) : c === 3 ? (m = t[r + 1],
|
|
827
|
+
var m, f, h;
|
|
828
|
+
c === 1 ? l < 128 && (s = l) : c === 2 ? (m = t[r + 1], (m & 192) === 128 && (s = (l & 31) << 6 | m & 63, s <= 127 && (s = null))) : c === 3 ? (m = t[r + 1], f = t[r + 2], (m & 192) === 128 && (f & 192) === 128 && (s = (l & 15) << 12 | (m & 63) << 6 | f & 63, (s <= 2047 || s >= 55296 && s <= 57343) && (s = null))) : c === 4 && (m = t[r + 1], f = t[r + 2], h = t[r + 3], (m & 192) === 128 && (f & 192) === 128 && (h & 192) === 128 && (s = (l & 15) << 18 | (m & 63) << 12 | (f & 63) << 6 | h & 63, (s <= 65535 || s >= 1114112) && (s = null))), s === null ? (s = 65533, c = 1) : s > 65535 && (s -= 65536, n += String.fromCharCode(s >>> 10 & 1023 | 55296), s = 56320 | s & 1023), n += String.fromCharCode(s), r += c;
|
|
829
829
|
}
|
|
830
830
|
return n;
|
|
831
831
|
}
|
|
@@ -850,10 +850,10 @@ Mt(["exports"], function(o) {
|
|
|
850
850
|
}
|
|
851
851
|
return i;
|
|
852
852
|
}
|
|
853
|
-
var ve = /* @__PURE__ */ ae(ne),
|
|
853
|
+
var ve = /* @__PURE__ */ ae(ne), ht;
|
|
854
854
|
(function(t) {
|
|
855
855
|
t[t.UNKNOWN = 0] = "UNKNOWN", t[t.POINT = 1] = "POINT", t[t.LINESTRING = 2] = "LINESTRING", t[t.POLYGON = 3] = "POLYGON";
|
|
856
|
-
})(
|
|
856
|
+
})(ht || (ht = {}));
|
|
857
857
|
function De(t) {
|
|
858
858
|
const e = new ve();
|
|
859
859
|
for (const i in t.layers) {
|
|
@@ -891,13 +891,13 @@ Mt(["exports"], function(o) {
|
|
|
891
891
|
throw new Error();
|
|
892
892
|
const n = t.keys, r = t.values, l = t.keycache, s = t.valuecache;
|
|
893
893
|
for (const c in i.properties) {
|
|
894
|
-
let m = i.properties[c],
|
|
894
|
+
let m = i.properties[c], f = l[c];
|
|
895
895
|
if (m === null)
|
|
896
896
|
continue;
|
|
897
|
-
typeof
|
|
898
|
-
const
|
|
899
|
-
|
|
900
|
-
const d = `${
|
|
897
|
+
typeof f > "u" && (n.push(c), f = n.length - 1, l[c] = f), e.writeVarint(f);
|
|
898
|
+
const h = typeof m;
|
|
899
|
+
h !== "string" && h !== "boolean" && h !== "number" && (m = JSON.stringify(m));
|
|
900
|
+
const d = `${h}:${m}`;
|
|
901
901
|
let w = s[d];
|
|
902
902
|
typeof w > "u" && (r.push(m), w = r.length - 1, s[d] = w), e.writeVarint(w);
|
|
903
903
|
}
|
|
@@ -915,14 +915,14 @@ Mt(["exports"], function(o) {
|
|
|
915
915
|
let r = 0, l = 0;
|
|
916
916
|
for (const s of i) {
|
|
917
917
|
let c = 1;
|
|
918
|
-
n ===
|
|
919
|
-
const m = s.length / 2,
|
|
920
|
-
for (let
|
|
921
|
-
|
|
922
|
-
const d = s[
|
|
918
|
+
n === ht.POINT && (c = s.length / 2), e.writeVarint(St(1, c));
|
|
919
|
+
const m = s.length / 2, f = n === ht.POLYGON ? m - 1 : m;
|
|
920
|
+
for (let h = 0; h < f; h++) {
|
|
921
|
+
h === 1 && n !== 1 && e.writeVarint(St(2, f - 1));
|
|
922
|
+
const d = s[h * 2] - r, w = s[h * 2 + 1] - l;
|
|
923
923
|
e.writeVarint(Vt(d)), e.writeVarint(Vt(w)), r += d, l += w;
|
|
924
924
|
}
|
|
925
|
-
n ===
|
|
925
|
+
n === ht.POLYGON && e.writeVarint(St(7, 1));
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
928
|
function ke(t, e) {
|
|
@@ -932,27 +932,27 @@ Mt(["exports"], function(o) {
|
|
|
932
932
|
}
|
|
933
933
|
class Re {
|
|
934
934
|
constructor(e, i, n, r, l) {
|
|
935
|
-
this.loaded = Promise.resolve(), this.decodeImage = It, this.fetchAndParseTile = (s, c, m,
|
|
935
|
+
this.loaded = Promise.resolve(), this.decodeImage = It, this.fetchAndParseTile = (s, c, m, f, h) => {
|
|
936
936
|
const d = this, w = this.demUrlPattern.replace("{z}", s.toString()).replace("{x}", c.toString()).replace("{y}", m.toString());
|
|
937
|
-
return
|
|
938
|
-
const O = await d.fetchTile(s, c, m, P,
|
|
937
|
+
return h == null || h.useTile(w), this.parsedCache.get(w, async (F, P) => {
|
|
938
|
+
const O = await d.fetchTile(s, c, m, P, h);
|
|
939
939
|
if (B(P))
|
|
940
940
|
throw new Error("canceled");
|
|
941
|
-
const I = d.decodeImage(O.data, d.encoding, P), R =
|
|
941
|
+
const I = d.decodeImage(O.data, d.encoding, P), 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 = r;
|
|
945
945
|
}
|
|
946
946
|
fetchTile(e, i, n, r, l) {
|
|
947
947
|
const s = this.demUrlPattern.replace("{z}", e.toString()).replace("{x}", i.toString()).replace("{y}", n.toString());
|
|
948
948
|
return l == null || l.useTile(s), this.tileCache.get(s, (c, m) => {
|
|
949
|
-
const
|
|
949
|
+
const f = {
|
|
950
950
|
signal: m.signal
|
|
951
951
|
};
|
|
952
952
|
l == null || l.fetchTile(s);
|
|
953
|
-
const
|
|
954
|
-
return G(this.timeoutMs, fetch(s,
|
|
955
|
-
if (
|
|
953
|
+
const h = l == null ? void 0 : l.marker("fetch");
|
|
954
|
+
return G(this.timeoutMs, fetch(s, f).then(async (d) => {
|
|
955
|
+
if (h == null || h(), !d.ok)
|
|
956
956
|
throw new Error(`Bad response: ${d.status} for ${s}`);
|
|
957
957
|
return {
|
|
958
958
|
data: await d.blob(),
|
|
@@ -963,11 +963,11 @@ Mt(["exports"], function(o) {
|
|
|
963
963
|
}, r);
|
|
964
964
|
}
|
|
965
965
|
async fetchDem(e, i, n, r, l, s) {
|
|
966
|
-
const c = Math.min(e - (r.overzoom || 0), this.maxzoom), m = e - c,
|
|
967
|
-
return $.fromRawDem(w).split(m, i %
|
|
966
|
+
const c = Math.min(e - (r.overzoom || 0), this.maxzoom), m = e - c, f = 1 << m, h = Math.floor(i / f), d = Math.floor(n / f), w = await this.fetchAndParseTile(c, h, d, l, s);
|
|
967
|
+
return $.fromRawDem(w).split(m, i % f, n % f);
|
|
968
968
|
}
|
|
969
969
|
fetchContourTile(e, i, n, r, l, s) {
|
|
970
|
-
const { levels: c, multiplier: m = 1, buffer:
|
|
970
|
+
const { levels: c, multiplier: m = 1, buffer: f = 1, extent: h = 4096, contourLayer: d = "contours", elevationKey: w = "ele", levelKey: F = "level", subsampleBelow: P = 100 } = r;
|
|
971
971
|
if (!c || c.length === 0)
|
|
972
972
|
return Promise.resolve({ arrayBuffer: new ArrayBuffer(0) });
|
|
973
973
|
const O = [e, i, n, p(r)].join("/");
|
|
@@ -987,16 +987,16 @@ Mt(["exports"], function(o) {
|
|
|
987
987
|
for (; X.width < P; )
|
|
988
988
|
X = X.subsamplePixelCenters(2).materialize(2);
|
|
989
989
|
X = X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);
|
|
990
|
-
const C = x(c[0], X,
|
|
990
|
+
const C = x(c[0], X, h, f);
|
|
991
991
|
ot == null || ot();
|
|
992
992
|
const At = De({
|
|
993
|
-
extent:
|
|
993
|
+
extent: h,
|
|
994
994
|
layers: {
|
|
995
995
|
[d]: {
|
|
996
996
|
features: Object.entries(C).map(([q, nt]) => {
|
|
997
997
|
const _t = Number(q);
|
|
998
998
|
return {
|
|
999
|
-
type:
|
|
999
|
+
type: ht.LINESTRING,
|
|
1000
1000
|
geometry: nt,
|
|
1001
1001
|
properties: {
|
|
1002
1002
|
[w]: _t,
|
|
@@ -1030,8 +1030,8 @@ Mt(["exports"], function(o) {
|
|
|
1030
1030
|
this.marks = {}, this.urls = [], this.fetched = [], this.resources = [], this.tilesFetched = 0, this.timeOrigin = Ce, this.finish = (i) => {
|
|
1031
1031
|
this.markFinish();
|
|
1032
1032
|
const n = (m) => {
|
|
1033
|
-
const
|
|
1034
|
-
return Number.isFinite(
|
|
1033
|
+
const f = this.marks[m] || [], h = Math.max(...f.map((w) => Math.max(...w))), d = Math.min(...f.map((w) => Math.min(...w)));
|
|
1034
|
+
return Number.isFinite(h) ? h - d : void 0;
|
|
1035
1035
|
}, r = n("main") || 0, l = n("fetch"), s = n("decode"), c = n("isoline");
|
|
1036
1036
|
return {
|
|
1037
1037
|
url: i,
|
|
@@ -1063,7 +1063,7 @@ Mt(["exports"], function(o) {
|
|
|
1063
1063
|
const r = i.origin - this.timeOrigin;
|
|
1064
1064
|
for (const l in i.marks) {
|
|
1065
1065
|
const s = l;
|
|
1066
|
-
(this.marks[s] || (this.marks[s] = [])).push(...((n = i.marks[s]) === null || n === void 0 ? void 0 : n.map((m) => m.map((
|
|
1066
|
+
(this.marks[s] || (this.marks[s] = [])).push(...((n = i.marks[s]) === null || n === void 0 ? void 0 : n.map((m) => m.map((f) => f + r))) || []);
|
|
1067
1067
|
}
|
|
1068
1068
|
this.resources.push(...i.resources.map((l) => Ie(l, r)));
|
|
1069
1069
|
}, this.markFinish = this.marker(e);
|
|
@@ -1088,27 +1088,27 @@ Mt(["exports"], function(o) {
|
|
|
1088
1088
|
const s = this.callbacks[l.id];
|
|
1089
1089
|
delete this.callbacks[l.id], s && s(l.error ? new Error(l.error) : void 0, l.response, l.timings);
|
|
1090
1090
|
} else if (l.type === "request") {
|
|
1091
|
-
const s = new Wt("worker"), c = i[l.name], m = new AbortController(),
|
|
1091
|
+
const s = new Wt("worker"), c = i[l.name], m = new AbortController(), f = c.apply(c, [
|
|
1092
1092
|
...l.args,
|
|
1093
1093
|
m,
|
|
1094
1094
|
s
|
|
1095
|
-
]),
|
|
1096
|
-
if (l.id &&
|
|
1095
|
+
]), h = `${l.name}_${l.id}`;
|
|
1096
|
+
if (l.id && f) {
|
|
1097
1097
|
this.cancels[l.id] = m;
|
|
1098
1098
|
try {
|
|
1099
|
-
const d = await
|
|
1099
|
+
const d = await f, w = d == null ? void 0 : d.transferrables;
|
|
1100
1100
|
this.postMessage({
|
|
1101
1101
|
id: l.id,
|
|
1102
1102
|
type: "response",
|
|
1103
1103
|
response: d,
|
|
1104
|
-
timings: s.finish(
|
|
1104
|
+
timings: s.finish(h)
|
|
1105
1105
|
}, w);
|
|
1106
1106
|
} catch (d) {
|
|
1107
1107
|
this.postMessage({
|
|
1108
1108
|
id: l.id,
|
|
1109
1109
|
type: "response",
|
|
1110
1110
|
error: (d == null ? void 0 : d.toString()) || "error",
|
|
1111
|
-
timings: s.finish(
|
|
1111
|
+
timings: s.finish(h)
|
|
1112
1112
|
});
|
|
1113
1113
|
}
|
|
1114
1114
|
delete this.cancels[l.id];
|
|
@@ -1121,9 +1121,9 @@ Mt(["exports"], function(o) {
|
|
|
1121
1121
|
}
|
|
1122
1122
|
/** Invokes a method by name with a set of arguments in the remote context. */
|
|
1123
1123
|
send(e, i, n, r, ...l) {
|
|
1124
|
-
const s = ++Le, c = new Promise((m,
|
|
1125
|
-
this.postMessage({ id: s, type: "request", name: e, args: l }, i), this.callbacks[s] = (
|
|
1126
|
-
r == null || r.addAll(w),
|
|
1124
|
+
const s = ++Le, c = new Promise((m, f) => {
|
|
1125
|
+
this.postMessage({ id: s, type: "request", name: e, args: l }, i), this.callbacks[s] = (h, d, w) => {
|
|
1126
|
+
r == null || r.addAll(w), h ? f(h) : m(d);
|
|
1127
1127
|
};
|
|
1128
1128
|
});
|
|
1129
1129
|
return U(n, () => {
|
|
@@ -2107,7 +2107,6 @@ function Ke() {
|
|
|
2107
2107
|
source: "boundary",
|
|
2108
2108
|
minzoom: 0.5,
|
|
2109
2109
|
paint: {
|
|
2110
|
-
"line-color": "#2A303C",
|
|
2111
2110
|
"line-width": [
|
|
2112
2111
|
"interpolate",
|
|
2113
2112
|
[
|
|
@@ -2122,7 +2121,7 @@ function Ke() {
|
|
|
2122
2121
|
4
|
|
2123
2122
|
],
|
|
2124
2123
|
"line-opacity": 1,
|
|
2125
|
-
"line-pattern": "normal:national-border"
|
|
2124
|
+
"line-pattern": "normal:national-border-dark"
|
|
2126
2125
|
}
|
|
2127
2126
|
},
|
|
2128
2127
|
{
|
|
@@ -3294,9 +3293,9 @@ class ri {
|
|
|
3294
3293
|
}, this._initMap(u), new Proxy(this, {
|
|
3295
3294
|
get(p, _, v) {
|
|
3296
3295
|
var A;
|
|
3297
|
-
if (_ in p) return Reflect.get(p, _, v);
|
|
3296
|
+
if (typeof _ == "symbol" || _ in p) return Reflect.get(p, _, v);
|
|
3298
3297
|
const D = (A = p._map) == null ? void 0 : A[_];
|
|
3299
|
-
return typeof D == "function" ? D.bind(p._map) :
|
|
3298
|
+
return typeof D == "function" ? D.bind(p._map) : void 0;
|
|
3300
3299
|
}
|
|
3301
3300
|
});
|
|
3302
3301
|
}
|