aviation-chart 0.1.13 → 0.1.15

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/index.js CHANGED
@@ -142,77 +142,77 @@ 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, h, f;
146
- const d = {}, w = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
147
- function C(P, I, k) {
148
- P[0] === 0 ? k(r * (f - 1), r * (h - y(c, I, l))) : P[0] === 2 ? k(r * f, r * (h - y(m, I, s))) : P[1] === 0 ? k(r * (f - y(s, I, l)), r * (h - 1)) : k(r * (f - y(m, I, c)), r * h);
145
+ let l, s, c, m, h, d;
146
+ const f = {}, w = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
147
+ function P(O, I, R) {
148
+ O[0] === 0 ? R(r * (d - 1), r * (h - y(c, I, l))) : O[0] === 2 ? R(r * d, r * (h - y(m, I, s))) : O[1] === 0 ? R(r * (d - y(s, I, l)), r * (h - 1)) : R(r * (d - y(m, I, c)), r * h);
149
149
  }
150
150
  for (h = 1 - n; h < e.height + n; h++) {
151
151
  s = e.get(0, h - 1), m = e.get(0, h);
152
- let P = Math.min(s, m), I = Math.max(s, m);
153
- for (f = 1 - n; f < e.width + n; f++) {
154
- l = s, c = m, s = e.get(f, h - 1), m = e.get(f, h);
155
- const k = P, V = I;
156
- if (P = Math.min(s, m), I = Math.max(s, m), isNaN(l) || isNaN(s) || isNaN(m) || isNaN(c))
152
+ let O = Math.min(s, m), I = Math.max(s, m);
153
+ for (d = 1 - n; d < e.width + n; d++) {
154
+ l = s, c = m, s = e.get(d, h - 1), m = e.get(d, h);
155
+ const R = O, V = I;
156
+ if (O = 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(k, P), pt = Math.max(V, I), X = Math.ceil(dt / t) * t, ot = Math.floor(pt / t) * t;
159
- for (let R = X; R <= ot; R += t) {
160
- const At = l > R, q = s > R, nt = c > R, _t = m > R;
158
+ const ft = Math.min(R, O), pt = Math.max(V, I), X = Math.ceil(ft / t) * t, ot = Math.floor(pt / t) * t;
159
+ for (let C = X; C <= ot; C += t) {
160
+ const At = l > C, q = s > C, nt = c > C, _t = m > C;
161
161
  for (const bt of u[(At ? 8 : 0) | (q ? 4 : 0) | (_t ? 2 : 0) | (nt ? 1 : 0)]) {
162
- let Y = w.get(R);
163
- Y || w.set(R, Y = /* @__PURE__ */ new Map());
164
- let lt = F.get(R);
165
- lt || F.set(R, lt = /* @__PURE__ */ new Map());
166
- const kt = bt[0], zt = bt[1], yt = g(e.width, f, h, kt), st = g(e.width, f, h, zt);
162
+ let Y = w.get(C);
163
+ Y || w.set(C, Y = /* @__PURE__ */ new Map());
164
+ let lt = F.get(C);
165
+ lt || F.set(C, lt = /* @__PURE__ */ new Map());
166
+ const kt = bt[0], zt = bt[1], yt = g(e.width, d, h, kt), st = g(e.width, d, h, zt);
167
167
  let L, Tt;
168
168
  if (L = lt.get(yt))
169
169
  if (lt.delete(yt), Tt = Y.get(st))
170
170
  if (Y.delete(st), L === Tt) {
171
- if (C(zt, R, L.append), !L.isEmpty()) {
172
- let rt = d[R];
173
- rt || (d[R] = rt = []), rt.push(L.lineString());
171
+ if (P(zt, C, L.append), !L.isEmpty()) {
172
+ let rt = f[C];
173
+ rt || (f[C] = rt = []), rt.push(L.lineString());
174
174
  }
175
175
  } else
176
176
  L.appendFragment(Tt), lt.set(L.end = Tt.end, L);
177
177
  else
178
- C(zt, R, L.append), lt.set(L.end = st, L);
178
+ P(zt, C, L.append), lt.set(L.end = st, L);
179
179
  else if (L = Y.get(st))
180
- Y.delete(st), C(kt, R, L.prepend), Y.set(L.start = yt, L);
180
+ Y.delete(st), P(kt, C, L.prepend), Y.set(L.start = yt, L);
181
181
  else {
182
182
  const rt = new a(yt, st);
183
- C(kt, R, rt.append), C(zt, R, rt.append), Y.set(yt, rt), lt.set(st, rt);
183
+ P(kt, C, rt.append), P(zt, C, rt.append), Y.set(yt, rt), lt.set(st, rt);
184
184
  }
185
185
  }
186
186
  }
187
187
  }
188
188
  }
189
- for (const [P, I] of w.entries()) {
190
- let k = null;
189
+ for (const [O, I] of w.entries()) {
190
+ let R = null;
191
191
  for (const V of I.values())
192
- V.isEmpty() || (k == null && (k = d[P] || (d[P] = [])), k.push(V.lineString()));
192
+ V.isEmpty() || (R == null && (R = f[O] || (f[O] = [])), R.push(V.lineString()));
193
193
  }
194
- return d;
194
+ return f;
195
195
  }
196
- function z(t) {
196
+ function b(t) {
197
197
  const e = Object.entries(t);
198
198
  return e.sort(([i], [n]) => i < n ? -1 : i > n ? 1 : 0), e;
199
199
  }
200
200
  function S(t) {
201
- return z(t).map(([e, i]) => [e, ...typeof i == "number" ? [i] : i].join("*")).join("~");
201
+ return b(t).map(([e, i]) => [e, ...typeof i == "number" ? [i] : i].join("*")).join("~");
202
202
  }
203
- function O(t) {
203
+ function M(t) {
204
204
  return Object.fromEntries(t.split("~").map((e) => e.split("*").map(Number)).map(([e, ...i]) => [e, i]));
205
205
  }
206
- function A({ thresholds: t, ...e }) {
207
- return z({ thresholds: S(t), ...e }).map(([i, n]) => `${encodeURIComponent(i)}=${encodeURIComponent(n)}`).join("&");
206
+ function k({ thresholds: t, ...e }) {
207
+ return b({ thresholds: S(t), ...e }).map(([i, n]) => `${encodeURIComponent(i)}=${encodeURIComponent(n)}`).join("&");
208
208
  }
209
- function _(t) {
209
+ function z(t) {
210
210
  return Object.fromEntries(t.replace(/^.*\?/, "").split("&").map((e) => {
211
211
  const i = e.split("=").map(decodeURIComponent), n = i[0];
212
212
  let r = i[1];
213
213
  switch (n) {
214
214
  case "thresholds":
215
- r = O(r);
215
+ r = M(r);
216
216
  break;
217
217
  case "extent":
218
218
  case "multiplier":
@@ -224,9 +224,9 @@ Mt(["exports"], function(o) {
224
224
  }));
225
225
  }
226
226
  function p(t) {
227
- return z(t).map(([e, i]) => `${encodeURIComponent(e)}=${encodeURIComponent(i)}`).join(",");
227
+ return b(t).map(([e, i]) => `${encodeURIComponent(e)}=${encodeURIComponent(i)}`).join(",");
228
228
  }
229
- function b(t, e) {
229
+ function _(t, e) {
230
230
  const { thresholds: i, ...n } = t;
231
231
  let r = [], l = -1 / 0;
232
232
  return Object.entries(i).forEach(([s, c]) => {
@@ -247,7 +247,7 @@ Mt(["exports"], function(o) {
247
247
  return e && (r = new Float32Array(i.length), r.set(i)), { ...n, data: r, transferrables: [r.buffer] };
248
248
  });
249
249
  }
250
- function M(t) {
250
+ function A(t) {
251
251
  return t.then(({ arrayBuffer: e }) => {
252
252
  const i = v(e);
253
253
  return {
@@ -311,10 +311,10 @@ Mt(["exports"], function(o) {
311
311
  if (l)
312
312
  l.lastUsed = ++E, l.waiting++;
313
313
  else {
314
- const h = new AbortController(), f = n(i, h);
314
+ const h = new AbortController(), d = n(i, h);
315
315
  l = {
316
316
  abortController: h,
317
- item: f,
317
+ item: d,
318
318
  lastUsed: ++E,
319
319
  waiting: 1
320
320
  }, this.items.set(i, l), this.prune();
@@ -355,13 +355,13 @@ 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 h = (l = c == null ? void 0 : c.format) === null || l === void 0 ? void 0 : l.startsWith("BGR"), f = c.allocationSize(), d = new Uint8ClampedArray(f);
359
- if (await c.copyTo(d), h)
360
- for (let w = 0; w < d.length; w += 4) {
361
- const F = d[w];
362
- d[w] = d[w + 2], d[w + 2] = F;
358
+ const h = (l = c == null ? void 0 : c.format) === null || l === void 0 ? void 0 : l.startsWith("BGR"), d = c.allocationSize(), f = new Uint8ClampedArray(d);
359
+ if (await c.copyTo(f), h)
360
+ for (let w = 0; w < f.length; w += 4) {
361
+ const F = f[w];
362
+ f[w] = f[w + 2], f[w + 2] = F;
363
363
  }
364
- return Dt(s.width, s.height, e, d);
364
+ return Dt(s.width, s.height, e, f);
365
365
  } catch {
366
366
  return B(i) ? null : W(s, e);
367
367
  } finally {
@@ -415,21 +415,21 @@ Mt(["exports"], function(o) {
415
415
  if (r === 0)
416
416
  return this;
417
417
  const c = 1 << r, m = l * this.width / c, h = s * this.height / c;
418
- return new $(this.width / c, this.height / c, (f, d) => this.get(f + m, d + h));
418
+ return new $(this.width / c, this.height / c, (d, f) => this.get(d + m, f + h));
419
419
  }, this.subsamplePixelCenters = (r) => {
420
- const l = (m, h, f) => isNaN(m) ? h : isNaN(h) ? m : m + (h - m) * f;
420
+ const l = (m, h, d) => isNaN(m) ? h : isNaN(h) ? m : m + (h - m) * d;
421
421
  if (r <= 1)
422
422
  return this;
423
423
  const s = 0.5 - 1 / (2 * r), c = (m, h) => {
424
- const f = m / r - s, d = h / r - s, w = Math.floor(f), F = Math.floor(d), C = this.get(w, F), P = this.get(w + 1, F), I = this.get(w, F + 1), k = this.get(w + 1, F + 1), V = f - w, dt = d - F, pt = l(C, P, V), X = l(I, k, V);
425
- return l(pt, X, dt);
424
+ const d = m / r - s, f = h / r - s, w = Math.floor(d), F = Math.floor(f), 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 = d - w, ft = f - F, pt = l(P, O, V), X = l(I, R, V);
425
+ return l(pt, X, ft);
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
429
  let c = 0, m = 0, h = 0;
430
- for (let f = l - r; f < l + r; f++)
431
- for (let d = s - r; d < s + r; d++)
432
- isNaN(h = this.get(f, d)) || (m++, c += h);
430
+ for (let d = l - r; d < l + r; d++)
431
+ for (let f = s - r; f < s + r; f++)
432
+ isNaN(h = this.get(d, f)) || (m++, c += h);
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));
@@ -474,10 +474,10 @@ 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, h = m >> 1, f = -7, d = i ? r - 1 : 0, w = i ? -1 : 1, F = t[e + d];
478
- for (d += w, l = F & (1 << -f) - 1, F >>= -f, f += c; f > 0; l = l * 256 + t[e + d], d += w, f -= 8)
477
+ var l, s, c = r * 8 - n - 1, m = (1 << c) - 1, h = m >> 1, d = -7, f = i ? r - 1 : 0, w = i ? -1 : 1, F = t[e + f];
478
+ for (f += w, l = F & (1 << -d) - 1, F >>= -d, d += c; d > 0; l = l * 256 + t[e + f], f += w, d -= 8)
479
479
  ;
480
- for (s = l & (1 << -f) - 1, l >>= -f, f += n; f > 0; s = s * 256 + t[e + d], d += w, f -= 8)
480
+ for (s = l & (1 << -d) - 1, l >>= -d, d += n; d > 0; s = s * 256 + t[e + f], f += w, d -= 8)
481
481
  ;
482
482
  if (l === 0)
483
483
  l = 1 - h;
@@ -488,12 +488,12 @@ Mt(["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, r, l) {
491
- var s, c, m, h = l * 8 - r - 1, f = (1 << h) - 1, d = f >> 1, w = r === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, F = n ? 0 : l - 1, C = 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 = f) : (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 >= f ? (c = 0, s = f) : 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 += C, c /= 256, r -= 8)
491
+ var s, c, m, h = l * 8 - r - 1, d = (1 << h) - 1, f = d >> 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 = d) : (s = Math.floor(Math.log(e) / Math.LN2), e * (m = Math.pow(2, -s)) < 1 && (s--, m *= 2), s + f >= 1 ? e += w / m : e += w * Math.pow(2, 1 - f), e * m >= 2 && (s++, m /= 2), s + f >= d ? (c = 0, s = d) : s + f >= 1 ? (c = (e * m - 1) * Math.pow(2, r), s = s + f) : (c = e * Math.pow(2, f - 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, h += r; h > 0; t[i + F] = s & 255, F += C, s /= 256, h -= 8)
494
+ for (s = s << r | c, h += r; h > 0; t[i + F] = s & 255, F += P, s /= 256, h -= 8)
495
495
  ;
496
- t[i + F - C] |= P * 128;
496
+ t[i + F - P] |= O * 128;
497
497
  };
498
498
  var ne = T, gt = Et;
499
499
  function T(t) {
@@ -695,10 +695,10 @@ 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, fe, e);
698
+ e.length && this.writeMessage(t, de, e);
699
699
  },
700
700
  writePackedSVarint: function(t, e) {
701
- e.length && this.writeMessage(t, de, e);
701
+ e.length && this.writeMessage(t, fe, e);
702
702
  },
703
703
  writePackedBoolean: function(t, e) {
704
704
  e.length && this.writeMessage(t, ye, e);
@@ -784,10 +784,10 @@ 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 fe(t, e) {
787
+ function de(t, e) {
788
788
  for (var i = 0; i < t.length; i++) e.writeVarint(t[i]);
789
789
  }
790
- function de(t, e) {
790
+ function fe(t, e) {
791
791
  for (var i = 0; i < t.length; i++) e.writeSVarint(t[i]);
792
792
  }
793
793
  function ue(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, h, f;
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], h = t[r + 2], (m & 192) === 128 && (h & 192) === 128 && (s = (l & 15) << 12 | (m & 63) << 6 | h & 63, (s <= 2047 || s >= 55296 && s <= 57343) && (s = null))) : c === 4 && (m = t[r + 1], h = t[r + 2], f = t[r + 3], (m & 192) === 128 && (h & 192) === 128 && (f & 192) === 128 && (s = (l & 15) << 18 | (m & 63) << 12 | (h & 63) << 6 | f & 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;
827
+ var m, h, d;
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], h = t[r + 2], (m & 192) === 128 && (h & 192) === 128 && (s = (l & 15) << 12 | (m & 63) << 6 | h & 63, (s <= 2047 || s >= 55296 && s <= 57343) && (s = null))) : c === 4 && (m = t[r + 1], h = t[r + 2], d = t[r + 3], (m & 192) === 128 && (h & 192) === 128 && (d & 192) === 128 && (s = (l & 15) << 18 | (m & 63) << 12 | (h & 63) << 6 | d & 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), ft;
853
+ var ve = /* @__PURE__ */ ae(ne), dt;
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
- })(ft || (ft = {}));
856
+ })(dt || (dt = {}));
857
857
  function De(t) {
858
858
  const e = new ve();
859
859
  for (const i in t.layers) {
@@ -895,11 +895,11 @@ Mt(["exports"], function(o) {
895
895
  if (m === null)
896
896
  continue;
897
897
  typeof h > "u" && (n.push(c), h = n.length - 1, l[c] = h), e.writeVarint(h);
898
- const f = typeof m;
899
- f !== "string" && f !== "boolean" && f !== "number" && (m = JSON.stringify(m));
900
- const d = `${f}:${m}`;
901
- let w = s[d];
902
- typeof w > "u" && (r.push(m), w = r.length - 1, s[d] = w), e.writeVarint(w);
898
+ const d = typeof m;
899
+ d !== "string" && d !== "boolean" && d !== "number" && (m = JSON.stringify(m));
900
+ const f = `${d}:${m}`;
901
+ let w = s[f];
902
+ typeof w > "u" && (r.push(m), w = r.length - 1, s[f] = w), e.writeVarint(w);
903
903
  }
904
904
  }
905
905
  function St(t, e) {
@@ -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 === ft.POINT && (c = s.length / 2), e.writeVarint(St(1, c));
919
- const m = s.length / 2, h = n === ft.POLYGON ? m - 1 : m;
920
- for (let f = 0; f < h; f++) {
921
- f === 1 && n !== 1 && e.writeVarint(St(2, h - 1));
922
- const d = s[f * 2] - r, w = s[f * 2 + 1] - l;
923
- e.writeVarint(Vt(d)), e.writeVarint(Vt(w)), r += d, l += w;
918
+ n === dt.POINT && (c = s.length / 2), e.writeVarint(St(1, c));
919
+ const m = s.length / 2, h = n === dt.POLYGON ? m - 1 : m;
920
+ for (let d = 0; d < h; d++) {
921
+ d === 1 && n !== 1 && e.writeVarint(St(2, h - 1));
922
+ const f = s[d * 2] - r, w = s[d * 2 + 1] - l;
923
+ e.writeVarint(Vt(f)), e.writeVarint(Vt(w)), r += f, l += w;
924
924
  }
925
- n === ft.POLYGON && e.writeVarint(St(7, 1));
925
+ n === dt.POLYGON && e.writeVarint(St(7, 1));
926
926
  }
927
927
  }
928
928
  function ke(t, e) {
@@ -932,14 +932,14 @@ 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, h, f) => {
936
- const d = this, w = this.demUrlPattern.replace("{z}", s.toString()).replace("{x}", c.toString()).replace("{y}", m.toString());
937
- return f == null || f.useTile(w), this.parsedCache.get(w, async (F, C) => {
938
- const P = await d.fetchTile(s, c, m, C, f);
939
- if (B(C))
935
+ this.loaded = Promise.resolve(), this.decodeImage = It, this.fetchAndParseTile = (s, c, m, h, d) => {
936
+ const f = this, w = this.demUrlPattern.replace("{z}", s.toString()).replace("{x}", c.toString()).replace("{y}", m.toString());
937
+ return d == null || d.useTile(w), this.parsedCache.get(w, async (F, P) => {
938
+ const O = await f.fetchTile(s, c, m, P, d);
939
+ if (B(P))
940
940
  throw new Error("canceled");
941
- const I = d.decodeImage(P.data, d.encoding, C), k = f == null ? void 0 : f.marker("decode"), V = await I;
942
- return k == null || k(), V;
941
+ const I = f.decodeImage(O.data, f.encoding, P), R = d == null ? void 0 : d.marker("decode"), V = await I;
942
+ return R == null || R(), V;
943
943
  }, h);
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
  }
@@ -950,53 +950,53 @@ Mt(["exports"], function(o) {
950
950
  signal: m.signal
951
951
  };
952
952
  l == null || l.fetchTile(s);
953
- const f = l == null ? void 0 : l.marker("fetch");
954
- return G(this.timeoutMs, fetch(s, h).then(async (d) => {
955
- if (f == null || f(), !d.ok)
956
- throw new Error(`Bad response: ${d.status} for ${s}`);
953
+ const d = l == null ? void 0 : l.marker("fetch");
954
+ return G(this.timeoutMs, fetch(s, h).then(async (f) => {
955
+ if (d == null || d(), !f.ok)
956
+ throw new Error(`Bad response: ${f.status} for ${s}`);
957
957
  return {
958
- data: await d.blob(),
959
- expires: d.headers.get("expires") || void 0,
960
- cacheControl: d.headers.get("cache-control") || void 0
958
+ data: await f.blob(),
959
+ expires: f.headers.get("expires") || void 0,
960
+ cacheControl: f.headers.get("cache-control") || void 0
961
961
  };
962
962
  }), m);
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, h = 1 << m, f = Math.floor(i / h), d = Math.floor(n / h), w = await this.fetchAndParseTile(c, f, d, l, s);
966
+ const c = Math.min(e - (r.overzoom || 0), this.maxzoom), m = e - c, h = 1 << m, d = Math.floor(i / h), f = Math.floor(n / h), w = await this.fetchAndParseTile(c, d, f, l, s);
967
967
  return $.fromRawDem(w).split(m, i % h, n % h);
968
968
  }
969
969
  fetchContourTile(e, i, n, r, l, s) {
970
- const { levels: c, multiplier: m = 1, buffer: h = 1, extent: f = 4096, contourLayer: d = "contours", elevationKey: w = "ele", levelKey: F = "level", subsampleBelow: C = 100 } = r;
970
+ const { levels: c, multiplier: m = 1, buffer: h = 1, extent: d = 4096, contourLayer: f = "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
- const P = [e, i, n, p(r)].join("/");
974
- return this.contourCache.get(P, async (I, k) => {
975
- const V = 1 << e, dt = [];
973
+ const O = [e, i, n, p(r)].join("/");
974
+ return this.contourCache.get(O, async (I, R) => {
975
+ const V = 1 << e, ft = [];
976
976
  for (let q = n - 1; q <= n + 1; q++)
977
977
  for (let nt = i - 1; nt <= i + 1; nt++)
978
- dt.push(q < 0 || q >= V ? void 0 : this.fetchDem(e, (nt + V) % V, q, r, k, s));
979
- const pt = await Promise.all(dt);
978
+ ft.push(q < 0 || q >= V ? void 0 : this.fetchDem(e, (nt + V) % V, q, r, R, s));
979
+ const pt = await Promise.all(ft);
980
980
  let X = $.combineNeighbors(pt);
981
- if (!X || B(k))
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 >= C)
984
+ if (X.width >= P)
985
985
  X = X.materialize(2);
986
986
  else
987
- for (; X.width < C; )
987
+ for (; X.width < P; )
988
988
  X = X.subsamplePixelCenters(2).materialize(2);
989
989
  X = X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);
990
- const R = x(c[0], X, f, h);
990
+ const C = x(c[0], X, d, h);
991
991
  ot == null || ot();
992
992
  const At = De({
993
- extent: f,
993
+ extent: d,
994
994
  layers: {
995
- [d]: {
996
- features: Object.entries(R).map(([q, nt]) => {
995
+ [f]: {
996
+ features: Object.entries(C).map(([q, nt]) => {
997
997
  const _t = Number(q);
998
998
  return {
999
- type: ft.LINESTRING,
999
+ type: dt.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 h = this.marks[m] || [], f = Math.max(...h.map((w) => Math.max(...w))), d = Math.min(...h.map((w) => Math.min(...w)));
1034
- return Number.isFinite(f) ? f - d : void 0;
1033
+ const h = this.marks[m] || [], d = Math.max(...h.map((w) => Math.max(...w))), f = Math.min(...h.map((w) => Math.min(...w)));
1034
+ return Number.isFinite(d) ? d - f : void 0;
1035
1035
  }, r = n("main") || 0, l = n("fetch"), s = n("decode"), c = n("isoline");
1036
1036
  return {
1037
1037
  url: i,
@@ -1092,23 +1092,23 @@ Mt(["exports"], function(o) {
1092
1092
  ...l.args,
1093
1093
  m,
1094
1094
  s
1095
- ]), f = `${l.name}_${l.id}`;
1095
+ ]), d = `${l.name}_${l.id}`;
1096
1096
  if (l.id && h) {
1097
1097
  this.cancels[l.id] = m;
1098
1098
  try {
1099
- const d = await h, w = d == null ? void 0 : d.transferrables;
1099
+ const f = await h, w = f == null ? void 0 : f.transferrables;
1100
1100
  this.postMessage({
1101
1101
  id: l.id,
1102
1102
  type: "response",
1103
- response: d,
1104
- timings: s.finish(f)
1103
+ response: f,
1104
+ timings: s.finish(d)
1105
1105
  }, w);
1106
- } catch (d) {
1106
+ } catch (f) {
1107
1107
  this.postMessage({
1108
1108
  id: l.id,
1109
1109
  type: "response",
1110
- error: (d == null ? void 0 : d.toString()) || "error",
1111
- timings: s.finish(f)
1110
+ error: (f == null ? void 0 : f.toString()) || "error",
1111
+ timings: s.finish(d)
1112
1112
  });
1113
1113
  }
1114
1114
  delete this.cancels[l.id];
@@ -1122,8 +1122,8 @@ Mt(["exports"], function(o) {
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
1124
  const s = ++Le, c = new Promise((m, h) => {
1125
- this.postMessage({ id: s, type: "request", name: e, args: l }, i), this.callbacks[s] = (f, d, w) => {
1126
- r == null || r.addAll(w), f ? h(f) : m(d);
1125
+ this.postMessage({ id: s, type: "request", name: e, args: l }, i), this.callbacks[s] = (d, f, w) => {
1126
+ r == null || r.addAll(w), d ? h(d) : m(f);
1127
1127
  };
1128
1128
  });
1129
1129
  return U(n, () => {
@@ -1131,21 +1131,21 @@ Mt(["exports"], function(o) {
1131
1131
  }), G(this.timeoutMs, c, n);
1132
1132
  }
1133
1133
  }
1134
- o.A = Ge, o.H = $, o.L = Re, o.T = Wt, o.a = _, o.b = x, o.c = Dt, o.d = It, o.e = A, o.f = M, o.g = b, o.p = D;
1134
+ o.A = Ge, o.H = $, o.L = Re, o.T = Wt, o.a = z, o.b = x, o.c = Dt, o.d = It, o.e = k, o.f = A, o.g = _, o.p = D;
1135
1135
  });
1136
1136
  Mt(["./shared"], function(o) {
1137
1137
  const a = (y) => Promise.reject(new Error(`No manager registered for ${y}`));
1138
1138
  class u {
1139
1139
  constructor() {
1140
- this.managers = {}, this.init = (x, z) => (this.managers[x.managerId] = new o.L(x.demUrlPattern, x.cacheSize, x.encoding, x.maxzoom, x.timeoutMs), Promise.resolve()), this.fetchTile = (x, z, S, O, A, _) => {
1140
+ this.managers = {}, this.init = (x, b) => (this.managers[x.managerId] = new o.L(x.demUrlPattern, x.cacheSize, x.encoding, x.maxzoom, x.timeoutMs), Promise.resolve()), this.fetchTile = (x, b, S, M, k, z) => {
1141
1141
  var p;
1142
- return ((p = this.managers[x]) === null || p === void 0 ? void 0 : p.fetchTile(z, S, O, A, _)) || a(x);
1143
- }, this.fetchAndParseTile = (x, z, S, O, A, _) => {
1142
+ return ((p = this.managers[x]) === null || p === void 0 ? void 0 : p.fetchTile(b, S, M, k, z)) || a(x);
1143
+ }, this.fetchAndParseTile = (x, b, S, M, k, z) => {
1144
1144
  var p;
1145
- return o.p(((p = this.managers[x]) === null || p === void 0 ? void 0 : p.fetchAndParseTile(z, S, O, A, _)) || a(x), !0);
1146
- }, this.fetchContourTile = (x, z, S, O, A, _, p) => {
1147
- var b;
1148
- return o.f(((b = this.managers[x]) === null || b === void 0 ? void 0 : b.fetchContourTile(z, S, O, A, _, p)) || a(x));
1145
+ return o.p(((p = this.managers[x]) === null || p === void 0 ? void 0 : p.fetchAndParseTile(b, S, M, k, z)) || a(x), !0);
1146
+ }, this.fetchContourTile = (x, b, S, M, k, z, p) => {
1147
+ var _;
1148
+ return o.f(((_ = this.managers[x]) === null || _ === void 0 ? void 0 : _.fetchContourTile(b, S, M, k, z, p)) || a(x));
1149
1149
  };
1150
1150
  }
1151
1151
  }
@@ -1157,49 +1157,49 @@ Mt(["./shared"], function(o) {
1157
1157
  let u, g = 0;
1158
1158
  class y {
1159
1159
  constructor() {
1160
- this.decodeImage = (b, v, D) => o.p(o.d(b, v, D), !1);
1160
+ this.decodeImage = (_, v, D) => o.p(o.d(_, v, D), !1);
1161
1161
  }
1162
1162
  }
1163
1163
  function x() {
1164
1164
  if (!u) {
1165
- const p = new Worker(a.workerUrl), b = new y();
1166
- u = new o.A(p, b);
1165
+ const p = new Worker(a.workerUrl), _ = new y();
1166
+ u = new o.A(p, _);
1167
1167
  }
1168
1168
  return u;
1169
1169
  }
1170
- class z {
1171
- constructor(b, v, D, M, j, ct) {
1170
+ class b {
1171
+ constructor(_, v, D, A, j, ct) {
1172
1172
  this.fetchTile = (H, G, U, B, E) => this.actor.send("fetchTile", [], B, E, this.managerId, H, G, U), this.fetchAndParseTile = (H, G, U, B, E) => this.actor.send("fetchAndParseTile", [], B, E, this.managerId, H, G, U), this.fetchContourTile = (H, G, U, B, E, Z) => this.actor.send("fetchContourTile", [], E, Z, this.managerId, H, G, U, B);
1173
1173
  const tt = this.managerId = ++g;
1174
1174
  this.actor = ct || x(), this.loaded = this.actor.send("init", [], new AbortController(), void 0, {
1175
1175
  cacheSize: v,
1176
- demUrlPattern: b,
1176
+ demUrlPattern: _,
1177
1177
  encoding: D,
1178
- maxzoom: M,
1178
+ maxzoom: A,
1179
1179
  managerId: tt,
1180
1180
  timeoutMs: j
1181
1181
  });
1182
1182
  }
1183
1183
  }
1184
1184
  Blob.prototype.arrayBuffer || (Blob.prototype.arrayBuffer = function() {
1185
- return new Promise((b, v) => {
1185
+ return new Promise((_, v) => {
1186
1186
  const D = new FileReader();
1187
- D.onload = (M) => {
1187
+ D.onload = (A) => {
1188
1188
  var j;
1189
- return b((j = M.target) === null || j === void 0 ? void 0 : j.result);
1189
+ return _((j = A.target) === null || j === void 0 ? void 0 : j.result);
1190
1190
  }, D.onerror = v, D.readAsArrayBuffer(this);
1191
1191
  });
1192
1192
  });
1193
- const S = (p) => (b, v) => {
1193
+ const S = (p) => (_, v) => {
1194
1194
  if (v instanceof AbortController)
1195
- return p(b, v);
1195
+ return p(_, v);
1196
1196
  {
1197
1197
  const D = new AbortController();
1198
- return p(b, D).then((M) => v(void 0, M.data, M.cacheControl, M.expires), (M) => v(M)), { cancel: () => D.abort() };
1198
+ return p(_, D).then((A) => v(void 0, A.data, A.cacheControl, A.expires), (A) => v(A)), { cancel: () => D.abort() };
1199
1199
  }
1200
- }, O = /* @__PURE__ */ new Set();
1201
- class A {
1202
- constructor({ url: b, cacheSize: v = 100, id: D = "dem", encoding: M = "terrarium", maxzoom: j = 12, worker: ct = !0, timeoutMs: tt = 1e4, actor: H }) {
1200
+ }, M = /* @__PURE__ */ new Set();
1201
+ class k {
1202
+ constructor({ url: _, cacheSize: v = 100, id: D = "dem", encoding: A = "terrarium", maxzoom: j = 12, worker: ct = !0, timeoutMs: tt = 1e4, actor: H }) {
1203
1203
  this.timingCallbacks = [], this.onTiming = (E) => {
1204
1204
  this.timingCallbacks.push(E);
1205
1205
  }, this.setupMaplibre = (E) => {
@@ -1232,23 +1232,23 @@ Mt(["./shared"], function(o) {
1232
1232
  }
1233
1233
  }, this.contourProtocol = S(this.contourProtocolV4), this.sharedDemProtocol = S(this.sharedDemProtocolV4), this.contourProtocolUrl = (E) => `${this.contourProtocolUrlBase}?${o.e(E)}`;
1234
1234
  let G = D, U = 1;
1235
- for (; O.has(G); )
1235
+ for (; M.has(G); )
1236
1236
  G = D + U++;
1237
- O.add(G), this.sharedDemProtocolId = `${G}-shared`, this.contourProtocolId = `${G}-contour`, this.sharedDemProtocolUrl = `${this.sharedDemProtocolId}://{z}/{x}/{y}`, this.contourProtocolUrlBase = `${this.contourProtocolId}://{z}/{x}/{y}`;
1238
- const B = ct ? z : o.L;
1239
- this.manager = new B(b, v, M, j, tt, H);
1237
+ M.add(G), this.sharedDemProtocolId = `${G}-shared`, this.contourProtocolId = `${G}-contour`, this.sharedDemProtocolUrl = `${this.sharedDemProtocolId}://{z}/{x}/{y}`, this.contourProtocolUrlBase = `${this.contourProtocolId}://{z}/{x}/{y}`;
1238
+ const B = ct ? b : o.L;
1239
+ this.manager = new B(_, v, A, j, tt, H);
1240
1240
  }
1241
- getDemTile(b, v, D, M) {
1242
- return this.manager.fetchAndParseTile(b, v, D, M || new AbortController());
1241
+ getDemTile(_, v, D, A) {
1242
+ return this.manager.fetchAndParseTile(_, v, D, A || new AbortController());
1243
1243
  }
1244
- parseUrl(b) {
1245
- const [, v, D, M] = /\/\/(\d+)\/(\d+)\/(\d+)/.exec(b) || [];
1246
- return [Number(v), Number(D), Number(M)];
1244
+ parseUrl(_) {
1245
+ const [, v, D, A] = /\/\/(\d+)\/(\d+)\/(\d+)/.exec(_) || [];
1246
+ return [Number(v), Number(D), Number(A)];
1247
1247
  }
1248
1248
  }
1249
1249
  return {
1250
1250
  generateIsolines: o.b,
1251
- DemSource: A,
1251
+ DemSource: k,
1252
1252
  HeightTile: o.H,
1253
1253
  LocalDemManager: o.L,
1254
1254
  decodeParsedImage: o.c,
@@ -1266,11 +1266,11 @@ function Xe(o) {
1266
1266
  }
1267
1267
  function Ne(o) {
1268
1268
  if (o == null) return Xe;
1269
- var a, u, g = o.scale[0], y = o.scale[1], x = o.translate[0], z = o.translate[1];
1270
- return function(S, O) {
1271
- O || (a = u = 0);
1272
- var A = 2, _ = S.length, p = new Array(_);
1273
- for (p[0] = (a += S[0]) * g + x, p[1] = (u += S[1]) * y + z; A < _; ) p[A] = S[A], ++A;
1269
+ var a, u, g = o.scale[0], y = o.scale[1], x = o.translate[0], b = o.translate[1];
1270
+ return function(S, M) {
1271
+ M || (a = u = 0);
1272
+ var k = 2, z = S.length, p = new Array(z);
1273
+ for (p[0] = (a += S[0]) * g + x, p[1] = (u += S[1]) * y + b; k < z; ) p[k] = S[k], ++k;
1274
1274
  return p;
1275
1275
  };
1276
1276
  }
@@ -1288,55 +1288,55 @@ function Kt(o, a) {
1288
1288
  }
1289
1289
  function Ue(o, a) {
1290
1290
  var u = Ne(o.transform), g = o.arcs;
1291
- function y(_, p) {
1291
+ function y(z, p) {
1292
1292
  p.length && p.pop();
1293
- for (var b = g[_ < 0 ? ~_ : _], v = 0, D = b.length; v < D; ++v)
1294
- p.push(u(b[v], v));
1295
- _ < 0 && Ve(p, D);
1293
+ for (var _ = g[z < 0 ? ~z : z], v = 0, D = _.length; v < D; ++v)
1294
+ p.push(u(_[v], v));
1295
+ z < 0 && Ve(p, D);
1296
1296
  }
1297
- function x(_) {
1298
- return u(_);
1297
+ function x(z) {
1298
+ return u(z);
1299
1299
  }
1300
- function z(_) {
1301
- for (var p = [], b = 0, v = _.length; b < v; ++b) y(_[b], p);
1300
+ function b(z) {
1301
+ for (var p = [], _ = 0, v = z.length; _ < v; ++_) y(z[_], p);
1302
1302
  return p.length < 2 && p.push(p[0]), p;
1303
1303
  }
1304
- function S(_) {
1305
- for (var p = z(_); p.length < 4; ) p.push(p[0]);
1304
+ function S(z) {
1305
+ for (var p = b(z); p.length < 4; ) p.push(p[0]);
1306
1306
  return p;
1307
1307
  }
1308
- function O(_) {
1309
- return _.map(S);
1308
+ function M(z) {
1309
+ return z.map(S);
1310
1310
  }
1311
- function A(_) {
1312
- var p = _.type, b;
1311
+ function k(z) {
1312
+ var p = z.type, _;
1313
1313
  switch (p) {
1314
1314
  case "GeometryCollection":
1315
- return { type: p, geometries: _.geometries.map(A) };
1315
+ return { type: p, geometries: z.geometries.map(k) };
1316
1316
  case "Point":
1317
- b = x(_.coordinates);
1317
+ _ = x(z.coordinates);
1318
1318
  break;
1319
1319
  case "MultiPoint":
1320
- b = _.coordinates.map(x);
1320
+ _ = z.coordinates.map(x);
1321
1321
  break;
1322
1322
  case "LineString":
1323
- b = z(_.arcs);
1323
+ _ = b(z.arcs);
1324
1324
  break;
1325
1325
  case "MultiLineString":
1326
- b = _.arcs.map(z);
1326
+ _ = z.arcs.map(b);
1327
1327
  break;
1328
1328
  case "Polygon":
1329
- b = O(_.arcs);
1329
+ _ = M(z.arcs);
1330
1330
  break;
1331
1331
  case "MultiPolygon":
1332
- b = _.arcs.map(O);
1332
+ _ = z.arcs.map(M);
1333
1333
  break;
1334
1334
  default:
1335
1335
  return null;
1336
1336
  }
1337
- return { type: p, coordinates: b };
1337
+ return { type: p, coordinates: _ };
1338
1338
  }
1339
- return A(a);
1339
+ return k(a);
1340
1340
  }
1341
1341
  const We = {
1342
1342
  airspaceStroke: "#AAB7B8",
@@ -1452,7 +1452,7 @@ function je() {
1452
1452
  "source-layer": "restricted-fill",
1453
1453
  minzoom: 4,
1454
1454
  paint: {
1455
- "fill-color": "##FAD7A0",
1455
+ "fill-color": "#FAD7A0",
1456
1456
  // "fill-pattern": "normal:passline",
1457
1457
  "fill-opacity": [
1458
1458
  "interpolate",
@@ -3256,8 +3256,9 @@ class ri {
3256
3256
  * @param {string} [options.spriteUrl] Override sprite server URL (defaults to apiUrl)
3257
3257
  * @param {string} [options.period] Period id; defaults to latest
3258
3258
  * @param {object} [options.layers] Initial layer visibility map
3259
- * @param {[number,number]} [options.center] Initial map center [lng, lat] (default [104, 36])
3260
- * @param {number} [options.zoom] Initial zoom level (default 4)
3259
+ * @param {[number,number]} [options.center] Initial map center [lng, lat] (default [104, 36])
3260
+ * @param {number} [options.zoom] Initial zoom level (default 4)
3261
+ * @param {string} [options.terrainUrl] Terrain DEM tile URL template (default internal server)
3261
3262
  */
3262
3263
  constructor(a = {}) {
3263
3264
  const {
@@ -3265,12 +3266,13 @@ class ri {
3265
3266
  theme: g = "light",
3266
3267
  apiUrl: y = ti,
3267
3268
  spriteUrl: x,
3268
- period: z = null,
3269
+ period: b = null,
3269
3270
  layers: S = {},
3270
- center: O = [104, 36],
3271
- zoom: A = 4
3271
+ center: M = [104, 36],
3272
+ zoom: k = 4,
3273
+ terrainUrl: z = "http://192.168.125.168:3456/terrain-dem/{z}/{x}/{y}.png"
3272
3274
  } = a;
3273
- return this._apiUrl = y.replace(/\/$/, ""), this._spriteUrl = (x ?? y).replace(/\/$/, ""), this._theme = g, this._period = z, this._center = O, this._zoom = A, this._ready = !1, this._layerVisible = {
3275
+ return this._apiUrl = y.replace(/\/$/, ""), this._spriteUrl = (x ?? y).replace(/\/$/, ""), this._terrainUrl = z, this._theme = g, this._period = b, this._center = M, this._zoom = k, this._ready = !1, this._layerVisible = {
3274
3276
  // aviation groups — all visible by default
3275
3277
  adiz: !0,
3276
3278
  fir: !0,
@@ -3290,11 +3292,11 @@ class ri {
3290
3292
  // user overrides
3291
3293
  ...S
3292
3294
  }, this._initMap(u), new Proxy(this, {
3293
- get(_, p, b) {
3294
- var D;
3295
- if (p in _) return Reflect.get(_, p, b);
3296
- const v = (D = _._map) == null ? void 0 : D[p];
3297
- return typeof v == "function" ? v.bind(_._map) : v;
3295
+ get(p, _, v) {
3296
+ var A;
3297
+ if (_ in p) return Reflect.get(p, _, v);
3298
+ const D = (A = p._map) == null ? void 0 : A[_];
3299
+ return typeof D == "function" ? D.bind(p._map) : D;
3298
3300
  }
3299
3301
  });
3300
3302
  }
@@ -3352,13 +3354,13 @@ class ri {
3352
3354
  maxzoom: 18
3353
3355
  }), this._map.addSource("terrain", {
3354
3356
  type: "raster-dem",
3355
- tiles: [`${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`],
3357
+ tiles: [this._terrainUrl],
3356
3358
  tileSize: 256,
3357
3359
  encoding: "mapbox",
3358
3360
  maxzoom: 8
3359
3361
  });
3360
3362
  const a = new Be.DemSource({
3361
- url: `${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`,
3363
+ url: this._terrainUrl,
3362
3364
  encoding: "mapbox",
3363
3365
  maxzoom: 8,
3364
3366
  worker: !0
@@ -3383,11 +3385,11 @@ class ri {
3383
3385
  async _loadBaseData() {
3384
3386
  var a, u, g, y;
3385
3387
  try {
3386
- const [x, z] = await Promise.all([
3388
+ const [x, b] = await Promise.all([
3387
3389
  Qt(`${this._apiUrl}/topjson/land.topojson.gz`),
3388
3390
  Qt(`${this._apiUrl}/topjson/boundary.topojson.gz`)
3389
3391
  ]);
3390
- (a = x == null ? void 0 : x.objects) != null && a.land ? (u = this._map.getSource("land")) == null || u.setData($t(x, x.objects.land)) : console.warn("[AviationChart] land topojson missing objects.land"), (g = z == null ? void 0 : z.objects) != null && g.boundary ? (y = this._map.getSource("boundary")) == null || y.setData($t(z, z.objects.boundary)) : console.warn("[AviationChart] boundary topojson missing objects.boundary");
3392
+ (a = x == null ? void 0 : x.objects) != null && a.land ? (u = this._map.getSource("land")) == null || u.setData($t(x, x.objects.land)) : console.warn("[AviationChart] land topojson missing objects.land"), (g = b == null ? void 0 : b.objects) != null && g.boundary ? (y = this._map.getSource("boundary")) == null || y.setData($t(b, b.objects.boundary)) : console.warn("[AviationChart] boundary topojson missing objects.boundary");
3391
3393
  } catch (x) {
3392
3394
  console.error("[AviationChart] loadBaseData failed:", x);
3393
3395
  }
@@ -3451,9 +3453,9 @@ class ri {
3451
3453
  }
3452
3454
  _applyVisibility() {
3453
3455
  for (const [y, x] of Object.entries(Ct)) {
3454
- const z = this._layerVisible[y] !== !1 ? "visible" : "none";
3456
+ const b = this._layerVisible[y] !== !1 ? "visible" : "none";
3455
3457
  for (const S of x)
3456
- this._map.getLayer(S) && this._map.setLayoutProperty(S, "visibility", z);
3458
+ this._map.getLayer(S) && this._map.setLayoutProperty(S, "visibility", b);
3457
3459
  }
3458
3460
  const a = this._layerVisible.amm !== !1 ? "visible" : "none";
3459
3461
  for (const y of Pt)
@@ -3515,21 +3517,21 @@ class ri {
3515
3517
  setLayerVisible(a, u) {
3516
3518
  if (this._layerVisible[a] = u, a === "terrain") {
3517
3519
  const x = u ? "visible" : "none";
3518
- for (const z of Zt)
3519
- this._map.getLayer(z) && this._map.setLayoutProperty(z, "visibility", x);
3520
+ for (const b of Zt)
3521
+ this._map.getLayer(b) && this._map.setLayoutProperty(b, "visibility", x);
3520
3522
  this._map.setTerrain(u ? { source: "terrain", exaggeration: 4 } : null);
3521
3523
  return;
3522
3524
  }
3523
3525
  if (a === "contour") {
3524
3526
  const x = u ? "visible" : "none";
3525
- for (const z of Jt)
3526
- this._map.getLayer(z) && this._map.setLayoutProperty(z, "visibility", x);
3527
+ for (const b of Jt)
3528
+ this._map.getLayer(b) && this._map.setLayoutProperty(b, "visibility", x);
3527
3529
  return;
3528
3530
  }
3529
3531
  if (a === "amm") {
3530
3532
  const x = u ? "visible" : "none";
3531
- for (const z of Pt)
3532
- this._map.getLayer(z) && this._map.setLayoutProperty(z, "visibility", x);
3533
+ for (const b of Pt)
3534
+ this._map.getLayer(b) && this._map.setLayoutProperty(b, "visibility", x);
3533
3535
  return;
3534
3536
  }
3535
3537
  const g = Ct[a];