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