aviation-chart 0.1.35 → 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 -3571
  86. package/preview.html +0 -48
package/dist/index.js DELETED
@@ -1,3571 +0,0 @@
1
- import jt from "maplibre-gl";
2
- var vt, Rt, Pt;
3
- function Ot(o, r) {
4
- if (!vt)
5
- vt = r;
6
- else if (!Rt)
7
- Rt = r;
8
- else {
9
- var d = "var sharedChunk = {}; (" + vt + ")(sharedChunk); (" + Rt + ")(sharedChunk);", y = {};
10
- vt(y), Pt = r(y), typeof window < "u" && (Pt.workerUrl = window.URL.createObjectURL(
11
- new Blob([d], { type: "text/javascript" })
12
- ));
13
- }
14
- }
15
- Ot(["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, n) {
136
- return e = e * 2 + n[0], i = i * 2 + n[1], e + i * (t + 1) * 2;
137
- }
138
- function g(t, e, i) {
139
- return (e - t) / (i - t);
140
- }
141
- function w(t, e, i = 4096, n = 1) {
142
- if (!t)
143
- return {};
144
- const a = i / (e.width - 1);
145
- let l, s, c, m, h, f;
146
- const u = {}, _ = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
147
- function M(P, L, R) {
148
- P[0] === 0 ? R(a * (f - 1), a * (h - g(c, L, l))) : P[0] === 2 ? R(a * f, a * (h - g(m, L, s))) : P[1] === 0 ? R(a * (f - g(s, L, l)), a * (h - 1)) : R(a * (f - g(m, L, c)), a * h);
149
- }
150
- for (h = 1 - n; h < e.height + n; h++) {
151
- s = e.get(0, h - 1), m = e.get(0, h);
152
- let P = Math.min(s, m), L = Math.max(s, m);
153
- for (f = 1 - n; f < e.width + n; f++) {
154
- l = s, c = m, s = e.get(f, h - 1), m = e.get(f, h);
155
- const R = P, V = L;
156
- if (P = Math.min(s, m), L = Math.max(s, m), isNaN(l) || isNaN(s) || isNaN(m) || isNaN(c))
157
- continue;
158
- const dt = Math.min(R, P), pt = Math.max(V, L), X = Math.ceil(dt / t) * t, ot = Math.floor(pt / t) * t;
159
- for (let C = X; C <= ot; C += t) {
160
- const kt = l > C, q = s > C, nt = c > C, _t = m > C;
161
- for (const bt of d[(kt ? 8 : 0) | (q ? 4 : 0) | (_t ? 2 : 0) | (nt ? 1 : 0)]) {
162
- let H = _.get(C);
163
- H || _.set(C, H = /* @__PURE__ */ new Map());
164
- let lt = F.get(C);
165
- lt || F.set(C, lt = /* @__PURE__ */ new Map());
166
- const At = bt[0], zt = bt[1], yt = y(e.width, f, h, At), st = y(e.width, f, h, zt);
167
- let I, Tt;
168
- if (I = lt.get(yt))
169
- if (lt.delete(yt), Tt = H.get(st))
170
- if (H.delete(st), I === Tt) {
171
- if (M(zt, C, I.append), !I.isEmpty()) {
172
- let rt = u[C];
173
- rt || (u[C] = rt = []), rt.push(I.lineString());
174
- }
175
- } else
176
- I.appendFragment(Tt), lt.set(I.end = Tt.end, I);
177
- else
178
- M(zt, C, I.append), lt.set(I.end = st, I);
179
- else if (I = H.get(st))
180
- H.delete(st), M(At, C, I.prepend), H.set(I.start = yt, I);
181
- else {
182
- const rt = new r(yt, st);
183
- M(At, C, rt.append), M(zt, C, rt.append), H.set(yt, rt), lt.set(st, rt);
184
- }
185
- }
186
- }
187
- }
188
- }
189
- for (const [P, L] of _.entries()) {
190
- let R = null;
191
- for (const V of L.values())
192
- V.isEmpty() || (R == null && (R = u[P] || (u[P] = [])), R.push(V.lineString()));
193
- }
194
- return u;
195
- }
196
- function b(t) {
197
- const e = Object.entries(t);
198
- return e.sort(([i], [n]) => i < n ? -1 : i > n ? 1 : 0), e;
199
- }
200
- function S(t) {
201
- return b(t).map(([e, i]) => [e, ...typeof i == "number" ? [i] : i].join("*")).join("~");
202
- }
203
- function O(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: S(t), ...e }).map(([i, n]) => `${encodeURIComponent(i)}=${encodeURIComponent(n)}`).join("&");
208
- }
209
- function z(t) {
210
- return Object.fromEntries(t.replace(/^.*\?/, "").split("&").map((e) => {
211
- const i = e.split("=").map(decodeURIComponent), n = i[0];
212
- let a = i[1];
213
- switch (n) {
214
- case "thresholds":
215
- a = O(a);
216
- break;
217
- case "extent":
218
- case "multiplier":
219
- case "overzoom":
220
- case "buffer":
221
- a = Number(a);
222
- }
223
- return [n, a];
224
- }));
225
- }
226
- function p(t) {
227
- return b(t).map(([e, i]) => `${encodeURIComponent(e)}=${encodeURIComponent(i)}`).join(",");
228
- }
229
- function x(t, e) {
230
- const { thresholds: i, ...n } = t;
231
- let a = [], l = -1 / 0;
232
- return Object.entries(i).forEach(([s, c]) => {
233
- const m = Number(s);
234
- m <= e && m > l && (l = m, a = typeof c == "number" ? [c] : c);
235
- }), {
236
- levels: a,
237
- ...n
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 D(t, e) {
245
- return t.then(({ data: i, ...n }) => {
246
- let a = i;
247
- return e && (a = new Float32Array(i.length), a.set(i)), { ...n, data: a, transferrables: [a.buffer] };
248
- });
249
- }
250
- function k(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 a = 0; a < 5 * 5; a++) {
269
- const l = a * 4;
270
- i.fillStyle = `rgb(${l},${l + 1},${l + 2})`, i.fillRect(a % 5, Math.floor(a / 5), 1, 1);
271
- }
272
- const n = i.getImageData(0, 0, 5, 5).data;
273
- for (let a = 0; a < 5 * 5 * 4; a++)
274
- if (a % 4 !== 3 && n[a] !== a) {
275
- tt = !0;
276
- break;
277
- }
278
- }
279
- }
280
- return tt || !1;
281
- }
282
- function G(t, e, i) {
283
- let n = () => {
284
- };
285
- const a = setTimeout(() => {
286
- n(new Error("timed out")), i == null || i.abort();
287
- }, t);
288
- U(i, () => {
289
- n(new Error("aborted")), clearTimeout(a);
290
- });
291
- const l = new Promise((s, c) => {
292
- n = c;
293
- });
294
- return Promise.race([
295
- l,
296
- e.finally(() => clearTimeout(a))
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 E = 0;
307
- class Z {
308
- constructor(e = 100) {
309
- this.size = () => this.items.size, this.get = (i, n, a) => {
310
- let l = this.items.get(i);
311
- if (l)
312
- l.lastUsed = ++E, l.waiting++;
313
- else {
314
- const h = new AbortController(), f = n(i, h);
315
- l = {
316
- abortController: h,
317
- item: f,
318
- lastUsed: ++E,
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(a, () => {
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((n, a) => {
334
- n.lastUsed < i && (i = n.lastUsed, e = a);
335
- }), typeof e < "u" && this.items.delete(e);
336
- }
337
- }
338
- }
339
- let K, et, N, it;
340
- async function at(t, e, i) {
341
- const n = await createImageBitmap(t);
342
- return B(i) ? null : W(n, 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
- })), It(t, e, K, et);
348
- }
349
- async function xt(t, e, i) {
350
- var n, a, 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 (!(((n = c == null ? void 0 : c.format) === null || n === void 0 ? void 0 : n.startsWith("BGR")) || ((a = c == null ? void 0 : c.format) === null || a === void 0 ? void 0 : a.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 F = u[_];
362
- u[_] = u[_ + 2], u[_ + 2] = F;
363
- }
364
- return Dt(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 qt(t, e, i) {
372
- N || (N = document.createElement("canvas"), it = N.getContext("2d", {
373
- willReadFrequently: !0
374
- }));
375
- const n = new Image();
376
- U(i, () => n.src = "");
377
- const a = await new Promise((l, s) => {
378
- n.onload = () => {
379
- B(i) || l(n), URL.revokeObjectURL(n.src), n.onload = null;
380
- }, n.onerror = () => s(new Error("Could not load image.")), n.src = t.size ? URL.createObjectURL(t) : "";
381
- });
382
- return It(a, e, N, it);
383
- }
384
- function te(t, e, i) {
385
- return self.actor.send("decodeImage", [], i, void 0, t, e);
386
- }
387
- function ee() {
388
- return (
389
- // @ts-ignore
390
- typeof WorkerGlobalScope < "u" && typeof self < "u" && // @ts-ignore
391
- self instanceof WorkerGlobalScope
392
- );
393
- }
394
- const Lt = Y() ? xt : ct() ? at : ee() ? te : qt;
395
- function It(t, e, i, n) {
396
- if (i.width = t.width, i.height = t.height, !n)
397
- throw new Error("failed to get context");
398
- n.drawImage(t, 0, 0, t.width, t.height);
399
- const a = n.getImageData(0, 0, t.width, t.height).data;
400
- return Dt(t.width, t.height, e, a);
401
- }
402
- function Dt(t, e, i, n) {
403
- const a = 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 < n.length; s += 4)
405
- l[s / 4] = a(n[s], n[s + 1], n[s + 2]);
406
- return { width: t, height: e, data: l };
407
- }
408
- const ie = -12e3, oe = 9e3;
409
- function re(t) {
410
- return !isNaN(t) && t >= ie && t <= oe;
411
- }
412
- class $ {
413
- constructor(e, i, n) {
414
- this.split = (a, l, s) => {
415
- if (a === 0)
416
- return this;
417
- const c = 1 << a, 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 = (a) => {
420
- const l = (m, h, f) => isNaN(m) ? h : isNaN(h) ? m : m + (h - m) * f;
421
- if (a <= 1)
422
- return this;
423
- const s = 0.5 - 1 / (2 * a), c = (m, h) => {
424
- const f = m / a - s, u = h / a - s, _ = Math.floor(f), F = Math.floor(u), M = this.get(_, F), P = this.get(_ + 1, F), L = this.get(_, F + 1), R = this.get(_ + 1, F + 1), V = f - _, dt = u - F, pt = l(M, P, V), X = l(L, R, V);
425
- return l(pt, X, dt);
426
- };
427
- return new $(this.width * a, this.height * a, c);
428
- }, this.averagePixelCentersToGrid = (a = 1) => new $(this.width + 1, this.height + 1, (l, s) => {
429
- let c = 0, m = 0, h = 0;
430
- for (let f = l - a; f < l + a; f++)
431
- for (let u = s - a; u < s + a; u++)
432
- isNaN(h = this.get(f, u)) || (m++, c += h);
433
- return m === 0 ? NaN : c / m;
434
- }), this.scaleElevation = (a) => a === 1 ? this : new $(this.width, this.height, (l, s) => this.get(l, s) * a), this.materialize = (a = 2) => {
435
- const l = this.width + 2 * a, s = new Float32Array(l * (this.height + 2 * a));
436
- let c = 0;
437
- for (let m = -a; m < this.height + a; m++)
438
- for (let h = -a; h < this.width + a; h++)
439
- s[c++] = this.get(h, m);
440
- return new $(this.width, this.height, (m, h) => s[(h + a) * l + m + a]);
441
- }, this.get = n, 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, n) => {
446
- const a = e.data[n * e.width + i];
447
- return re(a) ? a : 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 n = i.width, a = i.height;
463
- return new $(n, a, (l, s) => {
464
- let c = 0;
465
- s < 0 ? s += a : s < a ? c += 3 : (s -= a, c += 6), l < 0 ? l += n : l < n ? c += 1 : (l -= n, 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 Et = {};
475
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
476
- Et.read = function(t, e, i, n, a) {
477
- var l, s, c = a * 8 - n - 1, m = (1 << c) - 1, h = m >> 1, f = -7, u = i ? a - 1 : 0, _ = i ? -1 : 1, F = t[e + u];
478
- for (u += _, l = F & (1 << -f) - 1, F >>= -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 += n; 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 : (F ? -1 : 1) * (1 / 0);
487
- s = s + Math.pow(2, n), l = l - h;
488
- }
489
- return (F ? -1 : 1) * s * Math.pow(2, l - n);
490
- }, Et.write = function(t, e, i, n, a, l) {
491
- var s, c, m, h = l * 8 - a - 1, f = (1 << h) - 1, u = f >> 1, _ = a === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, F = n ? 0 : l - 1, M = n ? 1 : -1, P = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
492
- for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (c = isNaN(e) ? 1 : 0, s = 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, a), s = s + u) : (c = e * Math.pow(2, u - 1) * Math.pow(2, a), s = 0)); a >= 8; t[i + F] = c & 255, F += M, c /= 256, a -= 8)
493
- ;
494
- for (s = s << a | c, h += a; h > 0; t[i + F] = s & 255, F += M, s /= 256, h -= 8)
495
- ;
496
- t[i + F - M] |= P * 128;
497
- };
498
- var ne = v, gt = Et;
499
- function v(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
- v.Varint = 0, v.Fixed64 = 1, v.Bytes = 2, v.Fixed32 = 5;
503
- var Ft = 65536 * 65536, Gt = 1 / Ft, le = 12, Bt = typeof TextDecoder > "u" ? null : new TextDecoder("utf8");
504
- v.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 n = this.readVarint(), a = n >> 3, l = this.pos;
512
- this.type = n & 7, t(a, e, this), this.pos === l && this.skip(n);
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 = Nt(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) * Ft;
530
- return this.pos += 8, t;
531
- },
532
- readSFixed64: function() {
533
- var t = wt(this.buf, this.pos) + Nt(this.buf, this.pos + 4) * Ft;
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, n;
546
- return n = e[this.pos++], i = n & 127, n < 128 || (n = e[this.pos++], i |= (n & 127) << 7, n < 128) || (n = e[this.pos++], i |= (n & 127) << 14, n < 128) || (n = e[this.pos++], i |= (n & 127) << 21, n < 128) ? i : (n = e[this.pos], i |= (n & 15) << 28, se(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 >= le && Bt ? ze(this.buf, e, t) : be(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 !== v.Bytes) return t.push(this.readVarint(e));
569
- var i = J(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 !== v.Bytes) return t.push(this.readSVarint());
575
- var e = J(this);
576
- for (t = t || []; this.pos < e; ) t.push(this.readSVarint());
577
- return t;
578
- },
579
- readPackedBoolean: function(t) {
580
- if (this.type !== v.Bytes) return t.push(this.readBoolean());
581
- var e = J(this);
582
- for (t = t || []; this.pos < e; ) t.push(this.readBoolean());
583
- return t;
584
- },
585
- readPackedFloat: function(t) {
586
- if (this.type !== v.Bytes) return t.push(this.readFloat());
587
- var e = J(this);
588
- for (t = t || []; this.pos < e; ) t.push(this.readFloat());
589
- return t;
590
- },
591
- readPackedDouble: function(t) {
592
- if (this.type !== v.Bytes) return t.push(this.readDouble());
593
- var e = J(this);
594
- for (t = t || []; this.pos < e; ) t.push(this.readDouble());
595
- return t;
596
- },
597
- readPackedFixed32: function(t) {
598
- if (this.type !== v.Bytes) return t.push(this.readFixed32());
599
- var e = J(this);
600
- for (t = t || []; this.pos < e; ) t.push(this.readFixed32());
601
- return t;
602
- },
603
- readPackedSFixed32: function(t) {
604
- if (this.type !== v.Bytes) return t.push(this.readSFixed32());
605
- var e = J(this);
606
- for (t = t || []; this.pos < e; ) t.push(this.readSFixed32());
607
- return t;
608
- },
609
- readPackedFixed64: function(t) {
610
- if (this.type !== v.Bytes) return t.push(this.readFixed64());
611
- var e = J(this);
612
- for (t = t || []; this.pos < e; ) t.push(this.readFixed64());
613
- return t;
614
- },
615
- readPackedSFixed64: function(t) {
616
- if (this.type !== v.Bytes) return t.push(this.readSFixed64());
617
- var e = J(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 === v.Varint) for (; this.buf[this.pos++] > 127; )
624
- ;
625
- else if (e === v.Bytes) this.pos = this.readVarint() + this.pos;
626
- else if (e === v.Fixed32) this.pos += 4;
627
- else if (e === v.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 * Gt), 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 * Gt), this.pos + 4), this.pos += 8;
655
- },
656
- writeVarint: function(t) {
657
- if (t = +t || 0, t > 268435455 || t < 0) {
658
- ce(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 = Te(this.buf, t, this.pos);
673
- var i = this.pos - e;
674
- i >= 128 && Xt(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 n = this.pos - i;
692
- n >= 128 && Xt(i, n, this), this.pos = i - 1, this.writeVarint(n), this.pos += n;
693
- },
694
- writeMessage: function(t, e, i) {
695
- this.writeTag(t, v.Bytes), this.writeRawMessage(e, i);
696
- },
697
- writePackedVarint: function(t, e) {
698
- e.length && this.writeMessage(t, fe, e);
699
- },
700
- writePackedSVarint: function(t, e) {
701
- e.length && this.writeMessage(t, de, e);
702
- },
703
- writePackedBoolean: function(t, e) {
704
- e.length && this.writeMessage(t, ye, e);
705
- },
706
- writePackedFloat: function(t, e) {
707
- e.length && this.writeMessage(t, ue, e);
708
- },
709
- writePackedDouble: function(t, e) {
710
- e.length && this.writeMessage(t, pe, e);
711
- },
712
- writePackedFixed32: function(t, e) {
713
- e.length && this.writeMessage(t, xe, e);
714
- },
715
- writePackedSFixed32: function(t, e) {
716
- e.length && this.writeMessage(t, ge, e);
717
- },
718
- writePackedFixed64: function(t, e) {
719
- e.length && this.writeMessage(t, we, 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, v.Bytes), this.writeBytes(e);
726
- },
727
- writeFixed32Field: function(t, e) {
728
- this.writeTag(t, v.Fixed32), this.writeFixed32(e);
729
- },
730
- writeSFixed32Field: function(t, e) {
731
- this.writeTag(t, v.Fixed32), this.writeSFixed32(e);
732
- },
733
- writeFixed64Field: function(t, e) {
734
- this.writeTag(t, v.Fixed64), this.writeFixed64(e);
735
- },
736
- writeSFixed64Field: function(t, e) {
737
- this.writeTag(t, v.Fixed64), this.writeSFixed64(e);
738
- },
739
- writeVarintField: function(t, e) {
740
- this.writeTag(t, v.Varint), this.writeVarint(e);
741
- },
742
- writeSVarintField: function(t, e) {
743
- this.writeTag(t, v.Varint), this.writeSVarint(e);
744
- },
745
- writeStringField: function(t, e) {
746
- this.writeTag(t, v.Bytes), this.writeString(e);
747
- },
748
- writeFloatField: function(t, e) {
749
- this.writeTag(t, v.Fixed32), this.writeFloat(e);
750
- },
751
- writeDoubleField: function(t, e) {
752
- this.writeTag(t, v.Fixed64), this.writeDouble(e);
753
- },
754
- writeBooleanField: function(t, e) {
755
- this.writeVarintField(t, !!e);
756
- }
757
- };
758
- function se(t, e, i) {
759
- var n = i.buf, a, l;
760
- if (l = n[i.pos++], a = (l & 112) >> 4, l < 128 || (l = n[i.pos++], a |= (l & 127) << 3, l < 128) || (l = n[i.pos++], a |= (l & 127) << 10, l < 128) || (l = n[i.pos++], a |= (l & 127) << 17, l < 128) || (l = n[i.pos++], a |= (l & 127) << 24, l < 128) || (l = n[i.pos++], a |= (l & 1) << 31, l < 128)) return mt(t, a, e);
761
- throw new Error("Expected varint not more than 10 bytes");
762
- }
763
- function J(t) {
764
- return t.type === v.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 ce(t, e) {
770
- var i, n;
771
- if (t >= 0 ? (i = t % 4294967296 | 0, n = t / 4294967296 | 0) : (i = ~(-t % 4294967296), n = ~(-t / 4294967296), i ^ 4294967295 ? i = i + 1 | 0 : (i = 0, n = n + 1 | 0)), t >= 18446744073709552e3 || t < -18446744073709552e3)
772
- throw new Error("Given varint doesn't fit into 10 bytes");
773
- e.realloc(10), me(i, n, e), he(n, e);
774
- }
775
- function me(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 he(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 Xt(t, e, i) {
783
- var n = e <= 16383 ? 1 : e <= 2097151 ? 2 : e <= 268435455 ? 3 : Math.floor(Math.log(e) / (Math.LN2 * 7));
784
- i.realloc(n);
785
- for (var a = i.pos - 1; a >= t; a--) i.buf[a + n] = i.buf[a];
786
- }
787
- function fe(t, e) {
788
- for (var i = 0; i < t.length; i++) e.writeVarint(t[i]);
789
- }
790
- function de(t, e) {
791
- for (var i = 0; i < t.length; i++) e.writeSVarint(t[i]);
792
- }
793
- function ue(t, e) {
794
- for (var i = 0; i < t.length; i++) e.writeFloat(t[i]);
795
- }
796
- function pe(t, e) {
797
- for (var i = 0; i < t.length; i++) e.writeDouble(t[i]);
798
- }
799
- function ye(t, e) {
800
- for (var i = 0; i < t.length; i++) e.writeBoolean(t[i]);
801
- }
802
- function xe(t, e) {
803
- for (var i = 0; i < t.length; i++) e.writeFixed32(t[i]);
804
- }
805
- function ge(t, e) {
806
- for (var i = 0; i < t.length; i++) e.writeSFixed32(t[i]);
807
- }
808
- function we(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 Nt(t, e) {
821
- return (t[e] | t[e + 1] << 8 | t[e + 2] << 16) + (t[e + 3] << 24);
822
- }
823
- function be(t, e, i) {
824
- for (var n = "", a = e; a < i; ) {
825
- var l = t[a], s = null, c = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1;
826
- if (a + c > i) break;
827
- var m, h, f;
828
- c === 1 ? l < 128 && (s = l) : c === 2 ? (m = t[a + 1], (m & 192) === 128 && (s = (l & 31) << 6 | m & 63, s <= 127 && (s = null))) : c === 3 ? (m = t[a + 1], h = t[a + 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[a + 1], h = t[a + 2], f = t[a + 3], (m & 192) === 128 && (h & 192) === 128 && (f & 192) === 128 && (s = (l & 15) << 18 | (m & 63) << 12 | (h & 63) << 6 | f & 63, (s <= 65535 || s >= 1114112) && (s = null))), s === null ? (s = 65533, c = 1) : s > 65535 && (s -= 65536, n += String.fromCharCode(s >>> 10 & 1023 | 55296), s = 56320 | s & 1023), n += String.fromCharCode(s), a += c;
829
- }
830
- return n;
831
- }
832
- function ze(t, e, i) {
833
- return Bt.decode(t.subarray(e, i));
834
- }
835
- function Te(t, e, i) {
836
- for (var n = 0, a, l; n < e.length; n++) {
837
- if (a = e.charCodeAt(n), a > 55295 && a < 57344)
838
- if (l)
839
- if (a < 56320) {
840
- t[i++] = 239, t[i++] = 191, t[i++] = 189, l = a;
841
- continue;
842
- } else
843
- a = l - 55296 << 10 | a - 56320 | 65536, l = null;
844
- else {
845
- a > 56319 || n + 1 === e.length ? (t[i++] = 239, t[i++] = 191, t[i++] = 189) : l = a;
846
- continue;
847
- }
848
- else l && (t[i++] = 239, t[i++] = 191, t[i++] = 189, l = null);
849
- a < 128 ? t[i++] = a : (a < 2048 ? t[i++] = a >> 6 | 192 : (a < 65536 ? t[i++] = a >> 12 | 224 : (t[i++] = a >> 18 | 240, t[i++] = a >> 12 & 63 | 128), t[i++] = a >> 6 & 63 | 128), t[i++] = a & 63 | 128);
850
- }
851
- return i;
852
- }
853
- var ve = /* @__PURE__ */ ae(ne), 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 De(t) {
858
- const e = new ve();
859
- for (const i in t.layers) {
860
- const n = t.layers[i];
861
- n.extent || (n.extent = t.extent), e.writeMessage(3, Ee, { ...n, id: i });
862
- }
863
- return e.finish();
864
- }
865
- function Ee(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 n of t.features)
876
- i.feature = n, e.writeMessage(2, Fe, i);
877
- for (const n of i.keys)
878
- e.writeStringField(3, n);
879
- for (const n of i.values)
880
- e.writeMessage(4, Ae, n);
881
- }
882
- function Fe(t, e) {
883
- const i = t.feature;
884
- if (!i || !e)
885
- throw new Error();
886
- e.writeMessage(2, Se, t), e.writeVarintField(3, i.type), e.writeMessage(4, ke, i);
887
- }
888
- function Se(t, e) {
889
- const i = t.feature;
890
- if (!i || !e)
891
- throw new Error();
892
- const n = t.keys, a = 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" && (n.push(c), h = n.length - 1, l[c] = h), e.writeVarint(h);
898
- const f = typeof m;
899
- f !== "string" && f !== "boolean" && f !== "number" && (m = JSON.stringify(m));
900
- const u = `${f}:${m}`;
901
- let _ = s[u];
902
- typeof _ > "u" && (a.push(m), _ = a.length - 1, s[u] = _), e.writeVarint(_);
903
- }
904
- }
905
- function St(t, e) {
906
- return (e << 3) + (t & 7);
907
- }
908
- function Vt(t) {
909
- return t << 1 ^ t >> 31;
910
- }
911
- function ke(t, e) {
912
- if (!e)
913
- throw new Error();
914
- const i = t.geometry, n = t.type;
915
- let a = 0, l = 0;
916
- for (const s of i) {
917
- let c = 1;
918
- n === ft.POINT && (c = s.length / 2), e.writeVarint(St(1, c));
919
- const m = s.length / 2, h = n === ft.POLYGON ? m - 1 : m;
920
- for (let f = 0; f < h; f++) {
921
- f === 1 && n !== 1 && e.writeVarint(St(2, h - 1));
922
- const u = s[f * 2] - a, _ = s[f * 2 + 1] - l;
923
- e.writeVarint(Vt(u)), e.writeVarint(Vt(_)), a += u, l += _;
924
- }
925
- n === ft.POLYGON && e.writeVarint(St(7, 1));
926
- }
927
- }
928
- function Ae(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 Re {
934
- constructor(e, i, n, a, l) {
935
- this.loaded = Promise.resolve(), this.decodeImage = Lt, 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 (F, M) => {
938
- const P = await u.fetchTile(s, c, m, M, f);
939
- if (B(M))
940
- throw new Error("canceled");
941
- const L = u.decodeImage(P.data, u.encoding, M), R = f == null ? void 0 : f.marker("decode"), V = await L;
942
- return R == null || R(), V;
943
- }, h);
944
- }, this.tileCache = new Z(i), this.parsedCache = new Z(i), this.contourCache = new Z(i), this.timeoutMs = l, this.demUrlPattern = e, this.encoding = n, this.maxzoom = a;
945
- }
946
- fetchTile(e, i, n, a, l) {
947
- const s = this.demUrlPattern.replace("{z}", e.toString()).replace("{x}", i.toString()).replace("{y}", n.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 G(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
- }, a);
964
- }
965
- async fetchDem(e, i, n, a, l, s) {
966
- const c = Math.min(e - (a.overzoom || 0), this.maxzoom), m = e - c, h = 1 << m, f = Math.floor(i / h), u = Math.floor(n / h), _ = await this.fetchAndParseTile(c, f, u, l, s);
967
- return $.fromRawDem(_).split(m, i % h, n % h);
968
- }
969
- fetchContourTile(e, i, n, a, l, s) {
970
- const { levels: c, multiplier: m = 1, buffer: h = 1, extent: f = 4096, contourLayer: u = "contours", elevationKey: _ = "ele", levelKey: F = "level", subsampleBelow: M = 100 } = a;
971
- if (!c || c.length === 0)
972
- return Promise.resolve({ arrayBuffer: new ArrayBuffer(0) });
973
- const P = [e, i, n, p(a)].join("/");
974
- return this.contourCache.get(P, async (L, R) => {
975
- const V = 1 << e, dt = [];
976
- for (let q = n - 1; q <= n + 1; q++)
977
- for (let nt = i - 1; nt <= i + 1; nt++)
978
- dt.push(q < 0 || q >= V ? void 0 : this.fetchDem(e, (nt + V) % V, q, a, R, s));
979
- const pt = await Promise.all(dt);
980
- let X = $.combineNeighbors(pt);
981
- if (!X || B(R))
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 C = w(c[0], X, f, h);
991
- ot == null || ot();
992
- const kt = De({
993
- extent: f,
994
- layers: {
995
- [u]: {
996
- features: Object.entries(C).map(([q, nt]) => {
997
- const _t = Number(q);
998
- return {
999
- type: ft.LINESTRING,
1000
- geometry: nt,
1001
- properties: {
1002
- [_]: _t,
1003
- [F]: Math.max(...c.map((bt, H) => _t % bt === 0 ? H : 0))
1004
- }
1005
- };
1006
- })
1007
- }
1008
- }
1009
- });
1010
- return ot == null || ot(), { arrayBuffer: kt.buffer };
1011
- }, l);
1012
- }
1013
- }
1014
- const Q = typeof performance < "u" ? performance : void 0, Ce = Q ? Q.timeOrigin || (/* @__PURE__ */ new Date()).getTime() - Q.now() : (/* @__PURE__ */ new Date()).getTime();
1015
- function 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 Ut() {
1020
- return Q ? Q.now() : (/* @__PURE__ */ new Date()).getTime();
1021
- }
1022
- function Pe(t) {
1023
- const e = [];
1024
- for (const i of t)
1025
- e.push(...i);
1026
- return e;
1027
- }
1028
- class Wt {
1029
- constructor(e) {
1030
- this.marks = {}, this.urls = [], this.fetched = [], this.resources = [], this.tilesFetched = 0, this.timeOrigin = Ce, this.finish = (i) => {
1031
- this.markFinish();
1032
- const n = (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
- }, a = n("main") || 0, l = n("fetch"), s = n("decode"), c = n("isoline");
1036
- return {
1037
- url: i,
1038
- tilesUsed: this.tilesFetched,
1039
- origin: this.timeOrigin,
1040
- marks: this.marks,
1041
- resources: [
1042
- ...this.resources,
1043
- ...Pe(this.fetched.map(Me))
1044
- ],
1045
- duration: a,
1046
- fetch: l,
1047
- decode: s,
1048
- process: c,
1049
- wait: a - (l || 0) - (s || 0) - (c || 0)
1050
- };
1051
- }, this.error = (i) => ({ ...this.finish(i), error: !0 }), this.marker = (i) => {
1052
- var n;
1053
- this.marks[i] || (this.marks[i] = []);
1054
- const a = [Ut()];
1055
- return (n = this.marks[i]) === null || n === void 0 || n.push(a), () => a.push(Ut());
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 n;
1062
- this.tilesFetched += i.tilesUsed;
1063
- const a = i.origin - this.timeOrigin;
1064
- for (const l in i.marks) {
1065
- const s = l;
1066
- (this.marks[s] || (this.marks[s] = [])).push(...((n = i.marks[s]) === null || n === void 0 ? void 0 : n.map((m) => m.map((h) => h + a))) || []);
1067
- }
1068
- this.resources.push(...i.resources.map((l) => Le(l, a)));
1069
- }, this.markFinish = this.marker(e);
1070
- }
1071
- }
1072
- const Oe = /(Start$|End$|^start|^end)/;
1073
- function Le(t, e) {
1074
- const i = {};
1075
- for (const n in t)
1076
- t[n] !== 0 && Oe.test(n) ? i[n] = Number(t[n]) + e : i[n] = t[n];
1077
- return i;
1078
- }
1079
- let Ie = 0;
1080
- class Ge {
1081
- constructor(e, i, n = 2e4) {
1082
- this.callbacks = {}, this.cancels = {}, this.dest = e, this.timeoutMs = n, this.dest.onmessage = async ({ data: a }) => {
1083
- const l = a;
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 Wt("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, n, a, ...l) {
1124
- const s = ++Ie, c = new Promise((m, h) => {
1125
- this.postMessage({ id: s, type: "request", name: e, args: l }, i), this.callbacks[s] = (f, u, _) => {
1126
- a == null || a.addAll(_), f ? h(f) : m(u);
1127
- };
1128
- });
1129
- return U(n, () => {
1130
- delete this.callbacks[s], this.postMessage({ id: s, type: "cancel" });
1131
- }), G(this.timeoutMs, c, n);
1132
- }
1133
- }
1134
- o.A = Ge, o.H = $, o.L = Re, o.T = Wt, o.a = z, o.b = w, o.c = Dt, o.d = Lt, o.e = A, o.f = k, o.g = x, o.p = D;
1135
- });
1136
- Ot(["./shared"], function(o) {
1137
- const r = (g) => Promise.reject(new Error(`No manager registered for ${g}`));
1138
- class d {
1139
- constructor() {
1140
- this.managers = {}, this.init = (w, b) => (this.managers[w.managerId] = new o.L(w.demUrlPattern, w.cacheSize, w.encoding, w.maxzoom, w.timeoutMs), Promise.resolve()), this.fetchTile = (w, b, S, O, A, z) => {
1141
- var p;
1142
- return ((p = this.managers[w]) === null || p === void 0 ? void 0 : p.fetchTile(b, S, O, A, z)) || r(w);
1143
- }, this.fetchAndParseTile = (w, b, S, O, A, z) => {
1144
- var p;
1145
- return o.p(((p = this.managers[w]) === null || p === void 0 ? void 0 : p.fetchAndParseTile(b, S, O, A, z)) || r(w), !0);
1146
- }, this.fetchContourTile = (w, b, S, O, A, z, p) => {
1147
- var x;
1148
- return o.f(((x = this.managers[w]) === null || x === void 0 ? void 0 : x.fetchContourTile(b, S, O, A, z, p)) || r(w));
1149
- };
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
- Ot(["./shared"], function(o) {
1156
- const r = { workerUrl: "" };
1157
- let d, y = 0;
1158
- class g {
1159
- constructor() {
1160
- this.decodeImage = (x, T, D) => o.p(o.d(x, T, D), !1);
1161
- }
1162
- }
1163
- function w() {
1164
- if (!d) {
1165
- const p = new Worker(r.workerUrl), x = new g();
1166
- d = new o.A(p, x);
1167
- }
1168
- return d;
1169
- }
1170
- class b {
1171
- constructor(x, T, D, k, j, ct) {
1172
- this.fetchTile = (Y, G, U, B, E) => this.actor.send("fetchTile", [], B, E, this.managerId, Y, G, U), this.fetchAndParseTile = (Y, G, U, B, E) => this.actor.send("fetchAndParseTile", [], B, E, this.managerId, Y, G, U), this.fetchContourTile = (Y, G, U, B, E, Z) => this.actor.send("fetchContourTile", [], E, Z, this.managerId, Y, G, U, B);
1173
- const tt = this.managerId = ++y;
1174
- this.actor = ct || w(), this.loaded = this.actor.send("init", [], new AbortController(), void 0, {
1175
- cacheSize: T,
1176
- demUrlPattern: x,
1177
- encoding: D,
1178
- maxzoom: k,
1179
- managerId: tt,
1180
- timeoutMs: j
1181
- });
1182
- }
1183
- }
1184
- Blob.prototype.arrayBuffer || (Blob.prototype.arrayBuffer = function() {
1185
- return new Promise((x, T) => {
1186
- const D = new FileReader();
1187
- D.onload = (k) => {
1188
- var j;
1189
- return x((j = k.target) === null || j === void 0 ? void 0 : j.result);
1190
- }, D.onerror = T, D.readAsArrayBuffer(this);
1191
- });
1192
- });
1193
- const S = (p) => (x, T) => {
1194
- if (T instanceof AbortController)
1195
- return p(x, T);
1196
- {
1197
- const D = new AbortController();
1198
- return p(x, D).then((k) => T(void 0, k.data, k.cacheControl, k.expires), (k) => T(k)), { cancel: () => D.abort() };
1199
- }
1200
- }, O = /* @__PURE__ */ new Set();
1201
- class A {
1202
- constructor({ url: x, cacheSize: T = 100, id: D = "dem", encoding: k = "terrarium", maxzoom: j = 12, worker: ct = !0, timeoutMs: tt = 1e4, actor: Y }) {
1203
- this.timingCallbacks = [], this.onTiming = (E) => {
1204
- this.timingCallbacks.push(E);
1205
- }, this.setupMaplibre = (E) => {
1206
- E.addProtocol(this.sharedDemProtocolId, this.sharedDemProtocol), E.addProtocol(this.contourProtocolId, this.contourProtocol);
1207
- }, this.sharedDemProtocolV4 = async (E, Z) => {
1208
- const [K, et, N] = this.parseUrl(E.url), it = new o.T("main");
1209
- let at;
1210
- try {
1211
- const W = await this.manager.fetchTile(K, et, N, Z, it);
1212
- return at = it.finish(E.url), {
1213
- data: await W.data.arrayBuffer(),
1214
- cacheControl: W.cacheControl,
1215
- expires: W.expires
1216
- };
1217
- } catch (W) {
1218
- throw at = it.error(E.url), W;
1219
- } finally {
1220
- this.timingCallbacks.forEach((W) => W(at));
1221
- }
1222
- }, this.contourProtocolV4 = async (E, Z) => {
1223
- const K = new o.T("main");
1224
- let et;
1225
- try {
1226
- const [N, it, at] = this.parseUrl(E.url), W = o.a(E.url), xt = await this.manager.fetchContourTile(N, it, at, o.g(W, N), Z, K);
1227
- return et = K.finish(E.url), { data: xt.arrayBuffer };
1228
- } catch (N) {
1229
- throw et = K.error(E.url), N;
1230
- } finally {
1231
- this.timingCallbacks.forEach((N) => N(et));
1232
- }
1233
- }, this.contourProtocol = S(this.contourProtocolV4), this.sharedDemProtocol = S(this.sharedDemProtocolV4), this.contourProtocolUrl = (E) => `${this.contourProtocolUrlBase}?${o.e(E)}`;
1234
- let G = D, U = 1;
1235
- for (; O.has(G); )
1236
- G = D + U++;
1237
- O.add(G), this.sharedDemProtocolId = `${G}-shared`, this.contourProtocolId = `${G}-contour`, this.sharedDemProtocolUrl = `${this.sharedDemProtocolId}://{z}/{x}/{y}`, this.contourProtocolUrlBase = `${this.contourProtocolId}://{z}/{x}/{y}`;
1238
- const B = ct ? b : o.L;
1239
- this.manager = new B(x, T, k, j, tt, Y);
1240
- }
1241
- getDemTile(x, T, D, k) {
1242
- return this.manager.fetchAndParseTile(x, T, D, k || new AbortController());
1243
- }
1244
- parseUrl(x) {
1245
- const [, T, D, k] = /\/\/(\d+)\/(\d+)\/(\d+)/.exec(x) || [];
1246
- return [Number(T), Number(D), Number(k)];
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 Be = Pt;
1264
- function Xe(o) {
1265
- return o;
1266
- }
1267
- function Ne(o) {
1268
- if (o == null) return Xe;
1269
- var r, d, y = o.scale[0], g = o.scale[1], w = o.translate[0], b = o.translate[1];
1270
- return function(S, O) {
1271
- O || (r = d = 0);
1272
- var A = 2, z = S.length, p = new Array(z);
1273
- for (p[0] = (r += S[0]) * y + w, p[1] = (d += S[1]) * g + b; A < z; ) p[A] = S[A], ++A;
1274
- return p;
1275
- };
1276
- }
1277
- function Ve(o, r) {
1278
- for (var d, y = o.length, g = y - r; g < --y; ) d = o[g], o[g++] = o[y], o[y] = d;
1279
- }
1280
- function $t(o, r) {
1281
- return typeof r == "string" && (r = o.objects[r]), r.type === "GeometryCollection" ? { type: "FeatureCollection", features: r.geometries.map(function(d) {
1282
- return Kt(o, d);
1283
- }) } : Kt(o, r);
1284
- }
1285
- function Kt(o, r) {
1286
- var d = r.id, y = r.bbox, g = r.properties == null ? {} : r.properties, w = Ue(o, r);
1287
- return d == null && y == null ? { type: "Feature", properties: g, geometry: w } : y == null ? { type: "Feature", id: d, properties: g, geometry: w } : { type: "Feature", id: d, bbox: y, properties: g, geometry: w };
1288
- }
1289
- function Ue(o, r) {
1290
- var d = Ne(o.transform), y = o.arcs;
1291
- function g(z, p) {
1292
- p.length && p.pop();
1293
- for (var x = y[z < 0 ? ~z : z], T = 0, D = x.length; T < D; ++T)
1294
- p.push(d(x[T], T));
1295
- z < 0 && Ve(p, D);
1296
- }
1297
- function w(z) {
1298
- return d(z);
1299
- }
1300
- function b(z) {
1301
- for (var p = [], x = 0, T = z.length; x < T; ++x) g(z[x], p);
1302
- return p.length < 2 && p.push(p[0]), p;
1303
- }
1304
- function S(z) {
1305
- for (var p = b(z); p.length < 4; ) p.push(p[0]);
1306
- return p;
1307
- }
1308
- function O(z) {
1309
- return z.map(S);
1310
- }
1311
- function A(z) {
1312
- var p = z.type, x;
1313
- switch (p) {
1314
- case "GeometryCollection":
1315
- return { type: p, geometries: z.geometries.map(A) };
1316
- case "Point":
1317
- x = w(z.coordinates);
1318
- break;
1319
- case "MultiPoint":
1320
- x = z.coordinates.map(w);
1321
- break;
1322
- case "LineString":
1323
- x = b(z.arcs);
1324
- break;
1325
- case "MultiLineString":
1326
- x = z.arcs.map(b);
1327
- break;
1328
- case "Polygon":
1329
- x = O(z.arcs);
1330
- break;
1331
- case "MultiPolygon":
1332
- x = z.arcs.map(O);
1333
- break;
1334
- default:
1335
- return null;
1336
- }
1337
- return { type: p, coordinates: x };
1338
- }
1339
- return A(r);
1340
- }
1341
- const We = {
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 je() {
1354
- const o = "navdata", r = We;
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 $e = {
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 Ke() {
2064
- const o = "navdata", r = $e;
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-label",
2440
- type: "symbol",
2441
- source: o,
2442
- "source-layer": "vor",
2443
- minzoom: 5,
2444
- layout: { "text-field": ["get", "CODE_ID"], "text-size": 10, "text-anchor": "bottom", "text-offset": [0, -0.8] },
2445
- paint: { "text-color": r.vor, "text-halo-color": "#0f172a", "text-halo-width": 1 }
2446
- },
2447
- {
2448
- id: "ndb-symbol",
2449
- type: "symbol",
2450
- source: o,
2451
- minzoom: 4,
2452
- "source-layer": "ndb",
2453
- 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"], `
2454
- `, ["get", "VAL_FREQ"], "kHz"], "text-size": 10, "text-offset": [0, 1.4], "text-letter-spacing": 0.05, "text-optional": !0, "icon-allow-overlap": !0 },
2455
- paint: { "text-color": r.ndb, "text-halo-color": "#0f172a", "text-halo-width": 1, "icon-color": r.ndb }
2456
- },
2457
- {
2458
- id: "waypoint-symbol",
2459
- type: "symbol",
2460
- source: o,
2461
- "source-layer": "waypoint",
2462
- minzoom: 5,
2463
- 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 },
2464
- paint: { "icon-color": r.waypoint, "text-color": r.waypoint, "text-halo-color": "#0f172a", "text-halo-width": 1 }
2465
- },
2466
- {
2467
- id: "waypoint-off-airway-symbol",
2468
- type: "symbol",
2469
- source: o,
2470
- "source-layer": "waypoint-off-airway",
2471
- minzoom: 7,
2472
- 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 },
2473
- paint: { "icon-color": r.waypoint, "text-color": r.waypoint, "text-halo-color": "#0f172a", "text-halo-width": 1 }
2474
- }
2475
- ];
2476
- }
2477
- const ut = {
2478
- light: { id: "light", label: "日间", background: "#EAF2F8", build: je },
2479
- dark: { id: "dark", label: "夜间", background: "#000000", build: Ke }
2480
- };
2481
- function Ht(o = "light") {
2482
- return (ut[o] ?? ut.light).build();
2483
- }
2484
- const Ct = {
2485
- adiz: ["adiz-line", "adiz-label"],
2486
- airspace: ["fir-line", "fir_line_dash", "fir-label", "fir-label-lineside"],
2487
- restricted: ["restricted-fill", "restricted-stroke", "restricted-label"],
2488
- controlled: ["controlled-fill", "controlled-stroke", "controlled-label"],
2489
- airline: ["segment-radial", "segment-line", "segment-label", "waypoint-symbol"],
2490
- waypointOffAirway: ["waypoint-off-airway-symbol"],
2491
- vor: ["vor-symbol", "vor-label", "vor-symbol-normal"],
2492
- ndb: ["ndb-symbol"],
2493
- airport: ["airport-circle"],
2494
- runway: ["runway-line", "runway-line-amm", "runway-label"]
2495
- }, He = {
2496
- /** 机场边界(淡暖灰垫底,在纯白底上显现轮廓) */
2497
- airport: "#e2e8f0",
2498
- /** 跑道面(中深灰,作为白底上的绝对重心) */
2499
- runway: "#94a3b8",
2500
- /** 机坪面(中浅灰,与白底拉开清晰明度差) */
2501
- apron: "#cbd5e1",
2502
- /** 滑行道面(带微弱色调差的浅灰,与机坪剥离) */
2503
- taxiway: "#e2e8f0",
2504
- /** 滑行道中心线(深琥珀金,白底上极清晰) */
2505
- taxiwayLine: "#f59e0b",
2506
- /** 等待位(深砖红/铁锈红,高辨识度) */
2507
- holding: "#b91c1c",
2508
- /** 机位点(深翡翠绿) */
2509
- stand: "#1e293b",
2510
- /** 跑道标记(涂装面) */
2511
- runwayMarking: "#ffffff",
2512
- /** 跑道中心线 */
2513
- runwayCenterline: "#ffffff",
2514
- /** 停机位引导线(深绿色) */
2515
- standLine: "#64748b",
2516
- /** 限制区域(深红) */
2517
- restricted: "#b91c1c",
2518
- /** 事故易发区(深橙色) */
2519
- hotspot: "#ea580c"
2520
- };
2521
- function Ye(o = "amm") {
2522
- const r = He;
2523
- return [
2524
- // ── 机场边界轮廓(z11+)
2525
- {
2526
- id: "amm-airport-fill",
2527
- type: "fill",
2528
- source: o,
2529
- "source-layer": "amm-airport",
2530
- minzoom: 11,
2531
- paint: {
2532
- "fill-color": r.airport,
2533
- "fill-opacity": 0.4
2534
- // 适当调高不透明度,确保白底可见
2535
- }
2536
- },
2537
- {
2538
- id: "amm-airport-stroke",
2539
- type: "line",
2540
- source: o,
2541
- "source-layer": "amm-airport",
2542
- minzoom: 11,
2543
- paint: {
2544
- "line-color": r.airport,
2545
- "line-width": 1
2546
- }
2547
- },
2548
- // ── 跑道面(z11+)─────
2549
- {
2550
- id: "amm-runway-fill",
2551
- type: "fill",
2552
- source: o,
2553
- "source-layer": "amm-runway",
2554
- minzoom: 11,
2555
- paint: {
2556
- "fill-color": r.runway,
2557
- "fill-opacity": 0.9
2558
- }
2559
- },
2560
- {
2561
- id: "amm-runway-stroke",
2562
- type: "line",
2563
- source: o,
2564
- "source-layer": "amm-runway",
2565
- minzoom: 11,
2566
- paint: {
2567
- "line-color": "#64748b",
2568
- // 边缘加深,防止溶于白底
2569
- "line-width": 0.5
2570
- }
2571
- },
2572
- // ── 机坪面(z11+)─────
2573
- {
2574
- id: "amm-apron-fill",
2575
- type: "fill",
2576
- source: o,
2577
- "source-layer": "amm-apron",
2578
- minzoom: 11,
2579
- paint: {
2580
- "fill-color": r.apron,
2581
- "fill-opacity": 0.6
2582
- // 提高透明度浓度
2583
- }
2584
- },
2585
- {
2586
- id: "amm-apron-stroke",
2587
- type: "line",
2588
- source: o,
2589
- "source-layer": "amm-apron",
2590
- minzoom: 11,
2591
- paint: {
2592
- "line-color": "#94a3b8",
2593
- // 勾边加深,确保纯白背景下清晰可见
2594
- "line-width": 0.5
2595
- }
2596
- },
2597
- // ── 滑行道面(z11+)───
2598
- {
2599
- id: "amm-taxiway-fill",
2600
- type: "fill",
2601
- source: o,
2602
- "source-layer": "amm-taxiway",
2603
- minzoom: 11,
2604
- paint: {
2605
- "fill-color": r.taxiway,
2606
- "fill-opacity": 0.7
2607
- }
2608
- },
2609
- // ── 滑行道中心线(z11+)──────────────────────────────────────────
2610
- {
2611
- id: "amm-taxiway-line",
2612
- type: "line",
2613
- source: o,
2614
- "source-layer": "amm-taxiway-line",
2615
- minzoom: 11,
2616
- paint: {
2617
- "line-color": r.taxiwayLine,
2618
- "line-width": ["interpolate", ["linear"], ["zoom"], 15, 0.8, 18, 2]
2619
- }
2620
- },
2621
- // 滑行道名称(中心线 symbol)
2622
- {
2623
- id: "amm-taxiway-label",
2624
- type: "symbol",
2625
- source: o,
2626
- "source-layer": "amm-taxiway-line",
2627
- minzoom: 14,
2628
- layout: {
2629
- "text-field": ["get", "idlin"],
2630
- "text-size": 10,
2631
- "icon-image": "text_bg",
2632
- "icon-text-fit": "both",
2633
- "icon-text-fit-padding": [
2634
- 1,
2635
- 2,
2636
- 1,
2637
- 2
2638
- ],
2639
- "symbol-placement": "line",
2640
- "text-keep-upright": !0,
2641
- "text-allow-overlap": !1
2642
- },
2643
- paint: {
2644
- "text-color": "#FFF",
2645
- "icon-color": r.taxiwayLine
2646
- }
2647
- },
2648
- // ── 等待位(z11+)─────
2649
- {
2650
- id: "amm-holding",
2651
- type: "line",
2652
- source: o,
2653
- "source-layer": "amm-holding",
2654
- minzoom: 11,
2655
- paint: {
2656
- "line-color": r.holding,
2657
- "line-width": 1.5
2658
- }
2659
- },
2660
- // ── 跑道标记(斑马线、编号等涂装面,z13+)─────────────────────────
2661
- {
2662
- id: "amm-runway-marking",
2663
- type: "fill",
2664
- source: o,
2665
- "source-layer": "amm-runway-marking",
2666
- minzoom: 13,
2667
- paint: {
2668
- "fill-color": r.runwayMarking,
2669
- "fill-opacity": 0.9
2670
- }
2671
- },
2672
- // ── 限制区域(z11+)───────────────────────────────────────────────
2673
- {
2674
- id: "amm-restricted-fill",
2675
- type: "fill",
2676
- source: o,
2677
- "source-layer": "amm-restricted",
2678
- minzoom: 11,
2679
- paint: {
2680
- "fill-color": r.restricted,
2681
- "fill-opacity": 0.08
2682
- // 针对白底降低面纯度
2683
- }
2684
- },
2685
- {
2686
- id: "amm-restricted-stroke",
2687
- type: "line",
2688
- source: o,
2689
- "source-layer": "amm-restricted",
2690
- minzoom: 11,
2691
- paint: {
2692
- "line-color": r.restricted,
2693
- "line-width": 1.5,
2694
- "line-dasharray": [4, 2]
2695
- }
2696
- },
2697
- // ── 事故易发区警示(z11+)─────────────────────────────────────────
2698
- {
2699
- id: "amm-hotspot-fill",
2700
- type: "fill",
2701
- source: o,
2702
- "source-layer": "amm-hotspot",
2703
- minzoom: 11,
2704
- paint: {
2705
- "fill-color": r.hotspot,
2706
- "fill-opacity": 0.1
2707
- // 针对白底轻微淡化面
2708
- }
2709
- },
2710
- {
2711
- id: "amm-hotspot-stroke",
2712
- type: "line",
2713
- source: o,
2714
- "source-layer": "amm-hotspot",
2715
- minzoom: 11,
2716
- paint: {
2717
- "line-color": r.hotspot,
2718
- "line-width": 1.5
2719
- }
2720
- },
2721
- // ── 跑道中心线(z11+)─────────────────────────────────────────────
2722
- {
2723
- id: "amm-runway-centerline",
2724
- type: "line",
2725
- source: o,
2726
- "source-layer": "amm-runway-centerline",
2727
- minzoom: 11,
2728
- paint: {
2729
- "line-color": r.runwayCenterline,
2730
- "line-width": 1,
2731
- "line-dasharray": [6, 3]
2732
- }
2733
- },
2734
- // 跑道中心信息标签(z13+)
2735
- // 使用后端生成的 amm-runway-label 点图层:每条跑道仅一个中点,
2736
- // 点要素不跨 tile,标注绝对不重复
2737
- {
2738
- id: "amm-runway-info",
2739
- type: "symbol",
2740
- source: o,
2741
- "source-layer": "amm-runway-label",
2742
- minzoom: 13,
2743
- layout: {
2744
- "text-field": [
2745
- "concat",
2746
- ["coalesce", ["get", "length"], ""],
2747
- "×",
2748
- ["coalesce", ["get", "width"], ""],
2749
- "m"
2750
- ],
2751
- "text-size": [
2752
- "interpolate",
2753
- ["exponential", 1.5],
2754
- ["zoom"],
2755
- 13,
2756
- 10,
2757
- 16,
2758
- 13
2759
- ],
2760
- "symbol-placement": "point",
2761
- "text-rotate": ["coalesce", ["get", "bearing"], 0],
2762
- "text-rotation-alignment": "map",
2763
- "text-allow-overlap": !0,
2764
- "text-ignore-placement": !0
2765
- },
2766
- paint: {
2767
- "text-color": "#f8fafc",
2768
- // 加粗 halo 代替 icon 背景,旋转后不会变形
2769
- "text-halo-color": "#334155",
2770
- "text-halo-width": 2.5
2771
- }
2772
- },
2773
- // ── 停机位引导线(z13+)───────────────────────────────────────────
2774
- {
2775
- id: "amm-stand-line",
2776
- type: "line",
2777
- source: o,
2778
- "source-layer": "amm-stand-line",
2779
- minzoom: 13,
2780
- paint: {
2781
- "line-color": r.standLine,
2782
- "line-width": 1
2783
- }
2784
- },
2785
- // 跑道入口标签:编号 + 标高(z14+)
2786
- {
2787
- id: "amm-runway-threshold-label",
2788
- type: "symbol",
2789
- source: o,
2790
- "source-layer": "amm-runway-threshold",
2791
- minzoom: 12,
2792
- layout: {
2793
- "icon-image": "text_bg",
2794
- "icon-text-fit": "both",
2795
- "icon-text-fit-padding": [
2796
- 1,
2797
- 2,
2798
- 1,
2799
- 2
2800
- ],
2801
- "text-field": ["get", "idthr"],
2802
- "text-size": 14,
2803
- "text-allow-overlap": !0,
2804
- "text-rotation-alignment": "map",
2805
- "icon-rotation-alignment": "map"
2806
- },
2807
- paint: {
2808
- "text-color": "#fff",
2809
- "icon-color": "#b91c1c"
2810
- }
2811
- },
2812
- // ── 机位点(z11+)─────
2813
- {
2814
- id: "amm-stand",
2815
- type: "circle",
2816
- source: o,
2817
- "source-layer": "amm-stand",
2818
- minzoom: 12,
2819
- paint: {
2820
- "circle-color": r.stand,
2821
- "circle-radius": 1.5
2822
- }
2823
- },
2824
- // 机位编号标签
2825
- {
2826
- id: "amm-stand-label",
2827
- type: "symbol",
2828
- source: o,
2829
- "source-layer": "amm-stand",
2830
- minzoom: 14,
2831
- layout: {
2832
- "text-field": ["get", "idstd"],
2833
- "text-size": 9,
2834
- "text-anchor": "bottom",
2835
- "text-offset": [0, -0.5],
2836
- "text-allow-overlap": !1
2837
- },
2838
- paint: {
2839
- "text-color": r.standLine
2840
- // 改为深墨绿字,白底/浅灰底上高可读
2841
- }
2842
- },
2843
- // ── 垂直面状障碍物(z11+)──────────────────────────────────────
2844
- {
2845
- id: "amm-obstacle-region-fill",
2846
- type: "fill",
2847
- source: o,
2848
- "source-layer": "amm-obstacle-region",
2849
- minzoom: 11,
2850
- paint: {
2851
- "fill-color": "#fef08a",
2852
- "fill-opacity": 0.35
2853
- }
2854
- },
2855
- {
2856
- id: "amm-obstacle-region-stroke",
2857
- type: "line",
2858
- source: o,
2859
- "source-layer": "amm-obstacle-region",
2860
- minzoom: 11,
2861
- paint: {
2862
- "line-color": "#ca8a04",
2863
- "line-width": 1.5,
2864
- "line-dasharray": [1.5, 1]
2865
- }
2866
- },
2867
- // ── 垂直点状障碍物(z11+)──────────────────────────────────────
2868
- {
2869
- id: "amm-obstacle-point",
2870
- type: "circle",
2871
- source: o,
2872
- "source-layer": "amm-obstacle-point",
2873
- minzoom: 11,
2874
- paint: {
2875
- "circle-color": "#b45309",
2876
- "circle-radius": 4,
2877
- "circle-stroke-color": "#ffffff",
2878
- "circle-stroke-width": 1
2879
- }
2880
- },
2881
- // 点状障碍物名称标签
2882
- {
2883
- id: "amm-obstacle-point-label",
2884
- type: "symbol",
2885
- source: o,
2886
- "source-layer": "amm-obstacle-point",
2887
- minzoom: 14,
2888
- layout: {
2889
- "text-field": ["coalesce", ["get", "ident"], ["get", "LABEL"]],
2890
- "text-size": 9,
2891
- "text-anchor": "bottom",
2892
- "text-offset": [0, -0.5],
2893
- "text-allow-overlap": !1
2894
- },
2895
- paint: {
2896
- "text-color": "#92400e",
2897
- "text-halo-color": "#ffffff",
2898
- "text-halo-width": 1
2899
- }
2900
- },
2901
- // ── 施工区域面(表不存在的机场不返回此图层,自动跳过)──
2902
- {
2903
- id: "amm-construction-fill",
2904
- type: "fill",
2905
- source: o,
2906
- "source-layer": "amm-construction",
2907
- minzoom: 11,
2908
- paint: {
2909
- "fill-pattern": "normal:passline",
2910
- "fill-opacity": 0.8
2911
- }
2912
- },
2913
- {
2914
- id: "amm-construction-stroke",
2915
- type: "line",
2916
- source: o,
2917
- "source-layer": "amm-construction",
2918
- minzoom: 11,
2919
- paint: {
2920
- "line-color": "#d97706",
2921
- "line-width": 1.5,
2922
- "line-dasharray": [4, 2]
2923
- }
2924
- },
2925
- {
2926
- id: "amm-construction-label",
2927
- type: "symbol",
2928
- source: o,
2929
- "source-layer": "amm-construction",
2930
- minzoom: 13,
2931
- layout: {
2932
- "text-field": ["get", "text"],
2933
- "text-size": 9,
2934
- "text-anchor": "center",
2935
- "symbol-placement": "point",
2936
- "text-allow-overlap": !1
2937
- },
2938
- paint: {
2939
- "text-color": "#92400e",
2940
- "text-halo-color": "#ffffff",
2941
- "text-halo-width": 1
2942
- }
2943
- }
2944
- ];
2945
- }
2946
- const Ze = {
2947
- airport: "#334155",
2948
- runway: "#475569",
2949
- apron: "#1e293b",
2950
- taxiway: "#334155",
2951
- taxiwayLine: "#fbbf24",
2952
- holding: "#ef4444",
2953
- stand: "#34d399",
2954
- runwayMarking: "#cbd5e1",
2955
- runwayCenterline: "#94a3b8",
2956
- standLine: "#64748b",
2957
- restricted: "#f87171",
2958
- hotspot: "#fb923c"
2959
- };
2960
- function Je(o = "amm") {
2961
- const r = Ze;
2962
- return [
2963
- { id: "amm-airport-fill", type: "fill", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "fill-color": r.airport, "fill-opacity": 0.3 } },
2964
- { id: "amm-airport-stroke", type: "line", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "line-color": "#475569", "line-width": 1 } },
2965
- { id: "amm-runway-fill", type: "fill", source: o, "source-layer": "amm-runway", minzoom: 11, paint: { "fill-color": r.runway, "fill-opacity": 1 } },
2966
- { id: "amm-runway-stroke", type: "line", source: o, "source-layer": "amm-runway", minzoom: 11, paint: { "line-color": "#64748b", "line-width": 0.5 } },
2967
- { id: "amm-apron-fill", type: "fill", source: o, "source-layer": "amm-apron", minzoom: 11, paint: { "fill-color": r.apron, "fill-opacity": 1 } },
2968
- { id: "amm-apron-stroke", type: "line", source: o, "source-layer": "amm-apron", minzoom: 11, paint: { "line-color": "#334155", "line-width": 0.5 } },
2969
- { id: "amm-taxiway-fill", type: "fill", source: o, "source-layer": "amm-taxiway", minzoom: 11, paint: { "fill-color": r.taxiway, "fill-opacity": 0.8 } },
2970
- { 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] } },
2971
- {
2972
- id: "amm-taxiway-label",
2973
- type: "symbol",
2974
- source: o,
2975
- "source-layer": "amm-taxiway-line",
2976
- minzoom: 14,
2977
- 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 },
2978
- paint: { "text-color": "#0f172a", "icon-color": r.taxiwayLine }
2979
- },
2980
- { id: "amm-holding", type: "line", source: o, "source-layer": "amm-holding", minzoom: 11, paint: { "line-color": r.holding, "line-width": 1.5 } },
2981
- { id: "amm-runway-marking", type: "fill", source: o, "source-layer": "amm-runway-marking", minzoom: 13, paint: { "fill-color": r.runwayMarking, "fill-opacity": 0.8 } },
2982
- { id: "amm-restricted-fill", type: "fill", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "fill-color": r.restricted, "fill-opacity": 0.12 } },
2983
- { 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] } },
2984
- { id: "amm-hotspot-fill", type: "fill", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "fill-color": r.hotspot, "fill-opacity": 0.15 } },
2985
- { id: "amm-hotspot-stroke", type: "line", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "line-color": r.hotspot, "line-width": 1.2 } },
2986
- { 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] } },
2987
- {
2988
- id: "amm-runway-info",
2989
- type: "symbol",
2990
- source: o,
2991
- "source-layer": "amm-runway-label",
2992
- minzoom: 13,
2993
- 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 },
2994
- paint: { "text-color": "#e2e8f0", "text-halo-color": "#0f172a", "text-halo-width": 2 }
2995
- },
2996
- { id: "amm-stand-line", type: "line", source: o, "source-layer": "amm-stand-line", minzoom: 13, paint: { "line-color": r.standLine, "line-width": 1 } },
2997
- {
2998
- id: "amm-runway-threshold-label",
2999
- type: "symbol",
3000
- source: o,
3001
- "source-layer": "amm-runway-threshold",
3002
- minzoom: 12,
3003
- 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" },
3004
- paint: { "text-color": "#ffffff", "icon-color": "#ef4444" }
3005
- },
3006
- { id: "amm-stand", type: "circle", source: o, "source-layer": "amm-stand", minzoom: 12, paint: { "circle-color": r.stand, "circle-radius": 1.5 } },
3007
- {
3008
- id: "amm-stand-label",
3009
- type: "symbol",
3010
- source: o,
3011
- "source-layer": "amm-stand",
3012
- minzoom: 14,
3013
- layout: { "text-field": ["get", "idstd"], "text-size": 9, "text-anchor": "bottom", "text-offset": [0, -0.5], "text-allow-overlap": !1 },
3014
- paint: { "text-color": r.stand, "text-halo-color": "#0f172a", "text-halo-width": 1 }
3015
- },
3016
- { id: "amm-obstacle-region-fill", type: "fill", source: o, "source-layer": "amm-obstacle-region", minzoom: 11, paint: { "fill-color": "#fef08a", "fill-opacity": 0.15 } },
3017
- { 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] } },
3018
- { 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 } },
3019
- {
3020
- id: "amm-obstacle-point-label",
3021
- type: "symbol",
3022
- source: o,
3023
- "source-layer": "amm-obstacle-point",
3024
- minzoom: 14,
3025
- layout: { "text-field": ["coalesce", ["get", "ident"], ["get", "LABEL"]], "text-size": 9, "text-anchor": "bottom", "text-offset": [0, -0.5], "text-allow-overlap": !1 },
3026
- paint: { "text-color": "#fdba74", "text-halo-color": "#0f172a", "text-halo-width": 1.2 }
3027
- },
3028
- { id: "amm-construction-fill", type: "fill", source: o, "source-layer": "amm-construction", minzoom: 11, paint: { "fill-pattern": "normal:passline", "fill-opacity": 0.6 } },
3029
- { 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] } },
3030
- {
3031
- id: "amm-construction-label",
3032
- type: "symbol",
3033
- source: o,
3034
- "source-layer": "amm-construction",
3035
- minzoom: 13,
3036
- layout: { "text-field": ["get", "text"], "text-size": 9, "text-anchor": "center", "symbol-placement": "point", "text-allow-overlap": !1 },
3037
- paint: { "text-color": "#f97316", "text-halo-color": "#0f172a", "text-halo-width": 1 }
3038
- }
3039
- ];
3040
- }
3041
- const Qe = {
3042
- airport: "#4b5563",
3043
- runway: "#71717a",
3044
- apron: "#27272a",
3045
- taxiway: "#3f3f46",
3046
- taxiwayLine: "#eab308",
3047
- holding: "#ef4444",
3048
- stand: "#10b981",
3049
- runwayMarking: "#e4e4e7",
3050
- runwayCenterline: "#d4d4d8",
3051
- standLine: "#6b7280",
3052
- threshold: "#f97316",
3053
- restricted: "#f87171",
3054
- hotspot: "#fb923c"
3055
- };
3056
- function qe(o = "amm") {
3057
- const r = Qe, d = "#1f1f23";
3058
- return [
3059
- { id: "amm-airport-fill", type: "fill", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "fill-color": r.airport, "fill-opacity": 0.3 } },
3060
- { id: "amm-airport-stroke", type: "line", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "line-color": "#52525b", "line-width": 1 } },
3061
- { id: "amm-runway-fill", type: "fill", source: o, "source-layer": "amm-runway", minzoom: 11, paint: { "fill-color": r.runway, "fill-opacity": 1 } },
3062
- { id: "amm-runway-stroke", type: "line", source: o, "source-layer": "amm-runway", minzoom: 11, paint: { "line-color": "#52525b", "line-width": 0.5 } },
3063
- { id: "amm-apron-fill", type: "fill", source: o, "source-layer": "amm-apron", minzoom: 11, paint: { "fill-color": r.apron, "fill-opacity": 1 } },
3064
- { id: "amm-apron-stroke", type: "line", source: o, "source-layer": "amm-apron", minzoom: 11, paint: { "line-color": "#3f3f46", "line-width": 0.5 } },
3065
- { id: "amm-taxiway-fill", type: "fill", source: o, "source-layer": "amm-taxiway", minzoom: 11, paint: { "fill-color": r.taxiway, "fill-opacity": 0.9 } },
3066
- { 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] } },
3067
- {
3068
- id: "amm-taxiway-label",
3069
- type: "symbol",
3070
- source: o,
3071
- "source-layer": "amm-taxiway-line",
3072
- minzoom: 14,
3073
- 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 },
3074
- paint: { "text-color": d, "icon-color": r.taxiwayLine }
3075
- },
3076
- { id: "amm-holding", type: "line", source: o, "source-layer": "amm-holding", minzoom: 11, paint: { "line-color": r.holding, "line-width": 1.5 } },
3077
- { id: "amm-runway-marking", type: "fill", source: o, "source-layer": "amm-runway-marking", minzoom: 13, paint: { "fill-color": r.runwayMarking, "fill-opacity": 0.85 } },
3078
- { id: "amm-restricted-fill", type: "fill", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "fill-color": r.restricted, "fill-opacity": 0.1 } },
3079
- { 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] } },
3080
- { id: "amm-hotspot-fill", type: "fill", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "fill-color": r.hotspot, "fill-opacity": 0.12 } },
3081
- { id: "amm-hotspot-stroke", type: "line", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "line-color": r.hotspot, "line-width": 1.2 } },
3082
- { 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] } },
3083
- {
3084
- id: "amm-runway-info",
3085
- type: "symbol",
3086
- source: o,
3087
- "source-layer": "amm-runway-label",
3088
- minzoom: 13,
3089
- 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 },
3090
- paint: { "text-color": "#e4e4e7", "text-halo-color": d, "text-halo-width": 2 }
3091
- },
3092
- { id: "amm-stand-line", type: "line", source: o, "source-layer": "amm-stand-line", minzoom: 13, paint: { "line-color": r.standLine, "line-width": 1 } },
3093
- {
3094
- id: "amm-runway-threshold-label",
3095
- type: "symbol",
3096
- source: o,
3097
- "source-layer": "amm-runway-threshold",
3098
- minzoom: 12,
3099
- 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" },
3100
- paint: { "text-color": "#ffffff", "icon-color": r.threshold }
3101
- },
3102
- { id: "amm-stand", type: "circle", source: o, "source-layer": "amm-stand", minzoom: 12, paint: { "circle-color": r.stand, "circle-radius": 1.5 } },
3103
- {
3104
- id: "amm-stand-label",
3105
- type: "symbol",
3106
- source: o,
3107
- "source-layer": "amm-stand",
3108
- minzoom: 14,
3109
- layout: { "text-field": ["get", "idstd"], "text-size": 9, "text-anchor": "bottom", "text-offset": [0, -0.5], "text-allow-overlap": !1 },
3110
- paint: { "text-color": r.stand, "text-halo-color": d, "text-halo-width": 1 }
3111
- },
3112
- { id: "amm-obstacle-region-fill", type: "fill", source: o, "source-layer": "amm-obstacle-region", minzoom: 11, paint: { "fill-color": "#fef08a", "fill-opacity": 0.1 } },
3113
- { 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] } },
3114
- { 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 } },
3115
- {
3116
- id: "amm-obstacle-point-label",
3117
- type: "symbol",
3118
- source: o,
3119
- "source-layer": "amm-obstacle-point",
3120
- minzoom: 14,
3121
- layout: { "text-field": ["coalesce", ["get", "ident"], ["get", "LABEL"]], "text-size": 9, "text-anchor": "bottom", "text-offset": [0, -0.5], "text-allow-overlap": !1 },
3122
- paint: { "text-color": "#fdba74", "text-halo-color": d, "text-halo-width": 1.2 }
3123
- },
3124
- { id: "amm-construction-fill", type: "fill", source: o, "source-layer": "amm-construction", minzoom: 11, paint: { "fill-pattern": "normal:passline", "fill-opacity": 0.6 } },
3125
- { 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] } },
3126
- {
3127
- id: "amm-construction-label",
3128
- type: "symbol",
3129
- source: o,
3130
- "source-layer": "amm-construction",
3131
- minzoom: 13,
3132
- layout: { "text-field": ["get", "text"], "text-size": 9, "text-anchor": "center", "symbol-placement": "point", "text-allow-overlap": !1 },
3133
- paint: { "text-color": "#f97316", "text-halo-color": d, "text-halo-width": 1 }
3134
- }
3135
- ];
3136
- }
3137
- function Yt(o = "amm", r = "light") {
3138
- return r === "dark" ? Je(o) : r === "neutral" ? qe(o) : Ye(o);
3139
- }
3140
- const oi = {
3141
- ammAirport: ["amm-airport-fill", "amm-airport-stroke"],
3142
- ammRunway: [
3143
- "amm-runway-fill",
3144
- "amm-runway-stroke",
3145
- "amm-runway-info",
3146
- "amm-runway-marking",
3147
- "amm-runway-centerline",
3148
- "amm-runway-threshold",
3149
- "amm-runway-threshold-label"
3150
- ],
3151
- ammApron: ["amm-apron-fill", "amm-apron-stroke"],
3152
- ammTaxiway: ["amm-taxiway-fill", "amm-taxiway-line", "amm-taxiway-label"],
3153
- ammHolding: ["amm-holding"],
3154
- ammStand: ["amm-stand", "amm-stand-label", "amm-stand-line"],
3155
- ammRestricted: ["amm-restricted-fill", "amm-restricted-stroke"],
3156
- ammHotspot: ["amm-hotspot-fill", "amm-hotspot-stroke"],
3157
- /** 障碍物(点 + 面) */
3158
- ammObstacle: [
3159
- "amm-obstacle-region-fill",
3160
- "amm-obstacle-region-stroke",
3161
- "amm-obstacle-point",
3162
- "amm-obstacle-point-label"
3163
- ],
3164
- ammConstruction: ["amm-construction-fill", "amm-construction-stroke", "amm-construction-label"]
3165
- }, ti = "https://aips.siniswift.com", ei = [
3166
- "interpolate",
3167
- ["linear"],
3168
- ["elevation"],
3169
- 0,
3170
- "#a8c98a",
3171
- 600,
3172
- "#cdd98a",
3173
- 1200,
3174
- "#e8d79a",
3175
- 2400,
3176
- "#c79a5b",
3177
- 3600,
3178
- "#9c6b3f",
3179
- 4500,
3180
- "#f2efe9"
3181
- ], Mt = [
3182
- "amm-airport-fill",
3183
- "amm-airport-stroke",
3184
- "amm-runway-fill",
3185
- "amm-runway-stroke",
3186
- "amm-runway-info",
3187
- "amm-runway-marking",
3188
- "amm-runway-centerline",
3189
- "amm-runway-threshold-label",
3190
- "amm-apron-fill",
3191
- "amm-apron-stroke",
3192
- "amm-taxiway-fill",
3193
- "amm-taxiway-line",
3194
- "amm-taxiway-label",
3195
- "amm-holding",
3196
- "amm-stand",
3197
- "amm-stand-label",
3198
- "amm-stand-line",
3199
- "amm-restricted-fill",
3200
- "amm-restricted-stroke",
3201
- "amm-hotspot-fill",
3202
- "amm-hotspot-stroke",
3203
- "amm-obstacle-region-fill",
3204
- "amm-obstacle-region-stroke",
3205
- "amm-obstacle-point",
3206
- "amm-obstacle-point-label",
3207
- "amm-construction-fill",
3208
- "amm-construction-stroke",
3209
- "amm-construction-label"
3210
- ], Zt = ["terrain-color", "terrain-hillshade"], Jt = ["contour-line", "contour-label"];
3211
- async function Qt(o) {
3212
- const r = await fetch(o);
3213
- if (!r.ok) throw new Error(`fetch ${o} → ${r.status}`);
3214
- const d = r.headers.get("Content-Encoding"), y = r.headers.get("Content-Type") || "";
3215
- if (d === "gzip" || y.includes("json"))
3216
- return r.json();
3217
- const g = r.body.pipeThrough(new DecompressionStream("gzip"));
3218
- return new Response(g).json();
3219
- }
3220
- class ri {
3221
- /**
3222
- * @param {object} options
3223
- * @param {string|HTMLElement} options.container DOM element id or element
3224
- * @param {'light'|'dark'} [options.theme='light']
3225
- * @param {string} [options.apiUrl] Override server base URL
3226
- * @param {string} [options.spriteUrl] Override sprite server URL (defaults to apiUrl)
3227
- * @param {string} [options.period] Period id; defaults to latest
3228
- * @param {object} [options.layers] Initial layer visibility map
3229
- * @param {[number,number]} [options.center] Initial map center [lng, lat] (default [104, 36])
3230
- * @param {number} [options.zoom] Initial zoom level (default 4)
3231
- * @param {string} [options.terrainUrl] Terrain DEM tile URL template (default internal server)
3232
- */
3233
- constructor(r = {}) {
3234
- const {
3235
- container: d,
3236
- theme: y = "light",
3237
- apiUrl: g = ti,
3238
- spriteUrl: w,
3239
- period: b = null,
3240
- layers: S = {},
3241
- center: O = [104, 36],
3242
- zoom: A = 4,
3243
- terrainUrl: z = null
3244
- } = r;
3245
- return this._apiUrl = g.replace(/\/$/, ""), this._spriteUrl = (w ?? g).replace(/\/$/, ""), this._terrainUrl = z ?? `${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`, this._theme = y, this._period = b, this._center = O, this._zoom = A, this._ready = !1, this._layerVisible = {
3246
- // aviation groups — all visible by default
3247
- adiz: !0,
3248
- fir: !0,
3249
- restricted: !0,
3250
- controlled: !0,
3251
- segment: !0,
3252
- waypoint: !0,
3253
- waypointOffAirway: !0,
3254
- vor: !0,
3255
- ndb: !0,
3256
- airport: !0,
3257
- runway: !0,
3258
- // special groups
3259
- amm: !0,
3260
- terrain: !1,
3261
- contour: !1,
3262
- // user overrides
3263
- ...S
3264
- }, this._initMap(d), new Proxy(this, {
3265
- get(p, x) {
3266
- if (typeof x == "symbol" || Reflect.has(p, x)) {
3267
- const k = p[x];
3268
- return typeof k == "function" ? k.bind(p) : k;
3269
- }
3270
- const T = p._map;
3271
- if (!T) return;
3272
- const D = T[x];
3273
- return typeof D == "function" ? D.bind(T) : D;
3274
- },
3275
- set(p, x, T) {
3276
- return typeof x == "symbol" || Reflect.has(p, x) || !p._map ? p[x] = T : x in p._map ? p._map[x] = T : p[x] = T, !0;
3277
- },
3278
- has(p, x) {
3279
- return Reflect.has(p, x) || (p._map ? x in p._map : !1);
3280
- }
3281
- });
3282
- }
3283
- // ── Map initialization ────────────────────────────────────────────────────
3284
- _initMap(r) {
3285
- const d = ut[this._theme] ?? ut.light;
3286
- this._map = new jt.Map({
3287
- container: r,
3288
- style: {
3289
- version: 8,
3290
- glyphs: "https://aips.siniswift.com/mapsdk/glyphs/{fontstack}/{range}.pbf",
3291
- sprite: [
3292
- { id: "normal", url: `${this._spriteUrl}/sprites/sprite-color` },
3293
- { id: "default", url: `${this._spriteUrl}/sprites/sprite` },
3294
- { id: "v2", url: `${this._spriteUrl}/sprites/sprite-v2` },
3295
- { id: "plane", url: `${this._spriteUrl}/sprites/sprite-plane` }
3296
- ],
3297
- sources: {
3298
- land: { type: "geojson", data: { type: "FeatureCollection", features: [] } },
3299
- boundary: { type: "geojson", data: { type: "FeatureCollection", features: [] } }
3300
- },
3301
- layers: [
3302
- { id: "background", type: "background", paint: { "background-color": d.background } }
3303
- ]
3304
- },
3305
- center: this._center,
3306
- zoom: this._zoom,
3307
- minZoom: 0,
3308
- maxZoom: 17.5,
3309
- crossSourceCollisions: !1,
3310
- maxTileCacheSize: 512,
3311
- prefetchZoomDelta: 1,
3312
- fadeDuration: 0,
3313
- attributionControl: !1
3314
- }), this._map.on("load", async () => {
3315
- await this._initSources(), this._initLayers(), this._applyVisibility(), this._ready = !0, this._map.fire("aviation:ready");
3316
- });
3317
- }
3318
- async _initSources() {
3319
- if (!this._period)
3320
- try {
3321
- const y = await (await fetch(`${this._apiUrl}/api/periods`)).json();
3322
- this._period = y[y.length - 1];
3323
- } catch (d) {
3324
- console.warn("[AviationChart] fetchPeriods failed:", d), this._period = "latest";
3325
- }
3326
- this._map.addSource("navdata", {
3327
- type: "vector",
3328
- tiles: [`${this._apiUrl}/api/tiles/${this._period}/{z}/{x}/{y}.pbf`],
3329
- minzoom: 0.5,
3330
- maxzoom: 18
3331
- }), this._map.addSource("amm", {
3332
- type: "vector",
3333
- tiles: [`${this._apiUrl}/api/amm/{z}/{x}/{y}.pbf`],
3334
- minzoom: 11,
3335
- maxzoom: 18
3336
- }), this._map.addSource("terrain", {
3337
- type: "raster-dem",
3338
- tiles: [this._terrainUrl],
3339
- tileSize: 256,
3340
- encoding: "mapbox",
3341
- maxzoom: 8
3342
- });
3343
- const r = new Be.DemSource({
3344
- url: this._terrainUrl,
3345
- encoding: "mapbox",
3346
- maxzoom: 8,
3347
- worker: !0
3348
- });
3349
- r.setupMaplibre(jt), this._map.addSource("contour", {
3350
- type: "vector",
3351
- tiles: [r.contourProtocolUrl({
3352
- thresholds: {
3353
- 5: [250, 1e3],
3354
- 7: [125, 500],
3355
- 9: [100, 500],
3356
- 11: [50, 500],
3357
- 13: [25, 500]
3358
- },
3359
- elevationKey: "ele",
3360
- levelKey: "level",
3361
- contourLayer: "contours"
3362
- })],
3363
- maxzoom: 13
3364
- }), await this._loadBaseData();
3365
- }
3366
- async _loadBaseData() {
3367
- var r, d, y, g;
3368
- try {
3369
- const [w, b] = await Promise.all([
3370
- Qt(`${this._apiUrl}/topjson/land.topojson.gz`),
3371
- Qt(`${this._apiUrl}/topjson/boundary.topojson.gz`)
3372
- ]);
3373
- (r = w == null ? void 0 : w.objects) != null && r.land ? (d = this._map.getSource("land")) == null || d.setData($t(w, w.objects.land)) : console.warn("[AviationChart] land topojson missing objects.land"), (y = b == null ? void 0 : b.objects) != null && y.boundary ? (g = this._map.getSource("boundary")) == null || g.setData($t(b, b.objects.boundary)) : console.warn("[AviationChart] boundary topojson missing objects.boundary");
3374
- } catch (w) {
3375
- console.error("[AviationChart] loadBaseData failed:", w);
3376
- }
3377
- }
3378
- _initLayers() {
3379
- const r = this._layerVisible.terrain ? "visible" : "none", d = this._layerVisible.contour ? "visible" : "none";
3380
- this._map.addLayer({
3381
- id: "terrain-color",
3382
- type: "color-relief",
3383
- source: "terrain",
3384
- layout: { visibility: r },
3385
- paint: { "color-relief-color": ei }
3386
- }), this._map.addLayer({
3387
- id: "terrain-hillshade",
3388
- type: "hillshade",
3389
- source: "terrain",
3390
- layout: { visibility: r },
3391
- paint: {
3392
- "hillshade-shadow-color": "rgba(74,59,42,0.35)",
3393
- "hillshade-highlight-color": "rgba(255,246,230,0.25)",
3394
- "hillshade-accent-color": "rgba(74,59,42,0.2)",
3395
- "hillshade-exaggeration": 0.45,
3396
- "hillshade-illumination-direction": 315,
3397
- "hillshade-illumination-anchor": "viewport"
3398
- }
3399
- }), this._map.addLayer({
3400
- id: "contour-line",
3401
- type: "line",
3402
- source: "contour",
3403
- "source-layer": "contours",
3404
- layout: { visibility: d },
3405
- paint: {
3406
- "line-color": ["case", ["==", ["get", "level"], 1], "rgba(100,70,40,0.40)", "rgba(120,90,60,0.18)"],
3407
- "line-width": ["case", ["==", ["get", "level"], 1], 1, 0.5]
3408
- }
3409
- }), this._map.addLayer({
3410
- id: "contour-label",
3411
- type: "symbol",
3412
- source: "contour",
3413
- "source-layer": "contours",
3414
- filter: ["==", ["get", "level"], 1],
3415
- layout: {
3416
- visibility: d,
3417
- "symbol-placement": "line",
3418
- "text-field": ["concat", ["to-string", ["get", "ele"]], "m"],
3419
- "text-size": 10,
3420
- "text-font": ["Open Sans Regular"],
3421
- "text-allow-overlap": !0,
3422
- "text-keep-upright": !0
3423
- },
3424
- paint: {
3425
- "text-color": "rgba(100,70,40,0.55)",
3426
- "text-halo-color": "rgba(255,255,255,0.6)",
3427
- "text-halo-width": 1
3428
- }
3429
- }), this._layerVisible.terrain && this._map.setTerrain({ source: "terrain", exaggeration: 4 });
3430
- for (const y of Ht(this._theme))
3431
- this._map.getLayer(y.id) || this._map.addLayer(y);
3432
- for (const y of ["terrain-color", "terrain-hillshade", "contour-line", "contour-label"])
3433
- this._map.getLayer(y) && this._map.getLayer("boundary") && this._map.moveLayer(y, "boundary");
3434
- for (const y of Yt("amm", this._theme))
3435
- this._map.getLayer(y.id) || this._map.addLayer(y, "fir-line");
3436
- }
3437
- _applyVisibility() {
3438
- for (const [g, w] of Object.entries(Ct)) {
3439
- const b = this._layerVisible[g] !== !1 ? "visible" : "none";
3440
- for (const S of w)
3441
- this._map.getLayer(S) && this._map.setLayoutProperty(S, "visibility", b);
3442
- }
3443
- const r = this._layerVisible.amm !== !1 ? "visible" : "none";
3444
- for (const g of Mt)
3445
- this._map.getLayer(g) && this._map.setLayoutProperty(g, "visibility", r);
3446
- const d = this._layerVisible.terrain ? "visible" : "none";
3447
- for (const g of Zt)
3448
- this._map.getLayer(g) && this._map.setLayoutProperty(g, "visibility", d);
3449
- const y = this._layerVisible.contour ? "visible" : "none";
3450
- for (const g of Jt)
3451
- this._map.getLayer(g) && this._map.setLayoutProperty(g, "visibility", y);
3452
- }
3453
- // ── Public API ────────────────────────────────────────────────────────────
3454
- /** Raw MapLibre Map instance */
3455
- get map() {
3456
- return this._map;
3457
- }
3458
- /** Currently active theme id */
3459
- get theme() {
3460
- return this._theme;
3461
- }
3462
- /** Currently active period id */
3463
- get period() {
3464
- return this._period;
3465
- }
3466
- /**
3467
- * Switch the chart theme.
3468
- * @param {'light'|'dark'} theme
3469
- */
3470
- setTheme(r) {
3471
- if (r === this._theme) return;
3472
- this._theme = r;
3473
- const d = ut[r] ?? ut.light;
3474
- this._map.setPaintProperty("background", "background-color", d.background);
3475
- const y = [
3476
- "landLaye",
3477
- "boundary",
3478
- ...Object.values(Ct).flat(),
3479
- ...Mt
3480
- ];
3481
- for (const g of y)
3482
- this._map.getLayer(g) && this._map.removeLayer(g);
3483
- for (const g of Ht(this._theme))
3484
- this._map.addLayer(g);
3485
- for (const g of Yt("amm", this._theme))
3486
- this._map.getLayer(g.id) || this._map.addLayer(g, "fir-line");
3487
- this._applyVisibility();
3488
- }
3489
- /**
3490
- * Show or hide a built-in layer group.
3491
- *
3492
- * Aviation groups: 'adiz' | 'fir' | 'restricted' | 'controlled' |
3493
- * 'segment' | 'waypoint' | 'waypointOffAirway' | 'vor' | 'ndb' |
3494
- * 'airport' | 'runway'
3495
- * Special groups: 'amm' | 'terrain' | 'contour'
3496
- *
3497
- * @param {string} key
3498
- * @param {boolean} visible
3499
- */
3500
- setLayerVisible(r, d) {
3501
- if (this._layerVisible[r] = d, r === "terrain") {
3502
- const w = d ? "visible" : "none";
3503
- for (const b of Zt)
3504
- this._map.getLayer(b) && this._map.setLayoutProperty(b, "visibility", w);
3505
- this._map.setTerrain(d ? { source: "terrain", exaggeration: 4 } : null);
3506
- return;
3507
- }
3508
- if (r === "contour") {
3509
- const w = d ? "visible" : "none";
3510
- for (const b of Jt)
3511
- this._map.getLayer(b) && this._map.setLayoutProperty(b, "visibility", w);
3512
- return;
3513
- }
3514
- if (r === "amm") {
3515
- const w = d ? "visible" : "none";
3516
- for (const b of Mt)
3517
- this._map.getLayer(b) && this._map.setLayoutProperty(b, "visibility", w);
3518
- return;
3519
- }
3520
- const y = Ct[r];
3521
- if (!y) {
3522
- console.warn(`[AviationChart] Unknown layer key: "${r}"`);
3523
- return;
3524
- }
3525
- const g = d ? "visible" : "none";
3526
- for (const w of y)
3527
- this._map.getLayer(w) && this._map.setLayoutProperty(w, "visibility", g);
3528
- }
3529
- /**
3530
- * Switch the navdata period. Fetches tiles for the new period immediately.
3531
- * @param {string} period
3532
- */
3533
- setPeriod(r) {
3534
- var y;
3535
- this._period = r;
3536
- const d = (y = this._map) == null ? void 0 : y.getSource("navdata");
3537
- d && d.setTiles([`${this._apiUrl}/api/tiles/${r}/{z}/{x}/{y}.pbf`]);
3538
- }
3539
- /**
3540
- * Proxy to map.on. Supports both signatures:
3541
- * on(event, listener)
3542
- * on(event, layerId, listener) ← layer-delegated events
3543
- * Returns `this` for chaining.
3544
- */
3545
- on(r, d, y) {
3546
- return typeof d == "string" ? this._map.on(r, d, y) : this._map.on(r, d ?? y), this;
3547
- }
3548
- /**
3549
- * Proxy to map.off. Supports both signatures:
3550
- * off(event, listener)
3551
- * off(event, layerId, listener)
3552
- * Returns `this` for chaining.
3553
- */
3554
- off(r, d, y) {
3555
- return typeof d == "string" ? this._map.off(r, d, y) : this._map.off(r, d ?? y), this;
3556
- }
3557
- /** Proxy to map.once — supports layer-delegated signature too. */
3558
- once(r, d, y) {
3559
- return typeof d == "string" ? this._map.once(r, d, y) : this._map.once(r, d ?? y), this;
3560
- }
3561
- /** Remove the map and release all resources */
3562
- destroy() {
3563
- this._map && (this._map.remove(), this._map = null);
3564
- }
3565
- }
3566
- export {
3567
- oi as AMM_LAYER_GROUPS,
3568
- ri as AviationChart,
3569
- ut as CHART_THEMES,
3570
- Ct as LAYER_GROUPS
3571
- };