aviation-chart 0.1.4 → 0.1.6
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 +4 -4
- package/dist/index.cjs +4 -4
- package/dist/index.js +611 -599
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import jt from "maplibre-gl";
|
|
2
2
|
var vt, Rt, Ot;
|
|
3
|
-
function Mt(o,
|
|
3
|
+
function Mt(o, r) {
|
|
4
4
|
if (!vt)
|
|
5
|
-
vt =
|
|
5
|
+
vt = r;
|
|
6
6
|
else if (!Rt)
|
|
7
|
-
Rt =
|
|
7
|
+
Rt = r;
|
|
8
8
|
else {
|
|
9
|
-
var u = "var sharedChunk = {}; (" + vt + ")(sharedChunk); (" + Rt + ")(sharedChunk);",
|
|
10
|
-
vt(
|
|
9
|
+
var u = "var sharedChunk = {}; (" + vt + ")(sharedChunk); (" + Rt + ")(sharedChunk);", g = {};
|
|
10
|
+
vt(g), Ot = r(g), typeof window < "u" && (Ot.workerUrl = window.URL.createObjectURL(
|
|
11
11
|
new Blob([u], { type: "text/javascript" })
|
|
12
12
|
));
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
Mt(["exports"], function(o) {
|
|
16
|
-
class
|
|
16
|
+
class r {
|
|
17
17
|
constructor(e, i) {
|
|
18
18
|
this.start = e, this.end = i, this.points = [], this.append = this.append.bind(this), this.prepend = this.prepend.bind(this);
|
|
19
19
|
}
|
|
@@ -132,124 +132,124 @@ Mt(["exports"], function(o) {
|
|
|
132
132
|
],
|
|
133
133
|
[]
|
|
134
134
|
];
|
|
135
|
-
function
|
|
136
|
-
return e = e * 2 +
|
|
135
|
+
function g(t, e, i, n) {
|
|
136
|
+
return e = e * 2 + n[0], i = i * 2 + n[1], e + i * (t + 1) * 2;
|
|
137
137
|
}
|
|
138
138
|
function y(t, e, i) {
|
|
139
139
|
return (e - t) / (i - t);
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function x(t, e, i = 4096, n = 1) {
|
|
142
142
|
if (!t)
|
|
143
143
|
return {};
|
|
144
|
-
const
|
|
144
|
+
const a = i / (e.width - 1);
|
|
145
145
|
let l, s, c, m, d, f;
|
|
146
|
-
const h = {}, w = /* @__PURE__ */ new Map(),
|
|
147
|
-
function
|
|
148
|
-
|
|
146
|
+
const h = {}, w = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map();
|
|
147
|
+
function P(O, I, R) {
|
|
148
|
+
O[0] === 0 ? R(a * (f - 1), a * (d - y(c, I, l))) : O[0] === 2 ? R(a * f, a * (d - y(m, I, s))) : O[1] === 0 ? R(a * (f - y(s, I, l)), a * (d - 1)) : R(a * (f - y(m, I, c)), a * d);
|
|
149
149
|
}
|
|
150
|
-
for (d = 1 -
|
|
150
|
+
for (d = 1 - n; d < e.height + n; d++) {
|
|
151
151
|
s = e.get(0, d - 1), m = e.get(0, d);
|
|
152
|
-
let
|
|
153
|
-
for (f = 1 -
|
|
152
|
+
let O = Math.min(s, m), I = Math.max(s, m);
|
|
153
|
+
for (f = 1 - n; f < e.width + n; f++) {
|
|
154
154
|
l = s, c = m, s = e.get(f, d - 1), m = e.get(f, d);
|
|
155
|
-
const
|
|
156
|
-
if (
|
|
155
|
+
const R = O, V = I;
|
|
156
|
+
if (O = Math.min(s, m), I = Math.max(s, m), isNaN(l) || isNaN(s) || isNaN(m) || isNaN(c))
|
|
157
157
|
continue;
|
|
158
|
-
const ht = Math.min(
|
|
159
|
-
for (let
|
|
160
|
-
const At = l >
|
|
158
|
+
const ht = Math.min(R, O), pt = Math.max(V, I), X = Math.ceil(ht / t) * t, ot = Math.floor(pt / t) * t;
|
|
159
|
+
for (let C = X; C <= ot; C += t) {
|
|
160
|
+
const At = l > C, q = s > C, nt = c > C, _t = m > C;
|
|
161
161
|
for (const bt of u[(At ? 8 : 0) | (q ? 4 : 0) | (_t ? 2 : 0) | (nt ? 1 : 0)]) {
|
|
162
|
-
let Y = w.get(
|
|
163
|
-
Y || w.set(
|
|
164
|
-
let lt =
|
|
165
|
-
lt ||
|
|
166
|
-
const kt = bt[0], zt = bt[1], yt =
|
|
162
|
+
let Y = w.get(C);
|
|
163
|
+
Y || w.set(C, Y = /* @__PURE__ */ new Map());
|
|
164
|
+
let lt = E.get(C);
|
|
165
|
+
lt || E.set(C, lt = /* @__PURE__ */ new Map());
|
|
166
|
+
const kt = bt[0], zt = bt[1], yt = g(e.width, f, d, kt), st = g(e.width, f, d, zt);
|
|
167
167
|
let L, Tt;
|
|
168
168
|
if (L = lt.get(yt))
|
|
169
169
|
if (lt.delete(yt), Tt = Y.get(st))
|
|
170
170
|
if (Y.delete(st), L === Tt) {
|
|
171
|
-
if (
|
|
172
|
-
let rt = h[
|
|
173
|
-
rt || (h[
|
|
171
|
+
if (P(zt, C, L.append), !L.isEmpty()) {
|
|
172
|
+
let rt = h[C];
|
|
173
|
+
rt || (h[C] = rt = []), rt.push(L.lineString());
|
|
174
174
|
}
|
|
175
175
|
} else
|
|
176
176
|
L.appendFragment(Tt), lt.set(L.end = Tt.end, L);
|
|
177
177
|
else
|
|
178
|
-
|
|
178
|
+
P(zt, C, L.append), lt.set(L.end = st, L);
|
|
179
179
|
else if (L = Y.get(st))
|
|
180
|
-
Y.delete(st),
|
|
180
|
+
Y.delete(st), P(kt, C, L.prepend), Y.set(L.start = yt, L);
|
|
181
181
|
else {
|
|
182
|
-
const rt = new
|
|
183
|
-
|
|
182
|
+
const rt = new r(yt, st);
|
|
183
|
+
P(kt, C, rt.append), P(zt, C, rt.append), Y.set(yt, rt), lt.set(st, rt);
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
for (const [
|
|
190
|
-
let
|
|
189
|
+
for (const [O, I] of w.entries()) {
|
|
190
|
+
let R = null;
|
|
191
191
|
for (const V of I.values())
|
|
192
|
-
V.isEmpty() || (
|
|
192
|
+
V.isEmpty() || (R == null && (R = h[O] || (h[O] = [])), R.push(V.lineString()));
|
|
193
193
|
}
|
|
194
194
|
return h;
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function b(t) {
|
|
197
197
|
const e = Object.entries(t);
|
|
198
|
-
return e.sort(([i], [
|
|
198
|
+
return e.sort(([i], [n]) => i < n ? -1 : i > n ? 1 : 0), e;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
201
|
-
return
|
|
200
|
+
function F(t) {
|
|
201
|
+
return b(t).map(([e, i]) => [e, ...typeof i == "number" ? [i] : i].join("*")).join("~");
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function k(t) {
|
|
204
204
|
return Object.fromEntries(t.split("~").map((e) => e.split("*").map(Number)).map(([e, ...i]) => [e, i]));
|
|
205
205
|
}
|
|
206
|
-
function
|
|
207
|
-
return
|
|
206
|
+
function A({ thresholds: t, ...e }) {
|
|
207
|
+
return b({ thresholds: F(t), ...e }).map(([i, n]) => `${encodeURIComponent(i)}=${encodeURIComponent(n)}`).join("&");
|
|
208
208
|
}
|
|
209
209
|
function z(t) {
|
|
210
210
|
return Object.fromEntries(t.replace(/^.*\?/, "").split("&").map((e) => {
|
|
211
|
-
const i = e.split("=").map(decodeURIComponent),
|
|
212
|
-
let
|
|
213
|
-
switch (
|
|
211
|
+
const i = e.split("=").map(decodeURIComponent), n = i[0];
|
|
212
|
+
let a = i[1];
|
|
213
|
+
switch (n) {
|
|
214
214
|
case "thresholds":
|
|
215
|
-
|
|
215
|
+
a = k(a);
|
|
216
216
|
break;
|
|
217
217
|
case "extent":
|
|
218
218
|
case "multiplier":
|
|
219
219
|
case "overzoom":
|
|
220
220
|
case "buffer":
|
|
221
|
-
|
|
221
|
+
a = Number(a);
|
|
222
222
|
}
|
|
223
|
-
return [
|
|
223
|
+
return [n, a];
|
|
224
224
|
}));
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
return
|
|
226
|
+
function p(t) {
|
|
227
|
+
return b(t).map(([e, i]) => `${encodeURIComponent(e)}=${encodeURIComponent(i)}`).join(",");
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
const { thresholds: i, ...
|
|
231
|
-
let
|
|
229
|
+
function _(t, e) {
|
|
230
|
+
const { thresholds: i, ...n } = t;
|
|
231
|
+
let a = [], l = -1 / 0;
|
|
232
232
|
return Object.entries(i).forEach(([s, c]) => {
|
|
233
233
|
const m = Number(s);
|
|
234
|
-
m <= e && m > l && (l = m,
|
|
234
|
+
m <= e && m > l && (l = m, a = typeof c == "number" ? [c] : c);
|
|
235
235
|
}), {
|
|
236
|
-
levels:
|
|
237
|
-
...
|
|
236
|
+
levels: a,
|
|
237
|
+
...n
|
|
238
238
|
};
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function v(t) {
|
|
241
241
|
const e = new ArrayBuffer(t.byteLength);
|
|
242
242
|
return new Uint8Array(e).set(new Uint8Array(t)), e;
|
|
243
243
|
}
|
|
244
244
|
function S(t, e) {
|
|
245
|
-
return t.then(({ data: i, ...
|
|
246
|
-
let
|
|
247
|
-
return e && (
|
|
245
|
+
return t.then(({ data: i, ...n }) => {
|
|
246
|
+
let a = i;
|
|
247
|
+
return e && (a = new Float32Array(i.length), a.set(i)), { ...n, data: a, transferrables: [a.buffer] };
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function M(t) {
|
|
251
251
|
return t.then(({ arrayBuffer: e }) => {
|
|
252
|
-
const i =
|
|
252
|
+
const i = v(e);
|
|
253
253
|
return {
|
|
254
254
|
arrayBuffer: i,
|
|
255
255
|
transferrables: [i]
|
|
@@ -265,13 +265,13 @@ Mt(["exports"], function(o) {
|
|
|
265
265
|
if (tt == null && (tt = !1, ct() && typeof VideoFrame < "u")) {
|
|
266
266
|
const i = new OffscreenCanvas(5, 5).getContext("2d", { willReadFrequently: !0 });
|
|
267
267
|
if (i) {
|
|
268
|
-
for (let
|
|
269
|
-
const l =
|
|
270
|
-
i.fillStyle = `rgb(${l},${l + 1},${l + 2})`, i.fillRect(
|
|
268
|
+
for (let a = 0; a < 5 * 5; a++) {
|
|
269
|
+
const l = a * 4;
|
|
270
|
+
i.fillStyle = `rgb(${l},${l + 1},${l + 2})`, i.fillRect(a % 5, Math.floor(a / 5), 1, 1);
|
|
271
271
|
}
|
|
272
|
-
const
|
|
273
|
-
for (let
|
|
274
|
-
if (
|
|
272
|
+
const n = i.getImageData(0, 0, 5, 5).data;
|
|
273
|
+
for (let a = 0; a < 5 * 5 * 4; a++)
|
|
274
|
+
if (a % 4 !== 3 && n[a] !== a) {
|
|
275
275
|
tt = !0;
|
|
276
276
|
break;
|
|
277
277
|
}
|
|
@@ -280,20 +280,20 @@ Mt(["exports"], function(o) {
|
|
|
280
280
|
return tt || !1;
|
|
281
281
|
}
|
|
282
282
|
function G(t, e, i) {
|
|
283
|
-
let
|
|
283
|
+
let n = () => {
|
|
284
284
|
};
|
|
285
|
-
const
|
|
286
|
-
|
|
285
|
+
const a = setTimeout(() => {
|
|
286
|
+
n(new Error("timed out")), i == null || i.abort();
|
|
287
287
|
}, t);
|
|
288
288
|
U(i, () => {
|
|
289
|
-
|
|
289
|
+
n(new Error("aborted")), clearTimeout(a);
|
|
290
290
|
});
|
|
291
291
|
const l = new Promise((s, c) => {
|
|
292
|
-
|
|
292
|
+
n = c;
|
|
293
293
|
});
|
|
294
294
|
return Promise.race([
|
|
295
295
|
l,
|
|
296
|
-
e.finally(() => clearTimeout(
|
|
296
|
+
e.finally(() => clearTimeout(a))
|
|
297
297
|
]);
|
|
298
298
|
}
|
|
299
299
|
function U(t, e) {
|
|
@@ -303,25 +303,25 @@ Mt(["exports"], function(o) {
|
|
|
303
303
|
var e;
|
|
304
304
|
return !!(!((e = t == null ? void 0 : t.signal) === null || e === void 0) && e.aborted);
|
|
305
305
|
}
|
|
306
|
-
let
|
|
306
|
+
let D = 0;
|
|
307
307
|
class Z {
|
|
308
308
|
constructor(e = 100) {
|
|
309
|
-
this.size = () => this.items.size, this.get = (i,
|
|
309
|
+
this.size = () => this.items.size, this.get = (i, n, a) => {
|
|
310
310
|
let l = this.items.get(i);
|
|
311
311
|
if (l)
|
|
312
|
-
l.lastUsed = ++
|
|
312
|
+
l.lastUsed = ++D, l.waiting++;
|
|
313
313
|
else {
|
|
314
|
-
const d = new AbortController(), f =
|
|
314
|
+
const d = new AbortController(), f = n(i, d);
|
|
315
315
|
l = {
|
|
316
316
|
abortController: d,
|
|
317
317
|
item: f,
|
|
318
|
-
lastUsed: ++
|
|
318
|
+
lastUsed: ++D,
|
|
319
319
|
waiting: 1
|
|
320
320
|
}, this.items.set(i, l), this.prune();
|
|
321
321
|
}
|
|
322
322
|
const s = this.items, c = l.item.then((d) => d, (d) => (s.delete(i), Promise.reject(d)));
|
|
323
323
|
let m = !1;
|
|
324
|
-
return U(
|
|
324
|
+
return U(a, () => {
|
|
325
325
|
var d;
|
|
326
326
|
l && l.abortController && !m && (m = !0, --l.waiting <= 0 && ((d = l.abortController) === null || d === void 0 || d.abort(), s.delete(i)));
|
|
327
327
|
}), c;
|
|
@@ -330,16 +330,16 @@ Mt(["exports"], function(o) {
|
|
|
330
330
|
prune() {
|
|
331
331
|
if (this.items.size > this.maxSize) {
|
|
332
332
|
let e, i = 1 / 0;
|
|
333
|
-
this.items.forEach((
|
|
334
|
-
|
|
333
|
+
this.items.forEach((n, a) => {
|
|
334
|
+
n.lastUsed < i && (i = n.lastUsed, e = a);
|
|
335
335
|
}), typeof e < "u" && this.items.delete(e);
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
let K, et, N, it;
|
|
340
340
|
async function at(t, e, i) {
|
|
341
|
-
const
|
|
342
|
-
return B(i) ? null : W(
|
|
341
|
+
const n = await createImageBitmap(t);
|
|
342
|
+
return B(i) ? null : W(n, e);
|
|
343
343
|
}
|
|
344
344
|
function W(t, e) {
|
|
345
345
|
return K || (K = new OffscreenCanvas(t.width, t.height), et = K.getContext("2d", {
|
|
@@ -347,19 +347,19 @@ Mt(["exports"], function(o) {
|
|
|
347
347
|
})), Lt(t, e, K, et);
|
|
348
348
|
}
|
|
349
349
|
async function xt(t, e, i) {
|
|
350
|
-
var
|
|
350
|
+
var n, a, l;
|
|
351
351
|
const s = await createImageBitmap(t);
|
|
352
352
|
if (B(i))
|
|
353
353
|
return null;
|
|
354
354
|
const c = new VideoFrame(s, { timestamp: 0 });
|
|
355
355
|
try {
|
|
356
|
-
if (!(((
|
|
356
|
+
if (!(((n = c == null ? void 0 : c.format) === null || n === void 0 ? void 0 : n.startsWith("BGR")) || ((a = c == null ? void 0 : c.format) === null || a === void 0 ? void 0 : a.startsWith("RGB"))))
|
|
357
357
|
throw new Error(`Unrecognized format: ${c == null ? void 0 : c.format}`);
|
|
358
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
359
|
if (await c.copyTo(h), d)
|
|
360
360
|
for (let w = 0; w < h.length; w += 4) {
|
|
361
|
-
const
|
|
362
|
-
h[w] = h[w + 2], h[w + 2] =
|
|
361
|
+
const E = h[w];
|
|
362
|
+
h[w] = h[w + 2], h[w + 2] = E;
|
|
363
363
|
}
|
|
364
364
|
return Dt(s.width, s.height, e, h);
|
|
365
365
|
} catch {
|
|
@@ -368,83 +368,83 @@ Mt(["exports"], function(o) {
|
|
|
368
368
|
c.close();
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
async function
|
|
371
|
+
async function qt(t, e, i) {
|
|
372
372
|
N || (N = document.createElement("canvas"), it = N.getContext("2d", {
|
|
373
373
|
willReadFrequently: !0
|
|
374
374
|
}));
|
|
375
|
-
const
|
|
376
|
-
U(i, () =>
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
B(i) || l(
|
|
380
|
-
},
|
|
375
|
+
const n = new Image();
|
|
376
|
+
U(i, () => n.src = "");
|
|
377
|
+
const a = await new Promise((l, s) => {
|
|
378
|
+
n.onload = () => {
|
|
379
|
+
B(i) || l(n), URL.revokeObjectURL(n.src), n.onload = null;
|
|
380
|
+
}, n.onerror = () => s(new Error("Could not load image.")), n.src = t.size ? URL.createObjectURL(t) : "";
|
|
381
381
|
});
|
|
382
|
-
return Lt(
|
|
382
|
+
return Lt(a, e, N, it);
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function te(t, e, i) {
|
|
385
385
|
return self.actor.send("decodeImage", [], i, void 0, t, e);
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function ee() {
|
|
388
388
|
return (
|
|
389
389
|
// @ts-ignore
|
|
390
390
|
typeof WorkerGlobalScope < "u" && typeof self < "u" && // @ts-ignore
|
|
391
391
|
self instanceof WorkerGlobalScope
|
|
392
392
|
);
|
|
393
393
|
}
|
|
394
|
-
const It = H() ? xt : ct() ? at :
|
|
395
|
-
function Lt(t, e, i,
|
|
396
|
-
if (i.width = t.width, i.height = t.height, !
|
|
394
|
+
const It = H() ? xt : ct() ? at : ee() ? te : qt;
|
|
395
|
+
function Lt(t, e, i, n) {
|
|
396
|
+
if (i.width = t.width, i.height = t.height, !n)
|
|
397
397
|
throw new Error("failed to get context");
|
|
398
|
-
|
|
399
|
-
const
|
|
400
|
-
return Dt(t.width, t.height, e,
|
|
401
|
-
}
|
|
402
|
-
function Dt(t, e, i,
|
|
403
|
-
const
|
|
404
|
-
for (let s = 0; s <
|
|
405
|
-
l[s / 4] =
|
|
398
|
+
n.drawImage(t, 0, 0, t.width, t.height);
|
|
399
|
+
const a = n.getImageData(0, 0, t.width, t.height).data;
|
|
400
|
+
return Dt(t.width, t.height, e, a);
|
|
401
|
+
}
|
|
402
|
+
function Dt(t, e, i, n) {
|
|
403
|
+
const a = i === "mapbox" ? (s, c, m) => -1e4 + (s * 256 * 256 + c * 256 + m) * 0.1 : (s, c, m) => s * 256 + c + m / 256 - 32768, l = new Float32Array(t * e);
|
|
404
|
+
for (let s = 0; s < n.length; s += 4)
|
|
405
|
+
l[s / 4] = a(n[s], n[s + 1], n[s + 2]);
|
|
406
406
|
return { width: t, height: e, data: l };
|
|
407
407
|
}
|
|
408
|
-
const
|
|
409
|
-
function
|
|
410
|
-
return !isNaN(t) && t >=
|
|
408
|
+
const ie = -12e3, oe = 9e3;
|
|
409
|
+
function re(t) {
|
|
410
|
+
return !isNaN(t) && t >= ie && t <= oe;
|
|
411
411
|
}
|
|
412
412
|
class $ {
|
|
413
|
-
constructor(e, i,
|
|
414
|
-
this.split = (
|
|
415
|
-
if (
|
|
413
|
+
constructor(e, i, n) {
|
|
414
|
+
this.split = (a, l, s) => {
|
|
415
|
+
if (a === 0)
|
|
416
416
|
return this;
|
|
417
|
-
const c = 1 <<
|
|
417
|
+
const c = 1 << a, m = l * this.width / c, d = s * this.height / c;
|
|
418
418
|
return new $(this.width / c, this.height / c, (f, h) => this.get(f + m, h + d));
|
|
419
|
-
}, this.subsamplePixelCenters = (
|
|
419
|
+
}, this.subsamplePixelCenters = (a) => {
|
|
420
420
|
const l = (m, d, f) => isNaN(m) ? d : isNaN(d) ? m : m + (d - m) * f;
|
|
421
|
-
if (
|
|
421
|
+
if (a <= 1)
|
|
422
422
|
return this;
|
|
423
|
-
const s = 0.5 - 1 / (2 *
|
|
424
|
-
const f = m /
|
|
423
|
+
const s = 0.5 - 1 / (2 * a), c = (m, d) => {
|
|
424
|
+
const f = m / a - s, h = d / a - s, w = Math.floor(f), E = Math.floor(h), P = this.get(w, E), O = this.get(w + 1, E), I = this.get(w, E + 1), R = this.get(w + 1, E + 1), V = f - w, ht = h - E, pt = l(P, O, V), X = l(I, R, V);
|
|
425
425
|
return l(pt, X, ht);
|
|
426
426
|
};
|
|
427
|
-
return new $(this.width *
|
|
428
|
-
}, this.averagePixelCentersToGrid = (
|
|
427
|
+
return new $(this.width * a, this.height * a, c);
|
|
428
|
+
}, this.averagePixelCentersToGrid = (a = 1) => new $(this.width + 1, this.height + 1, (l, s) => {
|
|
429
429
|
let c = 0, m = 0, d = 0;
|
|
430
|
-
for (let f = l -
|
|
431
|
-
for (let h = s -
|
|
430
|
+
for (let f = l - a; f < l + a; f++)
|
|
431
|
+
for (let h = s - a; h < s + a; h++)
|
|
432
432
|
isNaN(d = this.get(f, h)) || (m++, c += d);
|
|
433
433
|
return m === 0 ? NaN : c / m;
|
|
434
|
-
}), this.scaleElevation = (
|
|
435
|
-
const l = this.width + 2 *
|
|
434
|
+
}), this.scaleElevation = (a) => a === 1 ? this : new $(this.width, this.height, (l, s) => this.get(l, s) * a), this.materialize = (a = 2) => {
|
|
435
|
+
const l = this.width + 2 * a, s = new Float32Array(l * (this.height + 2 * a));
|
|
436
436
|
let c = 0;
|
|
437
|
-
for (let m = -
|
|
438
|
-
for (let d = -
|
|
437
|
+
for (let m = -a; m < this.height + a; m++)
|
|
438
|
+
for (let d = -a; d < this.width + a; d++)
|
|
439
439
|
s[c++] = this.get(d, m);
|
|
440
|
-
return new $(this.width, this.height, (m, d) => s[(d +
|
|
441
|
-
}, this.get =
|
|
440
|
+
return new $(this.width, this.height, (m, d) => s[(d + a) * l + m + a]);
|
|
441
|
+
}, this.get = n, this.width = e, this.height = i;
|
|
442
442
|
}
|
|
443
443
|
/** Construct a height tile from raw DEM pixel values */
|
|
444
444
|
static fromRawDem(e) {
|
|
445
|
-
return new $(e.width, e.height, (i,
|
|
446
|
-
const
|
|
447
|
-
return
|
|
445
|
+
return new $(e.width, e.height, (i, n) => {
|
|
446
|
+
const a = e.data[n * e.width + i];
|
|
447
|
+
return re(a) ? a : NaN;
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
450
|
/**
|
|
@@ -459,48 +459,48 @@ Mt(["exports"], function(o) {
|
|
|
459
459
|
const i = e[4];
|
|
460
460
|
if (!i)
|
|
461
461
|
return;
|
|
462
|
-
const
|
|
463
|
-
return new $(
|
|
462
|
+
const n = i.width, a = i.height;
|
|
463
|
+
return new $(n, a, (l, s) => {
|
|
464
464
|
let c = 0;
|
|
465
|
-
s < 0 ? s +=
|
|
465
|
+
s < 0 ? s += a : s < a ? c += 3 : (s -= a, c += 6), l < 0 ? l += n : l < n ? c += 1 : (l -= n, c += 2);
|
|
466
466
|
const m = e[c];
|
|
467
467
|
return m ? m.get(l, s) : NaN;
|
|
468
468
|
});
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function ae(t) {
|
|
472
472
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
473
473
|
}
|
|
474
474
|
var Et = {};
|
|
475
475
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
476
|
-
Et.read = function(t, e, i,
|
|
477
|
-
var l, s, c =
|
|
478
|
-
for (h += w, l =
|
|
476
|
+
Et.read = function(t, e, i, n, a) {
|
|
477
|
+
var l, s, c = a * 8 - n - 1, m = (1 << c) - 1, d = m >> 1, f = -7, h = i ? a - 1 : 0, w = i ? -1 : 1, E = t[e + h];
|
|
478
|
+
for (h += w, l = E & (1 << -f) - 1, E >>= -f, f += c; f > 0; l = l * 256 + t[e + h], h += w, f -= 8)
|
|
479
479
|
;
|
|
480
|
-
for (s = l & (1 << -f) - 1, l >>= -f, f +=
|
|
480
|
+
for (s = l & (1 << -f) - 1, l >>= -f, f += n; f > 0; s = s * 256 + t[e + h], h += w, f -= 8)
|
|
481
481
|
;
|
|
482
482
|
if (l === 0)
|
|
483
483
|
l = 1 - d;
|
|
484
484
|
else {
|
|
485
485
|
if (l === m)
|
|
486
|
-
return s ? NaN : (
|
|
487
|
-
s = s + Math.pow(2,
|
|
486
|
+
return s ? NaN : (E ? -1 : 1) * (1 / 0);
|
|
487
|
+
s = s + Math.pow(2, n), l = l - d;
|
|
488
488
|
}
|
|
489
|
-
return (
|
|
490
|
-
}, Et.write = function(t, e, i,
|
|
491
|
-
var s, c, m, d = l * 8 -
|
|
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,
|
|
489
|
+
return (E ? -1 : 1) * s * Math.pow(2, l - n);
|
|
490
|
+
}, Et.write = function(t, e, i, n, a, l) {
|
|
491
|
+
var s, c, m, d = l * 8 - a - 1, f = (1 << d) - 1, h = f >> 1, w = a === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, E = n ? 0 : l - 1, P = n ? 1 : -1, O = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
|
|
492
|
+
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (c = isNaN(e) ? 1 : 0, s = 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, a), s = s + h) : (c = e * Math.pow(2, h - 1) * Math.pow(2, a), s = 0)); a >= 8; t[i + E] = c & 255, E += P, c /= 256, a -= 8)
|
|
493
493
|
;
|
|
494
|
-
for (s = s <<
|
|
494
|
+
for (s = s << a | c, d += a; d > 0; t[i + E] = s & 255, E += P, s /= 256, d -= 8)
|
|
495
495
|
;
|
|
496
|
-
t[i +
|
|
496
|
+
t[i + E - P] |= O * 128;
|
|
497
497
|
};
|
|
498
|
-
var
|
|
498
|
+
var ne = T, gt = Et;
|
|
499
499
|
function T(t) {
|
|
500
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
501
|
}
|
|
502
502
|
T.Varint = 0, T.Fixed64 = 1, T.Bytes = 2, T.Fixed32 = 5;
|
|
503
|
-
var Ft = 65536 * 65536, Gt = 1 / Ft,
|
|
503
|
+
var Ft = 65536 * 65536, Gt = 1 / Ft, le = 12, Bt = typeof TextDecoder > "u" ? null : new TextDecoder("utf8");
|
|
504
504
|
T.prototype = {
|
|
505
505
|
destroy: function() {
|
|
506
506
|
this.buf = null;
|
|
@@ -508,8 +508,8 @@ Mt(["exports"], function(o) {
|
|
|
508
508
|
// === READING =================================================================
|
|
509
509
|
readFields: function(t, e, i) {
|
|
510
510
|
for (i = i || this.length; this.pos < i; ) {
|
|
511
|
-
var
|
|
512
|
-
this.type =
|
|
511
|
+
var n = this.readVarint(), a = n >> 3, l = this.pos;
|
|
512
|
+
this.type = n & 7, t(a, e, this), this.pos === l && this.skip(n);
|
|
513
513
|
}
|
|
514
514
|
return e;
|
|
515
515
|
},
|
|
@@ -542,8 +542,8 @@ Mt(["exports"], function(o) {
|
|
|
542
542
|
return this.pos += 8, t;
|
|
543
543
|
},
|
|
544
544
|
readVarint: function(t) {
|
|
545
|
-
var e = this.buf, i,
|
|
546
|
-
return
|
|
545
|
+
var e = this.buf, i, n;
|
|
546
|
+
return n = e[this.pos++], i = n & 127, n < 128 || (n = e[this.pos++], i |= (n & 127) << 7, n < 128) || (n = e[this.pos++], i |= (n & 127) << 14, n < 128) || (n = e[this.pos++], i |= (n & 127) << 21, n < 128) ? i : (n = e[this.pos], i |= (n & 15) << 28, se(i, t, this));
|
|
547
547
|
},
|
|
548
548
|
readVarint64: function() {
|
|
549
549
|
return this.readVarint(!0);
|
|
@@ -557,7 +557,7 @@ Mt(["exports"], function(o) {
|
|
|
557
557
|
},
|
|
558
558
|
readString: function() {
|
|
559
559
|
var t = this.readVarint() + this.pos, e = this.pos;
|
|
560
|
-
return this.pos = t, t - e >=
|
|
560
|
+
return this.pos = t, t - e >= le && Bt ? ze(this.buf, e, t) : be(this.buf, e, t);
|
|
561
561
|
},
|
|
562
562
|
readBytes: function() {
|
|
563
563
|
var t = this.readVarint() + this.pos, e = this.buf.subarray(this.pos, t);
|
|
@@ -655,7 +655,7 @@ Mt(["exports"], function(o) {
|
|
|
655
655
|
},
|
|
656
656
|
writeVarint: function(t) {
|
|
657
657
|
if (t = +t || 0, t > 268435455 || t < 0) {
|
|
658
|
-
|
|
658
|
+
ce(t, this);
|
|
659
659
|
return;
|
|
660
660
|
}
|
|
661
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)));
|
|
@@ -669,7 +669,7 @@ Mt(["exports"], function(o) {
|
|
|
669
669
|
writeString: function(t) {
|
|
670
670
|
t = String(t), this.realloc(t.length * 4), this.pos++;
|
|
671
671
|
var e = this.pos;
|
|
672
|
-
this.pos =
|
|
672
|
+
this.pos = Te(this.buf, t, this.pos);
|
|
673
673
|
var i = this.pos - e;
|
|
674
674
|
i >= 128 && Xt(e, i, this), this.pos = e - 1, this.writeVarint(i), this.pos += i;
|
|
675
675
|
},
|
|
@@ -688,38 +688,38 @@ Mt(["exports"], function(o) {
|
|
|
688
688
|
this.pos++;
|
|
689
689
|
var i = this.pos;
|
|
690
690
|
t(e, this);
|
|
691
|
-
var
|
|
692
|
-
|
|
691
|
+
var n = this.pos - i;
|
|
692
|
+
n >= 128 && Xt(i, n, this), this.pos = i - 1, this.writeVarint(n), this.pos += n;
|
|
693
693
|
},
|
|
694
694
|
writeMessage: function(t, e, i) {
|
|
695
695
|
this.writeTag(t, T.Bytes), this.writeRawMessage(e, i);
|
|
696
696
|
},
|
|
697
697
|
writePackedVarint: function(t, e) {
|
|
698
|
-
e.length && this.writeMessage(t,
|
|
698
|
+
e.length && this.writeMessage(t, fe, e);
|
|
699
699
|
},
|
|
700
700
|
writePackedSVarint: function(t, e) {
|
|
701
|
-
e.length && this.writeMessage(t,
|
|
701
|
+
e.length && this.writeMessage(t, he, e);
|
|
702
702
|
},
|
|
703
703
|
writePackedBoolean: function(t, e) {
|
|
704
|
-
e.length && this.writeMessage(t,
|
|
704
|
+
e.length && this.writeMessage(t, ye, e);
|
|
705
705
|
},
|
|
706
706
|
writePackedFloat: function(t, e) {
|
|
707
|
-
e.length && this.writeMessage(t,
|
|
707
|
+
e.length && this.writeMessage(t, ue, e);
|
|
708
708
|
},
|
|
709
709
|
writePackedDouble: function(t, e) {
|
|
710
|
-
e.length && this.writeMessage(t,
|
|
710
|
+
e.length && this.writeMessage(t, pe, e);
|
|
711
711
|
},
|
|
712
712
|
writePackedFixed32: function(t, e) {
|
|
713
|
-
e.length && this.writeMessage(t,
|
|
713
|
+
e.length && this.writeMessage(t, xe, e);
|
|
714
714
|
},
|
|
715
715
|
writePackedSFixed32: function(t, e) {
|
|
716
|
-
e.length && this.writeMessage(t,
|
|
716
|
+
e.length && this.writeMessage(t, ge, e);
|
|
717
717
|
},
|
|
718
718
|
writePackedFixed64: function(t, e) {
|
|
719
|
-
e.length && this.writeMessage(t,
|
|
719
|
+
e.length && this.writeMessage(t, we, e);
|
|
720
720
|
},
|
|
721
721
|
writePackedSFixed64: function(t, e) {
|
|
722
|
-
e.length && this.writeMessage(t,
|
|
722
|
+
e.length && this.writeMessage(t, _e, e);
|
|
723
723
|
},
|
|
724
724
|
writeBytesField: function(t, e) {
|
|
725
725
|
this.writeTag(t, T.Bytes), this.writeBytes(e);
|
|
@@ -755,9 +755,9 @@ Mt(["exports"], function(o) {
|
|
|
755
755
|
this.writeVarintField(t, !!e);
|
|
756
756
|
}
|
|
757
757
|
};
|
|
758
|
-
function
|
|
759
|
-
var
|
|
760
|
-
if (l =
|
|
758
|
+
function se(t, e, i) {
|
|
759
|
+
var n = i.buf, a, l;
|
|
760
|
+
if (l = n[i.pos++], a = (l & 112) >> 4, l < 128 || (l = n[i.pos++], a |= (l & 127) << 3, l < 128) || (l = n[i.pos++], a |= (l & 127) << 10, l < 128) || (l = n[i.pos++], a |= (l & 127) << 17, l < 128) || (l = n[i.pos++], a |= (l & 127) << 24, l < 128) || (l = n[i.pos++], a |= (l & 1) << 31, l < 128)) return mt(t, a, e);
|
|
761
761
|
throw new Error("Expected varint not more than 10 bytes");
|
|
762
762
|
}
|
|
763
763
|
function J(t) {
|
|
@@ -766,49 +766,49 @@ Mt(["exports"], function(o) {
|
|
|
766
766
|
function mt(t, e, i) {
|
|
767
767
|
return i ? e * 4294967296 + (t >>> 0) : (e >>> 0) * 4294967296 + (t >>> 0);
|
|
768
768
|
}
|
|
769
|
-
function
|
|
770
|
-
var i,
|
|
771
|
-
if (t >= 0 ? (i = t % 4294967296 | 0,
|
|
769
|
+
function ce(t, e) {
|
|
770
|
+
var i, n;
|
|
771
|
+
if (t >= 0 ? (i = t % 4294967296 | 0, n = t / 4294967296 | 0) : (i = ~(-t % 4294967296), n = ~(-t / 4294967296), i ^ 4294967295 ? i = i + 1 | 0 : (i = 0, n = n + 1 | 0)), t >= 18446744073709552e3 || t < -18446744073709552e3)
|
|
772
772
|
throw new Error("Given varint doesn't fit into 10 bytes");
|
|
773
|
-
e.realloc(10),
|
|
773
|
+
e.realloc(10), me(i, n, e), de(n, e);
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function me(t, e, i) {
|
|
776
776
|
i.buf[i.pos++] = t & 127 | 128, t >>>= 7, i.buf[i.pos++] = t & 127 | 128, t >>>= 7, i.buf[i.pos++] = t & 127 | 128, t >>>= 7, i.buf[i.pos++] = t & 127 | 128, t >>>= 7, i.buf[i.pos] = t & 127;
|
|
777
777
|
}
|
|
778
|
-
function
|
|
778
|
+
function de(t, e) {
|
|
779
779
|
var i = (t & 7) << 4;
|
|
780
780
|
e.buf[e.pos++] |= i | ((t >>>= 3) ? 128 : 0), t && (e.buf[e.pos++] = t & 127 | ((t >>>= 7) ? 128 : 0), t && (e.buf[e.pos++] = t & 127 | ((t >>>= 7) ? 128 : 0), t && (e.buf[e.pos++] = t & 127 | ((t >>>= 7) ? 128 : 0), t && (e.buf[e.pos++] = t & 127 | ((t >>>= 7) ? 128 : 0), t && (e.buf[e.pos++] = t & 127)))));
|
|
781
781
|
}
|
|
782
782
|
function Xt(t, e, i) {
|
|
783
|
-
var
|
|
784
|
-
i.realloc(
|
|
785
|
-
for (var
|
|
783
|
+
var n = e <= 16383 ? 1 : e <= 2097151 ? 2 : e <= 268435455 ? 3 : Math.floor(Math.log(e) / (Math.LN2 * 7));
|
|
784
|
+
i.realloc(n);
|
|
785
|
+
for (var a = i.pos - 1; a >= t; a--) i.buf[a + n] = i.buf[a];
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function fe(t, e) {
|
|
788
788
|
for (var i = 0; i < t.length; i++) e.writeVarint(t[i]);
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function he(t, e) {
|
|
791
791
|
for (var i = 0; i < t.length; i++) e.writeSVarint(t[i]);
|
|
792
792
|
}
|
|
793
|
-
function
|
|
793
|
+
function ue(t, e) {
|
|
794
794
|
for (var i = 0; i < t.length; i++) e.writeFloat(t[i]);
|
|
795
795
|
}
|
|
796
|
-
function
|
|
796
|
+
function pe(t, e) {
|
|
797
797
|
for (var i = 0; i < t.length; i++) e.writeDouble(t[i]);
|
|
798
798
|
}
|
|
799
|
-
function
|
|
799
|
+
function ye(t, e) {
|
|
800
800
|
for (var i = 0; i < t.length; i++) e.writeBoolean(t[i]);
|
|
801
801
|
}
|
|
802
|
-
function
|
|
802
|
+
function xe(t, e) {
|
|
803
803
|
for (var i = 0; i < t.length; i++) e.writeFixed32(t[i]);
|
|
804
804
|
}
|
|
805
|
-
function
|
|
805
|
+
function ge(t, e) {
|
|
806
806
|
for (var i = 0; i < t.length; i++) e.writeSFixed32(t[i]);
|
|
807
807
|
}
|
|
808
|
-
function
|
|
808
|
+
function we(t, e) {
|
|
809
809
|
for (var i = 0; i < t.length; i++) e.writeFixed64(t[i]);
|
|
810
810
|
}
|
|
811
|
-
function
|
|
811
|
+
function _e(t, e) {
|
|
812
812
|
for (var i = 0; i < t.length; i++) e.writeSFixed64(t[i]);
|
|
813
813
|
}
|
|
814
814
|
function wt(t, e) {
|
|
@@ -820,49 +820,49 @@ Mt(["exports"], function(o) {
|
|
|
820
820
|
function Nt(t, e) {
|
|
821
821
|
return (t[e] | t[e + 1] << 8 | t[e + 2] << 16) + (t[e + 3] << 24);
|
|
822
822
|
}
|
|
823
|
-
function
|
|
824
|
-
for (var
|
|
825
|
-
var l = t[
|
|
826
|
-
if (
|
|
823
|
+
function be(t, e, i) {
|
|
824
|
+
for (var n = "", a = e; a < i; ) {
|
|
825
|
+
var l = t[a], s = null, c = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1;
|
|
826
|
+
if (a + c > i) break;
|
|
827
827
|
var m, d, f;
|
|
828
|
-
c === 1 ? l < 128 && (s = l) : c === 2 ? (m = t[
|
|
828
|
+
c === 1 ? l < 128 && (s = l) : c === 2 ? (m = t[a + 1], (m & 192) === 128 && (s = (l & 31) << 6 | m & 63, s <= 127 && (s = null))) : c === 3 ? (m = t[a + 1], d = t[a + 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[a + 1], d = t[a + 2], f = t[a + 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, n += String.fromCharCode(s >>> 10 & 1023 | 55296), s = 56320 | s & 1023), n += String.fromCharCode(s), a += c;
|
|
829
829
|
}
|
|
830
|
-
return
|
|
830
|
+
return n;
|
|
831
831
|
}
|
|
832
|
-
function
|
|
832
|
+
function ze(t, e, i) {
|
|
833
833
|
return Bt.decode(t.subarray(e, i));
|
|
834
834
|
}
|
|
835
|
-
function
|
|
836
|
-
for (var
|
|
837
|
-
if (
|
|
835
|
+
function Te(t, e, i) {
|
|
836
|
+
for (var n = 0, a, l; n < e.length; n++) {
|
|
837
|
+
if (a = e.charCodeAt(n), a > 55295 && a < 57344)
|
|
838
838
|
if (l)
|
|
839
|
-
if (
|
|
840
|
-
t[i++] = 239, t[i++] = 191, t[i++] = 189, l =
|
|
839
|
+
if (a < 56320) {
|
|
840
|
+
t[i++] = 239, t[i++] = 191, t[i++] = 189, l = a;
|
|
841
841
|
continue;
|
|
842
842
|
} else
|
|
843
|
-
|
|
843
|
+
a = l - 55296 << 10 | a - 56320 | 65536, l = null;
|
|
844
844
|
else {
|
|
845
|
-
|
|
845
|
+
a > 56319 || n + 1 === e.length ? (t[i++] = 239, t[i++] = 191, t[i++] = 189) : l = a;
|
|
846
846
|
continue;
|
|
847
847
|
}
|
|
848
848
|
else l && (t[i++] = 239, t[i++] = 191, t[i++] = 189, l = null);
|
|
849
|
-
|
|
849
|
+
a < 128 ? t[i++] = a : (a < 2048 ? t[i++] = a >> 6 | 192 : (a < 65536 ? t[i++] = a >> 12 | 224 : (t[i++] = a >> 18 | 240, t[i++] = a >> 12 & 63 | 128), t[i++] = a >> 6 & 63 | 128), t[i++] = a & 63 | 128);
|
|
850
850
|
}
|
|
851
851
|
return i;
|
|
852
852
|
}
|
|
853
|
-
var
|
|
853
|
+
var ve = /* @__PURE__ */ ae(ne), ft;
|
|
854
854
|
(function(t) {
|
|
855
855
|
t[t.UNKNOWN = 0] = "UNKNOWN", t[t.POINT = 1] = "POINT", t[t.LINESTRING = 2] = "LINESTRING", t[t.POLYGON = 3] = "POLYGON";
|
|
856
856
|
})(ft || (ft = {}));
|
|
857
|
-
function
|
|
858
|
-
const e = new
|
|
857
|
+
function De(t) {
|
|
858
|
+
const e = new ve();
|
|
859
859
|
for (const i in t.layers) {
|
|
860
|
-
const
|
|
861
|
-
|
|
860
|
+
const n = t.layers[i];
|
|
861
|
+
n.extent || (n.extent = t.extent), e.writeMessage(3, Ee, { ...n, id: i });
|
|
862
862
|
}
|
|
863
863
|
return e.finish();
|
|
864
864
|
}
|
|
865
|
-
function
|
|
865
|
+
function Ee(t, e) {
|
|
866
866
|
if (!e)
|
|
867
867
|
throw new Error("pbf undefined");
|
|
868
868
|
e.writeVarintField(15, 2), e.writeStringField(1, t.id || ""), e.writeVarintField(5, t.extent || 4096);
|
|
@@ -872,34 +872,34 @@ Mt(["exports"], function(o) {
|
|
|
872
872
|
keycache: {},
|
|
873
873
|
valuecache: {}
|
|
874
874
|
};
|
|
875
|
-
for (const
|
|
876
|
-
i.feature =
|
|
877
|
-
for (const
|
|
878
|
-
e.writeStringField(3,
|
|
879
|
-
for (const
|
|
880
|
-
e.writeMessage(4,
|
|
875
|
+
for (const n of t.features)
|
|
876
|
+
i.feature = n, e.writeMessage(2, Fe, i);
|
|
877
|
+
for (const n of i.keys)
|
|
878
|
+
e.writeStringField(3, n);
|
|
879
|
+
for (const n of i.values)
|
|
880
|
+
e.writeMessage(4, ke, n);
|
|
881
881
|
}
|
|
882
|
-
function
|
|
882
|
+
function Fe(t, e) {
|
|
883
883
|
const i = t.feature;
|
|
884
884
|
if (!i || !e)
|
|
885
885
|
throw new Error();
|
|
886
|
-
e.writeMessage(2,
|
|
886
|
+
e.writeMessage(2, Se, t), e.writeVarintField(3, i.type), e.writeMessage(4, Ae, i);
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function Se(t, e) {
|
|
889
889
|
const i = t.feature;
|
|
890
890
|
if (!i || !e)
|
|
891
891
|
throw new Error();
|
|
892
|
-
const
|
|
892
|
+
const n = t.keys, a = t.values, l = t.keycache, s = t.valuecache;
|
|
893
893
|
for (const c in i.properties) {
|
|
894
894
|
let m = i.properties[c], d = l[c];
|
|
895
895
|
if (m === null)
|
|
896
896
|
continue;
|
|
897
|
-
typeof d > "u" && (
|
|
897
|
+
typeof d > "u" && (n.push(c), d = n.length - 1, l[c] = d), e.writeVarint(d);
|
|
898
898
|
const f = typeof m;
|
|
899
899
|
f !== "string" && f !== "boolean" && f !== "number" && (m = JSON.stringify(m));
|
|
900
900
|
const h = `${f}:${m}`;
|
|
901
901
|
let w = s[h];
|
|
902
|
-
typeof w > "u" && (
|
|
902
|
+
typeof w > "u" && (a.push(m), w = a.length - 1, s[h] = w), e.writeVarint(w);
|
|
903
903
|
}
|
|
904
904
|
}
|
|
905
905
|
function St(t, e) {
|
|
@@ -908,43 +908,43 @@ Mt(["exports"], function(o) {
|
|
|
908
908
|
function Vt(t) {
|
|
909
909
|
return t << 1 ^ t >> 31;
|
|
910
910
|
}
|
|
911
|
-
function
|
|
911
|
+
function Ae(t, e) {
|
|
912
912
|
if (!e)
|
|
913
913
|
throw new Error();
|
|
914
|
-
const i = t.geometry,
|
|
915
|
-
let
|
|
914
|
+
const i = t.geometry, n = t.type;
|
|
915
|
+
let a = 0, l = 0;
|
|
916
916
|
for (const s of i) {
|
|
917
917
|
let c = 1;
|
|
918
|
-
|
|
919
|
-
const m = s.length / 2, d =
|
|
918
|
+
n === ft.POINT && (c = s.length / 2), e.writeVarint(St(1, c));
|
|
919
|
+
const m = s.length / 2, d = n === ft.POLYGON ? m - 1 : m;
|
|
920
920
|
for (let f = 0; f < d; f++) {
|
|
921
|
-
f === 1 &&
|
|
922
|
-
const h = s[f * 2] -
|
|
923
|
-
e.writeVarint(Vt(h)), e.writeVarint(Vt(w)),
|
|
921
|
+
f === 1 && n !== 1 && e.writeVarint(St(2, d - 1));
|
|
922
|
+
const h = s[f * 2] - a, w = s[f * 2 + 1] - l;
|
|
923
|
+
e.writeVarint(Vt(h)), e.writeVarint(Vt(w)), a += h, l += w;
|
|
924
924
|
}
|
|
925
|
-
|
|
925
|
+
n === ft.POLYGON && e.writeVarint(St(7, 1));
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
|
-
function
|
|
928
|
+
function ke(t, e) {
|
|
929
929
|
if (!e)
|
|
930
930
|
throw new Error();
|
|
931
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
932
|
}
|
|
933
|
-
class
|
|
934
|
-
constructor(e, i,
|
|
933
|
+
class Re {
|
|
934
|
+
constructor(e, i, n, a, l) {
|
|
935
935
|
this.loaded = Promise.resolve(), this.decodeImage = It, this.fetchAndParseTile = (s, c, m, d, f) => {
|
|
936
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 (
|
|
938
|
-
const
|
|
939
|
-
if (B(
|
|
937
|
+
return f == null || f.useTile(w), this.parsedCache.get(w, async (E, P) => {
|
|
938
|
+
const O = await h.fetchTile(s, c, m, P, f);
|
|
939
|
+
if (B(P))
|
|
940
940
|
throw new Error("canceled");
|
|
941
|
-
const I = h.decodeImage(
|
|
942
|
-
return
|
|
941
|
+
const I = h.decodeImage(O.data, h.encoding, P), R = f == null ? void 0 : f.marker("decode"), V = await I;
|
|
942
|
+
return R == null || R(), V;
|
|
943
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 =
|
|
944
|
+
}, this.tileCache = new Z(i), this.parsedCache = new Z(i), this.contourCache = new Z(i), this.timeoutMs = l, this.demUrlPattern = e, this.encoding = n, this.maxzoom = a;
|
|
945
945
|
}
|
|
946
|
-
fetchTile(e, i,
|
|
947
|
-
const s = this.demUrlPattern.replace("{z}", e.toString()).replace("{x}", i.toString()).replace("{y}",
|
|
946
|
+
fetchTile(e, i, n, a, l) {
|
|
947
|
+
const s = this.demUrlPattern.replace("{z}", e.toString()).replace("{x}", i.toString()).replace("{y}", n.toString());
|
|
948
948
|
return l == null || l.useTile(s), this.tileCache.get(s, (c, m) => {
|
|
949
949
|
const d = {
|
|
950
950
|
signal: m.signal
|
|
@@ -960,47 +960,47 @@ Mt(["exports"], function(o) {
|
|
|
960
960
|
cacheControl: h.headers.get("cache-control") || void 0
|
|
961
961
|
};
|
|
962
962
|
}), m);
|
|
963
|
-
},
|
|
963
|
+
}, a);
|
|
964
964
|
}
|
|
965
|
-
async fetchDem(e, i,
|
|
966
|
-
const c = Math.min(e - (
|
|
967
|
-
return $.fromRawDem(w).split(m, i % d,
|
|
965
|
+
async fetchDem(e, i, n, a, l, s) {
|
|
966
|
+
const c = Math.min(e - (a.overzoom || 0), this.maxzoom), m = e - c, d = 1 << m, f = Math.floor(i / d), h = Math.floor(n / d), w = await this.fetchAndParseTile(c, f, h, l, s);
|
|
967
|
+
return $.fromRawDem(w).split(m, i % d, n % d);
|
|
968
968
|
}
|
|
969
|
-
fetchContourTile(e, i,
|
|
970
|
-
const { levels: c, multiplier: m = 1, buffer: d = 1, extent: f = 4096, contourLayer: h = "contours", elevationKey: w = "ele", levelKey:
|
|
969
|
+
fetchContourTile(e, i, n, a, l, s) {
|
|
970
|
+
const { levels: c, multiplier: m = 1, buffer: d = 1, extent: f = 4096, contourLayer: h = "contours", elevationKey: w = "ele", levelKey: E = "level", subsampleBelow: P = 100 } = a;
|
|
971
971
|
if (!c || c.length === 0)
|
|
972
972
|
return Promise.resolve({ arrayBuffer: new ArrayBuffer(0) });
|
|
973
|
-
const
|
|
974
|
-
return this.contourCache.get(
|
|
973
|
+
const O = [e, i, n, p(a)].join("/");
|
|
974
|
+
return this.contourCache.get(O, async (I, R) => {
|
|
975
975
|
const V = 1 << e, ht = [];
|
|
976
|
-
for (let q =
|
|
976
|
+
for (let q = n - 1; q <= n + 1; q++)
|
|
977
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,
|
|
978
|
+
ht.push(q < 0 || q >= V ? void 0 : this.fetchDem(e, (nt + V) % V, q, a, R, s));
|
|
979
979
|
const pt = await Promise.all(ht);
|
|
980
980
|
let X = $.combineNeighbors(pt);
|
|
981
|
-
if (!X || B(
|
|
981
|
+
if (!X || B(R))
|
|
982
982
|
return { arrayBuffer: new Uint8Array().buffer };
|
|
983
983
|
const ot = s == null ? void 0 : s.marker("isoline");
|
|
984
|
-
if (X.width >=
|
|
984
|
+
if (X.width >= P)
|
|
985
985
|
X = X.materialize(2);
|
|
986
986
|
else
|
|
987
|
-
for (; X.width <
|
|
987
|
+
for (; X.width < P; )
|
|
988
988
|
X = X.subsamplePixelCenters(2).materialize(2);
|
|
989
989
|
X = X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);
|
|
990
|
-
const
|
|
990
|
+
const C = x(c[0], X, f, d);
|
|
991
991
|
ot == null || ot();
|
|
992
|
-
const At =
|
|
992
|
+
const At = De({
|
|
993
993
|
extent: f,
|
|
994
994
|
layers: {
|
|
995
995
|
[h]: {
|
|
996
|
-
features: Object.entries(
|
|
996
|
+
features: Object.entries(C).map(([q, nt]) => {
|
|
997
997
|
const _t = Number(q);
|
|
998
998
|
return {
|
|
999
999
|
type: ft.LINESTRING,
|
|
1000
1000
|
geometry: nt,
|
|
1001
1001
|
properties: {
|
|
1002
1002
|
[w]: _t,
|
|
1003
|
-
[
|
|
1003
|
+
[E]: Math.max(...c.map((bt, Y) => _t % bt === 0 ? Y : 0))
|
|
1004
1004
|
}
|
|
1005
1005
|
};
|
|
1006
1006
|
})
|
|
@@ -1011,15 +1011,15 @@ Mt(["exports"], function(o) {
|
|
|
1011
1011
|
}, l);
|
|
1012
1012
|
}
|
|
1013
1013
|
}
|
|
1014
|
-
const Q = typeof performance < "u" ? performance : void 0,
|
|
1015
|
-
function
|
|
1014
|
+
const Q = typeof performance < "u" ? performance : void 0, Ce = Q ? Q.timeOrigin || (/* @__PURE__ */ new Date()).getTime() - Q.now() : (/* @__PURE__ */ new Date()).getTime();
|
|
1015
|
+
function Pe(t) {
|
|
1016
1016
|
var e;
|
|
1017
1017
|
return JSON.parse(JSON.stringify(((e = Q == null ? void 0 : Q.getEntriesByName) === null || e === void 0 ? void 0 : e.call(Q, t)) || []));
|
|
1018
1018
|
}
|
|
1019
1019
|
function Ut() {
|
|
1020
1020
|
return Q ? Q.now() : (/* @__PURE__ */ new Date()).getTime();
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1022
|
+
function Oe(t) {
|
|
1023
1023
|
const e = [];
|
|
1024
1024
|
for (const i of t)
|
|
1025
1025
|
e.push(...i);
|
|
@@ -1027,12 +1027,12 @@ Mt(["exports"], function(o) {
|
|
|
1027
1027
|
}
|
|
1028
1028
|
class Wt {
|
|
1029
1029
|
constructor(e) {
|
|
1030
|
-
this.marks = {}, this.urls = [], this.fetched = [], this.resources = [], this.tilesFetched = 0, this.timeOrigin =
|
|
1030
|
+
this.marks = {}, this.urls = [], this.fetched = [], this.resources = [], this.tilesFetched = 0, this.timeOrigin = Ce, this.finish = (i) => {
|
|
1031
1031
|
this.markFinish();
|
|
1032
|
-
const
|
|
1032
|
+
const n = (m) => {
|
|
1033
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
1034
|
return Number.isFinite(f) ? f - h : void 0;
|
|
1035
|
-
},
|
|
1035
|
+
}, a = n("main") || 0, l = n("fetch"), s = n("decode"), c = n("isoline");
|
|
1036
1036
|
return {
|
|
1037
1037
|
url: i,
|
|
1038
1038
|
tilesUsed: this.tilesFetched,
|
|
@@ -1040,47 +1040,47 @@ Mt(["exports"], function(o) {
|
|
|
1040
1040
|
marks: this.marks,
|
|
1041
1041
|
resources: [
|
|
1042
1042
|
...this.resources,
|
|
1043
|
-
...
|
|
1043
|
+
...Oe(this.fetched.map(Pe))
|
|
1044
1044
|
],
|
|
1045
|
-
duration:
|
|
1045
|
+
duration: a,
|
|
1046
1046
|
fetch: l,
|
|
1047
1047
|
decode: s,
|
|
1048
1048
|
process: c,
|
|
1049
|
-
wait:
|
|
1049
|
+
wait: a - (l || 0) - (s || 0) - (c || 0)
|
|
1050
1050
|
};
|
|
1051
1051
|
}, this.error = (i) => ({ ...this.finish(i), error: !0 }), this.marker = (i) => {
|
|
1052
|
-
var
|
|
1052
|
+
var n;
|
|
1053
1053
|
this.marks[i] || (this.marks[i] = []);
|
|
1054
|
-
const
|
|
1055
|
-
return (
|
|
1054
|
+
const a = [Ut()];
|
|
1055
|
+
return (n = this.marks[i]) === null || n === void 0 || n.push(a), () => a.push(Ut());
|
|
1056
1056
|
}, this.useTile = (i) => {
|
|
1057
1057
|
this.urls.indexOf(i) < 0 && (this.urls.push(i), this.tilesFetched++);
|
|
1058
1058
|
}, this.fetchTile = (i) => {
|
|
1059
1059
|
this.fetched.indexOf(i) < 0 && this.fetched.push(i);
|
|
1060
1060
|
}, this.addAll = (i) => {
|
|
1061
|
-
var
|
|
1061
|
+
var n;
|
|
1062
1062
|
this.tilesFetched += i.tilesUsed;
|
|
1063
|
-
const
|
|
1063
|
+
const a = i.origin - this.timeOrigin;
|
|
1064
1064
|
for (const l in i.marks) {
|
|
1065
1065
|
const s = l;
|
|
1066
|
-
(this.marks[s] || (this.marks[s] = [])).push(...((
|
|
1066
|
+
(this.marks[s] || (this.marks[s] = [])).push(...((n = i.marks[s]) === null || n === void 0 ? void 0 : n.map((m) => m.map((d) => d + a))) || []);
|
|
1067
1067
|
}
|
|
1068
|
-
this.resources.push(...i.resources.map((l) =>
|
|
1068
|
+
this.resources.push(...i.resources.map((l) => Ie(l, a)));
|
|
1069
1069
|
}, this.markFinish = this.marker(e);
|
|
1070
1070
|
}
|
|
1071
1071
|
}
|
|
1072
|
-
const
|
|
1073
|
-
function
|
|
1072
|
+
const Me = /(Start$|End$|^start|^end)/;
|
|
1073
|
+
function Ie(t, e) {
|
|
1074
1074
|
const i = {};
|
|
1075
|
-
for (const
|
|
1076
|
-
t[
|
|
1075
|
+
for (const n in t)
|
|
1076
|
+
t[n] !== 0 && Me.test(n) ? i[n] = Number(t[n]) + e : i[n] = t[n];
|
|
1077
1077
|
return i;
|
|
1078
1078
|
}
|
|
1079
|
-
let
|
|
1080
|
-
class
|
|
1081
|
-
constructor(e, i,
|
|
1082
|
-
this.callbacks = {}, this.cancels = {}, this.dest = e, this.timeoutMs =
|
|
1083
|
-
const l =
|
|
1079
|
+
let Le = 0;
|
|
1080
|
+
class Ge {
|
|
1081
|
+
constructor(e, i, n = 2e4) {
|
|
1082
|
+
this.callbacks = {}, this.cancels = {}, this.dest = e, this.timeoutMs = n, this.dest.onmessage = async ({ data: a }) => {
|
|
1083
|
+
const l = a;
|
|
1084
1084
|
if (l.type === "cancel") {
|
|
1085
1085
|
const s = this.cancels[l.id];
|
|
1086
1086
|
delete this.cancels[l.id], s == null || s.abort();
|
|
@@ -1120,225 +1120,225 @@ Mt(["exports"], function(o) {
|
|
|
1120
1120
|
this.dest.postMessage(e, i || []);
|
|
1121
1121
|
}
|
|
1122
1122
|
/** Invokes a method by name with a set of arguments in the remote context. */
|
|
1123
|
-
send(e, i,
|
|
1124
|
-
const s = ++
|
|
1123
|
+
send(e, i, n, a, ...l) {
|
|
1124
|
+
const s = ++Le, c = new Promise((m, d) => {
|
|
1125
1125
|
this.postMessage({ id: s, type: "request", name: e, args: l }, i), this.callbacks[s] = (f, h, w) => {
|
|
1126
|
-
|
|
1126
|
+
a == null || a.addAll(w), f ? d(f) : m(h);
|
|
1127
1127
|
};
|
|
1128
1128
|
});
|
|
1129
|
-
return U(
|
|
1129
|
+
return U(n, () => {
|
|
1130
1130
|
delete this.callbacks[s], this.postMessage({ id: s, type: "cancel" });
|
|
1131
|
-
}), G(this.timeoutMs, c,
|
|
1131
|
+
}), G(this.timeoutMs, c, n);
|
|
1132
1132
|
}
|
|
1133
1133
|
}
|
|
1134
|
-
o.A =
|
|
1134
|
+
o.A = Ge, o.H = $, o.L = Re, o.T = Wt, o.a = z, o.b = x, o.c = Dt, o.d = It, o.e = A, o.f = M, o.g = _, o.p = S;
|
|
1135
1135
|
});
|
|
1136
1136
|
Mt(["./shared"], function(o) {
|
|
1137
|
-
const
|
|
1137
|
+
const r = (y) => Promise.reject(new Error(`No manager registered for ${y}`));
|
|
1138
1138
|
class u {
|
|
1139
1139
|
constructor() {
|
|
1140
|
-
this.managers = {}, this.init = (
|
|
1141
|
-
var
|
|
1142
|
-
return ((
|
|
1143
|
-
}, this.fetchAndParseTile = (
|
|
1144
|
-
var
|
|
1145
|
-
return o.p(((
|
|
1146
|
-
}, this.fetchContourTile = (
|
|
1147
|
-
var
|
|
1148
|
-
return o.f(((
|
|
1140
|
+
this.managers = {}, this.init = (x, b) => (this.managers[x.managerId] = new o.L(x.demUrlPattern, x.cacheSize, x.encoding, x.maxzoom, x.timeoutMs), Promise.resolve()), this.fetchTile = (x, b, F, k, A, z) => {
|
|
1141
|
+
var p;
|
|
1142
|
+
return ((p = this.managers[x]) === null || p === void 0 ? void 0 : p.fetchTile(b, F, k, A, z)) || r(x);
|
|
1143
|
+
}, this.fetchAndParseTile = (x, b, F, k, A, z) => {
|
|
1144
|
+
var p;
|
|
1145
|
+
return o.p(((p = this.managers[x]) === null || p === void 0 ? void 0 : p.fetchAndParseTile(b, F, k, A, z)) || r(x), !0);
|
|
1146
|
+
}, this.fetchContourTile = (x, b, F, k, A, z, p) => {
|
|
1147
|
+
var _;
|
|
1148
|
+
return o.f(((_ = this.managers[x]) === null || _ === void 0 ? void 0 : _.fetchContourTile(b, F, k, A, z, p)) || r(x));
|
|
1149
1149
|
};
|
|
1150
1150
|
}
|
|
1151
1151
|
}
|
|
1152
|
-
const
|
|
1153
|
-
|
|
1152
|
+
const g = typeof self < "u" ? self : typeof window < "u" ? window : global;
|
|
1153
|
+
g.actor = new o.A(g, new u());
|
|
1154
1154
|
});
|
|
1155
1155
|
Mt(["./shared"], function(o) {
|
|
1156
|
-
const
|
|
1157
|
-
let u,
|
|
1156
|
+
const r = { workerUrl: "" };
|
|
1157
|
+
let u, g = 0;
|
|
1158
1158
|
class y {
|
|
1159
1159
|
constructor() {
|
|
1160
|
-
this.decodeImage = (
|
|
1160
|
+
this.decodeImage = (_, v, S) => o.p(o.d(_, v, S), !1);
|
|
1161
1161
|
}
|
|
1162
1162
|
}
|
|
1163
|
-
function
|
|
1163
|
+
function x() {
|
|
1164
1164
|
if (!u) {
|
|
1165
|
-
const
|
|
1166
|
-
u = new o.A(
|
|
1165
|
+
const p = new Worker(r.workerUrl), _ = new y();
|
|
1166
|
+
u = new o.A(p, _);
|
|
1167
1167
|
}
|
|
1168
1168
|
return u;
|
|
1169
1169
|
}
|
|
1170
|
-
class
|
|
1171
|
-
constructor(
|
|
1172
|
-
this.fetchTile = (H, G, U, B,
|
|
1173
|
-
const tt = this.managerId = ++
|
|
1174
|
-
this.actor = ct ||
|
|
1175
|
-
cacheSize:
|
|
1176
|
-
demUrlPattern:
|
|
1170
|
+
class b {
|
|
1171
|
+
constructor(_, v, S, M, j, ct) {
|
|
1172
|
+
this.fetchTile = (H, G, U, B, D) => this.actor.send("fetchTile", [], B, D, this.managerId, H, G, U), this.fetchAndParseTile = (H, G, U, B, D) => this.actor.send("fetchAndParseTile", [], B, D, this.managerId, H, G, U), this.fetchContourTile = (H, G, U, B, D, Z) => this.actor.send("fetchContourTile", [], D, Z, this.managerId, H, G, U, B);
|
|
1173
|
+
const tt = this.managerId = ++g;
|
|
1174
|
+
this.actor = ct || x(), this.loaded = this.actor.send("init", [], new AbortController(), void 0, {
|
|
1175
|
+
cacheSize: v,
|
|
1176
|
+
demUrlPattern: _,
|
|
1177
1177
|
encoding: S,
|
|
1178
|
-
maxzoom:
|
|
1178
|
+
maxzoom: M,
|
|
1179
1179
|
managerId: tt,
|
|
1180
1180
|
timeoutMs: j
|
|
1181
1181
|
});
|
|
1182
1182
|
}
|
|
1183
1183
|
}
|
|
1184
1184
|
Blob.prototype.arrayBuffer || (Blob.prototype.arrayBuffer = function() {
|
|
1185
|
-
return new Promise((
|
|
1185
|
+
return new Promise((_, v) => {
|
|
1186
1186
|
const S = new FileReader();
|
|
1187
|
-
S.onload = (
|
|
1187
|
+
S.onload = (M) => {
|
|
1188
1188
|
var j;
|
|
1189
|
-
return
|
|
1190
|
-
}, S.onerror =
|
|
1189
|
+
return _((j = M.target) === null || j === void 0 ? void 0 : j.result);
|
|
1190
|
+
}, S.onerror = v, S.readAsArrayBuffer(this);
|
|
1191
1191
|
});
|
|
1192
1192
|
});
|
|
1193
|
-
const
|
|
1194
|
-
if (
|
|
1195
|
-
return
|
|
1193
|
+
const F = (p) => (_, v) => {
|
|
1194
|
+
if (v instanceof AbortController)
|
|
1195
|
+
return p(_, v);
|
|
1196
1196
|
{
|
|
1197
1197
|
const S = new AbortController();
|
|
1198
|
-
return
|
|
1198
|
+
return p(_, S).then((M) => v(void 0, M.data, M.cacheControl, M.expires), (M) => v(M)), { cancel: () => S.abort() };
|
|
1199
1199
|
}
|
|
1200
|
-
},
|
|
1201
|
-
class
|
|
1202
|
-
constructor({ url:
|
|
1203
|
-
this.timingCallbacks = [], this.onTiming = (
|
|
1204
|
-
this.timingCallbacks.push(
|
|
1205
|
-
}, this.setupMaplibre = (
|
|
1206
|
-
|
|
1207
|
-
}, this.sharedDemProtocolV4 = async (
|
|
1208
|
-
const [K, et, N] = this.parseUrl(
|
|
1200
|
+
}, k = /* @__PURE__ */ new Set();
|
|
1201
|
+
class A {
|
|
1202
|
+
constructor({ url: _, cacheSize: v = 100, id: S = "dem", encoding: M = "terrarium", maxzoom: j = 12, worker: ct = !0, timeoutMs: tt = 1e4, actor: H }) {
|
|
1203
|
+
this.timingCallbacks = [], this.onTiming = (D) => {
|
|
1204
|
+
this.timingCallbacks.push(D);
|
|
1205
|
+
}, this.setupMaplibre = (D) => {
|
|
1206
|
+
D.addProtocol(this.sharedDemProtocolId, this.sharedDemProtocol), D.addProtocol(this.contourProtocolId, this.contourProtocol);
|
|
1207
|
+
}, this.sharedDemProtocolV4 = async (D, Z) => {
|
|
1208
|
+
const [K, et, N] = this.parseUrl(D.url), it = new o.T("main");
|
|
1209
1209
|
let at;
|
|
1210
1210
|
try {
|
|
1211
1211
|
const W = await this.manager.fetchTile(K, et, N, Z, it);
|
|
1212
|
-
return at = it.finish(
|
|
1212
|
+
return at = it.finish(D.url), {
|
|
1213
1213
|
data: await W.data.arrayBuffer(),
|
|
1214
1214
|
cacheControl: W.cacheControl,
|
|
1215
1215
|
expires: W.expires
|
|
1216
1216
|
};
|
|
1217
1217
|
} catch (W) {
|
|
1218
|
-
throw at = it.error(
|
|
1218
|
+
throw at = it.error(D.url), W;
|
|
1219
1219
|
} finally {
|
|
1220
1220
|
this.timingCallbacks.forEach((W) => W(at));
|
|
1221
1221
|
}
|
|
1222
|
-
}, this.contourProtocolV4 = async (
|
|
1222
|
+
}, this.contourProtocolV4 = async (D, Z) => {
|
|
1223
1223
|
const K = new o.T("main");
|
|
1224
1224
|
let et;
|
|
1225
1225
|
try {
|
|
1226
|
-
const [N, it, at] = this.parseUrl(
|
|
1227
|
-
return et = K.finish(
|
|
1226
|
+
const [N, it, at] = this.parseUrl(D.url), W = o.a(D.url), xt = await this.manager.fetchContourTile(N, it, at, o.g(W, N), Z, K);
|
|
1227
|
+
return et = K.finish(D.url), { data: xt.arrayBuffer };
|
|
1228
1228
|
} catch (N) {
|
|
1229
|
-
throw et = K.error(
|
|
1229
|
+
throw et = K.error(D.url), N;
|
|
1230
1230
|
} finally {
|
|
1231
1231
|
this.timingCallbacks.forEach((N) => N(et));
|
|
1232
1232
|
}
|
|
1233
|
-
}, this.contourProtocol =
|
|
1233
|
+
}, this.contourProtocol = F(this.contourProtocolV4), this.sharedDemProtocol = F(this.sharedDemProtocolV4), this.contourProtocolUrl = (D) => `${this.contourProtocolUrlBase}?${o.e(D)}`;
|
|
1234
1234
|
let G = S, U = 1;
|
|
1235
|
-
for (;
|
|
1235
|
+
for (; k.has(G); )
|
|
1236
1236
|
G = S + U++;
|
|
1237
|
-
|
|
1238
|
-
const B = ct ?
|
|
1239
|
-
this.manager = new B(
|
|
1237
|
+
k.add(G), this.sharedDemProtocolId = `${G}-shared`, this.contourProtocolId = `${G}-contour`, this.sharedDemProtocolUrl = `${this.sharedDemProtocolId}://{z}/{x}/{y}`, this.contourProtocolUrlBase = `${this.contourProtocolId}://{z}/{x}/{y}`;
|
|
1238
|
+
const B = ct ? b : o.L;
|
|
1239
|
+
this.manager = new B(_, v, M, j, tt, H);
|
|
1240
1240
|
}
|
|
1241
|
-
getDemTile(
|
|
1242
|
-
return this.manager.fetchAndParseTile(
|
|
1241
|
+
getDemTile(_, v, S, M) {
|
|
1242
|
+
return this.manager.fetchAndParseTile(_, v, S, M || new AbortController());
|
|
1243
1243
|
}
|
|
1244
|
-
parseUrl(
|
|
1245
|
-
const [,
|
|
1246
|
-
return [Number(
|
|
1244
|
+
parseUrl(_) {
|
|
1245
|
+
const [, v, S, M] = /\/\/(\d+)\/(\d+)\/(\d+)/.exec(_) || [];
|
|
1246
|
+
return [Number(v), Number(S), Number(M)];
|
|
1247
1247
|
}
|
|
1248
1248
|
}
|
|
1249
1249
|
return {
|
|
1250
1250
|
generateIsolines: o.b,
|
|
1251
|
-
DemSource:
|
|
1251
|
+
DemSource: A,
|
|
1252
1252
|
HeightTile: o.H,
|
|
1253
1253
|
LocalDemManager: o.L,
|
|
1254
1254
|
decodeParsedImage: o.c,
|
|
1255
|
-
set workerUrl(
|
|
1256
|
-
|
|
1255
|
+
set workerUrl(p) {
|
|
1256
|
+
r.workerUrl = p;
|
|
1257
1257
|
},
|
|
1258
1258
|
get workerUrl() {
|
|
1259
|
-
return
|
|
1259
|
+
return r.workerUrl;
|
|
1260
1260
|
}
|
|
1261
1261
|
};
|
|
1262
1262
|
});
|
|
1263
|
-
var
|
|
1264
|
-
function
|
|
1263
|
+
var Be = Ot;
|
|
1264
|
+
function Xe(o) {
|
|
1265
1265
|
return o;
|
|
1266
1266
|
}
|
|
1267
|
-
function
|
|
1268
|
-
if (o == null) return
|
|
1269
|
-
var
|
|
1270
|
-
return function(
|
|
1271
|
-
|
|
1272
|
-
var
|
|
1273
|
-
for (
|
|
1274
|
-
return
|
|
1267
|
+
function Ne(o) {
|
|
1268
|
+
if (o == null) return Xe;
|
|
1269
|
+
var r, u, g = o.scale[0], y = o.scale[1], x = o.translate[0], b = o.translate[1];
|
|
1270
|
+
return function(F, k) {
|
|
1271
|
+
k || (r = u = 0);
|
|
1272
|
+
var A = 2, z = F.length, p = new Array(z);
|
|
1273
|
+
for (p[0] = (r += F[0]) * g + x, p[1] = (u += F[1]) * y + b; A < z; ) p[A] = F[A], ++A;
|
|
1274
|
+
return p;
|
|
1275
1275
|
};
|
|
1276
1276
|
}
|
|
1277
|
-
function
|
|
1278
|
-
for (var u,
|
|
1277
|
+
function Ve(o, r) {
|
|
1278
|
+
for (var u, g = o.length, y = g - r; y < --g; ) u = o[y], o[y++] = o[g], o[g] = u;
|
|
1279
1279
|
}
|
|
1280
|
-
function $t(o,
|
|
1281
|
-
return typeof
|
|
1280
|
+
function $t(o, r) {
|
|
1281
|
+
return typeof r == "string" && (r = o.objects[r]), r.type === "GeometryCollection" ? { type: "FeatureCollection", features: r.geometries.map(function(u) {
|
|
1282
1282
|
return Kt(o, u);
|
|
1283
|
-
}) } : Kt(o,
|
|
1283
|
+
}) } : Kt(o, r);
|
|
1284
1284
|
}
|
|
1285
|
-
function Kt(o,
|
|
1286
|
-
var u =
|
|
1287
|
-
return u == null &&
|
|
1285
|
+
function Kt(o, r) {
|
|
1286
|
+
var u = r.id, g = r.bbox, y = r.properties == null ? {} : r.properties, x = Ue(o, r);
|
|
1287
|
+
return u == null && g == null ? { type: "Feature", properties: y, geometry: x } : g == null ? { type: "Feature", id: u, properties: y, geometry: x } : { type: "Feature", id: u, bbox: g, properties: y, geometry: x };
|
|
1288
1288
|
}
|
|
1289
|
-
function
|
|
1290
|
-
var u =
|
|
1291
|
-
function y(z,
|
|
1292
|
-
|
|
1293
|
-
for (var
|
|
1294
|
-
|
|
1295
|
-
z < 0 &&
|
|
1296
|
-
}
|
|
1297
|
-
function
|
|
1289
|
+
function Ue(o, r) {
|
|
1290
|
+
var u = Ne(o.transform), g = o.arcs;
|
|
1291
|
+
function y(z, p) {
|
|
1292
|
+
p.length && p.pop();
|
|
1293
|
+
for (var _ = g[z < 0 ? ~z : z], v = 0, S = _.length; v < S; ++v)
|
|
1294
|
+
p.push(u(_[v], v));
|
|
1295
|
+
z < 0 && Ve(p, S);
|
|
1296
|
+
}
|
|
1297
|
+
function x(z) {
|
|
1298
1298
|
return u(z);
|
|
1299
1299
|
}
|
|
1300
|
-
function
|
|
1301
|
-
for (var
|
|
1302
|
-
return
|
|
1300
|
+
function b(z) {
|
|
1301
|
+
for (var p = [], _ = 0, v = z.length; _ < v; ++_) y(z[_], p);
|
|
1302
|
+
return p.length < 2 && p.push(p[0]), p;
|
|
1303
1303
|
}
|
|
1304
|
-
function
|
|
1305
|
-
for (var
|
|
1306
|
-
return
|
|
1304
|
+
function F(z) {
|
|
1305
|
+
for (var p = b(z); p.length < 4; ) p.push(p[0]);
|
|
1306
|
+
return p;
|
|
1307
1307
|
}
|
|
1308
|
-
function
|
|
1309
|
-
return z.map(
|
|
1308
|
+
function k(z) {
|
|
1309
|
+
return z.map(F);
|
|
1310
1310
|
}
|
|
1311
|
-
function
|
|
1312
|
-
var
|
|
1313
|
-
switch (
|
|
1311
|
+
function A(z) {
|
|
1312
|
+
var p = z.type, _;
|
|
1313
|
+
switch (p) {
|
|
1314
1314
|
case "GeometryCollection":
|
|
1315
|
-
return { type:
|
|
1315
|
+
return { type: p, geometries: z.geometries.map(A) };
|
|
1316
1316
|
case "Point":
|
|
1317
|
-
|
|
1317
|
+
_ = x(z.coordinates);
|
|
1318
1318
|
break;
|
|
1319
1319
|
case "MultiPoint":
|
|
1320
|
-
|
|
1320
|
+
_ = z.coordinates.map(x);
|
|
1321
1321
|
break;
|
|
1322
1322
|
case "LineString":
|
|
1323
|
-
|
|
1323
|
+
_ = b(z.arcs);
|
|
1324
1324
|
break;
|
|
1325
1325
|
case "MultiLineString":
|
|
1326
|
-
|
|
1326
|
+
_ = z.arcs.map(b);
|
|
1327
1327
|
break;
|
|
1328
1328
|
case "Polygon":
|
|
1329
|
-
|
|
1329
|
+
_ = k(z.arcs);
|
|
1330
1330
|
break;
|
|
1331
1331
|
case "MultiPolygon":
|
|
1332
|
-
|
|
1332
|
+
_ = z.arcs.map(k);
|
|
1333
1333
|
break;
|
|
1334
1334
|
default:
|
|
1335
1335
|
return null;
|
|
1336
1336
|
}
|
|
1337
|
-
return { type:
|
|
1337
|
+
return { type: p, coordinates: _ };
|
|
1338
1338
|
}
|
|
1339
|
-
return
|
|
1339
|
+
return A(r);
|
|
1340
1340
|
}
|
|
1341
|
-
const
|
|
1341
|
+
const We = {
|
|
1342
1342
|
airspaceStroke: "#AAB7B8",
|
|
1343
1343
|
restrictedStroke: "#D35400",
|
|
1344
1344
|
controlledStroke: "#10B981",
|
|
@@ -1350,8 +1350,8 @@ const Ue = {
|
|
|
1350
1350
|
airport: "#006400",
|
|
1351
1351
|
runway: "#333333"
|
|
1352
1352
|
};
|
|
1353
|
-
function
|
|
1354
|
-
const o = "navdata",
|
|
1353
|
+
function je() {
|
|
1354
|
+
const o = "navdata", r = We;
|
|
1355
1355
|
return [
|
|
1356
1356
|
{
|
|
1357
1357
|
id: "landLaye",
|
|
@@ -1408,7 +1408,7 @@ function We() {
|
|
|
1408
1408
|
"source-layer": "fir",
|
|
1409
1409
|
minzoom: 2,
|
|
1410
1410
|
// layout: { "line-cap": "butt", "line-join": "miter", "line-miter-limit": 0 },
|
|
1411
|
-
paint: { "line-color":
|
|
1411
|
+
paint: { "line-color": r.airspaceStroke, "line-opacity": ["interpolate", ["linear"], ["zoom"], 2, 0, 2.7, 0.8, 9, 0.8, 10, 0.5], "line-width": 0.5, "line-dasharray": [4.2, 4] }
|
|
1412
1412
|
},
|
|
1413
1413
|
{
|
|
1414
1414
|
id: "fir_line_dash",
|
|
@@ -1417,7 +1417,7 @@ function We() {
|
|
|
1417
1417
|
"source-layer": "fir",
|
|
1418
1418
|
minzoom: 5,
|
|
1419
1419
|
layout: { "line-miter-limit": 0, "line-cap": "butt", "line-join": "miter" },
|
|
1420
|
-
paint: { "line-color":
|
|
1420
|
+
paint: { "line-color": r.airspaceStroke, "line-opacity": ["interpolate", ["linear"], ["zoom"], 5, 0, 5.5, 0.8, 9, 0.8, 10, 0.5], "line-width": 6, "line-dasharray": [0.2, 5] }
|
|
1421
1421
|
},
|
|
1422
1422
|
{
|
|
1423
1423
|
id: "fir-label-lineside",
|
|
@@ -1426,7 +1426,7 @@ function We() {
|
|
|
1426
1426
|
"source-layer": "fir",
|
|
1427
1427
|
minzoom: 4,
|
|
1428
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":
|
|
1429
|
+
paint: { "text-color": r.airspaceStroke }
|
|
1430
1430
|
},
|
|
1431
1431
|
{
|
|
1432
1432
|
id: "fir-label",
|
|
@@ -1441,7 +1441,7 @@ function We() {
|
|
|
1441
1441
|
"text-max-width": 8
|
|
1442
1442
|
},
|
|
1443
1443
|
paint: {
|
|
1444
|
-
"text-color":
|
|
1444
|
+
"text-color": r.airspaceStroke,
|
|
1445
1445
|
"text-opacity": ["interpolate", ["linear"], ["zoom"], 3, 0.85, 8, 0.7, 12, 0.5]
|
|
1446
1446
|
}
|
|
1447
1447
|
},
|
|
@@ -1474,7 +1474,7 @@ function We() {
|
|
|
1474
1474
|
type: "line",
|
|
1475
1475
|
source: o,
|
|
1476
1476
|
"source-layer": "restricted",
|
|
1477
|
-
paint: { "line-color":
|
|
1477
|
+
paint: { "line-color": r.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
1478
|
},
|
|
1479
1479
|
{
|
|
1480
1480
|
id: "restricted-label",
|
|
@@ -1483,7 +1483,7 @@ function We() {
|
|
|
1483
1483
|
"source-layer": "restricted",
|
|
1484
1484
|
minzoom: 6,
|
|
1485
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":
|
|
1486
|
+
paint: { "text-color": r.restrictedStroke }
|
|
1487
1487
|
},
|
|
1488
1488
|
{
|
|
1489
1489
|
id: "controlled-fill",
|
|
@@ -1499,7 +1499,7 @@ function We() {
|
|
|
1499
1499
|
["!=", ["get", "CODE_TYPE"], "TRSA"]
|
|
1500
1500
|
],
|
|
1501
1501
|
paint: {
|
|
1502
|
-
"fill-color":
|
|
1502
|
+
"fill-color": r.controlledFill,
|
|
1503
1503
|
"fill-opacity": [
|
|
1504
1504
|
"interpolate",
|
|
1505
1505
|
[
|
|
@@ -1527,7 +1527,7 @@ function We() {
|
|
|
1527
1527
|
["!=", ["get", "CODE_TYPE"], "TRSA"]
|
|
1528
1528
|
],
|
|
1529
1529
|
paint: {
|
|
1530
|
-
"line-color":
|
|
1530
|
+
"line-color": r.controlledStroke,
|
|
1531
1531
|
"line-width": 1,
|
|
1532
1532
|
"line-opacity": ["interpolate", ["linear"], ["zoom"], 4, 0.5, 8, 1],
|
|
1533
1533
|
"line-dasharray": [
|
|
@@ -1549,7 +1549,7 @@ function We() {
|
|
|
1549
1549
|
"source-layer": "controlled",
|
|
1550
1550
|
minzoom: 6,
|
|
1551
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":
|
|
1552
|
+
paint: { "text-color": r.controlledStroke }
|
|
1553
1553
|
},
|
|
1554
1554
|
{
|
|
1555
1555
|
id: "segment-line",
|
|
@@ -1558,7 +1558,7 @@ function We() {
|
|
|
1558
1558
|
"source-layer": "segment",
|
|
1559
1559
|
minzoom: 5,
|
|
1560
1560
|
paint: {
|
|
1561
|
-
"line-color": ["case", ["==", ["get", "HAS_REMARK"], 1], "#E8A020",
|
|
1561
|
+
"line-color": ["case", ["==", ["get", "HAS_REMARK"], 1], "#E8A020", r.segment],
|
|
1562
1562
|
"line-width": ["interpolate", ["linear"], ["zoom"], 5, 0.2, 8, 0.8],
|
|
1563
1563
|
"line-blur": 0,
|
|
1564
1564
|
"line-opacity": [
|
|
@@ -1634,7 +1634,7 @@ function We() {
|
|
|
1634
1634
|
paint: {
|
|
1635
1635
|
"text-halo-color": "#ffffff",
|
|
1636
1636
|
"text-halo-width": 0.1,
|
|
1637
|
-
"icon-color":
|
|
1637
|
+
"icon-color": r.segment,
|
|
1638
1638
|
"text-opacity": [
|
|
1639
1639
|
"interpolate",
|
|
1640
1640
|
[
|
|
@@ -1683,7 +1683,7 @@ function We() {
|
|
|
1683
1683
|
"text-offset": [0, -0.6],
|
|
1684
1684
|
"text-justify": "auto"
|
|
1685
1685
|
},
|
|
1686
|
-
paint: { "text-color":
|
|
1686
|
+
paint: { "text-color": r.segment }
|
|
1687
1687
|
},
|
|
1688
1688
|
{
|
|
1689
1689
|
id: "airport-circle",
|
|
@@ -1728,7 +1728,7 @@ function We() {
|
|
|
1728
1728
|
"case",
|
|
1729
1729
|
["has", "has_amm"],
|
|
1730
1730
|
"#4B2D6E",
|
|
1731
|
-
|
|
1731
|
+
r.airport
|
|
1732
1732
|
],
|
|
1733
1733
|
"icon-opacity": [
|
|
1734
1734
|
"interpolate",
|
|
@@ -1783,7 +1783,7 @@ function We() {
|
|
|
1783
1783
|
"case",
|
|
1784
1784
|
["has", "has_amm"],
|
|
1785
1785
|
"#4B2D6E",
|
|
1786
|
-
|
|
1786
|
+
r.airport
|
|
1787
1787
|
]
|
|
1788
1788
|
}
|
|
1789
1789
|
},
|
|
@@ -1796,7 +1796,7 @@ function We() {
|
|
|
1796
1796
|
minzoom: 4,
|
|
1797
1797
|
maxzoom: 11,
|
|
1798
1798
|
paint: {
|
|
1799
|
-
"line-color":
|
|
1799
|
+
"line-color": r.runway,
|
|
1800
1800
|
"line-width": ["interpolate", ["linear"], ["zoom"], 4, 1, 13, 10]
|
|
1801
1801
|
}
|
|
1802
1802
|
},
|
|
@@ -1809,7 +1809,7 @@ function We() {
|
|
|
1809
1809
|
minzoom: 4,
|
|
1810
1810
|
maxzoom: 11,
|
|
1811
1811
|
paint: {
|
|
1812
|
-
"line-color":
|
|
1812
|
+
"line-color": r.runway,
|
|
1813
1813
|
"line-width": ["interpolate", ["linear"], ["zoom"], 4, 1, 10, 4],
|
|
1814
1814
|
"line-opacity": ["interpolate", ["linear"], ["zoom"], 10.5, 1, 11, 0]
|
|
1815
1815
|
}
|
|
@@ -1828,7 +1828,7 @@ function We() {
|
|
|
1828
1828
|
"text-optional": !0
|
|
1829
1829
|
},
|
|
1830
1830
|
paint: {
|
|
1831
|
-
"text-color":
|
|
1831
|
+
"text-color": r.runway,
|
|
1832
1832
|
"text-halo-width": 1,
|
|
1833
1833
|
"text-opacity": ["interpolate", ["linear"], ["zoom"], 10.5, 1, 11, 0]
|
|
1834
1834
|
}
|
|
@@ -1880,7 +1880,7 @@ function We() {
|
|
|
1880
1880
|
"source-layer": "vor",
|
|
1881
1881
|
minzoom: 5,
|
|
1882
1882
|
layout: { "text-field": ["get", "CODE_ID"], "text-size": 10, "text-anchor": "bottom", "text-offset": [0, -0.8] },
|
|
1883
|
-
paint: { "text-color":
|
|
1883
|
+
paint: { "text-color": r.vor, "text-halo-color": "#ffffff", "text-halo-width": 1 }
|
|
1884
1884
|
},
|
|
1885
1885
|
{
|
|
1886
1886
|
id: "ndb-symbol",
|
|
@@ -1900,7 +1900,7 @@ function We() {
|
|
|
1900
1900
|
"CODE_ID"
|
|
1901
1901
|
],
|
|
1902
1902
|
{
|
|
1903
|
-
"text-color":
|
|
1903
|
+
"text-color": r.ndb,
|
|
1904
1904
|
"font-scale": 1.1
|
|
1905
1905
|
},
|
|
1906
1906
|
"",
|
|
@@ -1914,7 +1914,7 @@ function We() {
|
|
|
1914
1914
|
""
|
|
1915
1915
|
],
|
|
1916
1916
|
{
|
|
1917
|
-
"text-color":
|
|
1917
|
+
"text-color": r.ndb,
|
|
1918
1918
|
"font-scale": 0.95
|
|
1919
1919
|
}
|
|
1920
1920
|
],
|
|
@@ -1926,11 +1926,11 @@ function We() {
|
|
|
1926
1926
|
"text-anchor": "top"
|
|
1927
1927
|
},
|
|
1928
1928
|
paint: {
|
|
1929
|
-
"text-color":
|
|
1929
|
+
"text-color": r.ndb,
|
|
1930
1930
|
"text-halo-color": "#ffffff",
|
|
1931
1931
|
"text-halo-width": 0.5,
|
|
1932
1932
|
"text-halo-blur": 1,
|
|
1933
|
-
"icon-color":
|
|
1933
|
+
"icon-color": r.ndb,
|
|
1934
1934
|
"text-opacity": [
|
|
1935
1935
|
"interpolate",
|
|
1936
1936
|
[
|
|
@@ -1993,8 +1993,8 @@ function We() {
|
|
|
1993
1993
|
"text-justify": "auto"
|
|
1994
1994
|
},
|
|
1995
1995
|
paint: {
|
|
1996
|
-
"icon-color":
|
|
1997
|
-
"text-color":
|
|
1996
|
+
"icon-color": r.waypoint,
|
|
1997
|
+
"text-color": r.waypoint,
|
|
1998
1998
|
"text-halo-color": "#ffffff",
|
|
1999
1999
|
"text-halo-width": 1,
|
|
2000
2000
|
"icon-halo-color": "rgba(0,0,0,0)",
|
|
@@ -2041,8 +2041,8 @@ function We() {
|
|
|
2041
2041
|
minzoom: 7,
|
|
2042
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
2043
|
paint: {
|
|
2044
|
-
"icon-color":
|
|
2045
|
-
"text-color":
|
|
2044
|
+
"icon-color": r.waypoint,
|
|
2045
|
+
"text-color": r.waypoint,
|
|
2046
2046
|
"text-halo-color": "#ffffff",
|
|
2047
2047
|
"text-halo-width": 1,
|
|
2048
2048
|
"icon-opacity": [
|
|
@@ -2079,7 +2079,7 @@ function We() {
|
|
|
2079
2079
|
}
|
|
2080
2080
|
];
|
|
2081
2081
|
}
|
|
2082
|
-
const
|
|
2082
|
+
const $e = {
|
|
2083
2083
|
airspaceStroke: "#18C29C",
|
|
2084
2084
|
restrictedStroke: "#f87171",
|
|
2085
2085
|
controlledStroke: "#38bdf8",
|
|
@@ -2091,8 +2091,8 @@ const je = {
|
|
|
2091
2091
|
airport: "#73ccdd",
|
|
2092
2092
|
runway: "#64748b"
|
|
2093
2093
|
};
|
|
2094
|
-
function
|
|
2095
|
-
const o = "navdata",
|
|
2094
|
+
function Ke() {
|
|
2095
|
+
const o = "navdata", r = $e;
|
|
2096
2096
|
return [
|
|
2097
2097
|
{
|
|
2098
2098
|
id: "landLaye",
|
|
@@ -2150,7 +2150,7 @@ function $e() {
|
|
|
2150
2150
|
"source-layer": "fir",
|
|
2151
2151
|
minzoom: 2,
|
|
2152
2152
|
layout: { "line-cap": "butt", "line-join": "miter", "line-miter-limit": 0 },
|
|
2153
|
-
paint: { "line-color":
|
|
2153
|
+
paint: { "line-color": r.airspaceStroke, "line-opacity": ["interpolate", ["linear"], ["zoom"], 2, 0, 2.7, 0.8, 9, 0.8, 10, 0.5], "line-width": 0.8, "line-dasharray": [4.2, 4] }
|
|
2154
2154
|
},
|
|
2155
2155
|
{
|
|
2156
2156
|
id: "fir_line_dash",
|
|
@@ -2159,7 +2159,7 @@ function $e() {
|
|
|
2159
2159
|
"source-layer": "fir",
|
|
2160
2160
|
minzoom: 5,
|
|
2161
2161
|
layout: { "line-miter-limit": 0, "line-cap": "butt", "line-join": "miter" },
|
|
2162
|
-
paint: { "line-color":
|
|
2162
|
+
paint: { "line-color": r.airspaceStroke, "line-opacity": ["interpolate", ["linear"], ["zoom"], 5, 0, 5.5, 0.8, 9, 0.8, 10, 0.5], "line-width": 5, "line-dasharray": [0.2, 5] }
|
|
2163
2163
|
},
|
|
2164
2164
|
{
|
|
2165
2165
|
id: "fir-label-lineside",
|
|
@@ -2168,7 +2168,7 @@ function $e() {
|
|
|
2168
2168
|
"source-layer": "fir",
|
|
2169
2169
|
minzoom: 4,
|
|
2170
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":
|
|
2171
|
+
paint: { "text-color": r.airspaceStroke, "text-halo-color": "#0f172a", "text-halo-width": 1 }
|
|
2172
2172
|
},
|
|
2173
2173
|
{
|
|
2174
2174
|
id: "fir-label",
|
|
@@ -2183,7 +2183,7 @@ function $e() {
|
|
|
2183
2183
|
"text-max-width": 8
|
|
2184
2184
|
},
|
|
2185
2185
|
paint: {
|
|
2186
|
-
"text-color":
|
|
2186
|
+
"text-color": r.airspaceStroke,
|
|
2187
2187
|
"text-halo-color": "#0f172a",
|
|
2188
2188
|
"text-halo-width": 1.5,
|
|
2189
2189
|
"text-opacity": ["interpolate", ["linear"], ["zoom"], 3, 0.85, 8, 0.7, 12, 0.5]
|
|
@@ -2202,7 +2202,7 @@ function $e() {
|
|
|
2202
2202
|
type: "line",
|
|
2203
2203
|
source: o,
|
|
2204
2204
|
"source-layer": "restricted",
|
|
2205
|
-
paint: { "line-color":
|
|
2205
|
+
paint: { "line-color": r.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
2206
|
},
|
|
2207
2207
|
{
|
|
2208
2208
|
id: "restricted-label",
|
|
@@ -2211,7 +2211,7 @@ function $e() {
|
|
|
2211
2211
|
"source-layer": "restricted",
|
|
2212
2212
|
minzoom: 6,
|
|
2213
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":
|
|
2214
|
+
paint: { "text-color": r.restrictedStroke, "text-halo-color": "#0f172a", "text-halo-width": 1 }
|
|
2215
2215
|
},
|
|
2216
2216
|
{
|
|
2217
2217
|
id: "controlled-fill",
|
|
@@ -2219,14 +2219,14 @@ function $e() {
|
|
|
2219
2219
|
source: o,
|
|
2220
2220
|
"source-layer": "controlled-fill",
|
|
2221
2221
|
minzoom: 4,
|
|
2222
|
-
paint: { "fill-color":
|
|
2222
|
+
paint: { "fill-color": r.controlledFill, "fill-opacity": 0.03 }
|
|
2223
2223
|
},
|
|
2224
2224
|
{
|
|
2225
2225
|
id: "controlled-stroke",
|
|
2226
2226
|
type: "line",
|
|
2227
2227
|
source: o,
|
|
2228
2228
|
"source-layer": "controlled",
|
|
2229
|
-
paint: { "line-color":
|
|
2229
|
+
paint: { "line-color": r.controlledStroke, "line-width": 1, "line-opacity": ["interpolate", ["linear"], ["zoom"], 4, 0.6, 8, 1], "line-dasharray": [2, 2] }
|
|
2230
2230
|
},
|
|
2231
2231
|
{
|
|
2232
2232
|
id: "controlled-label",
|
|
@@ -2235,7 +2235,7 @@ function $e() {
|
|
|
2235
2235
|
"source-layer": "controlled",
|
|
2236
2236
|
minzoom: 6,
|
|
2237
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":
|
|
2238
|
+
paint: { "text-color": r.controlledStroke, "text-halo-color": "#0f172a", "text-halo-width": 1.5 }
|
|
2239
2239
|
},
|
|
2240
2240
|
{
|
|
2241
2241
|
id: "segment-line",
|
|
@@ -2244,7 +2244,7 @@ function $e() {
|
|
|
2244
2244
|
"source-layer": "segment",
|
|
2245
2245
|
minzoom: 5,
|
|
2246
2246
|
paint: {
|
|
2247
|
-
"line-color": ["case", ["==", ["get", "HAS_REMARK"], 1], "#fbbf24",
|
|
2247
|
+
"line-color": ["case", ["==", ["get", "HAS_REMARK"], 1], "#fbbf24", r.segment],
|
|
2248
2248
|
"line-width": ["interpolate", ["linear"], ["zoom"], 5, 0.2, 8, 0.8],
|
|
2249
2249
|
"line-blur": 0,
|
|
2250
2250
|
"line-opacity": [
|
|
@@ -2316,7 +2316,7 @@ function $e() {
|
|
|
2316
2316
|
"text-size": ["interpolate", ["linear"], ["zoom"], 6, 9, 10, 10],
|
|
2317
2317
|
"icon-text-fit-padding": [0, 3, 0, 3]
|
|
2318
2318
|
},
|
|
2319
|
-
paint: { "icon-color":
|
|
2319
|
+
paint: { "icon-color": r.segment }
|
|
2320
2320
|
},
|
|
2321
2321
|
{
|
|
2322
2322
|
id: "segment-radial",
|
|
@@ -2325,7 +2325,7 @@ function $e() {
|
|
|
2325
2325
|
"source-layer": "segment-radial",
|
|
2326
2326
|
minzoom: 10,
|
|
2327
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":
|
|
2328
|
+
paint: { "text-color": r.segment, "text-halo-color": "#0f172a", "text-halo-width": 1 }
|
|
2329
2329
|
},
|
|
2330
2330
|
{
|
|
2331
2331
|
id: "airport-circle",
|
|
@@ -2370,7 +2370,7 @@ function $e() {
|
|
|
2370
2370
|
"case",
|
|
2371
2371
|
["has", "has_amm"],
|
|
2372
2372
|
"#4B2D6E",
|
|
2373
|
-
|
|
2373
|
+
r.airport
|
|
2374
2374
|
],
|
|
2375
2375
|
"icon-opacity": [
|
|
2376
2376
|
"interpolate",
|
|
@@ -2436,7 +2436,7 @@ function $e() {
|
|
|
2436
2436
|
"source-layer": "runway",
|
|
2437
2437
|
filter: ["!", ["has", "has_amm"]],
|
|
2438
2438
|
minzoom: 4,
|
|
2439
|
-
paint: { "line-color":
|
|
2439
|
+
paint: { "line-color": r.runway, "line-width": ["interpolate", ["linear"], ["zoom"], 4, 1, 10, 3] }
|
|
2440
2440
|
},
|
|
2441
2441
|
{
|
|
2442
2442
|
id: "runway-line-amm",
|
|
@@ -2445,7 +2445,7 @@ function $e() {
|
|
|
2445
2445
|
"source-layer": "runway",
|
|
2446
2446
|
filter: ["has", "has_amm"],
|
|
2447
2447
|
minzoom: 4,
|
|
2448
|
-
paint: { "line-color":
|
|
2448
|
+
paint: { "line-color": r.runway, "line-width": ["interpolate", ["linear"], ["zoom"], 4, 1, 10, 3], "line-opacity": ["interpolate", ["linear"], ["zoom"], 10.5, 1, 11, 0] }
|
|
2449
2449
|
},
|
|
2450
2450
|
{
|
|
2451
2451
|
id: "runway-label",
|
|
@@ -2454,7 +2454,7 @@ function $e() {
|
|
|
2454
2454
|
"source-layer": "runway",
|
|
2455
2455
|
minzoom: 10,
|
|
2456
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":
|
|
2457
|
+
paint: { "text-color": r.runway, "text-halo-color": "#0f172a", "text-halo-width": 1, "text-opacity": ["interpolate", ["linear"], ["zoom"], 10.5, 1, 11, 0] }
|
|
2458
2458
|
},
|
|
2459
2459
|
{
|
|
2460
2460
|
id: "vor-symbol",
|
|
@@ -2471,7 +2471,7 @@ function $e() {
|
|
|
2471
2471
|
"source-layer": "vor",
|
|
2472
2472
|
minzoom: 5,
|
|
2473
2473
|
layout: { "text-field": ["get", "CODE_ID"], "text-size": 10, "text-anchor": "bottom", "text-offset": [0, -0.8] },
|
|
2474
|
-
paint: { "text-color":
|
|
2474
|
+
paint: { "text-color": r.vor, "text-halo-color": "#0f172a", "text-halo-width": 1 }
|
|
2475
2475
|
},
|
|
2476
2476
|
{
|
|
2477
2477
|
id: "ndb-symbol",
|
|
@@ -2481,7 +2481,7 @@ function $e() {
|
|
|
2481
2481
|
"source-layer": "ndb",
|
|
2482
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
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":
|
|
2484
|
+
paint: { "text-color": r.ndb, "text-halo-color": "#0f172a", "text-halo-width": 1, "icon-color": r.ndb }
|
|
2485
2485
|
},
|
|
2486
2486
|
{
|
|
2487
2487
|
id: "waypoint-symbol",
|
|
@@ -2490,7 +2490,7 @@ function $e() {
|
|
|
2490
2490
|
"source-layer": "waypoint",
|
|
2491
2491
|
minzoom: 5,
|
|
2492
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":
|
|
2493
|
+
paint: { "icon-color": r.waypoint, "text-color": r.waypoint, "text-halo-color": "#0f172a", "text-halo-width": 1 }
|
|
2494
2494
|
},
|
|
2495
2495
|
{
|
|
2496
2496
|
id: "waypoint-off-airway-symbol",
|
|
@@ -2499,13 +2499,13 @@ function $e() {
|
|
|
2499
2499
|
"source-layer": "waypoint-off-airway",
|
|
2500
2500
|
minzoom: 7,
|
|
2501
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":
|
|
2502
|
+
paint: { "icon-color": r.waypoint, "text-color": r.waypoint, "text-halo-color": "#0f172a", "text-halo-width": 1 }
|
|
2503
2503
|
}
|
|
2504
2504
|
];
|
|
2505
2505
|
}
|
|
2506
2506
|
const ut = {
|
|
2507
|
-
light: { id: "light", label: "日间", background: "#EAF2F8", build:
|
|
2508
|
-
dark: { id: "dark", label: "夜间", background: "#000000", build:
|
|
2507
|
+
light: { id: "light", label: "日间", background: "#EAF2F8", build: je },
|
|
2508
|
+
dark: { id: "dark", label: "夜间", background: "#000000", build: Ke }
|
|
2509
2509
|
};
|
|
2510
2510
|
function Yt(o = "light") {
|
|
2511
2511
|
return (ut[o] ?? ut.light).build();
|
|
@@ -2522,7 +2522,7 @@ const Ct = {
|
|
|
2522
2522
|
ndb: ["ndb-symbol"],
|
|
2523
2523
|
airport: ["airport-circle", "airport-label"],
|
|
2524
2524
|
runway: ["runway-line", "runway-line-amm", "runway-label"]
|
|
2525
|
-
},
|
|
2525
|
+
}, Ye = {
|
|
2526
2526
|
/** 机场边界(淡暖灰垫底,在纯白底上显现轮廓) */
|
|
2527
2527
|
airport: "#e2e8f0",
|
|
2528
2528
|
/** 跑道面(中深灰,作为白底上的绝对重心) */
|
|
@@ -2548,8 +2548,8 @@ const Ct = {
|
|
|
2548
2548
|
/** 事故易发区(深橙色) */
|
|
2549
2549
|
hotspot: "#ea580c"
|
|
2550
2550
|
};
|
|
2551
|
-
function
|
|
2552
|
-
const
|
|
2551
|
+
function He(o = "amm") {
|
|
2552
|
+
const r = Ye;
|
|
2553
2553
|
return [
|
|
2554
2554
|
// ── 机场边界轮廓(z11+)
|
|
2555
2555
|
{
|
|
@@ -2559,7 +2559,7 @@ function Ye(o = "amm") {
|
|
|
2559
2559
|
"source-layer": "amm-airport",
|
|
2560
2560
|
minzoom: 11,
|
|
2561
2561
|
paint: {
|
|
2562
|
-
"fill-color":
|
|
2562
|
+
"fill-color": r.airport,
|
|
2563
2563
|
"fill-opacity": 0.4
|
|
2564
2564
|
// 适当调高不透明度,确保白底可见
|
|
2565
2565
|
}
|
|
@@ -2571,7 +2571,7 @@ function Ye(o = "amm") {
|
|
|
2571
2571
|
"source-layer": "amm-airport",
|
|
2572
2572
|
minzoom: 11,
|
|
2573
2573
|
paint: {
|
|
2574
|
-
"line-color":
|
|
2574
|
+
"line-color": r.airport,
|
|
2575
2575
|
"line-width": 1
|
|
2576
2576
|
}
|
|
2577
2577
|
},
|
|
@@ -2583,7 +2583,7 @@ function Ye(o = "amm") {
|
|
|
2583
2583
|
"source-layer": "amm-runway",
|
|
2584
2584
|
minzoom: 11,
|
|
2585
2585
|
paint: {
|
|
2586
|
-
"fill-color":
|
|
2586
|
+
"fill-color": r.runway,
|
|
2587
2587
|
"fill-opacity": 0.9
|
|
2588
2588
|
}
|
|
2589
2589
|
},
|
|
@@ -2607,7 +2607,7 @@ function Ye(o = "amm") {
|
|
|
2607
2607
|
"source-layer": "amm-apron",
|
|
2608
2608
|
minzoom: 11,
|
|
2609
2609
|
paint: {
|
|
2610
|
-
"fill-color":
|
|
2610
|
+
"fill-color": r.apron,
|
|
2611
2611
|
"fill-opacity": 0.6
|
|
2612
2612
|
// 提高透明度浓度
|
|
2613
2613
|
}
|
|
@@ -2632,7 +2632,7 @@ function Ye(o = "amm") {
|
|
|
2632
2632
|
"source-layer": "amm-taxiway",
|
|
2633
2633
|
minzoom: 11,
|
|
2634
2634
|
paint: {
|
|
2635
|
-
"fill-color":
|
|
2635
|
+
"fill-color": r.taxiway,
|
|
2636
2636
|
"fill-opacity": 0.7
|
|
2637
2637
|
}
|
|
2638
2638
|
},
|
|
@@ -2644,7 +2644,7 @@ function Ye(o = "amm") {
|
|
|
2644
2644
|
"source-layer": "amm-taxiway-line",
|
|
2645
2645
|
minzoom: 11,
|
|
2646
2646
|
paint: {
|
|
2647
|
-
"line-color":
|
|
2647
|
+
"line-color": r.taxiwayLine,
|
|
2648
2648
|
"line-width": ["interpolate", ["linear"], ["zoom"], 15, 0.8, 18, 2]
|
|
2649
2649
|
}
|
|
2650
2650
|
},
|
|
@@ -2672,7 +2672,7 @@ function Ye(o = "amm") {
|
|
|
2672
2672
|
},
|
|
2673
2673
|
paint: {
|
|
2674
2674
|
"text-color": "#FFF",
|
|
2675
|
-
"icon-color":
|
|
2675
|
+
"icon-color": r.taxiwayLine
|
|
2676
2676
|
}
|
|
2677
2677
|
},
|
|
2678
2678
|
// ── 等待位(z11+)─────
|
|
@@ -2683,7 +2683,7 @@ function Ye(o = "amm") {
|
|
|
2683
2683
|
"source-layer": "amm-holding",
|
|
2684
2684
|
minzoom: 11,
|
|
2685
2685
|
paint: {
|
|
2686
|
-
"line-color":
|
|
2686
|
+
"line-color": r.holding,
|
|
2687
2687
|
"line-width": 1.5
|
|
2688
2688
|
}
|
|
2689
2689
|
},
|
|
@@ -2695,7 +2695,7 @@ function Ye(o = "amm") {
|
|
|
2695
2695
|
"source-layer": "amm-runway-marking",
|
|
2696
2696
|
minzoom: 13,
|
|
2697
2697
|
paint: {
|
|
2698
|
-
"fill-color":
|
|
2698
|
+
"fill-color": r.runwayMarking,
|
|
2699
2699
|
"fill-opacity": 0.9
|
|
2700
2700
|
}
|
|
2701
2701
|
},
|
|
@@ -2707,7 +2707,7 @@ function Ye(o = "amm") {
|
|
|
2707
2707
|
"source-layer": "amm-restricted",
|
|
2708
2708
|
minzoom: 11,
|
|
2709
2709
|
paint: {
|
|
2710
|
-
"fill-color":
|
|
2710
|
+
"fill-color": r.restricted,
|
|
2711
2711
|
"fill-opacity": 0.08
|
|
2712
2712
|
// 针对白底降低面纯度
|
|
2713
2713
|
}
|
|
@@ -2719,7 +2719,7 @@ function Ye(o = "amm") {
|
|
|
2719
2719
|
"source-layer": "amm-restricted",
|
|
2720
2720
|
minzoom: 11,
|
|
2721
2721
|
paint: {
|
|
2722
|
-
"line-color":
|
|
2722
|
+
"line-color": r.restricted,
|
|
2723
2723
|
"line-width": 1.5,
|
|
2724
2724
|
"line-dasharray": [4, 2]
|
|
2725
2725
|
}
|
|
@@ -2732,7 +2732,7 @@ function Ye(o = "amm") {
|
|
|
2732
2732
|
"source-layer": "amm-hotspot",
|
|
2733
2733
|
minzoom: 11,
|
|
2734
2734
|
paint: {
|
|
2735
|
-
"fill-color":
|
|
2735
|
+
"fill-color": r.hotspot,
|
|
2736
2736
|
"fill-opacity": 0.1
|
|
2737
2737
|
// 针对白底轻微淡化面
|
|
2738
2738
|
}
|
|
@@ -2744,7 +2744,7 @@ function Ye(o = "amm") {
|
|
|
2744
2744
|
"source-layer": "amm-hotspot",
|
|
2745
2745
|
minzoom: 11,
|
|
2746
2746
|
paint: {
|
|
2747
|
-
"line-color":
|
|
2747
|
+
"line-color": r.hotspot,
|
|
2748
2748
|
"line-width": 1.5
|
|
2749
2749
|
}
|
|
2750
2750
|
},
|
|
@@ -2756,7 +2756,7 @@ function Ye(o = "amm") {
|
|
|
2756
2756
|
"source-layer": "amm-runway-centerline",
|
|
2757
2757
|
minzoom: 11,
|
|
2758
2758
|
paint: {
|
|
2759
|
-
"line-color":
|
|
2759
|
+
"line-color": r.runwayCenterline,
|
|
2760
2760
|
"line-width": 1,
|
|
2761
2761
|
"line-dasharray": [6, 3]
|
|
2762
2762
|
}
|
|
@@ -2808,7 +2808,7 @@ function Ye(o = "amm") {
|
|
|
2808
2808
|
"source-layer": "amm-stand-line",
|
|
2809
2809
|
minzoom: 13,
|
|
2810
2810
|
paint: {
|
|
2811
|
-
"line-color":
|
|
2811
|
+
"line-color": r.standLine,
|
|
2812
2812
|
"line-width": 1
|
|
2813
2813
|
}
|
|
2814
2814
|
},
|
|
@@ -2847,7 +2847,7 @@ function Ye(o = "amm") {
|
|
|
2847
2847
|
"source-layer": "amm-stand",
|
|
2848
2848
|
minzoom: 12,
|
|
2849
2849
|
paint: {
|
|
2850
|
-
"circle-color":
|
|
2850
|
+
"circle-color": r.stand,
|
|
2851
2851
|
"circle-radius": 1.5
|
|
2852
2852
|
}
|
|
2853
2853
|
},
|
|
@@ -2866,7 +2866,7 @@ function Ye(o = "amm") {
|
|
|
2866
2866
|
"text-allow-overlap": !1
|
|
2867
2867
|
},
|
|
2868
2868
|
paint: {
|
|
2869
|
-
"text-color":
|
|
2869
|
+
"text-color": r.standLine
|
|
2870
2870
|
// 改为深墨绿字,白底/浅灰底上高可读
|
|
2871
2871
|
}
|
|
2872
2872
|
},
|
|
@@ -2973,7 +2973,7 @@ function Ye(o = "amm") {
|
|
|
2973
2973
|
}
|
|
2974
2974
|
];
|
|
2975
2975
|
}
|
|
2976
|
-
const
|
|
2976
|
+
const Ze = {
|
|
2977
2977
|
airport: "#334155",
|
|
2978
2978
|
runway: "#475569",
|
|
2979
2979
|
apron: "#1e293b",
|
|
@@ -2987,17 +2987,17 @@ const He = {
|
|
|
2987
2987
|
restricted: "#f87171",
|
|
2988
2988
|
hotspot: "#fb923c"
|
|
2989
2989
|
};
|
|
2990
|
-
function
|
|
2991
|
-
const
|
|
2990
|
+
function Je(o = "amm") {
|
|
2991
|
+
const r = Ze;
|
|
2992
2992
|
return [
|
|
2993
|
-
{ id: "amm-airport-fill", type: "fill", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "fill-color":
|
|
2993
|
+
{ id: "amm-airport-fill", type: "fill", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "fill-color": r.airport, "fill-opacity": 0.3 } },
|
|
2994
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":
|
|
2995
|
+
{ id: "amm-runway-fill", type: "fill", source: o, "source-layer": "amm-runway", minzoom: 11, paint: { "fill-color": r.runway, "fill-opacity": 1 } },
|
|
2996
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":
|
|
2997
|
+
{ id: "amm-apron-fill", type: "fill", source: o, "source-layer": "amm-apron", minzoom: 11, paint: { "fill-color": r.apron, "fill-opacity": 1 } },
|
|
2998
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":
|
|
3000
|
-
{ id: "amm-taxiway-line", type: "line", source: o, "source-layer": "amm-taxiway-line", minzoom: 11, paint: { "line-color":
|
|
2999
|
+
{ id: "amm-taxiway-fill", type: "fill", source: o, "source-layer": "amm-taxiway", minzoom: 11, paint: { "fill-color": r.taxiway, "fill-opacity": 0.8 } },
|
|
3000
|
+
{ id: "amm-taxiway-line", type: "line", source: o, "source-layer": "amm-taxiway-line", minzoom: 11, paint: { "line-color": r.taxiwayLine, "line-width": ["interpolate", ["linear"], ["zoom"], 15, 0.8, 18, 2] } },
|
|
3001
3001
|
{
|
|
3002
3002
|
id: "amm-taxiway-label",
|
|
3003
3003
|
type: "symbol",
|
|
@@ -3005,15 +3005,15 @@ function Ze(o = "amm") {
|
|
|
3005
3005
|
"source-layer": "amm-taxiway-line",
|
|
3006
3006
|
minzoom: 14,
|
|
3007
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":
|
|
3008
|
+
paint: { "text-color": "#0f172a", "icon-color": r.taxiwayLine }
|
|
3009
3009
|
},
|
|
3010
|
-
{ id: "amm-holding", type: "line", source: o, "source-layer": "amm-holding", minzoom: 11, paint: { "line-color":
|
|
3011
|
-
{ id: "amm-runway-marking", type: "fill", source: o, "source-layer": "amm-runway-marking", minzoom: 13, paint: { "fill-color":
|
|
3012
|
-
{ id: "amm-restricted-fill", type: "fill", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "fill-color":
|
|
3013
|
-
{ id: "amm-restricted-stroke", type: "line", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "line-color":
|
|
3014
|
-
{ id: "amm-hotspot-fill", type: "fill", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "fill-color":
|
|
3015
|
-
{ id: "amm-hotspot-stroke", type: "line", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "line-color":
|
|
3016
|
-
{ id: "amm-runway-centerline", type: "line", source: o, "source-layer": "amm-runway-centerline", minzoom: 11, paint: { "line-color":
|
|
3010
|
+
{ id: "amm-holding", type: "line", source: o, "source-layer": "amm-holding", minzoom: 11, paint: { "line-color": r.holding, "line-width": 1.5 } },
|
|
3011
|
+
{ id: "amm-runway-marking", type: "fill", source: o, "source-layer": "amm-runway-marking", minzoom: 13, paint: { "fill-color": r.runwayMarking, "fill-opacity": 0.8 } },
|
|
3012
|
+
{ id: "amm-restricted-fill", type: "fill", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "fill-color": r.restricted, "fill-opacity": 0.12 } },
|
|
3013
|
+
{ id: "amm-restricted-stroke", type: "line", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "line-color": r.restricted, "line-width": 1.2, "line-dasharray": [4, 2] } },
|
|
3014
|
+
{ id: "amm-hotspot-fill", type: "fill", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "fill-color": r.hotspot, "fill-opacity": 0.15 } },
|
|
3015
|
+
{ id: "amm-hotspot-stroke", type: "line", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "line-color": r.hotspot, "line-width": 1.2 } },
|
|
3016
|
+
{ id: "amm-runway-centerline", type: "line", source: o, "source-layer": "amm-runway-centerline", minzoom: 11, paint: { "line-color": r.runwayCenterline, "line-width": 1, "line-dasharray": [6, 3] } },
|
|
3017
3017
|
{
|
|
3018
3018
|
id: "amm-runway-info",
|
|
3019
3019
|
type: "symbol",
|
|
@@ -3023,7 +3023,7 @@ function Ze(o = "amm") {
|
|
|
3023
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
3024
|
paint: { "text-color": "#e2e8f0", "text-halo-color": "#0f172a", "text-halo-width": 2 }
|
|
3025
3025
|
},
|
|
3026
|
-
{ id: "amm-stand-line", type: "line", source: o, "source-layer": "amm-stand-line", minzoom: 13, paint: { "line-color":
|
|
3026
|
+
{ id: "amm-stand-line", type: "line", source: o, "source-layer": "amm-stand-line", minzoom: 13, paint: { "line-color": r.standLine, "line-width": 1 } },
|
|
3027
3027
|
{
|
|
3028
3028
|
id: "amm-runway-threshold-label",
|
|
3029
3029
|
type: "symbol",
|
|
@@ -3033,7 +3033,7 @@ function Ze(o = "amm") {
|
|
|
3033
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
3034
|
paint: { "text-color": "#ffffff", "icon-color": "#ef4444" }
|
|
3035
3035
|
},
|
|
3036
|
-
{ id: "amm-stand", type: "circle", source: o, "source-layer": "amm-stand", minzoom: 12, paint: { "circle-color":
|
|
3036
|
+
{ id: "amm-stand", type: "circle", source: o, "source-layer": "amm-stand", minzoom: 12, paint: { "circle-color": r.stand, "circle-radius": 1.5 } },
|
|
3037
3037
|
{
|
|
3038
3038
|
id: "amm-stand-label",
|
|
3039
3039
|
type: "symbol",
|
|
@@ -3041,7 +3041,7 @@ function Ze(o = "amm") {
|
|
|
3041
3041
|
"source-layer": "amm-stand",
|
|
3042
3042
|
minzoom: 14,
|
|
3043
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":
|
|
3044
|
+
paint: { "text-color": r.stand, "text-halo-color": "#0f172a", "text-halo-width": 1 }
|
|
3045
3045
|
},
|
|
3046
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
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] } },
|
|
@@ -3068,7 +3068,7 @@ function Ze(o = "amm") {
|
|
|
3068
3068
|
}
|
|
3069
3069
|
];
|
|
3070
3070
|
}
|
|
3071
|
-
const
|
|
3071
|
+
const Qe = {
|
|
3072
3072
|
airport: "#4b5563",
|
|
3073
3073
|
runway: "#71717a",
|
|
3074
3074
|
apron: "#27272a",
|
|
@@ -3083,17 +3083,17 @@ const Je = {
|
|
|
3083
3083
|
restricted: "#f87171",
|
|
3084
3084
|
hotspot: "#fb923c"
|
|
3085
3085
|
};
|
|
3086
|
-
function
|
|
3087
|
-
const
|
|
3086
|
+
function qe(o = "amm") {
|
|
3087
|
+
const r = Qe, u = "#1f1f23";
|
|
3088
3088
|
return [
|
|
3089
|
-
{ id: "amm-airport-fill", type: "fill", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "fill-color":
|
|
3089
|
+
{ id: "amm-airport-fill", type: "fill", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "fill-color": r.airport, "fill-opacity": 0.3 } },
|
|
3090
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":
|
|
3091
|
+
{ id: "amm-runway-fill", type: "fill", source: o, "source-layer": "amm-runway", minzoom: 11, paint: { "fill-color": r.runway, "fill-opacity": 1 } },
|
|
3092
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":
|
|
3093
|
+
{ id: "amm-apron-fill", type: "fill", source: o, "source-layer": "amm-apron", minzoom: 11, paint: { "fill-color": r.apron, "fill-opacity": 1 } },
|
|
3094
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":
|
|
3096
|
-
{ id: "amm-taxiway-line", type: "line", source: o, "source-layer": "amm-taxiway-line", minzoom: 11, paint: { "line-color":
|
|
3095
|
+
{ id: "amm-taxiway-fill", type: "fill", source: o, "source-layer": "amm-taxiway", minzoom: 11, paint: { "fill-color": r.taxiway, "fill-opacity": 0.9 } },
|
|
3096
|
+
{ id: "amm-taxiway-line", type: "line", source: o, "source-layer": "amm-taxiway-line", minzoom: 11, paint: { "line-color": r.taxiwayLine, "line-width": ["interpolate", ["linear"], ["zoom"], 15, 0.8, 18, 2] } },
|
|
3097
3097
|
{
|
|
3098
3098
|
id: "amm-taxiway-label",
|
|
3099
3099
|
type: "symbol",
|
|
@@ -3101,15 +3101,15 @@ function Qe(o = "amm") {
|
|
|
3101
3101
|
"source-layer": "amm-taxiway-line",
|
|
3102
3102
|
minzoom: 14,
|
|
3103
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":
|
|
3104
|
+
paint: { "text-color": u, "icon-color": r.taxiwayLine }
|
|
3105
3105
|
},
|
|
3106
|
-
{ id: "amm-holding", type: "line", source: o, "source-layer": "amm-holding", minzoom: 11, paint: { "line-color":
|
|
3107
|
-
{ id: "amm-runway-marking", type: "fill", source: o, "source-layer": "amm-runway-marking", minzoom: 13, paint: { "fill-color":
|
|
3108
|
-
{ id: "amm-restricted-fill", type: "fill", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "fill-color":
|
|
3109
|
-
{ id: "amm-restricted-stroke", type: "line", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "line-color":
|
|
3110
|
-
{ id: "amm-hotspot-fill", type: "fill", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "fill-color":
|
|
3111
|
-
{ id: "amm-hotspot-stroke", type: "line", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "line-color":
|
|
3112
|
-
{ id: "amm-runway-centerline", type: "line", source: o, "source-layer": "amm-runway-centerline", minzoom: 11, paint: { "line-color":
|
|
3106
|
+
{ id: "amm-holding", type: "line", source: o, "source-layer": "amm-holding", minzoom: 11, paint: { "line-color": r.holding, "line-width": 1.5 } },
|
|
3107
|
+
{ id: "amm-runway-marking", type: "fill", source: o, "source-layer": "amm-runway-marking", minzoom: 13, paint: { "fill-color": r.runwayMarking, "fill-opacity": 0.85 } },
|
|
3108
|
+
{ id: "amm-restricted-fill", type: "fill", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "fill-color": r.restricted, "fill-opacity": 0.1 } },
|
|
3109
|
+
{ id: "amm-restricted-stroke", type: "line", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "line-color": r.restricted, "line-width": 1.2, "line-dasharray": [4, 2] } },
|
|
3110
|
+
{ id: "amm-hotspot-fill", type: "fill", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "fill-color": r.hotspot, "fill-opacity": 0.12 } },
|
|
3111
|
+
{ id: "amm-hotspot-stroke", type: "line", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "line-color": r.hotspot, "line-width": 1.2 } },
|
|
3112
|
+
{ id: "amm-runway-centerline", type: "line", source: o, "source-layer": "amm-runway-centerline", minzoom: 11, paint: { "line-color": r.runwayCenterline, "line-width": 1, "line-dasharray": [6, 3] } },
|
|
3113
3113
|
{
|
|
3114
3114
|
id: "amm-runway-info",
|
|
3115
3115
|
type: "symbol",
|
|
@@ -3119,7 +3119,7 @@ function Qe(o = "amm") {
|
|
|
3119
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
3120
|
paint: { "text-color": "#e4e4e7", "text-halo-color": u, "text-halo-width": 2 }
|
|
3121
3121
|
},
|
|
3122
|
-
{ id: "amm-stand-line", type: "line", source: o, "source-layer": "amm-stand-line", minzoom: 13, paint: { "line-color":
|
|
3122
|
+
{ id: "amm-stand-line", type: "line", source: o, "source-layer": "amm-stand-line", minzoom: 13, paint: { "line-color": r.standLine, "line-width": 1 } },
|
|
3123
3123
|
{
|
|
3124
3124
|
id: "amm-runway-threshold-label",
|
|
3125
3125
|
type: "symbol",
|
|
@@ -3127,9 +3127,9 @@ function Qe(o = "amm") {
|
|
|
3127
3127
|
"source-layer": "amm-runway-threshold",
|
|
3128
3128
|
minzoom: 12,
|
|
3129
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":
|
|
3130
|
+
paint: { "text-color": "#ffffff", "icon-color": r.threshold }
|
|
3131
3131
|
},
|
|
3132
|
-
{ id: "amm-stand", type: "circle", source: o, "source-layer": "amm-stand", minzoom: 12, paint: { "circle-color":
|
|
3132
|
+
{ id: "amm-stand", type: "circle", source: o, "source-layer": "amm-stand", minzoom: 12, paint: { "circle-color": r.stand, "circle-radius": 1.5 } },
|
|
3133
3133
|
{
|
|
3134
3134
|
id: "amm-stand-label",
|
|
3135
3135
|
type: "symbol",
|
|
@@ -3137,7 +3137,7 @@ function Qe(o = "amm") {
|
|
|
3137
3137
|
"source-layer": "amm-stand",
|
|
3138
3138
|
minzoom: 14,
|
|
3139
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":
|
|
3140
|
+
paint: { "text-color": r.stand, "text-halo-color": u, "text-halo-width": 1 }
|
|
3141
3141
|
},
|
|
3142
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
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] } },
|
|
@@ -3164,10 +3164,10 @@ function Qe(o = "amm") {
|
|
|
3164
3164
|
}
|
|
3165
3165
|
];
|
|
3166
3166
|
}
|
|
3167
|
-
function Ht(o = "amm",
|
|
3168
|
-
return
|
|
3167
|
+
function Ht(o = "amm", r = "light") {
|
|
3168
|
+
return r === "dark" ? Je(o) : r === "neutral" ? qe(o) : He(o);
|
|
3169
3169
|
}
|
|
3170
|
-
const
|
|
3170
|
+
const oi = {
|
|
3171
3171
|
ammAirport: ["amm-airport-fill", "amm-airport-stroke"],
|
|
3172
3172
|
ammRunway: [
|
|
3173
3173
|
"amm-runway-fill",
|
|
@@ -3192,7 +3192,7 @@ const ii = {
|
|
|
3192
3192
|
"amm-obstacle-point-label"
|
|
3193
3193
|
],
|
|
3194
3194
|
ammConstruction: ["amm-construction-fill", "amm-construction-stroke", "amm-construction-label"]
|
|
3195
|
-
},
|
|
3195
|
+
}, ti = "http://pre.aips.siniswift.com", ei = [
|
|
3196
3196
|
"interpolate",
|
|
3197
3197
|
["linear"],
|
|
3198
3198
|
["elevation"],
|
|
@@ -3238,7 +3238,16 @@ const ii = {
|
|
|
3238
3238
|
"amm-construction-stroke",
|
|
3239
3239
|
"amm-construction-label"
|
|
3240
3240
|
], Zt = ["terrain-color", "terrain-hillshade"], Jt = ["contour-line", "contour-label"];
|
|
3241
|
-
|
|
3241
|
+
async function Qt(o) {
|
|
3242
|
+
const r = await fetch(o);
|
|
3243
|
+
if (!r.ok) throw new Error(`fetch ${o} → ${r.status}`);
|
|
3244
|
+
const u = r.headers.get("Content-Encoding"), g = r.headers.get("Content-Type") || "";
|
|
3245
|
+
if (u === "gzip" || g.includes("json"))
|
|
3246
|
+
return r.json();
|
|
3247
|
+
const y = r.body.pipeThrough(new DecompressionStream("gzip"));
|
|
3248
|
+
return new Response(y).json();
|
|
3249
|
+
}
|
|
3250
|
+
class ri {
|
|
3242
3251
|
/**
|
|
3243
3252
|
* @param {object} options
|
|
3244
3253
|
* @param {string|HTMLElement} options.container DOM element id or element
|
|
@@ -3248,16 +3257,16 @@ class oi {
|
|
|
3248
3257
|
* @param {string} [options.period] Period id; defaults to latest
|
|
3249
3258
|
* @param {object} [options.layers] Initial layer visibility map
|
|
3250
3259
|
*/
|
|
3251
|
-
constructor(
|
|
3260
|
+
constructor(r = {}) {
|
|
3252
3261
|
const {
|
|
3253
3262
|
container: u,
|
|
3254
|
-
theme:
|
|
3255
|
-
apiUrl: y =
|
|
3256
|
-
spriteUrl:
|
|
3257
|
-
period:
|
|
3258
|
-
layers:
|
|
3259
|
-
} =
|
|
3260
|
-
this._apiUrl = y.replace(/\/$/, ""), this._spriteUrl = (
|
|
3263
|
+
theme: g = "light",
|
|
3264
|
+
apiUrl: y = ti,
|
|
3265
|
+
spriteUrl: x,
|
|
3266
|
+
period: b = null,
|
|
3267
|
+
layers: F = {}
|
|
3268
|
+
} = r;
|
|
3269
|
+
return this._apiUrl = y.replace(/\/$/, ""), this._spriteUrl = (x ?? y).replace(/\/$/, ""), this._theme = g, this._period = b, this._ready = !1, this._layerVisible = {
|
|
3261
3270
|
// aviation groups — all visible by default
|
|
3262
3271
|
adiz: !0,
|
|
3263
3272
|
fir: !0,
|
|
@@ -3275,14 +3284,21 @@ class oi {
|
|
|
3275
3284
|
terrain: !1,
|
|
3276
3285
|
contour: !1,
|
|
3277
3286
|
// user overrides
|
|
3278
|
-
...
|
|
3279
|
-
}, this._initMap(u)
|
|
3287
|
+
...F
|
|
3288
|
+
}, this._initMap(u), new Proxy(this, {
|
|
3289
|
+
get(k, A, z) {
|
|
3290
|
+
var _;
|
|
3291
|
+
if (A in k) return Reflect.get(k, A, z);
|
|
3292
|
+
const p = (_ = k._map) == null ? void 0 : _[A];
|
|
3293
|
+
return typeof p == "function" ? p.bind(k._map) : p;
|
|
3294
|
+
}
|
|
3295
|
+
});
|
|
3280
3296
|
}
|
|
3281
3297
|
// ── Map initialization ────────────────────────────────────────────────────
|
|
3282
|
-
_initMap(
|
|
3298
|
+
_initMap(r) {
|
|
3283
3299
|
const u = ut[this._theme] ?? ut.light;
|
|
3284
3300
|
this._map = new jt.Map({
|
|
3285
|
-
container:
|
|
3301
|
+
container: r,
|
|
3286
3302
|
style: {
|
|
3287
3303
|
version: 8,
|
|
3288
3304
|
glyphs: "https://aips.siniswift.com/mapsdk/glyphs/{fontstack}/{range}.pbf",
|
|
@@ -3315,8 +3331,8 @@ class oi {
|
|
|
3315
3331
|
async _initSources() {
|
|
3316
3332
|
if (!this._period)
|
|
3317
3333
|
try {
|
|
3318
|
-
const
|
|
3319
|
-
this._period =
|
|
3334
|
+
const g = await (await fetch(`${this._apiUrl}/api/periods`)).json();
|
|
3335
|
+
this._period = g[g.length - 1];
|
|
3320
3336
|
} catch (u) {
|
|
3321
3337
|
console.warn("[AviationChart] fetchPeriods failed:", u), this._period = "latest";
|
|
3322
3338
|
}
|
|
@@ -3337,15 +3353,15 @@ class oi {
|
|
|
3337
3353
|
encoding: "mapbox",
|
|
3338
3354
|
maxzoom: 8
|
|
3339
3355
|
});
|
|
3340
|
-
const
|
|
3356
|
+
const r = new Be.DemSource({
|
|
3341
3357
|
url: `${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`,
|
|
3342
3358
|
encoding: "mapbox",
|
|
3343
3359
|
maxzoom: 8,
|
|
3344
3360
|
worker: !0
|
|
3345
3361
|
});
|
|
3346
|
-
|
|
3362
|
+
r.setupMaplibre(jt), this._map.addSource("contour", {
|
|
3347
3363
|
type: "vector",
|
|
3348
|
-
tiles: [
|
|
3364
|
+
tiles: [r.contourProtocolUrl({
|
|
3349
3365
|
thresholds: {
|
|
3350
3366
|
5: [250, 1e3],
|
|
3351
3367
|
7: [125, 500],
|
|
@@ -3361,34 +3377,30 @@ class oi {
|
|
|
3361
3377
|
}), await this._loadBaseData();
|
|
3362
3378
|
}
|
|
3363
3379
|
async _loadBaseData() {
|
|
3364
|
-
var
|
|
3380
|
+
var r, u, g, y;
|
|
3365
3381
|
try {
|
|
3366
|
-
const [
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
}).then((v) => v.json()),
|
|
3370
|
-
fetch(`${this._apiUrl}/topjson/boundary.topojson.gz`, {
|
|
3371
|
-
headers: { "Accept-Encoding": "gzip" }
|
|
3372
|
-
}).then((v) => v.json())
|
|
3382
|
+
const [x, b] = await Promise.all([
|
|
3383
|
+
Qt(`${this._apiUrl}/topjson/land.topojson.gz`),
|
|
3384
|
+
Qt(`${this._apiUrl}/topjson/boundary.topojson.gz`)
|
|
3373
3385
|
]);
|
|
3374
|
-
(
|
|
3375
|
-
} catch (
|
|
3376
|
-
console.
|
|
3386
|
+
(r = x == null ? void 0 : x.objects) != null && r.land ? (u = this._map.getSource("land")) == null || u.setData($t(x, x.objects.land)) : console.warn("[AviationChart] land topojson missing objects.land"), (g = b == null ? void 0 : b.objects) != null && g.boundary ? (y = this._map.getSource("boundary")) == null || y.setData($t(b, b.objects.boundary)) : console.warn("[AviationChart] boundary topojson missing objects.boundary");
|
|
3387
|
+
} catch (x) {
|
|
3388
|
+
console.error("[AviationChart] loadBaseData failed:", x);
|
|
3377
3389
|
}
|
|
3378
3390
|
}
|
|
3379
3391
|
_initLayers() {
|
|
3380
|
-
const
|
|
3392
|
+
const r = this._layerVisible.terrain ? "visible" : "none", u = this._layerVisible.contour ? "visible" : "none";
|
|
3381
3393
|
this._map.addLayer({
|
|
3382
3394
|
id: "terrain-color",
|
|
3383
3395
|
type: "color-relief",
|
|
3384
3396
|
source: "terrain",
|
|
3385
|
-
layout: { visibility:
|
|
3386
|
-
paint: { "color-relief-color":
|
|
3397
|
+
layout: { visibility: r },
|
|
3398
|
+
paint: { "color-relief-color": ei }
|
|
3387
3399
|
}), this._map.addLayer({
|
|
3388
3400
|
id: "terrain-hillshade",
|
|
3389
3401
|
type: "hillshade",
|
|
3390
3402
|
source: "terrain",
|
|
3391
|
-
layout: { visibility:
|
|
3403
|
+
layout: { visibility: r },
|
|
3392
3404
|
paint: {
|
|
3393
3405
|
"hillshade-shadow-color": "rgba(74,59,42,0.35)",
|
|
3394
3406
|
"hillshade-highlight-color": "rgba(255,246,230,0.25)",
|
|
@@ -3428,26 +3440,26 @@ class oi {
|
|
|
3428
3440
|
"text-halo-width": 1
|
|
3429
3441
|
}
|
|
3430
3442
|
}), this._layerVisible.terrain && this._map.setTerrain({ source: "terrain", exaggeration: 4 });
|
|
3431
|
-
for (const
|
|
3432
|
-
this._map.getLayer(
|
|
3433
|
-
for (const
|
|
3434
|
-
this._map.getLayer(
|
|
3443
|
+
for (const g of Yt(this._theme))
|
|
3444
|
+
this._map.getLayer(g.id) || this._map.addLayer(g);
|
|
3445
|
+
for (const g of Ht("amm", this._theme))
|
|
3446
|
+
this._map.getLayer(g.id) || this._map.addLayer(g, "fir-line");
|
|
3435
3447
|
}
|
|
3436
3448
|
_applyVisibility() {
|
|
3437
|
-
for (const [y,
|
|
3438
|
-
const
|
|
3439
|
-
for (const
|
|
3440
|
-
this._map.getLayer(
|
|
3449
|
+
for (const [y, x] of Object.entries(Ct)) {
|
|
3450
|
+
const b = this._layerVisible[y] !== !1 ? "visible" : "none";
|
|
3451
|
+
for (const F of x)
|
|
3452
|
+
this._map.getLayer(F) && this._map.setLayoutProperty(F, "visibility", b);
|
|
3441
3453
|
}
|
|
3442
|
-
const
|
|
3454
|
+
const r = this._layerVisible.amm !== !1 ? "visible" : "none";
|
|
3443
3455
|
for (const y of Pt)
|
|
3444
|
-
this._map.getLayer(y) && this._map.setLayoutProperty(y, "visibility",
|
|
3456
|
+
this._map.getLayer(y) && this._map.setLayoutProperty(y, "visibility", r);
|
|
3445
3457
|
const u = this._layerVisible.terrain ? "visible" : "none";
|
|
3446
3458
|
for (const y of Zt)
|
|
3447
3459
|
this._map.getLayer(y) && this._map.setLayoutProperty(y, "visibility", u);
|
|
3448
|
-
const
|
|
3460
|
+
const g = this._layerVisible.contour ? "visible" : "none";
|
|
3449
3461
|
for (const y of Jt)
|
|
3450
|
-
this._map.getLayer(y) && this._map.setLayoutProperty(y, "visibility",
|
|
3462
|
+
this._map.getLayer(y) && this._map.setLayoutProperty(y, "visibility", g);
|
|
3451
3463
|
}
|
|
3452
3464
|
// ── Public API ────────────────────────────────────────────────────────────
|
|
3453
3465
|
/** Raw MapLibre Map instance */
|
|
@@ -3466,18 +3478,18 @@ class oi {
|
|
|
3466
3478
|
* Switch the chart theme.
|
|
3467
3479
|
* @param {'light'|'dark'} theme
|
|
3468
3480
|
*/
|
|
3469
|
-
setTheme(
|
|
3470
|
-
if (
|
|
3471
|
-
this._theme =
|
|
3472
|
-
const u = ut[
|
|
3481
|
+
setTheme(r) {
|
|
3482
|
+
if (r === this._theme) return;
|
|
3483
|
+
this._theme = r;
|
|
3484
|
+
const u = ut[r] ?? ut.light;
|
|
3473
3485
|
this._map.setPaintProperty("background", "background-color", u.background);
|
|
3474
|
-
const
|
|
3486
|
+
const g = [
|
|
3475
3487
|
"landLaye",
|
|
3476
3488
|
"boundary",
|
|
3477
3489
|
...Object.values(Ct).flat(),
|
|
3478
3490
|
...Pt
|
|
3479
3491
|
];
|
|
3480
|
-
for (const y of
|
|
3492
|
+
for (const y of g)
|
|
3481
3493
|
this._map.getLayer(y) && this._map.removeLayer(y);
|
|
3482
3494
|
for (const y of Yt(this._theme))
|
|
3483
3495
|
this._map.addLayer(y);
|
|
@@ -3496,52 +3508,52 @@ class oi {
|
|
|
3496
3508
|
* @param {string} key
|
|
3497
3509
|
* @param {boolean} visible
|
|
3498
3510
|
*/
|
|
3499
|
-
setLayerVisible(
|
|
3500
|
-
if (this._layerVisible[
|
|
3501
|
-
const
|
|
3502
|
-
for (const
|
|
3503
|
-
this._map.getLayer(
|
|
3511
|
+
setLayerVisible(r, u) {
|
|
3512
|
+
if (this._layerVisible[r] = u, r === "terrain") {
|
|
3513
|
+
const x = u ? "visible" : "none";
|
|
3514
|
+
for (const b of Zt)
|
|
3515
|
+
this._map.getLayer(b) && this._map.setLayoutProperty(b, "visibility", x);
|
|
3504
3516
|
this._map.setTerrain(u ? { source: "terrain", exaggeration: 4 } : null);
|
|
3505
3517
|
return;
|
|
3506
3518
|
}
|
|
3507
|
-
if (
|
|
3508
|
-
const
|
|
3509
|
-
for (const
|
|
3510
|
-
this._map.getLayer(
|
|
3519
|
+
if (r === "contour") {
|
|
3520
|
+
const x = u ? "visible" : "none";
|
|
3521
|
+
for (const b of Jt)
|
|
3522
|
+
this._map.getLayer(b) && this._map.setLayoutProperty(b, "visibility", x);
|
|
3511
3523
|
return;
|
|
3512
3524
|
}
|
|
3513
|
-
if (
|
|
3514
|
-
const
|
|
3515
|
-
for (const
|
|
3516
|
-
this._map.getLayer(
|
|
3525
|
+
if (r === "amm") {
|
|
3526
|
+
const x = u ? "visible" : "none";
|
|
3527
|
+
for (const b of Pt)
|
|
3528
|
+
this._map.getLayer(b) && this._map.setLayoutProperty(b, "visibility", x);
|
|
3517
3529
|
return;
|
|
3518
3530
|
}
|
|
3519
|
-
const
|
|
3520
|
-
if (!
|
|
3521
|
-
console.warn(`[AviationChart] Unknown layer key: "${
|
|
3531
|
+
const g = Ct[r];
|
|
3532
|
+
if (!g) {
|
|
3533
|
+
console.warn(`[AviationChart] Unknown layer key: "${r}"`);
|
|
3522
3534
|
return;
|
|
3523
3535
|
}
|
|
3524
3536
|
const y = u ? "visible" : "none";
|
|
3525
|
-
for (const
|
|
3526
|
-
this._map.getLayer(
|
|
3537
|
+
for (const x of g)
|
|
3538
|
+
this._map.getLayer(x) && this._map.setLayoutProperty(x, "visibility", y);
|
|
3527
3539
|
}
|
|
3528
3540
|
/**
|
|
3529
3541
|
* Switch the navdata period. Fetches tiles for the new period immediately.
|
|
3530
3542
|
* @param {string} period
|
|
3531
3543
|
*/
|
|
3532
|
-
setPeriod(
|
|
3533
|
-
var
|
|
3534
|
-
this._period =
|
|
3535
|
-
const u = (
|
|
3536
|
-
u && u.setTiles([`${this._apiUrl}/api/tiles/${
|
|
3544
|
+
setPeriod(r) {
|
|
3545
|
+
var g;
|
|
3546
|
+
this._period = r;
|
|
3547
|
+
const u = (g = this._map) == null ? void 0 : g.getSource("navdata");
|
|
3548
|
+
u && u.setTiles([`${this._apiUrl}/api/tiles/${r}/{z}/{x}/{y}.pbf`]);
|
|
3537
3549
|
}
|
|
3538
3550
|
/** Proxy to map.on — returns `this` for chaining */
|
|
3539
|
-
on(
|
|
3540
|
-
return this._map.on(
|
|
3551
|
+
on(r, u) {
|
|
3552
|
+
return this._map.on(r, u), this;
|
|
3541
3553
|
}
|
|
3542
3554
|
/** Proxy to map.off — returns `this` for chaining */
|
|
3543
|
-
off(
|
|
3544
|
-
return this._map.off(
|
|
3555
|
+
off(r, u) {
|
|
3556
|
+
return this._map.off(r, u), this;
|
|
3545
3557
|
}
|
|
3546
3558
|
/** Remove the map and release all resources */
|
|
3547
3559
|
destroy() {
|
|
@@ -3549,8 +3561,8 @@ class oi {
|
|
|
3549
3561
|
}
|
|
3550
3562
|
}
|
|
3551
3563
|
export {
|
|
3552
|
-
|
|
3553
|
-
|
|
3564
|
+
oi as AMM_LAYER_GROUPS,
|
|
3565
|
+
ri as AviationChart,
|
|
3554
3566
|
ut as CHART_THEMES,
|
|
3555
3567
|
Ct as LAYER_GROUPS
|
|
3556
3568
|
};
|