aviation-chart 0.1.36 → 0.2.0

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.
Files changed (86) hide show
  1. package/CHANGES.md +0 -0
  2. package/README.md +286 -0
  3. package/dist/MapSDK.d.ts +128 -0
  4. package/dist/apis/index.d.ts +60 -0
  5. package/dist/constants/aviation-sources.d.ts +28 -0
  6. package/dist/constants/builtin-layers.d.ts +3 -0
  7. package/dist/index.d.ts +21 -0
  8. package/dist/layericons/Airport-Civil-Selected.png +0 -0
  9. package/dist/layericons/Airport-Joint-Selected.png +0 -0
  10. package/dist/layericons/Airport-Military-Selected.png +0 -0
  11. package/dist/layericons/NDB-Mandatory-Selected.png +0 -0
  12. package/dist/layericons/NDB-Optional-Selected.png +0 -0
  13. package/dist/layericons/VOR-Mandatory-S-Selected.png +0 -0
  14. package/dist/layericons/VOR-Optional-S-Selected.png +0 -0
  15. package/dist/layericons/Waypoint-Mandatory-Selected.png +0 -0
  16. package/dist/layericons/Waypoint-Optional-Selected.png +0 -0
  17. package/dist/layericons/adsb-airplane.png +0 -0
  18. package/dist/layericons/air-label-left1.png +0 -0
  19. package/dist/layericons/air-label-none1.png +0 -0
  20. package/dist/layericons/air-label-right1.png +0 -0
  21. package/dist/layericons/airport-civ.png +0 -0
  22. package/dist/layericons/airport-mil.png +0 -0
  23. package/dist/layericons/airport-milext.png +0 -0
  24. package/dist/layericons/airport-userfoc.png +0 -0
  25. package/dist/layericons/airspace-line.png +0 -0
  26. package/dist/layericons/border.png +0 -0
  27. package/dist/layericons/controlled copy.png +0 -0
  28. package/dist/layericons/controlled-line.png +0 -0
  29. package/dist/layericons/controlled.png +0 -0
  30. package/dist/layericons/designate_point_inway.png +0 -0
  31. package/dist/layericons/designate_point_notinway.png +0 -0
  32. package/dist/layericons/line-blue-pattenr.png +0 -0
  33. package/dist/layericons/line-blue-pattern.png +0 -0
  34. package/dist/layericons/ndb-inway.png +0 -0
  35. package/dist/layericons/ndb-notinway.png +0 -0
  36. package/dist/layericons/notam-fill.png +0 -0
  37. package/dist/layericons/place-label.png +0 -0
  38. package/dist/layericons/re-text-bg.png +0 -0
  39. package/dist/layericons/restricted-line.png +0 -0
  40. package/dist/layericons/restricted.png +0 -0
  41. package/dist/layericons/segment-both.png +0 -0
  42. package/dist/layericons/segment-left.png +0 -0
  43. package/dist/layericons/segment-right.png +0 -0
  44. package/dist/layericons/sprite.json +352 -0
  45. package/dist/layericons/sprite.png +0 -0
  46. package/dist/layericons/sprite@2x.json +352 -0
  47. package/dist/layericons/sprite@2x.png +0 -0
  48. package/dist/layericons/taix-text-bg.png +0 -0
  49. package/dist/layericons/text-bg-orange.png +0 -0
  50. package/dist/layericons/text-bg-t.png +0 -0
  51. package/dist/layericons/text-bg.png +0 -0
  52. package/dist/layericons/vor-inway.png +0 -0
  53. package/dist/layericons/vor-notinway.png +0 -0
  54. package/dist/managers/ADSBManager.d.ts +39 -0
  55. package/dist/managers/ClickManager.d.ts +15 -0
  56. package/dist/managers/ErrorManager.d.ts +25 -0
  57. package/dist/managers/GeoJSONManager.d.ts +29 -0
  58. package/dist/managers/GlobalConfigManager.d.ts +48 -0
  59. package/dist/managers/Graticule.d.ts +41 -0
  60. package/dist/managers/HoverManage.d.ts +26 -0
  61. package/dist/managers/LayerManager.d.ts +33 -0
  62. package/dist/managers/LineLabelOptimizer.d.ts +38 -0
  63. package/dist/managers/NotamManager.d.ts +40 -0
  64. package/dist/managers/PerformanceManager.d.ts +40 -0
  65. package/dist/managers/PluginManager.d.ts +17 -0
  66. package/dist/managers/PopupManager.d.ts +2 -0
  67. package/dist/managers/RasterManager.d.ts +16 -0
  68. package/dist/managers/SelectFeature.d.ts +34 -0
  69. package/dist/managers/ThemeManage.d.ts +11 -0
  70. package/dist/managers/WindManager.d.ts +21 -0
  71. package/dist/nav-sdk.cjs +27061 -0
  72. package/dist/nav-sdk.d.ts +3228 -0
  73. package/dist/nav-sdk.esm.js +27037 -0
  74. package/dist/nav-sdk.min.js +1 -0
  75. package/dist/nav-sdk.umd.js +27067 -0
  76. package/dist/plugins/DrawPlugin.d.ts +14 -0
  77. package/dist/plugins/MeasurePlugin.d.ts +26 -0
  78. package/dist/sdk.style.css +696 -0
  79. package/dist/style/amm-chart.d.ts +439 -0
  80. package/dist/style/aviation-chart.d.ts +2354 -0
  81. package/dist/types/index.d.ts +212 -0
  82. package/package.json +64 -21
  83. package/dist/aviation-chart.umd.js +0 -6
  84. package/dist/index.cjs +0 -6
  85. package/dist/index.js +0 -3610
  86. package/preview.html +0 -48
package/dist/index.js DELETED
@@ -1,3610 +0,0 @@
1
- import $t from "maplibre-gl";
2
- var vt, Ct, Ot;
3
- function It(o, r) {
4
- if (!vt)
5
- vt = r;
6
- else if (!Ct)
7
- Ct = r;
8
- else {
9
- var d = "var sharedChunk = {}; (" + vt + ")(sharedChunk); (" + Ct + ")(sharedChunk);", y = {};
10
- vt(y), Ot = r(y), typeof window < "u" && (Ot.workerUrl = window.URL.createObjectURL(
11
- new Blob([d], { type: "text/javascript" })
12
- ));
13
- }
14
- }
15
- It(["exports"], function(o) {
16
- class r {
17
- constructor(e, i) {
18
- this.start = e, this.end = i, this.points = [], this.append = this.append.bind(this), this.prepend = this.prepend.bind(this);
19
- }
20
- append(e, i) {
21
- this.points.push(Math.round(e), Math.round(i));
22
- }
23
- prepend(e, i) {
24
- this.points.splice(0, 0, Math.round(e), Math.round(i));
25
- }
26
- lineString() {
27
- return this.toArray();
28
- }
29
- isEmpty() {
30
- return this.points.length < 2;
31
- }
32
- appendFragment(e) {
33
- this.points.push(...e.points), this.end = e.end;
34
- }
35
- toArray() {
36
- return this.points;
37
- }
38
- }
39
- const d = [
40
- [],
41
- [
42
- [
43
- [1, 2],
44
- [0, 1]
45
- ]
46
- ],
47
- [
48
- [
49
- [2, 1],
50
- [1, 2]
51
- ]
52
- ],
53
- [
54
- [
55
- [2, 1],
56
- [0, 1]
57
- ]
58
- ],
59
- [
60
- [
61
- [1, 0],
62
- [2, 1]
63
- ]
64
- ],
65
- [
66
- [
67
- [1, 2],
68
- [0, 1]
69
- ],
70
- [
71
- [1, 0],
72
- [2, 1]
73
- ]
74
- ],
75
- [
76
- [
77
- [1, 0],
78
- [1, 2]
79
- ]
80
- ],
81
- [
82
- [
83
- [1, 0],
84
- [0, 1]
85
- ]
86
- ],
87
- [
88
- [
89
- [0, 1],
90
- [1, 0]
91
- ]
92
- ],
93
- [
94
- [
95
- [1, 2],
96
- [1, 0]
97
- ]
98
- ],
99
- [
100
- [
101
- [0, 1],
102
- [1, 0]
103
- ],
104
- [
105
- [2, 1],
106
- [1, 2]
107
- ]
108
- ],
109
- [
110
- [
111
- [2, 1],
112
- [1, 0]
113
- ]
114
- ],
115
- [
116
- [
117
- [0, 1],
118
- [2, 1]
119
- ]
120
- ],
121
- [
122
- [
123
- [1, 2],
124
- [2, 1]
125
- ]
126
- ],
127
- [
128
- [
129
- [0, 1],
130
- [1, 2]
131
- ]
132
- ],
133
- []
134
- ];
135
- function y(t, e, i, a) {
136
- return e = e * 2 + a[0], i = i * 2 + a[1], e + i * (t + 1) * 2;
137
- }
138
- function w(t, e, i) {
139
- return (e - t) / (i - t);
140
- }
141
- function x(t, e, i = 4096, a = 1) {
142
- if (!t)
143
- return {};
144
- const n = i / (e.width - 1);
145
- let l, s, c, m, h, f;
146
- const u = {}, _ = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Map();
147
- function M(O, I, C) {
148
- O[0] === 0 ? C(n * (f - 1), n * (h - w(c, I, l))) : O[0] === 2 ? C(n * f, n * (h - w(m, I, s))) : O[1] === 0 ? C(n * (f - w(s, I, l)), n * (h - 1)) : C(n * (f - w(m, I, c)), n * h);
149
- }
150
- for (h = 1 - a; h < e.height + a; h++) {
151
- s = e.get(0, h - 1), m = e.get(0, h);
152
- let O = Math.min(s, m), I = Math.max(s, m);
153
- for (f = 1 - a; f < e.width + a; f++) {
154
- l = s, c = m, s = e.get(f, h - 1), m = e.get(f, h);
155
- const C = O, V = I;
156
- if (O = Math.min(s, m), I = Math.max(s, m), isNaN(l) || isNaN(s) || isNaN(m) || isNaN(c))
157
- continue;
158
- const dt = Math.min(C, O), pt = Math.max(V, I), X = Math.ceil(dt / t) * t, ot = Math.floor(pt / t) * t;
159
- for (let P = X; P <= ot; P += t) {
160
- const At = l > P, q = s > P, at = c > P, bt = m > P;
161
- for (const _t of d[(At ? 8 : 0) | (q ? 4 : 0) | (bt ? 2 : 0) | (at ? 1 : 0)]) {
162
- let H = _.get(P);
163
- H || _.set(P, H = /* @__PURE__ */ new Map());
164
- let lt = k.get(P);
165
- lt || k.set(P, lt = /* @__PURE__ */ new Map());
166
- const Rt = _t[0], zt = _t[1], yt = y(e.width, f, h, Rt), st = y(e.width, f, h, zt);
167
- let G, Tt;
168
- if (G = lt.get(yt))
169
- if (lt.delete(yt), Tt = H.get(st))
170
- if (H.delete(st), G === Tt) {
171
- if (M(zt, P, G.append), !G.isEmpty()) {
172
- let rt = u[P];
173
- rt || (u[P] = rt = []), rt.push(G.lineString());
174
- }
175
- } else
176
- G.appendFragment(Tt), lt.set(G.end = Tt.end, G);
177
- else
178
- M(zt, P, G.append), lt.set(G.end = st, G);
179
- else if (G = H.get(st))
180
- H.delete(st), M(Rt, P, G.prepend), H.set(G.start = yt, G);
181
- else {
182
- const rt = new r(yt, st);
183
- M(Rt, P, rt.append), M(zt, P, rt.append), H.set(yt, rt), lt.set(st, rt);
184
- }
185
- }
186
- }
187
- }
188
- }
189
- for (const [O, I] of _.entries()) {
190
- let C = null;
191
- for (const V of I.values())
192
- V.isEmpty() || (C == null && (C = u[O] || (u[O] = [])), C.push(V.lineString()));
193
- }
194
- return u;
195
- }
196
- function b(t) {
197
- const e = Object.entries(t);
198
- return e.sort(([i], [a]) => i < a ? -1 : i > a ? 1 : 0), e;
199
- }
200
- function v(t) {
201
- return b(t).map(([e, i]) => [e, ...typeof i == "number" ? [i] : i].join("*")).join("~");
202
- }
203
- function F(t) {
204
- return Object.fromEntries(t.split("~").map((e) => e.split("*").map(Number)).map(([e, ...i]) => [e, i]));
205
- }
206
- function A({ thresholds: t, ...e }) {
207
- return b({ thresholds: v(t), ...e }).map(([i, a]) => `${encodeURIComponent(i)}=${encodeURIComponent(a)}`).join("&");
208
- }
209
- function z(t) {
210
- return Object.fromEntries(t.replace(/^.*\?/, "").split("&").map((e) => {
211
- const i = e.split("=").map(decodeURIComponent), a = i[0];
212
- let n = i[1];
213
- switch (a) {
214
- case "thresholds":
215
- n = F(n);
216
- break;
217
- case "extent":
218
- case "multiplier":
219
- case "overzoom":
220
- case "buffer":
221
- n = Number(n);
222
- }
223
- return [a, n];
224
- }));
225
- }
226
- function p(t) {
227
- return b(t).map(([e, i]) => `${encodeURIComponent(e)}=${encodeURIComponent(i)}`).join(",");
228
- }
229
- function g(t, e) {
230
- const { thresholds: i, ...a } = t;
231
- let n = [], l = -1 / 0;
232
- return Object.entries(i).forEach(([s, c]) => {
233
- const m = Number(s);
234
- m <= e && m > l && (l = m, n = typeof c == "number" ? [c] : c);
235
- }), {
236
- levels: n,
237
- ...a
238
- };
239
- }
240
- function T(t) {
241
- const e = new ArrayBuffer(t.byteLength);
242
- return new Uint8Array(e).set(new Uint8Array(t)), e;
243
- }
244
- function E(t, e) {
245
- return t.then(({ data: i, ...a }) => {
246
- let n = i;
247
- return e && (n = new Float32Array(i.length), n.set(i)), { ...a, data: n, transferrables: [n.buffer] };
248
- });
249
- }
250
- function R(t) {
251
- return t.then(({ arrayBuffer: e }) => {
252
- const i = T(e);
253
- return {
254
- arrayBuffer: i,
255
- transferrables: [i]
256
- };
257
- });
258
- }
259
- let j = null;
260
- function ct() {
261
- return j == null && (j = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") && typeof createImageBitmap == "function"), j || !1;
262
- }
263
- let tt = null;
264
- function Y() {
265
- if (tt == null && (tt = !1, ct() && typeof VideoFrame < "u")) {
266
- const i = new OffscreenCanvas(5, 5).getContext("2d", { willReadFrequently: !0 });
267
- if (i) {
268
- for (let n = 0; n < 5 * 5; n++) {
269
- const l = n * 4;
270
- i.fillStyle = `rgb(${l},${l + 1},${l + 2})`, i.fillRect(n % 5, Math.floor(n / 5), 1, 1);
271
- }
272
- const a = i.getImageData(0, 0, 5, 5).data;
273
- for (let n = 0; n < 5 * 5 * 4; n++)
274
- if (n % 4 !== 3 && a[n] !== n) {
275
- tt = !0;
276
- break;
277
- }
278
- }
279
- }
280
- return tt || !1;
281
- }
282
- function L(t, e, i) {
283
- let a = () => {
284
- };
285
- const n = setTimeout(() => {
286
- a(new Error("timed out")), i == null || i.abort();
287
- }, t);
288
- U(i, () => {
289
- a(new Error("aborted")), clearTimeout(n);
290
- });
291
- const l = new Promise((s, c) => {
292
- a = c;
293
- });
294
- return Promise.race([
295
- l,
296
- e.finally(() => clearTimeout(n))
297
- ]);
298
- }
299
- function U(t, e) {
300
- e && (t == null || t.signal.addEventListener("abort", e));
301
- }
302
- function B(t) {
303
- var e;
304
- return !!(!((e = t == null ? void 0 : t.signal) === null || e === void 0) && e.aborted);
305
- }
306
- let S = 0;
307
- class J {
308
- constructor(e = 100) {
309
- this.size = () => this.items.size, this.get = (i, a, n) => {
310
- let l = this.items.get(i);
311
- if (l)
312
- l.lastUsed = ++S, l.waiting++;
313
- else {
314
- const h = new AbortController(), f = a(i, h);
315
- l = {
316
- abortController: h,
317
- item: f,
318
- lastUsed: ++S,
319
- waiting: 1
320
- }, this.items.set(i, l), this.prune();
321
- }
322
- const s = this.items, c = l.item.then((h) => h, (h) => (s.delete(i), Promise.reject(h)));
323
- let m = !1;
324
- return U(n, () => {
325
- var h;
326
- l && l.abortController && !m && (m = !0, --l.waiting <= 0 && ((h = l.abortController) === null || h === void 0 || h.abort(), s.delete(i)));
327
- }), c;
328
- }, this.clear = () => this.items.clear(), this.maxSize = e, this.items = /* @__PURE__ */ new Map();
329
- }
330
- prune() {
331
- if (this.items.size > this.maxSize) {
332
- let e, i = 1 / 0;
333
- this.items.forEach((a, n) => {
334
- a.lastUsed < i && (i = a.lastUsed, e = n);
335
- }), typeof e < "u" && this.items.delete(e);
336
- }
337
- }
338
- }
339
- let K, et, N, it;
340
- async function nt(t, e, i) {
341
- const a = await createImageBitmap(t);
342
- return B(i) ? null : W(a, e);
343
- }
344
- function W(t, e) {
345
- return K || (K = new OffscreenCanvas(t.width, t.height), et = K.getContext("2d", {
346
- willReadFrequently: !0
347
- })), Lt(t, e, K, et);
348
- }
349
- async function xt(t, e, i) {
350
- var a, n, l;
351
- const s = await createImageBitmap(t);
352
- if (B(i))
353
- return null;
354
- const c = new VideoFrame(s, { timestamp: 0 });
355
- try {
356
- if (!(((a = c == null ? void 0 : c.format) === null || a === void 0 ? void 0 : a.startsWith("BGR")) || ((n = c == null ? void 0 : c.format) === null || n === void 0 ? void 0 : n.startsWith("RGB"))))
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(), u = new Uint8ClampedArray(f);
359
- if (await c.copyTo(u), h)
360
- for (let _ = 0; _ < u.length; _ += 4) {
361
- const k = u[_];
362
- u[_] = u[_ + 2], u[_ + 2] = k;
363
- }
364
- return Et(s.width, s.height, e, u);
365
- } catch {
366
- return B(i) ? null : W(s, e);
367
- } finally {
368
- c.close();
369
- }
370
- }
371
- async function te(t, e, i) {
372
- N || (N = document.createElement("canvas"), it = N.getContext("2d", {
373
- willReadFrequently: !0
374
- }));
375
- const a = new Image();
376
- U(i, () => a.src = "");
377
- const n = await new Promise((l, s) => {
378
- a.onload = () => {
379
- B(i) || l(a), URL.revokeObjectURL(a.src), a.onload = null;
380
- }, a.onerror = () => s(new Error("Could not load image.")), a.src = t.size ? URL.createObjectURL(t) : "";
381
- });
382
- return Lt(n, e, N, it);
383
- }
384
- function ee(t, e, i) {
385
- return self.actor.send("decodeImage", [], i, void 0, t, e);
386
- }
387
- function ie() {
388
- return (
389
- // @ts-ignore
390
- typeof WorkerGlobalScope < "u" && typeof self < "u" && // @ts-ignore
391
- self instanceof WorkerGlobalScope
392
- );
393
- }
394
- const Gt = Y() ? xt : ct() ? nt : ie() ? ee : te;
395
- function Lt(t, e, i, a) {
396
- if (i.width = t.width, i.height = t.height, !a)
397
- throw new Error("failed to get context");
398
- a.drawImage(t, 0, 0, t.width, t.height);
399
- const n = a.getImageData(0, 0, t.width, t.height).data;
400
- return Et(t.width, t.height, e, n);
401
- }
402
- function Et(t, e, i, a) {
403
- const n = i === "mapbox" ? (s, c, m) => -1e4 + (s * 256 * 256 + c * 256 + m) * 0.1 : (s, c, m) => s * 256 + c + m / 256 - 32768, l = new Float32Array(t * e);
404
- for (let s = 0; s < a.length; s += 4)
405
- l[s / 4] = n(a[s], a[s + 1], a[s + 2]);
406
- return { width: t, height: e, data: l };
407
- }
408
- const oe = -12e3, re = 9e3;
409
- function ne(t) {
410
- return !isNaN(t) && t >= oe && t <= re;
411
- }
412
- class $ {
413
- constructor(e, i, a) {
414
- this.split = (n, l, s) => {
415
- if (n === 0)
416
- return this;
417
- const c = 1 << n, m = l * this.width / c, h = s * this.height / c;
418
- return new $(this.width / c, this.height / c, (f, u) => this.get(f + m, u + h));
419
- }, this.subsamplePixelCenters = (n) => {
420
- const l = (m, h, f) => isNaN(m) ? h : isNaN(h) ? m : m + (h - m) * f;
421
- if (n <= 1)
422
- return this;
423
- const s = 0.5 - 1 / (2 * n), c = (m, h) => {
424
- const f = m / n - s, u = h / n - s, _ = Math.floor(f), k = Math.floor(u), M = this.get(_, k), O = this.get(_ + 1, k), I = this.get(_, k + 1), C = this.get(_ + 1, k + 1), V = f - _, dt = u - k, pt = l(M, O, V), X = l(I, C, V);
425
- return l(pt, X, dt);
426
- };
427
- return new $(this.width * n, this.height * n, c);
428
- }, this.averagePixelCentersToGrid = (n = 1) => new $(this.width + 1, this.height + 1, (l, s) => {
429
- let c = 0, m = 0, h = 0;
430
- for (let f = l - n; f < l + n; f++)
431
- for (let u = s - n; u < s + n; u++)
432
- isNaN(h = this.get(f, u)) || (m++, c += h);
433
- return m === 0 ? NaN : c / m;
434
- }), this.scaleElevation = (n) => n === 1 ? this : new $(this.width, this.height, (l, s) => this.get(l, s) * n), this.materialize = (n = 2) => {
435
- const l = this.width + 2 * n, s = new Float32Array(l * (this.height + 2 * n));
436
- let c = 0;
437
- for (let m = -n; m < this.height + n; m++)
438
- for (let h = -n; h < this.width + n; h++)
439
- s[c++] = this.get(h, m);
440
- return new $(this.width, this.height, (m, h) => s[(h + n) * l + m + n]);
441
- }, this.get = a, this.width = e, this.height = i;
442
- }
443
- /** Construct a height tile from raw DEM pixel values */
444
- static fromRawDem(e) {
445
- return new $(e.width, e.height, (i, a) => {
446
- const n = e.data[a * e.width + i];
447
- return ne(n) ? n : NaN;
448
- });
449
- }
450
- /**
451
- * Construct a height tile from a DEM tile plus it's 8 neighbors, so that
452
- * you can request `x` or `y` outside the bounds of the original tile.
453
- *
454
- * @param neighbors An array containing tiles: `[nw, n, ne, w, c, e, sw, s, se]`
455
- */
456
- static combineNeighbors(e) {
457
- if (e.length !== 9)
458
- throw new Error("Must include a tile plus 8 neighbors");
459
- const i = e[4];
460
- if (!i)
461
- return;
462
- const a = i.width, n = i.height;
463
- return new $(a, n, (l, s) => {
464
- let c = 0;
465
- s < 0 ? s += n : s < n ? c += 3 : (s -= n, c += 6), l < 0 ? l += a : l < a ? c += 1 : (l -= a, c += 2);
466
- const m = e[c];
467
- return m ? m.get(l, s) : NaN;
468
- });
469
- }
470
- }
471
- function ae(t) {
472
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
473
- }
474
- var Ft = {};
475
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
476
- Ft.read = function(t, e, i, a, n) {
477
- var l, s, c = n * 8 - a - 1, m = (1 << c) - 1, h = m >> 1, f = -7, u = i ? n - 1 : 0, _ = i ? -1 : 1, k = t[e + u];
478
- for (u += _, l = k & (1 << -f) - 1, k >>= -f, f += c; f > 0; l = l * 256 + t[e + u], u += _, f -= 8)
479
- ;
480
- for (s = l & (1 << -f) - 1, l >>= -f, f += a; f > 0; s = s * 256 + t[e + u], u += _, f -= 8)
481
- ;
482
- if (l === 0)
483
- l = 1 - h;
484
- else {
485
- if (l === m)
486
- return s ? NaN : (k ? -1 : 1) * (1 / 0);
487
- s = s + Math.pow(2, a), l = l - h;
488
- }
489
- return (k ? -1 : 1) * s * Math.pow(2, l - a);
490
- }, Ft.write = function(t, e, i, a, n, l) {
491
- var s, c, m, h = l * 8 - n - 1, f = (1 << h) - 1, u = f >> 1, _ = n === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, k = a ? 0 : l - 1, M = a ? 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 = f) : (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 >= f ? (c = 0, s = f) : s + u >= 1 ? (c = (e * m - 1) * Math.pow(2, n), s = s + u) : (c = e * Math.pow(2, u - 1) * Math.pow(2, n), s = 0)); n >= 8; t[i + k] = c & 255, k += M, c /= 256, n -= 8)
493
- ;
494
- for (s = s << n | c, h += n; h > 0; t[i + k] = s & 255, k += M, s /= 256, h -= 8)
495
- ;
496
- t[i + k - M] |= O * 128;
497
- };
498
- var le = D, gt = Ft;
499
- function D(t) {
500
- this.buf = ArrayBuffer.isView && ArrayBuffer.isView(t) ? t : new Uint8Array(t || 0), this.pos = 0, this.type = 0, this.length = this.buf.length;
501
- }
502
- D.Varint = 0, D.Fixed64 = 1, D.Bytes = 2, D.Fixed32 = 5;
503
- var St = 65536 * 65536, Bt = 1 / St, se = 12, Xt = typeof TextDecoder > "u" ? null : new TextDecoder("utf8");
504
- D.prototype = {
505
- destroy: function() {
506
- this.buf = null;
507
- },
508
- // === READING =================================================================
509
- readFields: function(t, e, i) {
510
- for (i = i || this.length; this.pos < i; ) {
511
- var a = this.readVarint(), n = a >> 3, l = this.pos;
512
- this.type = a & 7, t(n, e, this), this.pos === l && this.skip(a);
513
- }
514
- return e;
515
- },
516
- readMessage: function(t, e) {
517
- return this.readFields(t, e, this.readVarint() + this.pos);
518
- },
519
- readFixed32: function() {
520
- var t = wt(this.buf, this.pos);
521
- return this.pos += 4, t;
522
- },
523
- readSFixed32: function() {
524
- var t = Vt(this.buf, this.pos);
525
- return this.pos += 4, t;
526
- },
527
- // 64-bit int handling is based on github.com/dpw/node-buffer-more-ints (MIT-licensed)
528
- readFixed64: function() {
529
- var t = wt(this.buf, this.pos) + wt(this.buf, this.pos + 4) * St;
530
- return this.pos += 8, t;
531
- },
532
- readSFixed64: function() {
533
- var t = wt(this.buf, this.pos) + Vt(this.buf, this.pos + 4) * St;
534
- return this.pos += 8, t;
535
- },
536
- readFloat: function() {
537
- var t = gt.read(this.buf, this.pos, !0, 23, 4);
538
- return this.pos += 4, t;
539
- },
540
- readDouble: function() {
541
- var t = gt.read(this.buf, this.pos, !0, 52, 8);
542
- return this.pos += 8, t;
543
- },
544
- readVarint: function(t) {
545
- var e = this.buf, i, a;
546
- return a = e[this.pos++], i = a & 127, a < 128 || (a = e[this.pos++], i |= (a & 127) << 7, a < 128) || (a = e[this.pos++], i |= (a & 127) << 14, a < 128) || (a = e[this.pos++], i |= (a & 127) << 21, a < 128) ? i : (a = e[this.pos], i |= (a & 15) << 28, ce(i, t, this));
547
- },
548
- readVarint64: function() {
549
- return this.readVarint(!0);
550
- },
551
- readSVarint: function() {
552
- var t = this.readVarint();
553
- return t % 2 === 1 ? (t + 1) / -2 : t / 2;
554
- },
555
- readBoolean: function() {
556
- return !!this.readVarint();
557
- },
558
- readString: function() {
559
- var t = this.readVarint() + this.pos, e = this.pos;
560
- return this.pos = t, t - e >= se && Xt ? Te(this.buf, e, t) : ze(this.buf, e, t);
561
- },
562
- readBytes: function() {
563
- var t = this.readVarint() + this.pos, e = this.buf.subarray(this.pos, t);
564
- return this.pos = t, e;
565
- },
566
- // verbose for performance reasons; doesn't affect gzipped size
567
- readPackedVarint: function(t, e) {
568
- if (this.type !== D.Bytes) return t.push(this.readVarint(e));
569
- var i = Z(this);
570
- for (t = t || []; this.pos < i; ) t.push(this.readVarint(e));
571
- return t;
572
- },
573
- readPackedSVarint: function(t) {
574
- if (this.type !== D.Bytes) return t.push(this.readSVarint());
575
- var e = Z(this);
576
- for (t = t || []; this.pos < e; ) t.push(this.readSVarint());
577
- return t;
578
- },
579
- readPackedBoolean: function(t) {
580
- if (this.type !== D.Bytes) return t.push(this.readBoolean());
581
- var e = Z(this);
582
- for (t = t || []; this.pos < e; ) t.push(this.readBoolean());
583
- return t;
584
- },
585
- readPackedFloat: function(t) {
586
- if (this.type !== D.Bytes) return t.push(this.readFloat());
587
- var e = Z(this);
588
- for (t = t || []; this.pos < e; ) t.push(this.readFloat());
589
- return t;
590
- },
591
- readPackedDouble: function(t) {
592
- if (this.type !== D.Bytes) return t.push(this.readDouble());
593
- var e = Z(this);
594
- for (t = t || []; this.pos < e; ) t.push(this.readDouble());
595
- return t;
596
- },
597
- readPackedFixed32: function(t) {
598
- if (this.type !== D.Bytes) return t.push(this.readFixed32());
599
- var e = Z(this);
600
- for (t = t || []; this.pos < e; ) t.push(this.readFixed32());
601
- return t;
602
- },
603
- readPackedSFixed32: function(t) {
604
- if (this.type !== D.Bytes) return t.push(this.readSFixed32());
605
- var e = Z(this);
606
- for (t = t || []; this.pos < e; ) t.push(this.readSFixed32());
607
- return t;
608
- },
609
- readPackedFixed64: function(t) {
610
- if (this.type !== D.Bytes) return t.push(this.readFixed64());
611
- var e = Z(this);
612
- for (t = t || []; this.pos < e; ) t.push(this.readFixed64());
613
- return t;
614
- },
615
- readPackedSFixed64: function(t) {
616
- if (this.type !== D.Bytes) return t.push(this.readSFixed64());
617
- var e = Z(this);
618
- for (t = t || []; this.pos < e; ) t.push(this.readSFixed64());
619
- return t;
620
- },
621
- skip: function(t) {
622
- var e = t & 7;
623
- if (e === D.Varint) for (; this.buf[this.pos++] > 127; )
624
- ;
625
- else if (e === D.Bytes) this.pos = this.readVarint() + this.pos;
626
- else if (e === D.Fixed32) this.pos += 4;
627
- else if (e === D.Fixed64) this.pos += 8;
628
- else throw new Error("Unimplemented type: " + e);
629
- },
630
- // === WRITING =================================================================
631
- writeTag: function(t, e) {
632
- this.writeVarint(t << 3 | e);
633
- },
634
- realloc: function(t) {
635
- for (var e = this.length || 16; e < this.pos + t; ) e *= 2;
636
- if (e !== this.length) {
637
- var i = new Uint8Array(e);
638
- i.set(this.buf), this.buf = i, this.length = e;
639
- }
640
- },
641
- finish: function() {
642
- return this.length = this.pos, this.pos = 0, this.buf.subarray(0, this.length);
643
- },
644
- writeFixed32: function(t) {
645
- this.realloc(4), ht(this.buf, t, this.pos), this.pos += 4;
646
- },
647
- writeSFixed32: function(t) {
648
- this.realloc(4), ht(this.buf, t, this.pos), this.pos += 4;
649
- },
650
- writeFixed64: function(t) {
651
- this.realloc(8), ht(this.buf, t & -1, this.pos), ht(this.buf, Math.floor(t * Bt), this.pos + 4), this.pos += 8;
652
- },
653
- writeSFixed64: function(t) {
654
- this.realloc(8), ht(this.buf, t & -1, this.pos), ht(this.buf, Math.floor(t * Bt), this.pos + 4), this.pos += 8;
655
- },
656
- writeVarint: function(t) {
657
- if (t = +t || 0, t > 268435455 || t < 0) {
658
- me(t, this);
659
- return;
660
- }
661
- this.realloc(4), this.buf[this.pos++] = t & 127 | (t > 127 ? 128 : 0), !(t <= 127) && (this.buf[this.pos++] = (t >>>= 7) & 127 | (t > 127 ? 128 : 0), !(t <= 127) && (this.buf[this.pos++] = (t >>>= 7) & 127 | (t > 127 ? 128 : 0), !(t <= 127) && (this.buf[this.pos++] = t >>> 7 & 127)));
662
- },
663
- writeSVarint: function(t) {
664
- this.writeVarint(t < 0 ? -t * 2 - 1 : t * 2);
665
- },
666
- writeBoolean: function(t) {
667
- this.writeVarint(!!t);
668
- },
669
- writeString: function(t) {
670
- t = String(t), this.realloc(t.length * 4), this.pos++;
671
- var e = this.pos;
672
- this.pos = ve(this.buf, t, this.pos);
673
- var i = this.pos - e;
674
- i >= 128 && Nt(e, i, this), this.pos = e - 1, this.writeVarint(i), this.pos += i;
675
- },
676
- writeFloat: function(t) {
677
- this.realloc(4), gt.write(this.buf, t, this.pos, !0, 23, 4), this.pos += 4;
678
- },
679
- writeDouble: function(t) {
680
- this.realloc(8), gt.write(this.buf, t, this.pos, !0, 52, 8), this.pos += 8;
681
- },
682
- writeBytes: function(t) {
683
- var e = t.length;
684
- this.writeVarint(e), this.realloc(e);
685
- for (var i = 0; i < e; i++) this.buf[this.pos++] = t[i];
686
- },
687
- writeRawMessage: function(t, e) {
688
- this.pos++;
689
- var i = this.pos;
690
- t(e, this);
691
- var a = this.pos - i;
692
- a >= 128 && Nt(i, a, this), this.pos = i - 1, this.writeVarint(a), this.pos += a;
693
- },
694
- writeMessage: function(t, e, i) {
695
- this.writeTag(t, D.Bytes), this.writeRawMessage(e, i);
696
- },
697
- writePackedVarint: function(t, e) {
698
- e.length && this.writeMessage(t, de, e);
699
- },
700
- writePackedSVarint: function(t, e) {
701
- e.length && this.writeMessage(t, ue, e);
702
- },
703
- writePackedBoolean: function(t, e) {
704
- e.length && this.writeMessage(t, xe, e);
705
- },
706
- writePackedFloat: function(t, e) {
707
- e.length && this.writeMessage(t, pe, e);
708
- },
709
- writePackedDouble: function(t, e) {
710
- e.length && this.writeMessage(t, ye, e);
711
- },
712
- writePackedFixed32: function(t, e) {
713
- e.length && this.writeMessage(t, ge, e);
714
- },
715
- writePackedSFixed32: function(t, e) {
716
- e.length && this.writeMessage(t, we, e);
717
- },
718
- writePackedFixed64: function(t, e) {
719
- e.length && this.writeMessage(t, be, e);
720
- },
721
- writePackedSFixed64: function(t, e) {
722
- e.length && this.writeMessage(t, _e, e);
723
- },
724
- writeBytesField: function(t, e) {
725
- this.writeTag(t, D.Bytes), this.writeBytes(e);
726
- },
727
- writeFixed32Field: function(t, e) {
728
- this.writeTag(t, D.Fixed32), this.writeFixed32(e);
729
- },
730
- writeSFixed32Field: function(t, e) {
731
- this.writeTag(t, D.Fixed32), this.writeSFixed32(e);
732
- },
733
- writeFixed64Field: function(t, e) {
734
- this.writeTag(t, D.Fixed64), this.writeFixed64(e);
735
- },
736
- writeSFixed64Field: function(t, e) {
737
- this.writeTag(t, D.Fixed64), this.writeSFixed64(e);
738
- },
739
- writeVarintField: function(t, e) {
740
- this.writeTag(t, D.Varint), this.writeVarint(e);
741
- },
742
- writeSVarintField: function(t, e) {
743
- this.writeTag(t, D.Varint), this.writeSVarint(e);
744
- },
745
- writeStringField: function(t, e) {
746
- this.writeTag(t, D.Bytes), this.writeString(e);
747
- },
748
- writeFloatField: function(t, e) {
749
- this.writeTag(t, D.Fixed32), this.writeFloat(e);
750
- },
751
- writeDoubleField: function(t, e) {
752
- this.writeTag(t, D.Fixed64), this.writeDouble(e);
753
- },
754
- writeBooleanField: function(t, e) {
755
- this.writeVarintField(t, !!e);
756
- }
757
- };
758
- function ce(t, e, i) {
759
- var a = i.buf, n, l;
760
- if (l = a[i.pos++], n = (l & 112) >> 4, l < 128 || (l = a[i.pos++], n |= (l & 127) << 3, l < 128) || (l = a[i.pos++], n |= (l & 127) << 10, l < 128) || (l = a[i.pos++], n |= (l & 127) << 17, l < 128) || (l = a[i.pos++], n |= (l & 127) << 24, l < 128) || (l = a[i.pos++], n |= (l & 1) << 31, l < 128)) return mt(t, n, e);
761
- throw new Error("Expected varint not more than 10 bytes");
762
- }
763
- function Z(t) {
764
- return t.type === D.Bytes ? t.readVarint() + t.pos : t.pos + 1;
765
- }
766
- function mt(t, e, i) {
767
- return i ? e * 4294967296 + (t >>> 0) : (e >>> 0) * 4294967296 + (t >>> 0);
768
- }
769
- function me(t, e) {
770
- var i, a;
771
- if (t >= 0 ? (i = t % 4294967296 | 0, a = t / 4294967296 | 0) : (i = ~(-t % 4294967296), a = ~(-t / 4294967296), i ^ 4294967295 ? i = i + 1 | 0 : (i = 0, a = a + 1 | 0)), t >= 18446744073709552e3 || t < -18446744073709552e3)
772
- throw new Error("Given varint doesn't fit into 10 bytes");
773
- e.realloc(10), he(i, a, e), fe(a, e);
774
- }
775
- function he(t, e, i) {
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
- }
778
- function fe(t, e) {
779
- var i = (t & 7) << 4;
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
- }
782
- function Nt(t, e, i) {
783
- var a = e <= 16383 ? 1 : e <= 2097151 ? 2 : e <= 268435455 ? 3 : Math.floor(Math.log(e) / (Math.LN2 * 7));
784
- i.realloc(a);
785
- for (var n = i.pos - 1; n >= t; n--) i.buf[n + a] = i.buf[n];
786
- }
787
- function de(t, e) {
788
- for (var i = 0; i < t.length; i++) e.writeVarint(t[i]);
789
- }
790
- function ue(t, e) {
791
- for (var i = 0; i < t.length; i++) e.writeSVarint(t[i]);
792
- }
793
- function pe(t, e) {
794
- for (var i = 0; i < t.length; i++) e.writeFloat(t[i]);
795
- }
796
- function ye(t, e) {
797
- for (var i = 0; i < t.length; i++) e.writeDouble(t[i]);
798
- }
799
- function xe(t, e) {
800
- for (var i = 0; i < t.length; i++) e.writeBoolean(t[i]);
801
- }
802
- function ge(t, e) {
803
- for (var i = 0; i < t.length; i++) e.writeFixed32(t[i]);
804
- }
805
- function we(t, e) {
806
- for (var i = 0; i < t.length; i++) e.writeSFixed32(t[i]);
807
- }
808
- function be(t, e) {
809
- for (var i = 0; i < t.length; i++) e.writeFixed64(t[i]);
810
- }
811
- function _e(t, e) {
812
- for (var i = 0; i < t.length; i++) e.writeSFixed64(t[i]);
813
- }
814
- function wt(t, e) {
815
- return (t[e] | t[e + 1] << 8 | t[e + 2] << 16) + t[e + 3] * 16777216;
816
- }
817
- function ht(t, e, i) {
818
- t[i] = e, t[i + 1] = e >>> 8, t[i + 2] = e >>> 16, t[i + 3] = e >>> 24;
819
- }
820
- function Vt(t, e) {
821
- return (t[e] | t[e + 1] << 8 | t[e + 2] << 16) + (t[e + 3] << 24);
822
- }
823
- function ze(t, e, i) {
824
- for (var a = "", n = e; n < i; ) {
825
- var l = t[n], s = null, c = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1;
826
- if (n + c > i) break;
827
- var m, h, f;
828
- c === 1 ? l < 128 && (s = l) : c === 2 ? (m = t[n + 1], (m & 192) === 128 && (s = (l & 31) << 6 | m & 63, s <= 127 && (s = null))) : c === 3 ? (m = t[n + 1], h = t[n + 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[n + 1], h = t[n + 2], f = t[n + 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, a += String.fromCharCode(s >>> 10 & 1023 | 55296), s = 56320 | s & 1023), a += String.fromCharCode(s), n += c;
829
- }
830
- return a;
831
- }
832
- function Te(t, e, i) {
833
- return Xt.decode(t.subarray(e, i));
834
- }
835
- function ve(t, e, i) {
836
- for (var a = 0, n, l; a < e.length; a++) {
837
- if (n = e.charCodeAt(a), n > 55295 && n < 57344)
838
- if (l)
839
- if (n < 56320) {
840
- t[i++] = 239, t[i++] = 191, t[i++] = 189, l = n;
841
- continue;
842
- } else
843
- n = l - 55296 << 10 | n - 56320 | 65536, l = null;
844
- else {
845
- n > 56319 || a + 1 === e.length ? (t[i++] = 239, t[i++] = 191, t[i++] = 189) : l = n;
846
- continue;
847
- }
848
- else l && (t[i++] = 239, t[i++] = 191, t[i++] = 189, l = null);
849
- n < 128 ? t[i++] = n : (n < 2048 ? t[i++] = n >> 6 | 192 : (n < 65536 ? t[i++] = n >> 12 | 224 : (t[i++] = n >> 18 | 240, t[i++] = n >> 12 & 63 | 128), t[i++] = n >> 6 & 63 | 128), t[i++] = n & 63 | 128);
850
- }
851
- return i;
852
- }
853
- var De = /* @__PURE__ */ ae(le), ft;
854
- (function(t) {
855
- t[t.UNKNOWN = 0] = "UNKNOWN", t[t.POINT = 1] = "POINT", t[t.LINESTRING = 2] = "LINESTRING", t[t.POLYGON = 3] = "POLYGON";
856
- })(ft || (ft = {}));
857
- function Ee(t) {
858
- const e = new De();
859
- for (const i in t.layers) {
860
- const a = t.layers[i];
861
- a.extent || (a.extent = t.extent), e.writeMessage(3, Fe, { ...a, id: i });
862
- }
863
- return e.finish();
864
- }
865
- function Fe(t, e) {
866
- if (!e)
867
- throw new Error("pbf undefined");
868
- e.writeVarintField(15, 2), e.writeStringField(1, t.id || ""), e.writeVarintField(5, t.extent || 4096);
869
- const i = {
870
- keys: [],
871
- values: [],
872
- keycache: {},
873
- valuecache: {}
874
- };
875
- for (const a of t.features)
876
- i.feature = a, e.writeMessage(2, Se, i);
877
- for (const a of i.keys)
878
- e.writeStringField(3, a);
879
- for (const a of i.values)
880
- e.writeMessage(4, Re, a);
881
- }
882
- function Se(t, e) {
883
- const i = t.feature;
884
- if (!i || !e)
885
- throw new Error();
886
- e.writeMessage(2, ke, t), e.writeVarintField(3, i.type), e.writeMessage(4, Ae, i);
887
- }
888
- function ke(t, e) {
889
- const i = t.feature;
890
- if (!i || !e)
891
- throw new Error();
892
- const a = t.keys, n = t.values, l = t.keycache, s = t.valuecache;
893
- for (const c in i.properties) {
894
- let m = i.properties[c], h = l[c];
895
- if (m === null)
896
- continue;
897
- typeof h > "u" && (a.push(c), h = a.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 u = `${f}:${m}`;
901
- let _ = s[u];
902
- typeof _ > "u" && (n.push(m), _ = n.length - 1, s[u] = _), e.writeVarint(_);
903
- }
904
- }
905
- function kt(t, e) {
906
- return (e << 3) + (t & 7);
907
- }
908
- function Ut(t) {
909
- return t << 1 ^ t >> 31;
910
- }
911
- function Ae(t, e) {
912
- if (!e)
913
- throw new Error();
914
- const i = t.geometry, a = t.type;
915
- let n = 0, l = 0;
916
- for (const s of i) {
917
- let c = 1;
918
- a === ft.POINT && (c = s.length / 2), e.writeVarint(kt(1, c));
919
- const m = s.length / 2, h = a === ft.POLYGON ? m - 1 : m;
920
- for (let f = 0; f < h; f++) {
921
- f === 1 && a !== 1 && e.writeVarint(kt(2, h - 1));
922
- const u = s[f * 2] - n, _ = s[f * 2 + 1] - l;
923
- e.writeVarint(Ut(u)), e.writeVarint(Ut(_)), n += u, l += _;
924
- }
925
- a === ft.POLYGON && e.writeVarint(kt(7, 1));
926
- }
927
- }
928
- function Re(t, e) {
929
- if (!e)
930
- throw new Error();
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));
932
- }
933
- class Ce {
934
- constructor(e, i, a, n, l) {
935
- this.loaded = Promise.resolve(), this.decodeImage = Gt, this.fetchAndParseTile = (s, c, m, h, f) => {
936
- const u = this, _ = this.demUrlPattern.replace("{z}", s.toString()).replace("{x}", c.toString()).replace("{y}", m.toString());
937
- return f == null || f.useTile(_), this.parsedCache.get(_, async (k, M) => {
938
- const O = await u.fetchTile(s, c, m, M, f);
939
- if (B(M))
940
- throw new Error("canceled");
941
- const I = u.decodeImage(O.data, u.encoding, M), C = f == null ? void 0 : f.marker("decode"), V = await I;
942
- return C == null || C(), V;
943
- }, h);
944
- }, this.tileCache = new J(i), this.parsedCache = new J(i), this.contourCache = new J(i), this.timeoutMs = l, this.demUrlPattern = e, this.encoding = a, this.maxzoom = n;
945
- }
946
- fetchTile(e, i, a, n, l) {
947
- const s = this.demUrlPattern.replace("{z}", e.toString()).replace("{x}", i.toString()).replace("{y}", a.toString());
948
- return l == null || l.useTile(s), this.tileCache.get(s, (c, m) => {
949
- const h = {
950
- signal: m.signal
951
- };
952
- l == null || l.fetchTile(s);
953
- const f = l == null ? void 0 : l.marker("fetch");
954
- return L(this.timeoutMs, fetch(s, h).then(async (u) => {
955
- if (f == null || f(), !u.ok)
956
- throw new Error(`Bad response: ${u.status} for ${s}`);
957
- return {
958
- data: await u.blob(),
959
- expires: u.headers.get("expires") || void 0,
960
- cacheControl: u.headers.get("cache-control") || void 0
961
- };
962
- }), m);
963
- }, n);
964
- }
965
- async fetchDem(e, i, a, n, l, s) {
966
- const c = Math.min(e - (n.overzoom || 0), this.maxzoom), m = e - c, h = 1 << m, f = Math.floor(i / h), u = Math.floor(a / h), _ = await this.fetchAndParseTile(c, f, u, l, s);
967
- return $.fromRawDem(_).split(m, i % h, a % h);
968
- }
969
- fetchContourTile(e, i, a, n, l, s) {
970
- const { levels: c, multiplier: m = 1, buffer: h = 1, extent: f = 4096, contourLayer: u = "contours", elevationKey: _ = "ele", levelKey: k = "level", subsampleBelow: M = 100 } = n;
971
- if (!c || c.length === 0)
972
- return Promise.resolve({ arrayBuffer: new ArrayBuffer(0) });
973
- const O = [e, i, a, p(n)].join("/");
974
- return this.contourCache.get(O, async (I, C) => {
975
- const V = 1 << e, dt = [];
976
- for (let q = a - 1; q <= a + 1; q++)
977
- for (let at = i - 1; at <= i + 1; at++)
978
- dt.push(q < 0 || q >= V ? void 0 : this.fetchDem(e, (at + V) % V, q, n, C, s));
979
- const pt = await Promise.all(dt);
980
- let X = $.combineNeighbors(pt);
981
- if (!X || B(C))
982
- return { arrayBuffer: new Uint8Array().buffer };
983
- const ot = s == null ? void 0 : s.marker("isoline");
984
- if (X.width >= M)
985
- X = X.materialize(2);
986
- else
987
- for (; X.width < M; )
988
- X = X.subsamplePixelCenters(2).materialize(2);
989
- X = X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);
990
- const P = x(c[0], X, f, h);
991
- ot == null || ot();
992
- const At = Ee({
993
- extent: f,
994
- layers: {
995
- [u]: {
996
- features: Object.entries(P).map(([q, at]) => {
997
- const bt = Number(q);
998
- return {
999
- type: ft.LINESTRING,
1000
- geometry: at,
1001
- properties: {
1002
- [_]: bt,
1003
- [k]: Math.max(...c.map((_t, H) => bt % _t === 0 ? H : 0))
1004
- }
1005
- };
1006
- })
1007
- }
1008
- }
1009
- });
1010
- return ot == null || ot(), { arrayBuffer: At.buffer };
1011
- }, l);
1012
- }
1013
- }
1014
- const Q = typeof performance < "u" ? performance : void 0, Pe = Q ? Q.timeOrigin || (/* @__PURE__ */ new Date()).getTime() - Q.now() : (/* @__PURE__ */ new Date()).getTime();
1015
- function Me(t) {
1016
- var e;
1017
- return JSON.parse(JSON.stringify(((e = Q == null ? void 0 : Q.getEntriesByName) === null || e === void 0 ? void 0 : e.call(Q, t)) || []));
1018
- }
1019
- function Wt() {
1020
- return Q ? Q.now() : (/* @__PURE__ */ new Date()).getTime();
1021
- }
1022
- function Oe(t) {
1023
- const e = [];
1024
- for (const i of t)
1025
- e.push(...i);
1026
- return e;
1027
- }
1028
- class jt {
1029
- constructor(e) {
1030
- this.marks = {}, this.urls = [], this.fetched = [], this.resources = [], this.tilesFetched = 0, this.timeOrigin = Pe, this.finish = (i) => {
1031
- this.markFinish();
1032
- const a = (m) => {
1033
- const h = this.marks[m] || [], f = Math.max(...h.map((_) => Math.max(..._))), u = Math.min(...h.map((_) => Math.min(..._)));
1034
- return Number.isFinite(f) ? f - u : void 0;
1035
- }, n = a("main") || 0, l = a("fetch"), s = a("decode"), c = a("isoline");
1036
- return {
1037
- url: i,
1038
- tilesUsed: this.tilesFetched,
1039
- origin: this.timeOrigin,
1040
- marks: this.marks,
1041
- resources: [
1042
- ...this.resources,
1043
- ...Oe(this.fetched.map(Me))
1044
- ],
1045
- duration: n,
1046
- fetch: l,
1047
- decode: s,
1048
- process: c,
1049
- wait: n - (l || 0) - (s || 0) - (c || 0)
1050
- };
1051
- }, this.error = (i) => ({ ...this.finish(i), error: !0 }), this.marker = (i) => {
1052
- var a;
1053
- this.marks[i] || (this.marks[i] = []);
1054
- const n = [Wt()];
1055
- return (a = this.marks[i]) === null || a === void 0 || a.push(n), () => n.push(Wt());
1056
- }, this.useTile = (i) => {
1057
- this.urls.indexOf(i) < 0 && (this.urls.push(i), this.tilesFetched++);
1058
- }, this.fetchTile = (i) => {
1059
- this.fetched.indexOf(i) < 0 && this.fetched.push(i);
1060
- }, this.addAll = (i) => {
1061
- var a;
1062
- this.tilesFetched += i.tilesUsed;
1063
- const n = i.origin - this.timeOrigin;
1064
- for (const l in i.marks) {
1065
- const s = l;
1066
- (this.marks[s] || (this.marks[s] = [])).push(...((a = i.marks[s]) === null || a === void 0 ? void 0 : a.map((m) => m.map((h) => h + n))) || []);
1067
- }
1068
- this.resources.push(...i.resources.map((l) => Ge(l, n)));
1069
- }, this.markFinish = this.marker(e);
1070
- }
1071
- }
1072
- const Ie = /(Start$|End$|^start|^end)/;
1073
- function Ge(t, e) {
1074
- const i = {};
1075
- for (const a in t)
1076
- t[a] !== 0 && Ie.test(a) ? i[a] = Number(t[a]) + e : i[a] = t[a];
1077
- return i;
1078
- }
1079
- let Le = 0;
1080
- class Be {
1081
- constructor(e, i, a = 2e4) {
1082
- this.callbacks = {}, this.cancels = {}, this.dest = e, this.timeoutMs = a, this.dest.onmessage = async ({ data: n }) => {
1083
- const l = n;
1084
- if (l.type === "cancel") {
1085
- const s = this.cancels[l.id];
1086
- delete this.cancels[l.id], s == null || s.abort();
1087
- } else if (l.type === "response") {
1088
- const s = this.callbacks[l.id];
1089
- delete this.callbacks[l.id], s && s(l.error ? new Error(l.error) : void 0, l.response, l.timings);
1090
- } else if (l.type === "request") {
1091
- const s = new jt("worker"), c = i[l.name], m = new AbortController(), h = c.apply(c, [
1092
- ...l.args,
1093
- m,
1094
- s
1095
- ]), f = `${l.name}_${l.id}`;
1096
- if (l.id && h) {
1097
- this.cancels[l.id] = m;
1098
- try {
1099
- const u = await h, _ = u == null ? void 0 : u.transferrables;
1100
- this.postMessage({
1101
- id: l.id,
1102
- type: "response",
1103
- response: u,
1104
- timings: s.finish(f)
1105
- }, _);
1106
- } catch (u) {
1107
- this.postMessage({
1108
- id: l.id,
1109
- type: "response",
1110
- error: (u == null ? void 0 : u.toString()) || "error",
1111
- timings: s.finish(f)
1112
- });
1113
- }
1114
- delete this.cancels[l.id];
1115
- }
1116
- }
1117
- };
1118
- }
1119
- postMessage(e, i) {
1120
- this.dest.postMessage(e, i || []);
1121
- }
1122
- /** Invokes a method by name with a set of arguments in the remote context. */
1123
- send(e, i, a, n, ...l) {
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, u, _) => {
1126
- n == null || n.addAll(_), f ? h(f) : m(u);
1127
- };
1128
- });
1129
- return U(a, () => {
1130
- delete this.callbacks[s], this.postMessage({ id: s, type: "cancel" });
1131
- }), L(this.timeoutMs, c, a);
1132
- }
1133
- }
1134
- o.A = Be, o.H = $, o.L = Ce, o.T = jt, o.a = z, o.b = x, o.c = Et, o.d = Gt, o.e = A, o.f = R, o.g = g, o.p = E;
1135
- });
1136
- It(["./shared"], function(o) {
1137
- const r = (w) => Promise.reject(new Error(`No manager registered for ${w}`));
1138
- class d {
1139
- constructor() {
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, v, F, A, z) => {
1141
- var p;
1142
- return ((p = this.managers[x]) === null || p === void 0 ? void 0 : p.fetchTile(b, v, F, A, z)) || r(x);
1143
- }, this.fetchAndParseTile = (x, b, v, F, A, z) => {
1144
- var p;
1145
- return o.p(((p = this.managers[x]) === null || p === void 0 ? void 0 : p.fetchAndParseTile(b, v, F, A, z)) || r(x), !0);
1146
- }, this.fetchContourTile = (x, b, v, F, A, z, p) => {
1147
- var g;
1148
- return o.f(((g = this.managers[x]) === null || g === void 0 ? void 0 : g.fetchContourTile(b, v, F, A, z, p)) || r(x));
1149
- };
1150
- }
1151
- }
1152
- const y = typeof self < "u" ? self : typeof window < "u" ? window : global;
1153
- y.actor = new o.A(y, new d());
1154
- });
1155
- It(["./shared"], function(o) {
1156
- const r = { workerUrl: "" };
1157
- let d, y = 0;
1158
- class w {
1159
- constructor() {
1160
- this.decodeImage = (g, T, E) => o.p(o.d(g, T, E), !1);
1161
- }
1162
- }
1163
- function x() {
1164
- if (!d) {
1165
- const p = new Worker(r.workerUrl), g = new w();
1166
- d = new o.A(p, g);
1167
- }
1168
- return d;
1169
- }
1170
- class b {
1171
- constructor(g, T, E, R, j, ct) {
1172
- this.fetchTile = (Y, L, U, B, S) => this.actor.send("fetchTile", [], B, S, this.managerId, Y, L, U), this.fetchAndParseTile = (Y, L, U, B, S) => this.actor.send("fetchAndParseTile", [], B, S, this.managerId, Y, L, U), this.fetchContourTile = (Y, L, U, B, S, J) => this.actor.send("fetchContourTile", [], S, J, this.managerId, Y, L, U, B);
1173
- const tt = this.managerId = ++y;
1174
- this.actor = ct || x(), this.loaded = this.actor.send("init", [], new AbortController(), void 0, {
1175
- cacheSize: T,
1176
- demUrlPattern: g,
1177
- encoding: E,
1178
- maxzoom: R,
1179
- managerId: tt,
1180
- timeoutMs: j
1181
- });
1182
- }
1183
- }
1184
- Blob.prototype.arrayBuffer || (Blob.prototype.arrayBuffer = function() {
1185
- return new Promise((g, T) => {
1186
- const E = new FileReader();
1187
- E.onload = (R) => {
1188
- var j;
1189
- return g((j = R.target) === null || j === void 0 ? void 0 : j.result);
1190
- }, E.onerror = T, E.readAsArrayBuffer(this);
1191
- });
1192
- });
1193
- const v = (p) => (g, T) => {
1194
- if (T instanceof AbortController)
1195
- return p(g, T);
1196
- {
1197
- const E = new AbortController();
1198
- return p(g, E).then((R) => T(void 0, R.data, R.cacheControl, R.expires), (R) => T(R)), { cancel: () => E.abort() };
1199
- }
1200
- }, F = /* @__PURE__ */ new Set();
1201
- class A {
1202
- constructor({ url: g, cacheSize: T = 100, id: E = "dem", encoding: R = "terrarium", maxzoom: j = 12, worker: ct = !0, timeoutMs: tt = 1e4, actor: Y }) {
1203
- this.timingCallbacks = [], this.onTiming = (S) => {
1204
- this.timingCallbacks.push(S);
1205
- }, this.setupMaplibre = (S) => {
1206
- S.addProtocol(this.sharedDemProtocolId, this.sharedDemProtocol), S.addProtocol(this.contourProtocolId, this.contourProtocol);
1207
- }, this.sharedDemProtocolV4 = async (S, J) => {
1208
- const [K, et, N] = this.parseUrl(S.url), it = new o.T("main");
1209
- let nt;
1210
- try {
1211
- const W = await this.manager.fetchTile(K, et, N, J, it);
1212
- return nt = it.finish(S.url), {
1213
- data: await W.data.arrayBuffer(),
1214
- cacheControl: W.cacheControl,
1215
- expires: W.expires
1216
- };
1217
- } catch (W) {
1218
- throw nt = it.error(S.url), W;
1219
- } finally {
1220
- this.timingCallbacks.forEach((W) => W(nt));
1221
- }
1222
- }, this.contourProtocolV4 = async (S, J) => {
1223
- const K = new o.T("main");
1224
- let et;
1225
- try {
1226
- const [N, it, nt] = this.parseUrl(S.url), W = o.a(S.url), xt = await this.manager.fetchContourTile(N, it, nt, o.g(W, N), J, K);
1227
- return et = K.finish(S.url), { data: xt.arrayBuffer };
1228
- } catch (N) {
1229
- throw et = K.error(S.url), N;
1230
- } finally {
1231
- this.timingCallbacks.forEach((N) => N(et));
1232
- }
1233
- }, this.contourProtocol = v(this.contourProtocolV4), this.sharedDemProtocol = v(this.sharedDemProtocolV4), this.contourProtocolUrl = (S) => `${this.contourProtocolUrlBase}?${o.e(S)}`;
1234
- let L = E, U = 1;
1235
- for (; F.has(L); )
1236
- L = E + U++;
1237
- F.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
- const B = ct ? b : o.L;
1239
- this.manager = new B(g, T, R, j, tt, Y);
1240
- }
1241
- getDemTile(g, T, E, R) {
1242
- return this.manager.fetchAndParseTile(g, T, E, R || new AbortController());
1243
- }
1244
- parseUrl(g) {
1245
- const [, T, E, R] = /\/\/(\d+)\/(\d+)\/(\d+)/.exec(g) || [];
1246
- return [Number(T), Number(E), Number(R)];
1247
- }
1248
- }
1249
- return {
1250
- generateIsolines: o.b,
1251
- DemSource: A,
1252
- HeightTile: o.H,
1253
- LocalDemManager: o.L,
1254
- decodeParsedImage: o.c,
1255
- set workerUrl(p) {
1256
- r.workerUrl = p;
1257
- },
1258
- get workerUrl() {
1259
- return r.workerUrl;
1260
- }
1261
- };
1262
- });
1263
- var Xe = Ot;
1264
- function Ne(o) {
1265
- return o;
1266
- }
1267
- function Ve(o) {
1268
- if (o == null) return Ne;
1269
- var r, d, y = o.scale[0], w = o.scale[1], x = o.translate[0], b = o.translate[1];
1270
- return function(v, F) {
1271
- F || (r = d = 0);
1272
- var A = 2, z = v.length, p = new Array(z);
1273
- for (p[0] = (r += v[0]) * y + x, p[1] = (d += v[1]) * w + b; A < z; ) p[A] = v[A], ++A;
1274
- return p;
1275
- };
1276
- }
1277
- function Ue(o, r) {
1278
- for (var d, y = o.length, w = y - r; w < --y; ) d = o[w], o[w++] = o[y], o[y] = d;
1279
- }
1280
- function Kt(o, r) {
1281
- return typeof r == "string" && (r = o.objects[r]), r.type === "GeometryCollection" ? { type: "FeatureCollection", features: r.geometries.map(function(d) {
1282
- return Ht(o, d);
1283
- }) } : Ht(o, r);
1284
- }
1285
- function Ht(o, r) {
1286
- var d = r.id, y = r.bbox, w = r.properties == null ? {} : r.properties, x = We(o, r);
1287
- return d == null && y == null ? { type: "Feature", properties: w, geometry: x } : y == null ? { type: "Feature", id: d, properties: w, geometry: x } : { type: "Feature", id: d, bbox: y, properties: w, geometry: x };
1288
- }
1289
- function We(o, r) {
1290
- var d = Ve(o.transform), y = o.arcs;
1291
- function w(z, p) {
1292
- p.length && p.pop();
1293
- for (var g = y[z < 0 ? ~z : z], T = 0, E = g.length; T < E; ++T)
1294
- p.push(d(g[T], T));
1295
- z < 0 && Ue(p, E);
1296
- }
1297
- function x(z) {
1298
- return d(z);
1299
- }
1300
- function b(z) {
1301
- for (var p = [], g = 0, T = z.length; g < T; ++g) w(z[g], p);
1302
- return p.length < 2 && p.push(p[0]), p;
1303
- }
1304
- function v(z) {
1305
- for (var p = b(z); p.length < 4; ) p.push(p[0]);
1306
- return p;
1307
- }
1308
- function F(z) {
1309
- return z.map(v);
1310
- }
1311
- function A(z) {
1312
- var p = z.type, g;
1313
- switch (p) {
1314
- case "GeometryCollection":
1315
- return { type: p, geometries: z.geometries.map(A) };
1316
- case "Point":
1317
- g = x(z.coordinates);
1318
- break;
1319
- case "MultiPoint":
1320
- g = z.coordinates.map(x);
1321
- break;
1322
- case "LineString":
1323
- g = b(z.arcs);
1324
- break;
1325
- case "MultiLineString":
1326
- g = z.arcs.map(b);
1327
- break;
1328
- case "Polygon":
1329
- g = F(z.arcs);
1330
- break;
1331
- case "MultiPolygon":
1332
- g = z.arcs.map(F);
1333
- break;
1334
- default:
1335
- return null;
1336
- }
1337
- return { type: p, coordinates: g };
1338
- }
1339
- return A(r);
1340
- }
1341
- const je = {
1342
- airspaceStroke: "#AAB7B8",
1343
- restrictedStroke: "#D35400",
1344
- controlledStroke: "#10B981",
1345
- controlledFill: "#10B981",
1346
- segment: "#2E4053",
1347
- waypoint: "#1C2526",
1348
- vor: "#00008B",
1349
- ndb: "#0066CC",
1350
- airport: "#006400",
1351
- runway: "#333333"
1352
- };
1353
- function $e() {
1354
- const o = "navdata", r = je;
1355
- return [
1356
- {
1357
- id: "landLaye",
1358
- type: "fill",
1359
- source: "land",
1360
- layout: { visibility: "visible" },
1361
- paint: { "fill-color": "#F7F9FB", "fill-opacity": 1 }
1362
- },
1363
- {
1364
- id: "boundary",
1365
- type: "line",
1366
- source: "boundary",
1367
- minzoom: 0.5,
1368
- paint: {
1369
- "line-width": [
1370
- "interpolate",
1371
- [
1372
- "linear"
1373
- ],
1374
- [
1375
- "zoom"
1376
- ],
1377
- 0,
1378
- 1,
1379
- 7,
1380
- 4
1381
- ],
1382
- "line-opacity": 1,
1383
- "line-pattern": "normal:national-border"
1384
- }
1385
- },
1386
- {
1387
- id: "adiz-line",
1388
- type: "line",
1389
- source: o,
1390
- "source-layer": "adiz",
1391
- minzoom: 3,
1392
- layout: { "line-cap": "round", "line-join": "round" },
1393
- paint: { "line-width": 4, "line-pattern": "normal:adiz", "line-opacity": ["interpolate", ["linear"], ["zoom"], 3, 0.6, 8, 0.4] }
1394
- },
1395
- {
1396
- id: "adiz-label",
1397
- type: "symbol",
1398
- source: o,
1399
- "source-layer": "adiz-centroid",
1400
- minzoom: 3,
1401
- layout: { "text-field": ["coalesce", ["get", "TXT_NAME"], ["get", "CODE_ID"]], "text-size": 10, "text-max-width": 10, "symbol-placement": "point" },
1402
- paint: { "text-color": "#6600cc", "text-halo-color": "#ffffff", "text-halo-width": 1.5 }
1403
- },
1404
- {
1405
- id: "fir-line",
1406
- type: "line",
1407
- source: o,
1408
- "source-layer": "fir",
1409
- minzoom: 2,
1410
- // layout: { "line-cap": "butt", "line-join": "miter", "line-miter-limit": 0 },
1411
- paint: { "line-color": r.airspaceStroke, "line-opacity": ["interpolate", ["linear"], ["zoom"], 2, 0, 2.7, 0.8, 9, 0.8, 10, 0.5], "line-width": 0.5, "line-dasharray": [4.2, 4] }
1412
- },
1413
- {
1414
- id: "fir_line_dash",
1415
- type: "line",
1416
- source: o,
1417
- "source-layer": "fir",
1418
- minzoom: 5,
1419
- layout: { "line-miter-limit": 0, "line-cap": "butt", "line-join": "miter" },
1420
- paint: { "line-color": r.airspaceStroke, "line-opacity": ["interpolate", ["linear"], ["zoom"], 5, 0, 5.5, 0.8, 9, 0.8, 10, 0.5], "line-width": 6, "line-dasharray": [0.2, 5] }
1421
- },
1422
- {
1423
- id: "fir-label-lineside",
1424
- type: "symbol",
1425
- source: o,
1426
- "source-layer": "fir",
1427
- minzoom: 4,
1428
- layout: { "text-field": ["concat", ["get", "TXT_NAME"], "/", ["get", "CODE_ID"], "/", ["get", "CODE_TYPE"]], "text-size": 10, "symbol-placement": "line", "text-max-width": 8, "text-offset": [0, 1], "text-letter-spacing": 0.05, "text-optional": !0 },
1429
- paint: { "text-color": r.airspaceStroke }
1430
- },
1431
- {
1432
- id: "fir-label",
1433
- type: "symbol",
1434
- source: o,
1435
- "source-layer": "fir-centroid",
1436
- minzoom: 3,
1437
- layout: {
1438
- "text-field": ["coalesce", ["get", "TXT_NAME"], ["get", "CODE_ID"]],
1439
- "text-size": ["interpolate", ["linear"], ["zoom"], 3, 12, 17, 16],
1440
- "symbol-placement": "point",
1441
- "text-max-width": 8
1442
- },
1443
- paint: {
1444
- "text-color": r.airspaceStroke,
1445
- "text-opacity": ["interpolate", ["linear"], ["zoom"], 3, 0.85, 8, 0.7, 12, 0.5]
1446
- }
1447
- },
1448
- {
1449
- id: "restricted-fill",
1450
- type: "fill",
1451
- source: o,
1452
- "source-layer": "restricted-fill",
1453
- minzoom: 4,
1454
- paint: {
1455
- "fill-color": "#FAD7A0",
1456
- // "fill-pattern": "normal:passline",
1457
- "fill-opacity": [
1458
- "interpolate",
1459
- [
1460
- "linear"
1461
- ],
1462
- [
1463
- "zoom"
1464
- ],
1465
- 10,
1466
- 0.15,
1467
- 11.5,
1468
- 0
1469
- ]
1470
- }
1471
- },
1472
- {
1473
- id: "restricted-stroke",
1474
- type: "line",
1475
- source: o,
1476
- "source-layer": "restricted",
1477
- paint: { "line-color": "#f6bf65", "line-width": 1, "line-dasharray": [2, 2], "line-opacity": ["interpolate", ["linear"], ["zoom"], 4, 0.5, 8, 1] }
1478
- },
1479
- {
1480
- id: "restricted-label",
1481
- type: "symbol",
1482
- source: o,
1483
- "source-layer": "restricted",
1484
- minzoom: 6,
1485
- layout: { "text-field": ["concat", ["get", "TXT_NAME"], "/", ["get", "CODE_ID"], "/", ["get", "CODE_TYPE"]], "text-letter-spacing": 0.1, "text-size": 10, "symbol-placement": "line", "text-max-width": 8, "text-offset": [0, 1] },
1486
- paint: { "text-color": r.restrictedStroke }
1487
- },
1488
- {
1489
- id: "controlled-fill",
1490
- type: "fill",
1491
- source: o,
1492
- "source-layer": "controlled-fill",
1493
- minzoom: 4,
1494
- paint: {
1495
- "fill-color": r.controlledFill,
1496
- "fill-opacity": [
1497
- "interpolate",
1498
- [
1499
- "linear"
1500
- ],
1501
- [
1502
- "zoom"
1503
- ],
1504
- 10,
1505
- 0.035,
1506
- 11.5,
1507
- 0
1508
- ]
1509
- }
1510
- },
1511
- {
1512
- id: "controlled-stroke",
1513
- type: "line",
1514
- source: o,
1515
- "source-layer": "controlled",
1516
- paint: {
1517
- "line-color": r.controlledStroke,
1518
- "line-width": 1,
1519
- "line-opacity": ["interpolate", ["linear"], ["zoom"], 4, 0.5, 8, 1],
1520
- "line-dasharray": [
1521
- 1,
1522
- 1.4
1523
- ]
1524
- }
1525
- },
1526
- {
1527
- id: "controlled-label",
1528
- type: "symbol",
1529
- source: o,
1530
- "source-layer": "controlled",
1531
- minzoom: 6,
1532
- layout: { "text-field": ["concat", ["get", "TXT_NAME"], "/", ["get", "CODE_ID"], "/", ["get", "CODE_TYPE"]], "text-size": 10, "symbol-placement": "line", "text-letter-spacing": 0.2, "text-max-width": 8, "text-offset": [0, 1] },
1533
- paint: { "text-color": r.controlledStroke }
1534
- },
1535
- {
1536
- id: "segment-line",
1537
- type: "line",
1538
- source: o,
1539
- "source-layer": "segment",
1540
- minzoom: 5,
1541
- paint: {
1542
- "line-color": ["case", ["==", ["get", "HAS_REMARK"], 1], "#E8A020", r.segment],
1543
- "line-width": ["interpolate", ["linear"], ["zoom"], 5, 0.2, 8, 0.8],
1544
- "line-blur": 0,
1545
- "line-opacity": [
1546
- "interpolate",
1547
- [
1548
- "linear"
1549
- ],
1550
- [
1551
- "zoom"
1552
- ],
1553
- 5,
1554
- 0.3,
1555
- 6,
1556
- 1,
1557
- 8,
1558
- 1,
1559
- 12,
1560
- 0.8,
1561
- 15,
1562
- 0.2
1563
- ]
1564
- }
1565
- },
1566
- {
1567
- id: "segment-label",
1568
- type: "symbol",
1569
- source: o,
1570
- "source-layer": "segment",
1571
- minzoom: 6,
1572
- layout: {
1573
- "icon-image": ["case", ["all", ["has", "TXT_DESIG"], ["!=", ["get", "TXT_DESIG"], ""], ["!=", ["get", "TXT_DESIG"], " "], ["!=", ["get", "TXT_DESIG"], null]], "segment-both", ["all", ["has", "TXT_DESIG_FORWARD"]], "segment-right", ["all", ["has", "TXT_DESIG_BACKWARD"]], "segment-left", "segment-both"],
1574
- "icon-anchor": "center",
1575
- "symbol-placement": "line",
1576
- "icon-text-fit": "width",
1577
- "icon-size": 1,
1578
- "text-allow-overlap": !1,
1579
- "icon-allow-overlap": !1,
1580
- "text-optional": !1,
1581
- "text-anchor": "center",
1582
- "text-justify": "center",
1583
- "text-line-height": 1.3,
1584
- "text-letter-spacing": 0.1,
1585
- "text-field": [
1586
- "step",
1587
- ["zoom"],
1588
- ["format", ["case", ["all", ["has", "TXT_DESIG"], ["!=", ["get", "TXT_DESIG"], ""]], ["get", "TXT_DESIG"], ["all", ["has", "TXT_DESIG_FORWARD"], ["!=", ["get", "TXT_DESIG_FORWARD"], ""]], ["get", "TXT_DESIG_FORWARD"], ["all", ["has", "TXT_DESIG_BACKWARD"], ["!=", ["get", "TXT_DESIG_BACKWARD"], ""]], ["get", "TXT_DESIG_BACKWARD"], "-"], { "font-scale": 1, "text-color": "#ffffff" }],
1589
- 10,
1590
- [
1591
- "format",
1592
- ["concat", ["get", "VAL_LEN"], "", ["get", "UOM_DIST"]],
1593
- { "font-scale": 0.95, "text-color": "#3E4759" },
1594
- `
1595
- `,
1596
- ["case", ["all", ["has", "TXT_DESIG_FORWARD"], ["!=", ["get", "TXT_DESIG_FORWARD"], ""]], ["case", ["all", ["has", "TXT_DESIG_RNP"], ["!=", ["get", "TXT_DESIG_RNP"], ""]], ["get", "TXT_DESIG_RNP"], ""], ""],
1597
- { "font-scale": 1, "text-color": "#E8A020" },
1598
- ["case", ["all", ["has", "TXT_DESIG_FORWARD"], ["!=", ["get", "TXT_DESIG_FORWARD"], ""]], ["case", ["all", ["has", "TXT_DESIG_RNP"], ["!=", ["get", "TXT_DESIG_RNP"], ""]], " ", ""], ""],
1599
- {},
1600
- ["case", ["all", ["has", "TXT_DESIG_FORWARD"], ["!=", ["get", "TXT_DESIG_FORWARD"], ""]], ["get", "TXT_DESIG_FORWARD"], ["all", ["has", "TXT_DESIG"], ["!=", ["get", "TXT_DESIG"], ""]], ["get", "TXT_DESIG"], ["all", ["has", "TXT_DESIG_BACKWARD"], ["!=", ["get", "TXT_DESIG_BACKWARD"], ""]], ["get", "TXT_DESIG_BACKWARD"], "-"],
1601
- { "font-scale": 1, "text-color": "#ffffff", "font-weight": "bold" },
1602
- ["case", ["all", ["has", "TXT_DESIG_FORWARD"], ["!=", ["get", "TXT_DESIG_FORWARD"], ""]], "", ["case", ["all", ["has", "TXT_DESIG_RNP"], ["!=", ["get", "TXT_DESIG_RNP"], ""]], " ", ""]],
1603
- {},
1604
- ["case", ["all", ["has", "TXT_DESIG_FORWARD"], ["!=", ["get", "TXT_DESIG_FORWARD"], ""]], "", ["case", ["all", ["has", "TXT_DESIG_RNP"], ["!=", ["get", "TXT_DESIG_RNP"], ""]], ["get", "TXT_DESIG_RNP"], ""]],
1605
- { "font-scale": 0.85, "text-color": "#E8A020" },
1606
- `
1607
- `,
1608
- ["case", ["all", ["has", "TXT_DESIG_HIGH"], ["!=", ["get", "TXT_DESIG_HIGH"], ""]], ["get", "TXT_DESIG_HIGH"], ["all", ["has", "TXT_DESIG_FORWARD"], ["!=", ["get", "TXT_DESIG_FORWARD"], ""]], ["get", "TXT_DESIG_FORWARD"], ["all", ["has", "TXT_DESIG_BACKWARD"], ["!=", ["get", "TXT_DESIG_BACKWARD"], ""]], ["get", "TXT_DESIG_BACKWARD"], "-"],
1609
- { "font-scale": 0.95, "text-color": "#3E4759" }
1610
- ]
1611
- ],
1612
- "text-size": ["interpolate", ["linear"], ["zoom"], 6, 9, 10, 10],
1613
- "icon-text-fit-padding": [0, 3, 0, 3]
1614
- },
1615
- paint: {
1616
- "text-halo-color": "#ffffff",
1617
- "text-halo-width": 0.1,
1618
- "icon-color": r.segment,
1619
- "text-opacity": [
1620
- "interpolate",
1621
- [
1622
- "linear"
1623
- ],
1624
- [
1625
- "zoom"
1626
- ],
1627
- 6,
1628
- 1,
1629
- 12,
1630
- 1,
1631
- 15,
1632
- 0.3
1633
- ],
1634
- "icon-opacity": [
1635
- "interpolate",
1636
- [
1637
- "linear"
1638
- ],
1639
- [
1640
- "zoom"
1641
- ],
1642
- 6,
1643
- 1,
1644
- 12,
1645
- 1,
1646
- 15,
1647
- 0.3
1648
- ]
1649
- }
1650
- },
1651
- {
1652
- id: "segment-radial",
1653
- type: "symbol",
1654
- source: o,
1655
- "source-layer": "segment-radial",
1656
- minzoom: 10,
1657
- layout: {
1658
- "text-field": ["concat", ["get", "bearing"], "°"],
1659
- "text-size": 9,
1660
- "text-rotate": ["to-number", ["get", "line_angle"], 0],
1661
- "text-rotation-alignment": "map",
1662
- "text-allow-overlap": !0,
1663
- "text-ignore-placement": !0,
1664
- "text-offset": [0, -0.6],
1665
- "text-justify": "auto"
1666
- },
1667
- paint: { "text-color": r.segment }
1668
- },
1669
- {
1670
- id: "airport-circle",
1671
- type: "symbol",
1672
- source: o,
1673
- minzoom: 3,
1674
- "source-layer": "airport",
1675
- filter: ["case", ["<", ["zoom"], 6], ["==", ["get", "level"], 1], !0],
1676
- layout: {
1677
- "icon-image": ["case", ["==", ["get", "CODE_TYPE_MIL_OPS"], "MIL"], "airport-mil", ["==", ["get", "CODE_TYPE_MIL_OPS"], "MILEXT"], "airport-milext", "airport-civ"],
1678
- "icon-size": ["interpolate", ["linear"], ["zoom"], 4, 0.5, 10, 0.9],
1679
- "symbol-z-order": "viewport-y",
1680
- "text-field": ["get", "codeId"],
1681
- "text-letter-spacing": 0.05,
1682
- "text-field": ["get", "CODE_ID"],
1683
- "text-anchor": "bottom",
1684
- "text-justify": "center",
1685
- "text-size": ["interpolate", ["linear"], ["zoom"], 4, 0, 5, 12],
1686
- "text-offset": ["interpolate", ["linear"], ["zoom"], 4, ["literal", [0, -1.2]], 5, ["literal", [0, -0.6]]],
1687
- "icon-allow-overlap": !0,
1688
- "icon-ignore-placement": !0,
1689
- "text-allow-overlap": !0,
1690
- "text-ignore-placement": !0,
1691
- visibility: "none",
1692
- "icon-size": [
1693
- "interpolate",
1694
- [
1695
- "linear"
1696
- ],
1697
- [
1698
- "zoom"
1699
- ],
1700
- 5,
1701
- 0.6,
1702
- 9,
1703
- 1.2,
1704
- 12,
1705
- 1.3
1706
- ]
1707
- },
1708
- paint: {
1709
- "icon-color": [
1710
- "case",
1711
- ["has", "has_amm"],
1712
- "#4B2D6E",
1713
- r.airport
1714
- ],
1715
- "icon-opacity": [
1716
- "interpolate",
1717
- [
1718
- "linear"
1719
- ],
1720
- [
1721
- "zoom"
1722
- ],
1723
- 2,
1724
- 0.75,
1725
- 3,
1726
- 0.95,
1727
- 5,
1728
- 1,
1729
- 9,
1730
- 1,
1731
- 11,
1732
- 0.2
1733
- ],
1734
- "text-color": [
1735
- "case",
1736
- ["has", "has_amm"],
1737
- "#4B2D6E",
1738
- r.airport
1739
- ],
1740
- "text-opacity": [
1741
- "interpolate",
1742
- [
1743
- "linear"
1744
- ],
1745
- [
1746
- "zoom"
1747
- ],
1748
- 4,
1749
- 0.95,
1750
- 5,
1751
- 1,
1752
- 9,
1753
- 1,
1754
- 11,
1755
- 0.2
1756
- ]
1757
- }
1758
- },
1759
- {
1760
- id: "runway-line",
1761
- type: "line",
1762
- source: o,
1763
- "source-layer": "runway",
1764
- filter: ["!", ["has", "has_amm"]],
1765
- minzoom: 4,
1766
- maxzoom: 11,
1767
- paint: {
1768
- "line-color": r.runway,
1769
- "line-width": ["interpolate", ["linear"], ["zoom"], 4, 1, 13, 10]
1770
- }
1771
- },
1772
- {
1773
- id: "runway-line-amm",
1774
- type: "line",
1775
- source: o,
1776
- "source-layer": "runway",
1777
- filter: ["has", "has_amm"],
1778
- minzoom: 4,
1779
- maxzoom: 11,
1780
- paint: {
1781
- "line-color": r.runway,
1782
- "line-width": ["interpolate", ["linear"], ["zoom"], 4, 1, 10, 4],
1783
- "line-opacity": ["interpolate", ["linear"], ["zoom"], 10.5, 1, 11, 0]
1784
- }
1785
- },
1786
- {
1787
- id: "runway-label",
1788
- type: "symbol",
1789
- source: o,
1790
- "source-layer": "runway",
1791
- minzoom: 10,
1792
- layout: {
1793
- "text-field": ["concat", ["to-string", ["get", "VAL_LEN"]], "×", ["to-string", ["get", "VAL_WID"]], "m"],
1794
- "text-size": 10,
1795
- "symbol-placement": "line-center",
1796
- "text-rotation-alignment": "map",
1797
- "text-optional": !0
1798
- },
1799
- paint: {
1800
- "text-color": r.runway,
1801
- "text-halo-width": 1,
1802
- "text-opacity": ["interpolate", ["linear"], ["zoom"], 10.5, 1, 11, 0]
1803
- }
1804
- },
1805
- {
1806
- id: "vor-symbol",
1807
- type: "symbol",
1808
- source: o,
1809
- "source-layer": "vor",
1810
- minzoom: 8,
1811
- layout: {
1812
- "icon-image": "vor_dial",
1813
- "icon-size": ["interpolate", ["linear"], ["zoom"], 8, 0.072, 10, 0.072, 11, 0.126, 12, 0.18, 13, 0.234, 14, 0.288, 15, 0.342, 16, 0.396, 17, 0.45, 22, 0.45],
1814
- "icon-rotate": ["to-number", ["get", "VAL_MAG_VAR"], 0],
1815
- "icon-rotation-alignment": "map",
1816
- "symbol-z-order": "viewport-y",
1817
- "text-letter-spacing": 0.05,
1818
- "text-optional": !0,
1819
- "icon-allow-overlap": !0,
1820
- visibility: "none"
1821
- },
1822
- paint: { "icon-color": "#0b417a" }
1823
- },
1824
- {
1825
- id: "vor-symbol-normal",
1826
- minzoom: 4,
1827
- maxzoom: 9,
1828
- type: "symbol",
1829
- source: o,
1830
- "source-layer": "vor",
1831
- layout: {
1832
- "icon-image": "v2:vor-normal",
1833
- "icon-size": ["interpolate", ["linear"], ["zoom"], 4, 0.7, 8, 1],
1834
- "icon-rotation-alignment": "map",
1835
- "symbol-z-order": "viewport-y",
1836
- "text-letter-spacing": 0.05,
1837
- "text-optional": !0,
1838
- "icon-allow-overlap": !0
1839
- },
1840
- paint: {
1841
- "icon-color": "#3874cb",
1842
- "icon-opacity": ["interpolate", ["linear"], ["zoom"], 8, 1, 9, 0]
1843
- }
1844
- },
1845
- {
1846
- id: "vor-label",
1847
- type: "symbol",
1848
- source: o,
1849
- "source-layer": "vor",
1850
- minzoom: 5,
1851
- layout: { "text-field": ["get", "CODE_ID"], "text-size": 10, "text-anchor": "bottom", "text-offset": [0, -0.8] },
1852
- paint: { "text-color": r.vor, "text-halo-color": "#ffffff", "text-halo-width": 1 }
1853
- },
1854
- {
1855
- id: "ndb-symbol",
1856
- type: "symbol",
1857
- source: o,
1858
- minzoom: 4,
1859
- "source-layer": "ndb",
1860
- layout: {
1861
- "icon-image": "v2:ndb-normal",
1862
- "icon-size": ["interpolate", ["linear"], ["zoom"], 6, 0.5, 10, 1],
1863
- "symbol-z-order": "viewport-y",
1864
- // "text-field": ["concat", ["get", "CODE_ID"], "\n", ["get", "VAL_FREQ"], "kHz"],
1865
- "text-field": [
1866
- "format",
1867
- [
1868
- "get",
1869
- "CODE_ID"
1870
- ],
1871
- {
1872
- "text-color": r.ndb,
1873
- "font-scale": 1.1
1874
- },
1875
- "",
1876
- {},
1877
- [
1878
- "coalesce",
1879
- [
1880
- "get",
1881
- "VAL_FREQ"
1882
- ],
1883
- ""
1884
- ],
1885
- {
1886
- "text-color": r.ndb,
1887
- "font-scale": 0.95
1888
- }
1889
- ],
1890
- "text-size": 10,
1891
- "text-offset": [0, 0.5],
1892
- "text-letter-spacing": 0.05,
1893
- "text-optional": !0,
1894
- "icon-allow-overlap": !0,
1895
- "text-anchor": "top"
1896
- },
1897
- paint: {
1898
- "text-color": r.ndb,
1899
- "text-halo-color": "#ffffff",
1900
- "text-halo-width": 0.5,
1901
- "text-halo-blur": 1,
1902
- "icon-color": r.ndb,
1903
- "text-opacity": [
1904
- "interpolate",
1905
- [
1906
- "linear"
1907
- ],
1908
- [
1909
- "zoom"
1910
- ],
1911
- 4,
1912
- 0,
1913
- 5.5,
1914
- 0,
1915
- 6,
1916
- 0.6,
1917
- 8,
1918
- 1,
1919
- 10,
1920
- 0.3,
1921
- 12,
1922
- 0
1923
- ],
1924
- "icon-opacity": [
1925
- "interpolate",
1926
- [
1927
- "linear"
1928
- ],
1929
- [
1930
- "zoom"
1931
- ],
1932
- 4,
1933
- 0,
1934
- 5,
1935
- 0.3,
1936
- 5.5,
1937
- 0.8,
1938
- 8,
1939
- 1,
1940
- 12,
1941
- 1,
1942
- 14,
1943
- 0.6
1944
- ]
1945
- }
1946
- },
1947
- {
1948
- id: "waypoint-symbol",
1949
- type: "symbol",
1950
- source: o,
1951
- "source-layer": "waypoint",
1952
- minzoom: 5,
1953
- layout: {
1954
- "icon-image": ["case", ["==", ["get", "report_type"], "C"], "waypoint-compusory", "waypoint"],
1955
- "icon-size": 0.6,
1956
- "icon-allow-overlap": !0,
1957
- "icon-ignore-placement": !0,
1958
- "text-field": ["get", "CODE_ID"],
1959
- "text-size": 10,
1960
- "text-letter-spacing": 0.02,
1961
- "text-variable-anchor-offset": ["bottom", [0, -0.6], "top", [0, 0.6], "right", [-0.6, 0], "left", [0.6, 0], "bottom-right", [-0.4, -0.4], "bottom-left", [0.4, -0.4], "top-right", [-0.4, 0.4], "top-left", [0.4, 0.4]],
1962
- "text-justify": "auto"
1963
- },
1964
- paint: {
1965
- "icon-color": r.waypoint,
1966
- "text-color": r.waypoint,
1967
- "text-halo-color": "#ffffff",
1968
- "text-halo-width": 1,
1969
- "icon-halo-color": "rgba(0,0,0,0)",
1970
- "icon-halo-width": 0,
1971
- "icon-opacity": [
1972
- "interpolate",
1973
- [
1974
- "linear"
1975
- ],
1976
- [
1977
- "zoom"
1978
- ],
1979
- 5,
1980
- 0.5,
1981
- 12,
1982
- 1,
1983
- 15,
1984
- 0.2
1985
- ],
1986
- "text-halo-color": "#FFFFFF",
1987
- "text-halo-blur": 0,
1988
- "text-opacity": [
1989
- "interpolate",
1990
- [
1991
- "linear"
1992
- ],
1993
- [
1994
- "zoom"
1995
- ],
1996
- 6,
1997
- 1,
1998
- 12,
1999
- 0.9,
2000
- 15,
2001
- 0.15
2002
- ]
2003
- }
2004
- },
2005
- {
2006
- id: "waypoint-off-airway-symbol",
2007
- type: "symbol",
2008
- source: o,
2009
- "source-layer": "waypoint-off-airway",
2010
- minzoom: 7,
2011
- layout: { "icon-image": ["case", ["==", ["get", "report_type"], "C"], "designate_point_inway", "designate_point_notinway"], "icon-size": 0.6, "icon-allow-overlap": !0, "icon-ignore-placement": !0, "text-field": ["get", "CODE_ID"], "text-size": 9, "text-variable-anchor-offset": ["bottom", [0, -0.6], "top", [0, 0.6], "right", [-0.6, 0], "left", [0.6, 0], "bottom-right", [-0.4, -0.4], "bottom-left", [0.4, -0.4], "top-right", [-0.4, 0.4], "top-left", [0.4, 0.4]], "text-justify": "auto", "text-optional": !0 },
2012
- paint: {
2013
- "icon-color": r.waypoint,
2014
- "text-color": r.waypoint,
2015
- "text-halo-color": "#ffffff",
2016
- "text-halo-width": 1,
2017
- "icon-opacity": [
2018
- "interpolate",
2019
- [
2020
- "linear"
2021
- ],
2022
- [
2023
- "zoom"
2024
- ],
2025
- 7,
2026
- 0.5,
2027
- 12,
2028
- 1,
2029
- 15,
2030
- 0.2
2031
- ],
2032
- "text-opacity": [
2033
- "interpolate",
2034
- [
2035
- "linear"
2036
- ],
2037
- [
2038
- "zoom"
2039
- ],
2040
- 7,
2041
- 1,
2042
- 12,
2043
- 0.9,
2044
- 15,
2045
- 0.15
2046
- ]
2047
- }
2048
- }
2049
- ];
2050
- }
2051
- const Ke = {
2052
- airspaceStroke: "#18C29C",
2053
- restrictedStroke: "#CC7722",
2054
- controlledStroke: "#22C55E",
2055
- controlledFill: "#22C55E",
2056
- segment: "#40C4FF",
2057
- waypoint: "#74cdde",
2058
- vor: "#72aae5",
2059
- ndb: "#62d6ef",
2060
- airport: "#73ccdd",
2061
- runway: "#64748b"
2062
- };
2063
- function He() {
2064
- const o = "navdata", r = Ke;
2065
- return [
2066
- {
2067
- id: "landLaye",
2068
- type: "fill",
2069
- source: "land",
2070
- layout: { visibility: "visible" },
2071
- paint: { "fill-color": "#0A111A", "fill-opacity": 1 }
2072
- },
2073
- {
2074
- id: "boundary",
2075
- type: "line",
2076
- source: "boundary",
2077
- minzoom: 0.5,
2078
- paint: {
2079
- "line-width": [
2080
- "interpolate",
2081
- [
2082
- "linear"
2083
- ],
2084
- [
2085
- "zoom"
2086
- ],
2087
- 0,
2088
- 1,
2089
- 7,
2090
- 4
2091
- ],
2092
- "line-opacity": 1,
2093
- "line-pattern": "normal:national-border-dark"
2094
- }
2095
- },
2096
- {
2097
- id: "adiz-line",
2098
- type: "line",
2099
- source: o,
2100
- "source-layer": "adiz",
2101
- minzoom: 3,
2102
- layout: { "line-cap": "round", "line-join": "round" },
2103
- paint: { "line-color": "#a855f7", "line-width": ["interpolate", ["linear"], ["zoom"], 3, 3, 7, 6], "line-pattern": "normal:adiz", "line-opacity": ["interpolate", ["linear"], ["zoom"], 3, 0.7, 8, 0.5] }
2104
- },
2105
- {
2106
- id: "adiz-label",
2107
- type: "symbol",
2108
- source: o,
2109
- "source-layer": "adiz-centroid",
2110
- minzoom: 3,
2111
- layout: { "text-field": ["coalesce", ["get", "TXT_NAME"], ["get", "CODE_ID"]], "text-size": 10, "text-max-width": 10, "symbol-placement": "point" },
2112
- paint: { "text-color": "#c084fc", "text-halo-color": "#0f172a", "text-halo-width": 1.5 }
2113
- },
2114
- {
2115
- id: "fir-line",
2116
- type: "line",
2117
- source: o,
2118
- "source-layer": "fir",
2119
- minzoom: 2,
2120
- layout: { "line-cap": "butt", "line-join": "miter", "line-miter-limit": 0 },
2121
- paint: { "line-color": r.airspaceStroke, "line-opacity": ["interpolate", ["linear"], ["zoom"], 2, 0, 2.7, 0.8, 9, 0.8, 10, 0.5], "line-width": 0.8, "line-dasharray": [4.2, 4] }
2122
- },
2123
- {
2124
- id: "fir_line_dash",
2125
- type: "line",
2126
- source: o,
2127
- "source-layer": "fir",
2128
- minzoom: 5,
2129
- layout: { "line-miter-limit": 0, "line-cap": "butt", "line-join": "miter" },
2130
- paint: { "line-color": r.airspaceStroke, "line-opacity": ["interpolate", ["linear"], ["zoom"], 5, 0, 5.5, 0.8, 9, 0.8, 10, 0.5], "line-width": 5, "line-dasharray": [0.2, 5] }
2131
- },
2132
- {
2133
- id: "fir-label-lineside",
2134
- type: "symbol",
2135
- source: o,
2136
- "source-layer": "fir",
2137
- minzoom: 4,
2138
- layout: { "text-field": ["concat", ["get", "TXT_NAME"], "/", ["get", "CODE_ID"], "/", ["get", "CODE_TYPE"]], "text-size": 10, "symbol-placement": "line", "text-max-width": 8, "text-offset": [0, 1], "text-letter-spacing": 0.05, "text-optional": !0 },
2139
- paint: { "text-color": r.airspaceStroke, "text-halo-color": "#0f172a", "text-halo-width": 1 }
2140
- },
2141
- {
2142
- id: "fir-label",
2143
- type: "symbol",
2144
- source: o,
2145
- "source-layer": "fir-centroid",
2146
- minzoom: 3,
2147
- layout: {
2148
- "text-field": ["coalesce", ["get", "TXT_NAME"], ["get", "CODE_ID"]],
2149
- "text-size": ["interpolate", ["linear"], ["zoom"], 3, 12, 17, 16],
2150
- "symbol-placement": "point",
2151
- "text-max-width": 8
2152
- },
2153
- paint: {
2154
- "text-color": r.airspaceStroke,
2155
- "text-halo-color": "#0f172a",
2156
- "text-halo-width": 1.5,
2157
- "text-opacity": ["interpolate", ["linear"], ["zoom"], 3, 0.85, 8, 0.7, 12, 0.5]
2158
- }
2159
- },
2160
- {
2161
- id: "restricted-fill",
2162
- type: "fill",
2163
- source: o,
2164
- "source-layer": "restricted-fill",
2165
- minzoom: 4,
2166
- paint: { "fill-color": ["case", ["==", ["get", "CODE_TYPE"], "P"], "#ef4444", ["==", ["get", "CODE_TYPE"], "D"], "#f97316", "#ef4444"], "fill-opacity": 0.04 }
2167
- },
2168
- {
2169
- id: "restricted-stroke",
2170
- type: "line",
2171
- source: o,
2172
- "source-layer": "restricted",
2173
- paint: { "line-color": r.restrictedStroke, "line-width": 1, "line-dasharray": [2, 2], "line-opacity": ["interpolate", ["linear"], ["zoom"], 4, 0.6, 8, 1] }
2174
- },
2175
- {
2176
- id: "restricted-label",
2177
- type: "symbol",
2178
- source: o,
2179
- "source-layer": "restricted",
2180
- minzoom: 6,
2181
- layout: { "text-field": ["coalesce", ["get", "TXT_NAME"], ["get", "CODE_ID"]], "text-size": 10, "symbol-placement": "line", "text-max-width": 8, "text-offset": [0, 1] },
2182
- paint: { "text-color": r.restrictedStroke, "text-halo-color": "#0f172a", "text-halo-width": 1 }
2183
- },
2184
- {
2185
- id: "controlled-fill",
2186
- type: "fill",
2187
- source: o,
2188
- "source-layer": "controlled-fill",
2189
- minzoom: 4,
2190
- paint: {
2191
- "fill-color": r.controlledFill,
2192
- "fill-opacity": [
2193
- "interpolate",
2194
- [
2195
- "linear"
2196
- ],
2197
- [
2198
- "zoom"
2199
- ],
2200
- 10,
2201
- 0.04,
2202
- 11.5,
2203
- 0
2204
- ]
2205
- }
2206
- },
2207
- {
2208
- id: "controlled-stroke",
2209
- type: "line",
2210
- source: o,
2211
- "source-layer": "controlled",
2212
- paint: { "line-color": r.controlledStroke, "line-width": 1, "line-opacity": ["interpolate", ["linear"], ["zoom"], 4, 0.6, 8, 1], "line-dasharray": [4, 2] }
2213
- },
2214
- {
2215
- id: "controlled-label",
2216
- type: "symbol",
2217
- source: o,
2218
- "source-layer": "controlled",
2219
- minzoom: 6,
2220
- layout: { "text-field": ["coalesce", ["get", "TXT_NAME"], ["get", "CODE_ID"]], "text-size": 10, "symbol-placement": "point", "text-max-width": 8 },
2221
- paint: { "text-color": r.controlledStroke, "text-halo-color": "#0f172a", "text-halo-width": 1.5 }
2222
- },
2223
- {
2224
- id: "segment-line",
2225
- type: "line",
2226
- source: o,
2227
- "source-layer": "segment",
2228
- minzoom: 5,
2229
- paint: {
2230
- "line-color": ["case", ["==", ["get", "HAS_REMARK"], 1], "#fbbf24", r.segment],
2231
- "line-width": ["interpolate", ["linear"], ["zoom"], 5, 0.2, 8, 0.8],
2232
- "line-blur": 0,
2233
- "line-opacity": [
2234
- "interpolate",
2235
- [
2236
- "linear"
2237
- ],
2238
- [
2239
- "zoom"
2240
- ],
2241
- 5,
2242
- 0.3,
2243
- 6,
2244
- 1,
2245
- 8,
2246
- 1,
2247
- 12,
2248
- 0.8,
2249
- 15,
2250
- 0.2
2251
- ]
2252
- }
2253
- },
2254
- {
2255
- id: "segment-label",
2256
- type: "symbol",
2257
- source: o,
2258
- "source-layer": "segment",
2259
- minzoom: 6,
2260
- layout: {
2261
- "icon-image": ["case", ["all", ["has", "TXT_DESIG"], ["!=", ["get", "TXT_DESIG"], ""], ["!=", ["get", "TXT_DESIG"], " "], ["!=", ["get", "TXT_DESIG"], null]], "segment-both", ["all", ["has", "TXT_DESIG_FORWARD"]], "segment-right", ["all", ["has", "TXT_DESIG_BACKWARD"]], "segment-left", "segment-both"],
2262
- "icon-anchor": "center",
2263
- "symbol-placement": "line",
2264
- "icon-text-fit": "width",
2265
- "icon-size": 1,
2266
- "text-allow-overlap": !1,
2267
- "icon-allow-overlap": !1,
2268
- "text-anchor": "center",
2269
- "text-justify": "center",
2270
- "text-line-height": 1.3,
2271
- "text-letter-spacing": 0.1,
2272
- "text-field": [
2273
- "step",
2274
- ["zoom"],
2275
- ["format", ["case", ["all", ["has", "TXT_DESIG"], ["!=", ["get", "TXT_DESIG"], ""]], ["get", "TXT_DESIG"], ["all", ["has", "TXT_DESIG_FORWARD"], ["!=", ["get", "TXT_DESIG_FORWARD"], ""]], ["get", "TXT_DESIG_FORWARD"], ["all", ["has", "TXT_DESIG_BACKWARD"], ["!=", ["get", "TXT_DESIG_BACKWARD"], ""]], ["get", "TXT_DESIG_BACKWARD"], "-"], { "font-scale": 1, "text-color": "#0f172a" }],
2276
- 10,
2277
- [
2278
- "format",
2279
- ["concat", ["get", "VAL_LEN"], "", ["get", "UOM_DIST"]],
2280
- { "font-scale": 0.95, "text-color": "#cbd5e1" },
2281
- `
2282
- `,
2283
- ["case", ["all", ["has", "TXT_DESIG_FORWARD"], ["!=", ["get", "TXT_DESIG_FORWARD"], ""]], ["case", ["all", ["has", "TXT_DESIG_RNP"], ["!=", ["get", "TXT_DESIG_RNP"], ""]], ["get", "TXT_DESIG_RNP"], ""], ""],
2284
- { "font-scale": 1, "text-color": "#FFFFFF" },
2285
- ["case", ["all", ["has", "TXT_DESIG_FORWARD"], ["!=", ["get", "TXT_DESIG_FORWARD"], ""]], ["case", ["all", ["has", "TXT_DESIG_RNP"], ["!=", ["get", "TXT_DESIG_RNP"], ""]], " ", ""], ""],
2286
- {},
2287
- ["case", ["all", ["has", "TXT_DESIG_FORWARD"], ["!=", ["get", "TXT_DESIG_FORWARD"], ""]], ["get", "TXT_DESIG_FORWARD"], ["all", ["has", "TXT_DESIG"], ["!=", ["get", "TXT_DESIG"], ""]], ["get", "TXT_DESIG"], ["all", ["has", "TXT_DESIG_BACKWARD"], ["!=", ["get", "TXT_DESIG_BACKWARD"], ""]], ["get", "TXT_DESIG_BACKWARD"], "-"],
2288
- { "font-scale": 1, "text-color": "#0f172a", "font-weight": "bold" },
2289
- ["case", ["all", ["has", "TXT_DESIG_FORWARD"], ["!=", ["get", "TXT_DESIG_FORWARD"], ""]], "", ["case", ["all", ["has", "TXT_DESIG_RNP"], ["!=", ["get", "TXT_DESIG_RNP"], ""]], " ", ""]],
2290
- {},
2291
- ["case", ["all", ["has", "TXT_DESIG_FORWARD"], ["!=", ["get", "TXT_DESIG_FORWARD"], ""]], "", ["case", ["all", ["has", "TXT_DESIG_RNP"], ["!=", ["get", "TXT_DESIG_RNP"], ""]], ["get", "TXT_DESIG_RNP"], ""]],
2292
- { "font-scale": 0.85, "text-color": "#FFFFFF" },
2293
- `
2294
- `,
2295
- ["case", ["all", ["has", "TXT_DESIG_HIGH"], ["!=", ["get", "TXT_DESIG_HIGH"], ""]], ["get", "TXT_DESIG_HIGH"], ["all", ["has", "TXT_DESIG_FORWARD"], ["!=", ["get", "TXT_DESIG_FORWARD"], ""]], ["get", "TXT_DESIG_FORWARD"], ["all", ["has", "TXT_DESIG_BACKWARD"], ["!=", ["get", "TXT_DESIG_BACKWARD"], ""]], ["get", "TXT_DESIG_BACKWARD"], "-"],
2296
- { "font-scale": 0.95, "text-color": "#cbd5e1" }
2297
- ]
2298
- ],
2299
- "text-size": ["interpolate", ["linear"], ["zoom"], 6, 9, 10, 10],
2300
- "icon-text-fit-padding": [0, 3, 0, 3]
2301
- },
2302
- paint: { "icon-color": r.segment }
2303
- },
2304
- {
2305
- id: "segment-radial",
2306
- type: "symbol",
2307
- source: o,
2308
- "source-layer": "segment-radial",
2309
- minzoom: 10,
2310
- layout: { "text-field": ["concat", ["get", "bearing"], "°"], "text-size": 9, "text-rotate": ["to-number", ["get", "line_angle"], 0], "text-rotation-alignment": "map", "text-allow-overlap": !0, "text-ignore-placement": !0, "text-offset": [0, -1] },
2311
- paint: { "text-color": r.segment, "text-halo-color": "#0f172a", "text-halo-width": 1 }
2312
- },
2313
- {
2314
- id: "airport-circle",
2315
- type: "symbol",
2316
- source: o,
2317
- minzoom: 3,
2318
- "source-layer": "airport",
2319
- filter: ["case", ["<", ["zoom"], 6], ["==", ["get", "level"], 1], !0],
2320
- layout: {
2321
- "icon-image": ["case", ["==", ["get", "CODE_TYPE_MIL_OPS"], "MIL"], "airport-mil", ["==", ["get", "CODE_TYPE_MIL_OPS"], "MILEXT"], "airport-milext", "airport-civ"],
2322
- "icon-size": ["interpolate", ["linear"], ["zoom"], 4, 0.5, 10, 0.9],
2323
- "symbol-z-order": "viewport-y",
2324
- "text-field": ["get", "codeId"],
2325
- "text-letter-spacing": 0.05,
2326
- "text-anchor": "bottom",
2327
- "text-field": ["get", "CODE_ID"],
2328
- "text-justify": "center",
2329
- "text-size": ["interpolate", ["linear"], ["zoom"], 4, 0, 5, 12],
2330
- "text-offset": ["interpolate", ["linear"], ["zoom"], 4, ["literal", [0, -1.2]], 5, ["literal", [0, -0.6]]],
2331
- "icon-allow-overlap": !0,
2332
- "icon-ignore-placement": !0,
2333
- "text-allow-overlap": !0,
2334
- "text-ignore-placement": !0,
2335
- visibility: "none",
2336
- "icon-size": [
2337
- "interpolate",
2338
- [
2339
- "linear"
2340
- ],
2341
- [
2342
- "zoom"
2343
- ],
2344
- 5,
2345
- 0.6,
2346
- 9,
2347
- 1.2,
2348
- 12,
2349
- 1.3
2350
- ]
2351
- },
2352
- paint: {
2353
- "icon-color": [
2354
- "case",
2355
- ["has", "has_amm"],
2356
- "#4B2D6E",
2357
- r.airport
2358
- ],
2359
- "icon-opacity": [
2360
- "interpolate",
2361
- [
2362
- "linear"
2363
- ],
2364
- [
2365
- "zoom"
2366
- ],
2367
- 2,
2368
- 0.75,
2369
- 3,
2370
- 0.95,
2371
- 5,
2372
- 1,
2373
- 9,
2374
- 1,
2375
- 11,
2376
- 0.2
2377
- ],
2378
- "text-color": [
2379
- "case",
2380
- ["has", "has_amm"],
2381
- "#4B2D6E",
2382
- "#E0F7FA"
2383
- ],
2384
- "text-opacity": [
2385
- "interpolate",
2386
- [
2387
- "linear"
2388
- ],
2389
- [
2390
- "zoom"
2391
- ],
2392
- 4,
2393
- 0.95,
2394
- 5,
2395
- 1,
2396
- 9,
2397
- 1,
2398
- 11,
2399
- 0.2
2400
- ]
2401
- }
2402
- },
2403
- {
2404
- id: "runway-line",
2405
- type: "line",
2406
- source: o,
2407
- "source-layer": "runway",
2408
- filter: ["!", ["has", "has_amm"]],
2409
- minzoom: 4,
2410
- paint: { "line-color": r.runway, "line-width": ["interpolate", ["linear"], ["zoom"], 4, 1, 10, 3] }
2411
- },
2412
- {
2413
- id: "runway-line-amm",
2414
- type: "line",
2415
- source: o,
2416
- "source-layer": "runway",
2417
- filter: ["has", "has_amm"],
2418
- minzoom: 4,
2419
- paint: { "line-color": r.runway, "line-width": ["interpolate", ["linear"], ["zoom"], 4, 1, 10, 3], "line-opacity": ["interpolate", ["linear"], ["zoom"], 10.5, 1, 11, 0] }
2420
- },
2421
- {
2422
- id: "runway-label",
2423
- type: "symbol",
2424
- source: o,
2425
- "source-layer": "runway",
2426
- minzoom: 10,
2427
- layout: { "text-field": ["concat", ["to-string", ["get", "VAL_LEN"]], "×", ["to-string", ["get", "VAL_WID"]], "m"], "text-size": 10, "text-font": ["Noto Sans Regular"], "symbol-placement": "line-center", "text-rotation-alignment": "map", "text-optional": !0 },
2428
- paint: { "text-color": r.runway, "text-halo-color": "#0f172a", "text-halo-width": 1, "text-opacity": ["interpolate", ["linear"], ["zoom"], 10.5, 1, 11, 0] }
2429
- },
2430
- {
2431
- id: "vor-symbol",
2432
- type: "symbol",
2433
- source: o,
2434
- "source-layer": "vor",
2435
- layout: { "icon-image": "vor_dial", "icon-size": ["interpolate", ["linear"], ["zoom"], 5, 0.072, 10, 0.072, 11, 0.126, 12, 0.18, 13, 0.234, 14, 0.288, 15, 0.342, 16, 0.396, 17, 0.45, 22, 0.45], "icon-rotate": ["to-number", ["get", "VAL_MAG_VAR"], 0], "icon-rotation-alignment": "map", "symbol-z-order": "viewport-y", "text-letter-spacing": 0.05, "text-optional": !0, "icon-allow-overlap": !0, visibility: "none" },
2436
- paint: { "icon-color": "#38bdf8" }
2437
- },
2438
- {
2439
- id: "vor-symbol-normal",
2440
- minzoom: 4,
2441
- maxzoom: 9,
2442
- type: "symbol",
2443
- source: o,
2444
- "source-layer": "vor",
2445
- layout: {
2446
- "icon-image": "v2:vor-normal",
2447
- "icon-size": ["interpolate", ["linear"], ["zoom"], 4, 0.7, 8, 1],
2448
- "icon-rotation-alignment": "map",
2449
- "symbol-z-order": "viewport-y",
2450
- "text-letter-spacing": 0.05,
2451
- "text-optional": !0,
2452
- "icon-allow-overlap": !0
2453
- },
2454
- paint: {
2455
- "icon-color": "#38bdf8",
2456
- "icon-opacity": ["interpolate", ["linear"], ["zoom"], 8, 1, 9, 0]
2457
- }
2458
- },
2459
- {
2460
- id: "vor-label",
2461
- type: "symbol",
2462
- source: o,
2463
- "source-layer": "vor",
2464
- minzoom: 5,
2465
- layout: { "text-field": ["get", "CODE_ID"], "text-size": 10, "text-anchor": "bottom", "text-offset": [0, -0.8] },
2466
- paint: { "text-color": r.vor, "text-halo-color": "#0f172a", "text-halo-width": 1 }
2467
- },
2468
- {
2469
- id: "ndb-symbol",
2470
- type: "symbol",
2471
- source: o,
2472
- minzoom: 4,
2473
- "source-layer": "ndb",
2474
- layout: { "icon-image": "ndb-inway", "icon-size": ["interpolate", ["linear"], ["zoom"], 6, 0.5, 10, 1], "symbol-z-order": "viewport-y", "text-field": ["concat", ["get", "CODE_ID"], `
2475
- `, ["get", "VAL_FREQ"], "kHz"], "text-size": 10, "text-offset": [0, 1.4], "text-letter-spacing": 0.05, "text-optional": !0, "icon-allow-overlap": !0 },
2476
- paint: { "text-color": r.ndb, "text-halo-color": "#0f172a", "text-halo-width": 1, "icon-color": r.ndb }
2477
- },
2478
- {
2479
- id: "waypoint-symbol",
2480
- type: "symbol",
2481
- source: o,
2482
- "source-layer": "waypoint",
2483
- minzoom: 5,
2484
- layout: { "icon-image": ["case", ["==", ["get", "report_type"], "C"], "waypoint-compusory", "waypoint"], "icon-size": 0.6, "icon-allow-overlap": !0, "icon-ignore-placement": !0, "text-field": ["get", "CODE_ID"], "text-size": 9, "text-variable-anchor-offset": ["bottom", [0, -0.6], "top", [0, 0.6], "right", [-0.6, 0], "left", [0.6, 0], "bottom-right", [-0.4, -0.4], "bottom-left", [0.4, -0.4], "top-right", [-0.4, 0.4], "top-left", [0.4, 0.4]], "text-justify": "auto", "text-optional": !0 },
2485
- paint: { "icon-color": r.waypoint, "text-color": r.waypoint, "text-halo-color": "#0f172a", "text-halo-width": 1 }
2486
- },
2487
- {
2488
- id: "waypoint-off-airway-symbol",
2489
- type: "symbol",
2490
- source: o,
2491
- "source-layer": "waypoint-off-airway",
2492
- minzoom: 7,
2493
- layout: { "icon-image": ["case", ["==", ["get", "report_type"], "C"], "designate_point_inway", "designate_point_notinway"], "icon-size": 0.6, "icon-allow-overlap": !0, "icon-ignore-placement": !0, "text-field": ["get", "CODE_ID"], "text-size": 9, "text-variable-anchor-offset": ["bottom", [0, -0.6], "top", [0, 0.6], "right", [-0.6, 0], "left", [0.6, 0], "bottom-right", [-0.4, -0.4], "bottom-left", [0.4, -0.4], "top-right", [-0.4, 0.4], "top-left", [0.4, 0.4]], "text-justify": "auto", "text-optional": !0 },
2494
- paint: { "icon-color": r.waypoint, "text-color": r.waypoint, "text-halo-color": "#0f172a", "text-halo-width": 1 }
2495
- }
2496
- ];
2497
- }
2498
- const ut = {
2499
- light: { id: "light", label: "日间", background: "#EAF2F8", build: $e },
2500
- dark: { id: "dark", label: "夜间", background: "#000000", build: He }
2501
- };
2502
- function Pt(o = "light") {
2503
- return (ut[o] ?? ut.light).build();
2504
- }
2505
- const Yt = {
2506
- adiz: ["adiz-line", "adiz-label"],
2507
- airspace: ["fir-line", "fir_line_dash", "fir-label", "fir-label-lineside"],
2508
- restricted: ["restricted-fill", "restricted-stroke", "restricted-label"],
2509
- controlled: ["controlled-fill", "controlled-stroke", "controlled-label"],
2510
- airline: ["segment-radial", "segment-line", "segment-label", "waypoint-symbol"],
2511
- waypointOffAirway: ["waypoint-off-airway-symbol"],
2512
- vor: ["vor-symbol", "vor-label", "vor-symbol-normal"],
2513
- ndb: ["ndb-symbol"],
2514
- airport: ["airport-circle"],
2515
- runway: ["runway-line", "runway-line-amm", "runway-label"]
2516
- }, Ye = {
2517
- /** 机场边界(淡暖灰垫底,在纯白底上显现轮廓) */
2518
- airport: "#e2e8f0",
2519
- /** 跑道面(中深灰,作为白底上的绝对重心) */
2520
- runway: "#94a3b8",
2521
- /** 机坪面(中浅灰,与白底拉开清晰明度差) */
2522
- apron: "#cbd5e1",
2523
- /** 滑行道面(带微弱色调差的浅灰,与机坪剥离) */
2524
- taxiway: "#e2e8f0",
2525
- /** 滑行道中心线(深琥珀金,白底上极清晰) */
2526
- taxiwayLine: "#f59e0b",
2527
- /** 等待位(深砖红/铁锈红,高辨识度) */
2528
- holding: "#b91c1c",
2529
- /** 机位点(深翡翠绿) */
2530
- stand: "#1e293b",
2531
- /** 跑道标记(涂装面) */
2532
- runwayMarking: "#ffffff",
2533
- /** 跑道中心线 */
2534
- runwayCenterline: "#ffffff",
2535
- /** 停机位引导线(深绿色) */
2536
- standLine: "#64748b",
2537
- /** 限制区域(深红) */
2538
- restricted: "#b91c1c",
2539
- /** 事故易发区(深橙色) */
2540
- hotspot: "#ea580c"
2541
- };
2542
- function Je(o = "amm") {
2543
- const r = Ye;
2544
- return [
2545
- // ── 机场边界轮廓(z11+)
2546
- {
2547
- id: "amm-airport-fill",
2548
- type: "fill",
2549
- source: o,
2550
- "source-layer": "amm-airport",
2551
- minzoom: 11,
2552
- paint: {
2553
- "fill-color": r.airport,
2554
- "fill-opacity": 0.4
2555
- // 适当调高不透明度,确保白底可见
2556
- }
2557
- },
2558
- {
2559
- id: "amm-airport-stroke",
2560
- type: "line",
2561
- source: o,
2562
- "source-layer": "amm-airport",
2563
- minzoom: 11,
2564
- paint: {
2565
- "line-color": r.airport,
2566
- "line-width": 1
2567
- }
2568
- },
2569
- // ── 跑道面(z11+)─────
2570
- {
2571
- id: "amm-runway-fill",
2572
- type: "fill",
2573
- source: o,
2574
- "source-layer": "amm-runway",
2575
- minzoom: 11,
2576
- paint: {
2577
- "fill-color": r.runway,
2578
- "fill-opacity": 0.9
2579
- }
2580
- },
2581
- {
2582
- id: "amm-runway-stroke",
2583
- type: "line",
2584
- source: o,
2585
- "source-layer": "amm-runway",
2586
- minzoom: 11,
2587
- paint: {
2588
- "line-color": "#64748b",
2589
- // 边缘加深,防止溶于白底
2590
- "line-width": 0.5
2591
- }
2592
- },
2593
- // ── 机坪面(z11+)─────
2594
- {
2595
- id: "amm-apron-fill",
2596
- type: "fill",
2597
- source: o,
2598
- "source-layer": "amm-apron",
2599
- minzoom: 11,
2600
- paint: {
2601
- "fill-color": r.apron,
2602
- "fill-opacity": 0.6
2603
- // 提高透明度浓度
2604
- }
2605
- },
2606
- {
2607
- id: "amm-apron-stroke",
2608
- type: "line",
2609
- source: o,
2610
- "source-layer": "amm-apron",
2611
- minzoom: 11,
2612
- paint: {
2613
- "line-color": "#94a3b8",
2614
- // 勾边加深,确保纯白背景下清晰可见
2615
- "line-width": 0.5
2616
- }
2617
- },
2618
- // ── 滑行道面(z11+)───
2619
- {
2620
- id: "amm-taxiway-fill",
2621
- type: "fill",
2622
- source: o,
2623
- "source-layer": "amm-taxiway",
2624
- minzoom: 11,
2625
- paint: {
2626
- "fill-color": r.taxiway,
2627
- "fill-opacity": 0.7
2628
- }
2629
- },
2630
- // ── 滑行道中心线(z11+)──────────────────────────────────────────
2631
- {
2632
- id: "amm-taxiway-line",
2633
- type: "line",
2634
- source: o,
2635
- "source-layer": "amm-taxiway-line",
2636
- minzoom: 11,
2637
- paint: {
2638
- "line-color": r.taxiwayLine,
2639
- "line-width": ["interpolate", ["linear"], ["zoom"], 15, 0.8, 18, 2]
2640
- }
2641
- },
2642
- // 滑行道名称(中心线 symbol)
2643
- {
2644
- id: "amm-taxiway-label",
2645
- type: "symbol",
2646
- source: o,
2647
- "source-layer": "amm-taxiway-line",
2648
- minzoom: 14,
2649
- layout: {
2650
- "text-field": ["get", "idlin"],
2651
- "text-size": 10,
2652
- "icon-image": "text_bg",
2653
- "icon-text-fit": "both",
2654
- "icon-text-fit-padding": [
2655
- 1,
2656
- 2,
2657
- 1,
2658
- 2
2659
- ],
2660
- "symbol-placement": "line",
2661
- "text-keep-upright": !0,
2662
- "text-allow-overlap": !1
2663
- },
2664
- paint: {
2665
- "text-color": "#FFF",
2666
- "icon-color": r.taxiwayLine
2667
- }
2668
- },
2669
- // ── 等待位(z11+)─────
2670
- {
2671
- id: "amm-holding",
2672
- type: "line",
2673
- source: o,
2674
- "source-layer": "amm-holding",
2675
- minzoom: 11,
2676
- paint: {
2677
- "line-color": r.holding,
2678
- "line-width": 1.5
2679
- }
2680
- },
2681
- // ── 跑道标记(斑马线、编号等涂装面,z13+)─────────────────────────
2682
- {
2683
- id: "amm-runway-marking",
2684
- type: "fill",
2685
- source: o,
2686
- "source-layer": "amm-runway-marking",
2687
- minzoom: 13,
2688
- paint: {
2689
- "fill-color": r.runwayMarking,
2690
- "fill-opacity": 0.9
2691
- }
2692
- },
2693
- // ── 限制区域(z11+)───────────────────────────────────────────────
2694
- {
2695
- id: "amm-restricted-fill",
2696
- type: "fill",
2697
- source: o,
2698
- "source-layer": "amm-restricted",
2699
- minzoom: 11,
2700
- paint: {
2701
- "fill-color": r.restricted,
2702
- "fill-opacity": 0.08
2703
- // 针对白底降低面纯度
2704
- }
2705
- },
2706
- {
2707
- id: "amm-restricted-stroke",
2708
- type: "line",
2709
- source: o,
2710
- "source-layer": "amm-restricted",
2711
- minzoom: 11,
2712
- paint: {
2713
- "line-color": r.restricted,
2714
- "line-width": 1.5,
2715
- "line-dasharray": [4, 2]
2716
- }
2717
- },
2718
- // ── 事故易发区警示(z11+)─────────────────────────────────────────
2719
- {
2720
- id: "amm-hotspot-fill",
2721
- type: "fill",
2722
- source: o,
2723
- "source-layer": "amm-hotspot",
2724
- minzoom: 11,
2725
- paint: {
2726
- "fill-color": r.hotspot,
2727
- "fill-opacity": 0.1
2728
- // 针对白底轻微淡化面
2729
- }
2730
- },
2731
- {
2732
- id: "amm-hotspot-stroke",
2733
- type: "line",
2734
- source: o,
2735
- "source-layer": "amm-hotspot",
2736
- minzoom: 11,
2737
- paint: {
2738
- "line-color": r.hotspot,
2739
- "line-width": 1.5
2740
- }
2741
- },
2742
- // ── 跑道中心线(z11+)─────────────────────────────────────────────
2743
- {
2744
- id: "amm-runway-centerline",
2745
- type: "line",
2746
- source: o,
2747
- "source-layer": "amm-runway-centerline",
2748
- minzoom: 11,
2749
- paint: {
2750
- "line-color": r.runwayCenterline,
2751
- "line-width": 1,
2752
- "line-dasharray": [6, 3]
2753
- }
2754
- },
2755
- // 跑道中心信息标签(z13+)
2756
- // 使用后端生成的 amm-runway-label 点图层:每条跑道仅一个中点,
2757
- // 点要素不跨 tile,标注绝对不重复
2758
- {
2759
- id: "amm-runway-info",
2760
- type: "symbol",
2761
- source: o,
2762
- "source-layer": "amm-runway-label",
2763
- minzoom: 13,
2764
- layout: {
2765
- "text-field": [
2766
- "concat",
2767
- ["coalesce", ["get", "length"], ""],
2768
- "×",
2769
- ["coalesce", ["get", "width"], ""],
2770
- "m"
2771
- ],
2772
- "text-size": [
2773
- "interpolate",
2774
- ["exponential", 1.5],
2775
- ["zoom"],
2776
- 13,
2777
- 10,
2778
- 16,
2779
- 13
2780
- ],
2781
- "symbol-placement": "point",
2782
- "text-rotate": ["coalesce", ["get", "bearing"], 0],
2783
- "text-rotation-alignment": "map",
2784
- "text-allow-overlap": !0,
2785
- "text-ignore-placement": !0
2786
- },
2787
- paint: {
2788
- "text-color": "#f8fafc",
2789
- // 加粗 halo 代替 icon 背景,旋转后不会变形
2790
- "text-halo-color": "#334155",
2791
- "text-halo-width": 2.5
2792
- }
2793
- },
2794
- // ── 停机位引导线(z13+)───────────────────────────────────────────
2795
- {
2796
- id: "amm-stand-line",
2797
- type: "line",
2798
- source: o,
2799
- "source-layer": "amm-stand-line",
2800
- minzoom: 13,
2801
- paint: {
2802
- "line-color": r.standLine,
2803
- "line-width": 1
2804
- }
2805
- },
2806
- // 跑道入口标签:编号 + 标高(z14+)
2807
- {
2808
- id: "amm-runway-threshold-label",
2809
- type: "symbol",
2810
- source: o,
2811
- "source-layer": "amm-runway-threshold",
2812
- minzoom: 12,
2813
- layout: {
2814
- "icon-image": "text_bg",
2815
- "icon-text-fit": "both",
2816
- "icon-text-fit-padding": [
2817
- 1,
2818
- 2,
2819
- 1,
2820
- 2
2821
- ],
2822
- "text-field": ["get", "idthr"],
2823
- "text-size": 14,
2824
- "text-allow-overlap": !0,
2825
- "text-rotation-alignment": "map",
2826
- "icon-rotation-alignment": "map"
2827
- },
2828
- paint: {
2829
- "text-color": "#fff",
2830
- "icon-color": "#b91c1c"
2831
- }
2832
- },
2833
- // ── 机位点(z11+)─────
2834
- {
2835
- id: "amm-stand",
2836
- type: "circle",
2837
- source: o,
2838
- "source-layer": "amm-stand",
2839
- minzoom: 12,
2840
- paint: {
2841
- "circle-color": r.stand,
2842
- "circle-radius": 1.5
2843
- }
2844
- },
2845
- // 机位编号标签
2846
- {
2847
- id: "amm-stand-label",
2848
- type: "symbol",
2849
- source: o,
2850
- "source-layer": "amm-stand",
2851
- minzoom: 14,
2852
- layout: {
2853
- "text-field": ["get", "idstd"],
2854
- "text-size": 9,
2855
- "text-anchor": "bottom",
2856
- "text-offset": [0, -0.5],
2857
- "text-allow-overlap": !1
2858
- },
2859
- paint: {
2860
- "text-color": r.standLine
2861
- // 改为深墨绿字,白底/浅灰底上高可读
2862
- }
2863
- },
2864
- // ── 垂直面状障碍物(z11+)──────────────────────────────────────
2865
- {
2866
- id: "amm-obstacle-region-fill",
2867
- type: "fill",
2868
- source: o,
2869
- "source-layer": "amm-obstacle-region",
2870
- minzoom: 11,
2871
- paint: {
2872
- "fill-color": "#fef08a",
2873
- "fill-opacity": 0.35
2874
- }
2875
- },
2876
- {
2877
- id: "amm-obstacle-region-stroke",
2878
- type: "line",
2879
- source: o,
2880
- "source-layer": "amm-obstacle-region",
2881
- minzoom: 11,
2882
- paint: {
2883
- "line-color": "#ca8a04",
2884
- "line-width": 1.5,
2885
- "line-dasharray": [1.5, 1]
2886
- }
2887
- },
2888
- // ── 垂直点状障碍物(z11+)──────────────────────────────────────
2889
- {
2890
- id: "amm-obstacle-point",
2891
- type: "circle",
2892
- source: o,
2893
- "source-layer": "amm-obstacle-point",
2894
- minzoom: 11,
2895
- paint: {
2896
- "circle-color": "#b45309",
2897
- "circle-radius": 4,
2898
- "circle-stroke-color": "#ffffff",
2899
- "circle-stroke-width": 1
2900
- }
2901
- },
2902
- // 点状障碍物名称标签
2903
- {
2904
- id: "amm-obstacle-point-label",
2905
- type: "symbol",
2906
- source: o,
2907
- "source-layer": "amm-obstacle-point",
2908
- minzoom: 14,
2909
- layout: {
2910
- "text-field": ["coalesce", ["get", "ident"], ["get", "LABEL"]],
2911
- "text-size": 9,
2912
- "text-anchor": "bottom",
2913
- "text-offset": [0, -0.5],
2914
- "text-allow-overlap": !1
2915
- },
2916
- paint: {
2917
- "text-color": "#92400e",
2918
- "text-halo-color": "#ffffff",
2919
- "text-halo-width": 1
2920
- }
2921
- },
2922
- // ── 施工区域面(表不存在的机场不返回此图层,自动跳过)──
2923
- {
2924
- id: "amm-construction-fill",
2925
- type: "fill",
2926
- source: o,
2927
- "source-layer": "amm-construction",
2928
- minzoom: 11,
2929
- paint: {
2930
- "fill-pattern": "normal:passline",
2931
- "fill-opacity": 0.8
2932
- }
2933
- },
2934
- {
2935
- id: "amm-construction-stroke",
2936
- type: "line",
2937
- source: o,
2938
- "source-layer": "amm-construction",
2939
- minzoom: 11,
2940
- paint: {
2941
- "line-color": "#d97706",
2942
- "line-width": 1.5,
2943
- "line-dasharray": [4, 2]
2944
- }
2945
- },
2946
- {
2947
- id: "amm-construction-label",
2948
- type: "symbol",
2949
- source: o,
2950
- "source-layer": "amm-construction",
2951
- minzoom: 13,
2952
- layout: {
2953
- "text-field": ["get", "text"],
2954
- "text-size": 9,
2955
- "text-anchor": "center",
2956
- "symbol-placement": "point",
2957
- "text-allow-overlap": !1
2958
- },
2959
- paint: {
2960
- "text-color": "#92400e",
2961
- "text-halo-color": "#ffffff",
2962
- "text-halo-width": 1
2963
- }
2964
- }
2965
- ];
2966
- }
2967
- const Ze = {
2968
- airport: "#334155",
2969
- runway: "#475569",
2970
- apron: "#1e293b",
2971
- taxiway: "#334155",
2972
- taxiwayLine: "#fbbf24",
2973
- holding: "#ef4444",
2974
- stand: "#34d399",
2975
- runwayMarking: "#cbd5e1",
2976
- runwayCenterline: "#94a3b8",
2977
- standLine: "#64748b",
2978
- restricted: "#f87171",
2979
- hotspot: "#fb923c"
2980
- };
2981
- function Qe(o = "amm") {
2982
- const r = Ze;
2983
- return [
2984
- { id: "amm-airport-fill", type: "fill", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "fill-color": r.airport, "fill-opacity": 0.3 } },
2985
- { id: "amm-airport-stroke", type: "line", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "line-color": "#475569", "line-width": 1 } },
2986
- { id: "amm-runway-fill", type: "fill", source: o, "source-layer": "amm-runway", minzoom: 11, paint: { "fill-color": r.runway, "fill-opacity": 1 } },
2987
- { id: "amm-runway-stroke", type: "line", source: o, "source-layer": "amm-runway", minzoom: 11, paint: { "line-color": "#64748b", "line-width": 0.5 } },
2988
- { id: "amm-apron-fill", type: "fill", source: o, "source-layer": "amm-apron", minzoom: 11, paint: { "fill-color": r.apron, "fill-opacity": 1 } },
2989
- { id: "amm-apron-stroke", type: "line", source: o, "source-layer": "amm-apron", minzoom: 11, paint: { "line-color": "#334155", "line-width": 0.5 } },
2990
- { id: "amm-taxiway-fill", type: "fill", source: o, "source-layer": "amm-taxiway", minzoom: 11, paint: { "fill-color": r.taxiway, "fill-opacity": 0.8 } },
2991
- { id: "amm-taxiway-line", type: "line", source: o, "source-layer": "amm-taxiway-line", minzoom: 11, paint: { "line-color": r.taxiwayLine, "line-width": ["interpolate", ["linear"], ["zoom"], 15, 0.8, 18, 2] } },
2992
- {
2993
- id: "amm-taxiway-label",
2994
- type: "symbol",
2995
- source: o,
2996
- "source-layer": "amm-taxiway-line",
2997
- minzoom: 14,
2998
- layout: { "text-field": ["get", "idlin"], "text-size": 10, "icon-image": "text_bg", "icon-text-fit": "both", "icon-text-fit-padding": [1, 2, 1, 2], "symbol-placement": "line", "text-keep-upright": !0, "text-allow-overlap": !1 },
2999
- paint: { "text-color": "#0f172a", "icon-color": r.taxiwayLine }
3000
- },
3001
- { id: "amm-holding", type: "line", source: o, "source-layer": "amm-holding", minzoom: 11, paint: { "line-color": r.holding, "line-width": 1.5 } },
3002
- { id: "amm-runway-marking", type: "fill", source: o, "source-layer": "amm-runway-marking", minzoom: 13, paint: { "fill-color": r.runwayMarking, "fill-opacity": 0.8 } },
3003
- { id: "amm-restricted-fill", type: "fill", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "fill-color": r.restricted, "fill-opacity": 0.12 } },
3004
- { id: "amm-restricted-stroke", type: "line", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "line-color": r.restricted, "line-width": 1.2, "line-dasharray": [4, 2] } },
3005
- { id: "amm-hotspot-fill", type: "fill", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "fill-color": r.hotspot, "fill-opacity": 0.15 } },
3006
- { id: "amm-hotspot-stroke", type: "line", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "line-color": r.hotspot, "line-width": 1.2 } },
3007
- { id: "amm-runway-centerline", type: "line", source: o, "source-layer": "amm-runway-centerline", minzoom: 11, paint: { "line-color": r.runwayCenterline, "line-width": 1, "line-dasharray": [6, 3] } },
3008
- {
3009
- id: "amm-runway-info",
3010
- type: "symbol",
3011
- source: o,
3012
- "source-layer": "amm-runway-label",
3013
- minzoom: 13,
3014
- layout: { "text-field": ["concat", ["coalesce", ["get", "length"], ""], "×", ["coalesce", ["get", "width"], ""], "m"], "text-size": ["interpolate", ["exponential", 1.5], ["zoom"], 13, 10, 16, 13], "symbol-placement": "point", "text-rotate": ["coalesce", ["get", "bearing"], 0], "text-rotation-alignment": "map", "text-allow-overlap": !0, "text-ignore-placement": !0 },
3015
- paint: { "text-color": "#e2e8f0", "text-halo-color": "#0f172a", "text-halo-width": 2 }
3016
- },
3017
- { id: "amm-stand-line", type: "line", source: o, "source-layer": "amm-stand-line", minzoom: 13, paint: { "line-color": r.standLine, "line-width": 1 } },
3018
- {
3019
- id: "amm-runway-threshold-label",
3020
- type: "symbol",
3021
- source: o,
3022
- "source-layer": "amm-runway-threshold",
3023
- minzoom: 12,
3024
- layout: { "icon-image": "text_bg", "icon-text-fit": "both", "icon-text-fit-padding": [1, 2, 1, 2], "text-field": ["get", "idthr"], "text-size": 14, "text-allow-overlap": !0, "text-rotation-alignment": "map", "icon-rotation-alignment": "map" },
3025
- paint: { "text-color": "#ffffff", "icon-color": "#ef4444" }
3026
- },
3027
- { id: "amm-stand", type: "circle", source: o, "source-layer": "amm-stand", minzoom: 12, paint: { "circle-color": r.stand, "circle-radius": 1.5 } },
3028
- {
3029
- id: "amm-stand-label",
3030
- type: "symbol",
3031
- source: o,
3032
- "source-layer": "amm-stand",
3033
- minzoom: 14,
3034
- layout: { "text-field": ["get", "idstd"], "text-size": 9, "text-anchor": "bottom", "text-offset": [0, -0.5], "text-allow-overlap": !1 },
3035
- paint: { "text-color": r.stand, "text-halo-color": "#0f172a", "text-halo-width": 1 }
3036
- },
3037
- { id: "amm-obstacle-region-fill", type: "fill", source: o, "source-layer": "amm-obstacle-region", minzoom: 11, paint: { "fill-color": "#fef08a", "fill-opacity": 0.15 } },
3038
- { id: "amm-obstacle-region-stroke", type: "line", source: o, "source-layer": "amm-obstacle-region", minzoom: 11, paint: { "line-color": "#eab308", "line-width": 1.2, "line-dasharray": [1.5, 1] } },
3039
- { id: "amm-obstacle-point", type: "circle", source: o, "source-layer": "amm-obstacle-point", minzoom: 11, paint: { "circle-color": "#f97316", "circle-radius": 4, "circle-stroke-color": "#0f172a", "circle-stroke-width": 1 } },
3040
- {
3041
- id: "amm-obstacle-point-label",
3042
- type: "symbol",
3043
- source: o,
3044
- "source-layer": "amm-obstacle-point",
3045
- minzoom: 14,
3046
- layout: { "text-field": ["coalesce", ["get", "ident"], ["get", "LABEL"]], "text-size": 9, "text-anchor": "bottom", "text-offset": [0, -0.5], "text-allow-overlap": !1 },
3047
- paint: { "text-color": "#fdba74", "text-halo-color": "#0f172a", "text-halo-width": 1.2 }
3048
- },
3049
- { id: "amm-construction-fill", type: "fill", source: o, "source-layer": "amm-construction", minzoom: 11, paint: { "fill-pattern": "normal:passline", "fill-opacity": 0.6 } },
3050
- { id: "amm-construction-stroke", type: "line", source: o, "source-layer": "amm-construction", minzoom: 11, paint: { "line-color": "#ea580c", "line-width": 1.2, "line-dasharray": [4, 2] } },
3051
- {
3052
- id: "amm-construction-label",
3053
- type: "symbol",
3054
- source: o,
3055
- "source-layer": "amm-construction",
3056
- minzoom: 13,
3057
- layout: { "text-field": ["get", "text"], "text-size": 9, "text-anchor": "center", "symbol-placement": "point", "text-allow-overlap": !1 },
3058
- paint: { "text-color": "#f97316", "text-halo-color": "#0f172a", "text-halo-width": 1 }
3059
- }
3060
- ];
3061
- }
3062
- const qe = {
3063
- airport: "#4b5563",
3064
- runway: "#71717a",
3065
- apron: "#27272a",
3066
- taxiway: "#3f3f46",
3067
- taxiwayLine: "#eab308",
3068
- holding: "#ef4444",
3069
- stand: "#10b981",
3070
- runwayMarking: "#e4e4e7",
3071
- runwayCenterline: "#d4d4d8",
3072
- standLine: "#6b7280",
3073
- threshold: "#f97316",
3074
- restricted: "#f87171",
3075
- hotspot: "#fb923c"
3076
- };
3077
- function ti(o = "amm") {
3078
- const r = qe, d = "#1f1f23";
3079
- return [
3080
- { id: "amm-airport-fill", type: "fill", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "fill-color": r.airport, "fill-opacity": 0.3 } },
3081
- { id: "amm-airport-stroke", type: "line", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "line-color": "#52525b", "line-width": 1 } },
3082
- { id: "amm-runway-fill", type: "fill", source: o, "source-layer": "amm-runway", minzoom: 11, paint: { "fill-color": r.runway, "fill-opacity": 1 } },
3083
- { id: "amm-runway-stroke", type: "line", source: o, "source-layer": "amm-runway", minzoom: 11, paint: { "line-color": "#52525b", "line-width": 0.5 } },
3084
- { id: "amm-apron-fill", type: "fill", source: o, "source-layer": "amm-apron", minzoom: 11, paint: { "fill-color": r.apron, "fill-opacity": 1 } },
3085
- { id: "amm-apron-stroke", type: "line", source: o, "source-layer": "amm-apron", minzoom: 11, paint: { "line-color": "#3f3f46", "line-width": 0.5 } },
3086
- { id: "amm-taxiway-fill", type: "fill", source: o, "source-layer": "amm-taxiway", minzoom: 11, paint: { "fill-color": r.taxiway, "fill-opacity": 0.9 } },
3087
- { id: "amm-taxiway-line", type: "line", source: o, "source-layer": "amm-taxiway-line", minzoom: 11, paint: { "line-color": r.taxiwayLine, "line-width": ["interpolate", ["linear"], ["zoom"], 15, 0.8, 18, 2] } },
3088
- {
3089
- id: "amm-taxiway-label",
3090
- type: "symbol",
3091
- source: o,
3092
- "source-layer": "amm-taxiway-line",
3093
- minzoom: 14,
3094
- layout: { "text-field": ["get", "idlin"], "text-size": 10, "icon-image": "text_bg", "icon-text-fit": "both", "icon-text-fit-padding": [1, 2, 1, 2], "symbol-placement": "line", "text-keep-upright": !0, "text-allow-overlap": !1 },
3095
- paint: { "text-color": d, "icon-color": r.taxiwayLine }
3096
- },
3097
- { id: "amm-holding", type: "line", source: o, "source-layer": "amm-holding", minzoom: 11, paint: { "line-color": r.holding, "line-width": 1.5 } },
3098
- { id: "amm-runway-marking", type: "fill", source: o, "source-layer": "amm-runway-marking", minzoom: 13, paint: { "fill-color": r.runwayMarking, "fill-opacity": 0.85 } },
3099
- { id: "amm-restricted-fill", type: "fill", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "fill-color": r.restricted, "fill-opacity": 0.1 } },
3100
- { id: "amm-restricted-stroke", type: "line", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "line-color": r.restricted, "line-width": 1.2, "line-dasharray": [4, 2] } },
3101
- { id: "amm-hotspot-fill", type: "fill", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "fill-color": r.hotspot, "fill-opacity": 0.12 } },
3102
- { id: "amm-hotspot-stroke", type: "line", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "line-color": r.hotspot, "line-width": 1.2 } },
3103
- { id: "amm-runway-centerline", type: "line", source: o, "source-layer": "amm-runway-centerline", minzoom: 11, paint: { "line-color": r.runwayCenterline, "line-width": 1, "line-dasharray": [6, 3] } },
3104
- {
3105
- id: "amm-runway-info",
3106
- type: "symbol",
3107
- source: o,
3108
- "source-layer": "amm-runway-label",
3109
- minzoom: 13,
3110
- layout: { "text-field": ["concat", ["coalesce", ["get", "length"], ""], "×", ["coalesce", ["get", "width"], ""], "m"], "text-size": ["interpolate", ["exponential", 1.5], ["zoom"], 13, 10, 16, 13], "symbol-placement": "point", "text-rotate": ["coalesce", ["get", "bearing"], 0], "text-rotation-alignment": "map", "text-allow-overlap": !0, "text-ignore-placement": !0 },
3111
- paint: { "text-color": "#e4e4e7", "text-halo-color": d, "text-halo-width": 2 }
3112
- },
3113
- { id: "amm-stand-line", type: "line", source: o, "source-layer": "amm-stand-line", minzoom: 13, paint: { "line-color": r.standLine, "line-width": 1 } },
3114
- {
3115
- id: "amm-runway-threshold-label",
3116
- type: "symbol",
3117
- source: o,
3118
- "source-layer": "amm-runway-threshold",
3119
- minzoom: 12,
3120
- layout: { "icon-image": "text_bg", "icon-text-fit": "both", "icon-text-fit-padding": [1, 2, 1, 2], "text-field": ["get", "idthr"], "text-size": 14, "text-allow-overlap": !0, "text-rotation-alignment": "map", "icon-rotation-alignment": "map" },
3121
- paint: { "text-color": "#ffffff", "icon-color": r.threshold }
3122
- },
3123
- { id: "amm-stand", type: "circle", source: o, "source-layer": "amm-stand", minzoom: 12, paint: { "circle-color": r.stand, "circle-radius": 1.5 } },
3124
- {
3125
- id: "amm-stand-label",
3126
- type: "symbol",
3127
- source: o,
3128
- "source-layer": "amm-stand",
3129
- minzoom: 14,
3130
- layout: { "text-field": ["get", "idstd"], "text-size": 9, "text-anchor": "bottom", "text-offset": [0, -0.5], "text-allow-overlap": !1 },
3131
- paint: { "text-color": r.stand, "text-halo-color": d, "text-halo-width": 1 }
3132
- },
3133
- { id: "amm-obstacle-region-fill", type: "fill", source: o, "source-layer": "amm-obstacle-region", minzoom: 11, paint: { "fill-color": "#fef08a", "fill-opacity": 0.1 } },
3134
- { id: "amm-obstacle-region-stroke", type: "line", source: o, "source-layer": "amm-obstacle-region", minzoom: 11, paint: { "line-color": "#eab308", "line-width": 1.2, "line-dasharray": [1.5, 1] } },
3135
- { id: "amm-obstacle-point", type: "circle", source: o, "source-layer": "amm-obstacle-point", minzoom: 11, paint: { "circle-color": "#f97316", "circle-radius": 4, "circle-stroke-color": d, "circle-stroke-width": 1 } },
3136
- {
3137
- id: "amm-obstacle-point-label",
3138
- type: "symbol",
3139
- source: o,
3140
- "source-layer": "amm-obstacle-point",
3141
- minzoom: 14,
3142
- layout: { "text-field": ["coalesce", ["get", "ident"], ["get", "LABEL"]], "text-size": 9, "text-anchor": "bottom", "text-offset": [0, -0.5], "text-allow-overlap": !1 },
3143
- paint: { "text-color": "#fdba74", "text-halo-color": d, "text-halo-width": 1.2 }
3144
- },
3145
- { id: "amm-construction-fill", type: "fill", source: o, "source-layer": "amm-construction", minzoom: 11, paint: { "fill-pattern": "normal:passline", "fill-opacity": 0.6 } },
3146
- { id: "amm-construction-stroke", type: "line", source: o, "source-layer": "amm-construction", minzoom: 11, paint: { "line-color": "#ea580c", "line-width": 1.2, "line-dasharray": [4, 2] } },
3147
- {
3148
- id: "amm-construction-label",
3149
- type: "symbol",
3150
- source: o,
3151
- "source-layer": "amm-construction",
3152
- minzoom: 13,
3153
- layout: { "text-field": ["get", "text"], "text-size": 9, "text-anchor": "center", "symbol-placement": "point", "text-allow-overlap": !1 },
3154
- paint: { "text-color": "#f97316", "text-halo-color": d, "text-halo-width": 1 }
3155
- }
3156
- ];
3157
- }
3158
- function Mt(o = "amm", r = "light") {
3159
- return r === "dark" ? Qe(o) : r === "neutral" ? ti(o) : Je(o);
3160
- }
3161
- const ri = {
3162
- ammAirport: ["amm-airport-fill", "amm-airport-stroke"],
3163
- ammRunway: [
3164
- "amm-runway-fill",
3165
- "amm-runway-stroke",
3166
- "amm-runway-info",
3167
- "amm-runway-marking",
3168
- "amm-runway-centerline",
3169
- "amm-runway-threshold",
3170
- "amm-runway-threshold-label"
3171
- ],
3172
- ammApron: ["amm-apron-fill", "amm-apron-stroke"],
3173
- ammTaxiway: ["amm-taxiway-fill", "amm-taxiway-line", "amm-taxiway-label"],
3174
- ammHolding: ["amm-holding"],
3175
- ammStand: ["amm-stand", "amm-stand-label", "amm-stand-line"],
3176
- ammRestricted: ["amm-restricted-fill", "amm-restricted-stroke"],
3177
- ammHotspot: ["amm-hotspot-fill", "amm-hotspot-stroke"],
3178
- /** 障碍物(点 + 面) */
3179
- ammObstacle: [
3180
- "amm-obstacle-region-fill",
3181
- "amm-obstacle-region-stroke",
3182
- "amm-obstacle-point",
3183
- "amm-obstacle-point-label"
3184
- ],
3185
- ammConstruction: ["amm-construction-fill", "amm-construction-stroke", "amm-construction-label"]
3186
- }, ei = "https://aips.siniswift.com", ii = [
3187
- "interpolate",
3188
- ["linear"],
3189
- ["elevation"],
3190
- 0,
3191
- "#a8c98a",
3192
- 600,
3193
- "#cdd98a",
3194
- 1200,
3195
- "#e8d79a",
3196
- 2400,
3197
- "#c79a5b",
3198
- 3600,
3199
- "#9c6b3f",
3200
- 4500,
3201
- "#f2efe9"
3202
- ], Jt = [
3203
- "amm-airport-fill",
3204
- "amm-airport-stroke",
3205
- "amm-runway-fill",
3206
- "amm-runway-stroke",
3207
- "amm-runway-info",
3208
- "amm-runway-marking",
3209
- "amm-runway-centerline",
3210
- "amm-runway-threshold-label",
3211
- "amm-apron-fill",
3212
- "amm-apron-stroke",
3213
- "amm-taxiway-fill",
3214
- "amm-taxiway-line",
3215
- "amm-taxiway-label",
3216
- "amm-holding",
3217
- "amm-stand",
3218
- "amm-stand-label",
3219
- "amm-stand-line",
3220
- "amm-restricted-fill",
3221
- "amm-restricted-stroke",
3222
- "amm-hotspot-fill",
3223
- "amm-hotspot-stroke",
3224
- "amm-obstacle-region-fill",
3225
- "amm-obstacle-region-stroke",
3226
- "amm-obstacle-point",
3227
- "amm-obstacle-point-label",
3228
- "amm-construction-fill",
3229
- "amm-construction-stroke",
3230
- "amm-construction-label"
3231
- ], Zt = ["terrain-color", "terrain-hillshade"], Qt = ["contour-line", "contour-label"];
3232
- async function qt(o) {
3233
- const r = await fetch(o);
3234
- if (!r.ok) throw new Error(`fetch ${o} → ${r.status}`);
3235
- const d = r.headers.get("Content-Encoding"), y = r.headers.get("Content-Type") || "";
3236
- if (d === "gzip" || y.includes("json"))
3237
- return r.json();
3238
- const w = r.body.pipeThrough(new DecompressionStream("gzip"));
3239
- return new Response(w).json();
3240
- }
3241
- function Dt(o) {
3242
- const r = {};
3243
- for (const d of o) r[d.id] = d;
3244
- return r;
3245
- }
3246
- class ni {
3247
- /**
3248
- * @param {object} options
3249
- * @param {string|HTMLElement} options.container DOM element id or element
3250
- * @param {'light'|'dark'} [options.theme='light']
3251
- * @param {string} [options.apiUrl] Override server base URL
3252
- * @param {string} [options.spriteUrl] Override sprite server URL (defaults to apiUrl)
3253
- * @param {string} [options.period] Period id; defaults to latest
3254
- * @param {object} [options.layers] Initial layer visibility map
3255
- * @param {[number,number]} [options.center] Initial map center [lng, lat] (default [104, 36])
3256
- * @param {number} [options.zoom] Initial zoom level (default 4)
3257
- * @param {string} [options.terrainUrl] Terrain DEM tile URL template (default internal server)
3258
- */
3259
- constructor(r = {}) {
3260
- const {
3261
- container: d,
3262
- theme: y = "light",
3263
- apiUrl: w = ei,
3264
- spriteUrl: x,
3265
- period: b = null,
3266
- layers: v = {},
3267
- center: F = [104, 36],
3268
- zoom: A = 4,
3269
- terrainUrl: z = null
3270
- } = r;
3271
- return this._apiUrl = w.replace(/\/$/, ""), this._spriteUrl = (x ?? w).replace(/\/$/, ""), this._terrainUrl = z ?? `${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`, this._theme = y, this._period = b, this._center = F, this._zoom = A, this._ready = !1, this._layerVisible = {
3272
- // aviation groups — all visible by default
3273
- adiz: !0,
3274
- fir: !0,
3275
- restricted: !0,
3276
- controlled: !0,
3277
- segment: !0,
3278
- waypoint: !0,
3279
- waypointOffAirway: !0,
3280
- vor: !0,
3281
- ndb: !0,
3282
- airport: !0,
3283
- runway: !0,
3284
- // special groups
3285
- amm: !0,
3286
- terrain: !1,
3287
- contour: !1,
3288
- // user overrides
3289
- ...v
3290
- }, this._initMap(d), new Proxy(this, {
3291
- get(p, g) {
3292
- if (typeof g == "symbol" || Reflect.has(p, g)) {
3293
- const R = p[g];
3294
- return typeof R == "function" ? R.bind(p) : R;
3295
- }
3296
- const T = p._map;
3297
- if (!T) return;
3298
- const E = T[g];
3299
- return typeof E == "function" ? E.bind(T) : E;
3300
- },
3301
- set(p, g, T) {
3302
- return typeof g == "symbol" || Reflect.has(p, g) || !p._map ? p[g] = T : g in p._map ? p._map[g] = T : p[g] = T, !0;
3303
- },
3304
- has(p, g) {
3305
- return Reflect.has(p, g) || (p._map ? g in p._map : !1);
3306
- }
3307
- });
3308
- }
3309
- // ── Map initialization ────────────────────────────────────────────────────
3310
- _initMap(r) {
3311
- const d = ut[this._theme] ?? ut.light;
3312
- this._map = new $t.Map({
3313
- container: r,
3314
- style: {
3315
- version: 8,
3316
- glyphs: "https://aips.siniswift.com/mapsdk/glyphs/{fontstack}/{range}.pbf",
3317
- sprite: [
3318
- { id: "normal", url: `${this._spriteUrl}/sprites/sprite-color` },
3319
- { id: "default", url: `${this._spriteUrl}/sprites/sprite` },
3320
- { id: "v2", url: `${this._spriteUrl}/sprites/sprite-v2` },
3321
- { id: "plane", url: `${this._spriteUrl}/sprites/sprite-plane` }
3322
- ],
3323
- sources: {
3324
- land: { type: "geojson", data: { type: "FeatureCollection", features: [] } },
3325
- boundary: { type: "geojson", data: { type: "FeatureCollection", features: [] } }
3326
- },
3327
- layers: [
3328
- { id: "background", type: "background", paint: { "background-color": d.background } }
3329
- ]
3330
- },
3331
- center: this._center,
3332
- zoom: this._zoom,
3333
- minZoom: 0,
3334
- maxZoom: 17.5,
3335
- crossSourceCollisions: !1,
3336
- maxTileCacheSize: 512,
3337
- prefetchZoomDelta: 1,
3338
- fadeDuration: 0,
3339
- attributionControl: !1
3340
- }), this._map.on("load", async () => {
3341
- await this._initSources(), this._initLayers(), this._applyVisibility(), this._ready = !0, this._map.fire("aviation:ready");
3342
- });
3343
- }
3344
- async _initSources() {
3345
- if (!this._period)
3346
- try {
3347
- const y = await (await fetch(`${this._apiUrl}/api/periods`)).json();
3348
- this._period = y[y.length - 1];
3349
- } catch (d) {
3350
- console.warn("[AviationChart] fetchPeriods failed:", d), this._period = "latest";
3351
- }
3352
- this._map.addSource("navdata", {
3353
- type: "vector",
3354
- tiles: [`${this._apiUrl}/api/tiles/${this._period}/{z}/{x}/{y}.pbf`],
3355
- minzoom: 0.5,
3356
- maxzoom: 18
3357
- }), this._map.addSource("amm", {
3358
- type: "vector",
3359
- tiles: [`${this._apiUrl}/api/amm/{z}/{x}/{y}.pbf`],
3360
- minzoom: 11,
3361
- maxzoom: 18
3362
- }), this._map.addSource("terrain", {
3363
- type: "raster-dem",
3364
- tiles: [this._terrainUrl],
3365
- tileSize: 256,
3366
- encoding: "mapbox",
3367
- maxzoom: 8
3368
- });
3369
- const r = new Xe.DemSource({
3370
- url: this._terrainUrl,
3371
- encoding: "mapbox",
3372
- maxzoom: 8,
3373
- worker: !0
3374
- });
3375
- r.setupMaplibre($t), this._map.addSource("contour", {
3376
- type: "vector",
3377
- tiles: [r.contourProtocolUrl({
3378
- thresholds: {
3379
- 5: [250, 1e3],
3380
- 7: [125, 500],
3381
- 9: [100, 500],
3382
- 11: [50, 500],
3383
- 13: [25, 500]
3384
- },
3385
- elevationKey: "ele",
3386
- levelKey: "level",
3387
- contourLayer: "contours"
3388
- })],
3389
- maxzoom: 13
3390
- }), await this._loadBaseData();
3391
- }
3392
- async _loadBaseData() {
3393
- var r, d, y, w;
3394
- try {
3395
- const [x, b] = await Promise.all([
3396
- qt(`${this._apiUrl}/topjson/land.topojson.gz`),
3397
- qt(`${this._apiUrl}/topjson/boundary.topojson.gz`)
3398
- ]);
3399
- (r = x == null ? void 0 : x.objects) != null && r.land ? (d = this._map.getSource("land")) == null || d.setData(Kt(x, x.objects.land)) : console.warn("[AviationChart] land topojson missing objects.land"), (y = b == null ? void 0 : b.objects) != null && y.boundary ? (w = this._map.getSource("boundary")) == null || w.setData(Kt(b, b.objects.boundary)) : console.warn("[AviationChart] boundary topojson missing objects.boundary");
3400
- } catch (x) {
3401
- console.error("[AviationChart] loadBaseData failed:", x);
3402
- }
3403
- }
3404
- _initLayers() {
3405
- const r = this._layerVisible.terrain ? "visible" : "none", d = this._layerVisible.contour ? "visible" : "none";
3406
- this._map.addLayer({
3407
- id: "terrain-color",
3408
- type: "color-relief",
3409
- source: "terrain",
3410
- layout: { visibility: r },
3411
- paint: { "color-relief-color": ii }
3412
- }), this._map.addLayer({
3413
- id: "terrain-hillshade",
3414
- type: "hillshade",
3415
- source: "terrain",
3416
- layout: { visibility: r },
3417
- paint: {
3418
- "hillshade-shadow-color": "rgba(74,59,42,0.35)",
3419
- "hillshade-highlight-color": "rgba(255,246,230,0.25)",
3420
- "hillshade-accent-color": "rgba(74,59,42,0.2)",
3421
- "hillshade-exaggeration": 0.45,
3422
- "hillshade-illumination-direction": 315,
3423
- "hillshade-illumination-anchor": "viewport"
3424
- }
3425
- }), this._map.addLayer({
3426
- id: "contour-line",
3427
- type: "line",
3428
- source: "contour",
3429
- "source-layer": "contours",
3430
- layout: { visibility: d },
3431
- paint: {
3432
- "line-color": ["case", ["==", ["get", "level"], 1], "rgba(100,70,40,0.40)", "rgba(120,90,60,0.18)"],
3433
- "line-width": ["case", ["==", ["get", "level"], 1], 1, 0.5]
3434
- }
3435
- }), this._map.addLayer({
3436
- id: "contour-label",
3437
- type: "symbol",
3438
- source: "contour",
3439
- "source-layer": "contours",
3440
- filter: ["==", ["get", "level"], 1],
3441
- layout: {
3442
- visibility: d,
3443
- "symbol-placement": "line",
3444
- "text-field": ["concat", ["to-string", ["get", "ele"]], "m"],
3445
- "text-size": 10,
3446
- "text-font": ["Open Sans Regular"],
3447
- "text-allow-overlap": !0,
3448
- "text-keep-upright": !0
3449
- },
3450
- paint: {
3451
- "text-color": "rgba(100,70,40,0.55)",
3452
- "text-halo-color": "rgba(255,255,255,0.6)",
3453
- "text-halo-width": 1
3454
- }
3455
- }), this._layerVisible.terrain && this._map.setTerrain({ source: "terrain", exaggeration: 4 });
3456
- for (const y of Pt(this._theme))
3457
- this._map.getLayer(y.id) || this._map.addLayer(y);
3458
- for (const y of ["terrain-color", "terrain-hillshade", "contour-line", "contour-label"])
3459
- this._map.getLayer(y) && this._map.getLayer("boundary") && this._map.moveLayer(y, "boundary");
3460
- for (const y of Mt("amm", this._theme))
3461
- this._map.getLayer(y.id) || this._map.addLayer(y, "fir-line");
3462
- }
3463
- _applyVisibility() {
3464
- for (const [w, x] of Object.entries(Yt)) {
3465
- const b = this._layerVisible[w] !== !1 ? "visible" : "none";
3466
- for (const v of x)
3467
- this._map.getLayer(v) && this._map.setLayoutProperty(v, "visibility", b);
3468
- }
3469
- const r = this._layerVisible.amm !== !1 ? "visible" : "none";
3470
- for (const w of Jt)
3471
- this._map.getLayer(w) && this._map.setLayoutProperty(w, "visibility", r);
3472
- const d = this._layerVisible.terrain ? "visible" : "none";
3473
- for (const w of Zt)
3474
- this._map.getLayer(w) && this._map.setLayoutProperty(w, "visibility", d);
3475
- const y = this._layerVisible.contour ? "visible" : "none";
3476
- for (const w of Qt)
3477
- this._map.getLayer(w) && this._map.setLayoutProperty(w, "visibility", y);
3478
- }
3479
- // ── Public API ────────────────────────────────────────────────────────────
3480
- /** Raw MapLibre Map instance */
3481
- get map() {
3482
- return this._map;
3483
- }
3484
- /** Currently active theme id */
3485
- get theme() {
3486
- return this._theme;
3487
- }
3488
- /** Currently active period id */
3489
- get period() {
3490
- return this._period;
3491
- }
3492
- /**
3493
- * Switch the chart theme.
3494
- * @param {'light'|'dark'} theme
3495
- */
3496
- setTheme(r) {
3497
- if (r === this._theme) return;
3498
- const d = this._theme;
3499
- this._theme = r;
3500
- const y = ut[r] ?? ut.light;
3501
- this._map.setPaintProperty("background", "background-color", y.background);
3502
- const w = Dt(Pt(r)), x = Dt(Pt(d)), b = Dt(Mt("amm", r)), v = Dt(Mt("amm", d));
3503
- Object.assign(w, b), Object.assign(x, v);
3504
- for (const F of Object.keys(w))
3505
- this._map.getLayer(F) && this._applyThemedProps(F, x[F], w[F]);
3506
- this._applyVisibility();
3507
- }
3508
- /**
3509
- * Apply a layer definition's paint + layout properties in place. Properties
3510
- * present in the previous theme but absent in the next are reset to default
3511
- * (set to undefined) so no stale styling lingers.
3512
- * @private
3513
- */
3514
- _applyThemedProps(r, d, y) {
3515
- const w = this._map, x = {
3516
- paint: (b, v) => w.setPaintProperty(r, b, v),
3517
- layout: (b, v) => w.setLayoutProperty(r, b, v)
3518
- };
3519
- for (const b of ["paint", "layout"]) {
3520
- const v = d && d[b] || {}, F = y && y[b] || {}, A = /* @__PURE__ */ new Set([...Object.keys(v), ...Object.keys(F)]);
3521
- for (const z of A) {
3522
- if (b === "layout" && z === "visibility") continue;
3523
- const p = F[z], g = v[z];
3524
- JSON.stringify(p) !== JSON.stringify(g) && x[b](z, p);
3525
- }
3526
- }
3527
- }
3528
- /**
3529
- * Show or hide a built-in layer group.
3530
- *
3531
- * Aviation groups: 'adiz' | 'fir' | 'restricted' | 'controlled' |
3532
- * 'segment' | 'waypoint' | 'waypointOffAirway' | 'vor' | 'ndb' |
3533
- * 'airport' | 'runway'
3534
- * Special groups: 'amm' | 'terrain' | 'contour'
3535
- *
3536
- * @param {string} key
3537
- * @param {boolean} visible
3538
- */
3539
- setLayerVisible(r, d) {
3540
- if (this._layerVisible[r] = d, r === "terrain") {
3541
- const x = d ? "visible" : "none";
3542
- for (const b of Zt)
3543
- this._map.getLayer(b) && this._map.setLayoutProperty(b, "visibility", x);
3544
- this._map.setTerrain(d ? { source: "terrain", exaggeration: 4 } : null);
3545
- return;
3546
- }
3547
- if (r === "contour") {
3548
- const x = d ? "visible" : "none";
3549
- for (const b of Qt)
3550
- this._map.getLayer(b) && this._map.setLayoutProperty(b, "visibility", x);
3551
- return;
3552
- }
3553
- if (r === "amm") {
3554
- const x = d ? "visible" : "none";
3555
- for (const b of Jt)
3556
- this._map.getLayer(b) && this._map.setLayoutProperty(b, "visibility", x);
3557
- return;
3558
- }
3559
- const y = Yt[r];
3560
- if (!y) {
3561
- console.warn(`[AviationChart] Unknown layer key: "${r}"`);
3562
- return;
3563
- }
3564
- const w = d ? "visible" : "none";
3565
- for (const x of y)
3566
- this._map.getLayer(x) && this._map.setLayoutProperty(x, "visibility", w);
3567
- }
3568
- /**
3569
- * Switch the navdata period. Fetches tiles for the new period immediately.
3570
- * @param {string} period
3571
- */
3572
- setPeriod(r) {
3573
- var y;
3574
- this._period = r;
3575
- const d = (y = this._map) == null ? void 0 : y.getSource("navdata");
3576
- d && d.setTiles([`${this._apiUrl}/api/tiles/${r}/{z}/{x}/{y}.pbf`]);
3577
- }
3578
- /**
3579
- * Proxy to map.on. Supports both signatures:
3580
- * on(event, listener)
3581
- * on(event, layerId, listener) ← layer-delegated events
3582
- * Returns `this` for chaining.
3583
- */
3584
- on(r, d, y) {
3585
- return typeof d == "string" ? this._map.on(r, d, y) : this._map.on(r, d ?? y), this;
3586
- }
3587
- /**
3588
- * Proxy to map.off. Supports both signatures:
3589
- * off(event, listener)
3590
- * off(event, layerId, listener)
3591
- * Returns `this` for chaining.
3592
- */
3593
- off(r, d, y) {
3594
- return typeof d == "string" ? this._map.off(r, d, y) : this._map.off(r, d ?? y), this;
3595
- }
3596
- /** Proxy to map.once — supports layer-delegated signature too. */
3597
- once(r, d, y) {
3598
- return typeof d == "string" ? this._map.once(r, d, y) : this._map.once(r, d ?? y), this;
3599
- }
3600
- /** Remove the map and release all resources */
3601
- destroy() {
3602
- this._map && (this._map.remove(), this._map = null);
3603
- }
3604
- }
3605
- export {
3606
- ri as AMM_LAYER_GROUPS,
3607
- ni as AviationChart,
3608
- ut as CHART_THEMES,
3609
- Yt as LAYER_GROUPS
3610
- };