aviation-chart 0.1.19 → 0.1.21
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 +656 -625
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import jt from "maplibre-gl";
|
|
2
|
-
var vt, Rt,
|
|
3
|
-
function
|
|
2
|
+
var vt, Rt, Mt;
|
|
3
|
+
function Ot(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
|
|
10
|
-
vt(
|
|
11
|
-
new Blob([
|
|
9
|
+
var d = "var sharedChunk = {}; (" + vt + ")(sharedChunk); (" + Rt + ")(sharedChunk);", y = {};
|
|
10
|
+
vt(y), Mt = r(y), typeof window < "u" && (Mt.workerUrl = window.URL.createObjectURL(
|
|
11
|
+
new Blob([d], { type: "text/javascript" })
|
|
12
12
|
));
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
class
|
|
15
|
+
Ot(["exports"], function(o) {
|
|
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
|
}
|
|
@@ -36,7 +36,7 @@ Mt(["exports"], function(o) {
|
|
|
36
36
|
return this.points;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
const
|
|
39
|
+
const d = [
|
|
40
40
|
[],
|
|
41
41
|
[
|
|
42
42
|
[
|
|
@@ -132,124 +132,124 @@ Mt(["exports"], function(o) {
|
|
|
132
132
|
],
|
|
133
133
|
[]
|
|
134
134
|
];
|
|
135
|
-
function
|
|
135
|
+
function y(t, e, i, n) {
|
|
136
136
|
return e = e * 2 + n[0], i = i * 2 + n[1], e + i * (t + 1) * 2;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function g(t, e, i) {
|
|
139
139
|
return (e - t) / (i - t);
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function w(t, e, i = 4096, n = 1) {
|
|
142
142
|
if (!t)
|
|
143
143
|
return {};
|
|
144
|
-
const
|
|
145
|
-
let l, s, c, m,
|
|
146
|
-
const
|
|
147
|
-
function
|
|
148
|
-
|
|
144
|
+
const a = i / (e.width - 1);
|
|
145
|
+
let l, s, c, m, f, h;
|
|
146
|
+
const u = {}, _ = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
|
|
147
|
+
function P(M, I, R) {
|
|
148
|
+
M[0] === 0 ? R(a * (h - 1), a * (f - g(c, I, l))) : M[0] === 2 ? R(a * h, a * (f - g(m, I, s))) : M[1] === 0 ? R(a * (h - g(s, I, l)), a * (f - 1)) : R(a * (h - g(m, I, c)), a * f);
|
|
149
149
|
}
|
|
150
|
-
for (
|
|
151
|
-
s = e.get(0,
|
|
152
|
-
let
|
|
153
|
-
for (
|
|
154
|
-
l = s, c = m, s = e.get(
|
|
155
|
-
const
|
|
156
|
-
if (
|
|
150
|
+
for (f = 1 - n; f < e.height + n; f++) {
|
|
151
|
+
s = e.get(0, f - 1), m = e.get(0, f);
|
|
152
|
+
let M = Math.min(s, m), I = Math.max(s, m);
|
|
153
|
+
for (h = 1 - n; h < e.width + n; h++) {
|
|
154
|
+
l = s, c = m, s = e.get(h, f - 1), m = e.get(h, f);
|
|
155
|
+
const R = M, V = I;
|
|
156
|
+
if (M = Math.min(s, m), I = Math.max(s, m), isNaN(l) || isNaN(s) || isNaN(m) || isNaN(c))
|
|
157
157
|
continue;
|
|
158
|
-
const
|
|
159
|
-
for (let
|
|
160
|
-
const At = l >
|
|
161
|
-
for (const bt of
|
|
162
|
-
let Y =
|
|
163
|
-
Y ||
|
|
164
|
-
let lt =
|
|
165
|
-
lt ||
|
|
166
|
-
const kt = bt[0], zt = bt[1], yt =
|
|
167
|
-
let
|
|
168
|
-
if (
|
|
158
|
+
const dt = Math.min(R, M), pt = Math.max(V, I), X = Math.ceil(dt / 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
|
+
for (const bt of d[(At ? 8 : 0) | (q ? 4 : 0) | (_t ? 2 : 0) | (nt ? 1 : 0)]) {
|
|
162
|
+
let Y = _.get(C);
|
|
163
|
+
Y || _.set(C, Y = /* @__PURE__ */ new Map());
|
|
164
|
+
let lt = F.get(C);
|
|
165
|
+
lt || F.set(C, lt = /* @__PURE__ */ new Map());
|
|
166
|
+
const kt = bt[0], zt = bt[1], yt = y(e.width, h, f, kt), st = y(e.width, h, f, zt);
|
|
167
|
+
let G, Tt;
|
|
168
|
+
if (G = lt.get(yt))
|
|
169
169
|
if (lt.delete(yt), Tt = Y.get(st))
|
|
170
|
-
if (Y.delete(st),
|
|
171
|
-
if (
|
|
172
|
-
let rt =
|
|
173
|
-
rt || (
|
|
170
|
+
if (Y.delete(st), G === Tt) {
|
|
171
|
+
if (P(zt, C, G.append), !G.isEmpty()) {
|
|
172
|
+
let rt = u[C];
|
|
173
|
+
rt || (u[C] = rt = []), rt.push(G.lineString());
|
|
174
174
|
}
|
|
175
175
|
} else
|
|
176
|
-
|
|
176
|
+
G.appendFragment(Tt), lt.set(G.end = Tt.end, G);
|
|
177
177
|
else
|
|
178
|
-
|
|
179
|
-
else if (
|
|
180
|
-
Y.delete(st),
|
|
178
|
+
P(zt, C, G.append), lt.set(G.end = st, G);
|
|
179
|
+
else if (G = Y.get(st))
|
|
180
|
+
Y.delete(st), P(kt, C, G.prepend), Y.set(G.start = yt, G);
|
|
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 [M, I] of _.entries()) {
|
|
190
|
+
let R = null;
|
|
191
191
|
for (const V of I.values())
|
|
192
|
-
V.isEmpty() || (
|
|
192
|
+
V.isEmpty() || (R == null && (R = u[M] || (u[M] = [])), R.push(V.lineString()));
|
|
193
193
|
}
|
|
194
|
-
return
|
|
194
|
+
return u;
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function b(t) {
|
|
197
197
|
const e = Object.entries(t);
|
|
198
198
|
return e.sort(([i], [n]) => i < n ? -1 : i > n ? 1 : 0), e;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
201
|
-
return
|
|
200
|
+
function S(t) {
|
|
201
|
+
return b(t).map(([e, i]) => [e, ...typeof i == "number" ? [i] : i].join("*")).join("~");
|
|
202
202
|
}
|
|
203
203
|
function O(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 k({ thresholds: t, ...e }) {
|
|
207
|
+
return b({ thresholds: S(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
211
|
const i = e.split("=").map(decodeURIComponent), n = i[0];
|
|
212
|
-
let
|
|
212
|
+
let a = i[1];
|
|
213
213
|
switch (n) {
|
|
214
214
|
case "thresholds":
|
|
215
|
-
|
|
215
|
+
a = O(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 [n,
|
|
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
|
|
229
|
+
function x(t, e) {
|
|
230
230
|
const { thresholds: i, ...n } = t;
|
|
231
|
-
let
|
|
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:
|
|
236
|
+
levels: a,
|
|
237
237
|
...n
|
|
238
238
|
};
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function T(t) {
|
|
241
241
|
const e = new ArrayBuffer(t.byteLength);
|
|
242
242
|
return new Uint8Array(e).set(new Uint8Array(t)), e;
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function D(t, e) {
|
|
245
245
|
return t.then(({ data: i, ...n }) => {
|
|
246
|
-
let
|
|
247
|
-
return e && (
|
|
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 A(t) {
|
|
251
251
|
return t.then(({ arrayBuffer: e }) => {
|
|
252
|
-
const i =
|
|
252
|
+
const i = T(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
272
|
const n = i.getImageData(0, 0, 5, 5).data;
|
|
273
|
-
for (let
|
|
274
|
-
if (
|
|
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
|
}
|
|
@@ -279,21 +279,21 @@ Mt(["exports"], function(o) {
|
|
|
279
279
|
}
|
|
280
280
|
return tt || !1;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function L(t, e, i) {
|
|
283
283
|
let n = () => {
|
|
284
284
|
};
|
|
285
|
-
const
|
|
285
|
+
const a = setTimeout(() => {
|
|
286
286
|
n(new Error("timed out")), i == null || i.abort();
|
|
287
287
|
}, t);
|
|
288
288
|
U(i, () => {
|
|
289
|
-
n(new Error("aborted")), clearTimeout(
|
|
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,35 +303,35 @@ 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 E = 0;
|
|
307
307
|
class Z {
|
|
308
308
|
constructor(e = 100) {
|
|
309
|
-
this.size = () => this.items.size, this.get = (i, n,
|
|
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 = ++E, l.waiting++;
|
|
313
313
|
else {
|
|
314
|
-
const
|
|
314
|
+
const f = new AbortController(), h = n(i, f);
|
|
315
315
|
l = {
|
|
316
|
-
abortController:
|
|
317
|
-
item:
|
|
318
|
-
lastUsed: ++
|
|
316
|
+
abortController: f,
|
|
317
|
+
item: h,
|
|
318
|
+
lastUsed: ++E,
|
|
319
319
|
waiting: 1
|
|
320
320
|
}, this.items.set(i, l), this.prune();
|
|
321
321
|
}
|
|
322
|
-
const s = this.items, c = l.item.then((
|
|
322
|
+
const s = this.items, c = l.item.then((f) => f, (f) => (s.delete(i), Promise.reject(f)));
|
|
323
323
|
let m = !1;
|
|
324
|
-
return U(
|
|
325
|
-
var
|
|
326
|
-
l && l.abortController && !m && (m = !0, --l.waiting <= 0 && ((
|
|
324
|
+
return U(a, () => {
|
|
325
|
+
var f;
|
|
326
|
+
l && l.abortController && !m && (m = !0, --l.waiting <= 0 && ((f = l.abortController) === null || f === void 0 || f.abort(), s.delete(i)));
|
|
327
327
|
}), c;
|
|
328
328
|
}, this.clear = () => this.items.clear(), this.maxSize = e, this.items = /* @__PURE__ */ new Map();
|
|
329
329
|
}
|
|
330
330
|
prune() {
|
|
331
331
|
if (this.items.size > this.maxSize) {
|
|
332
332
|
let e, i = 1 / 0;
|
|
333
|
-
this.items.forEach((n,
|
|
334
|
-
n.lastUsed < i && (i = n.lastUsed, e =
|
|
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
|
}
|
|
@@ -344,24 +344,24 @@ Mt(["exports"], function(o) {
|
|
|
344
344
|
function W(t, e) {
|
|
345
345
|
return K || (K = new OffscreenCanvas(t.width, t.height), et = K.getContext("2d", {
|
|
346
346
|
willReadFrequently: !0
|
|
347
|
-
})),
|
|
347
|
+
})), Gt(t, e, K, et);
|
|
348
348
|
}
|
|
349
349
|
async function xt(t, e, i) {
|
|
350
|
-
var n,
|
|
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 (!(((n = c == null ? void 0 : c.format) === null || n === void 0 ? void 0 : n.startsWith("BGR")) || ((
|
|
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
|
-
const
|
|
359
|
-
if (await c.copyTo(
|
|
360
|
-
for (let
|
|
361
|
-
const
|
|
362
|
-
|
|
358
|
+
const f = (l = c == null ? void 0 : c.format) === null || l === void 0 ? void 0 : l.startsWith("BGR"), h = c.allocationSize(), u = new Uint8ClampedArray(h);
|
|
359
|
+
if (await c.copyTo(u), f)
|
|
360
|
+
for (let _ = 0; _ < u.length; _ += 4) {
|
|
361
|
+
const F = u[_];
|
|
362
|
+
u[_] = u[_ + 2], u[_ + 2] = F;
|
|
363
363
|
}
|
|
364
|
-
return Dt(s.width, s.height, e,
|
|
364
|
+
return Dt(s.width, s.height, e, u);
|
|
365
365
|
} catch {
|
|
366
366
|
return B(i) ? null : W(s, e);
|
|
367
367
|
} finally {
|
|
@@ -374,12 +374,12 @@ Mt(["exports"], function(o) {
|
|
|
374
374
|
}));
|
|
375
375
|
const n = new Image();
|
|
376
376
|
U(i, () => n.src = "");
|
|
377
|
-
const
|
|
377
|
+
const a = await new Promise((l, s) => {
|
|
378
378
|
n.onload = () => {
|
|
379
379
|
B(i) || l(n), URL.revokeObjectURL(n.src), n.onload = null;
|
|
380
380
|
}, n.onerror = () => s(new Error("Could not load image.")), n.src = t.size ? URL.createObjectURL(t) : "";
|
|
381
381
|
});
|
|
382
|
-
return
|
|
382
|
+
return Gt(a, e, N, it);
|
|
383
383
|
}
|
|
384
384
|
function te(t, e, i) {
|
|
385
385
|
return self.actor.send("decodeImage", [], i, void 0, t, e);
|
|
@@ -392,17 +392,17 @@ Mt(["exports"], function(o) {
|
|
|
392
392
|
);
|
|
393
393
|
}
|
|
394
394
|
const It = H() ? xt : ct() ? at : ee() ? te : qt;
|
|
395
|
-
function
|
|
395
|
+
function Gt(t, e, i, n) {
|
|
396
396
|
if (i.width = t.width, i.height = t.height, !n)
|
|
397
397
|
throw new Error("failed to get context");
|
|
398
398
|
n.drawImage(t, 0, 0, t.width, t.height);
|
|
399
|
-
const
|
|
400
|
-
return Dt(t.width, t.height, e,
|
|
399
|
+
const a = n.getImageData(0, 0, t.width, t.height).data;
|
|
400
|
+
return Dt(t.width, t.height, e, a);
|
|
401
401
|
}
|
|
402
402
|
function Dt(t, e, i, n) {
|
|
403
|
-
const
|
|
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
404
|
for (let s = 0; s < n.length; s += 4)
|
|
405
|
-
l[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
408
|
const ie = -12e3, oe = 9e3;
|
|
@@ -411,40 +411,40 @@ Mt(["exports"], function(o) {
|
|
|
411
411
|
}
|
|
412
412
|
class $ {
|
|
413
413
|
constructor(e, i, n) {
|
|
414
|
-
this.split = (
|
|
415
|
-
if (
|
|
414
|
+
this.split = (a, l, s) => {
|
|
415
|
+
if (a === 0)
|
|
416
416
|
return this;
|
|
417
|
-
const c = 1 <<
|
|
418
|
-
return new $(this.width / c, this.height / c, (
|
|
419
|
-
}, this.subsamplePixelCenters = (
|
|
420
|
-
const l = (m,
|
|
421
|
-
if (
|
|
417
|
+
const c = 1 << a, m = l * this.width / c, f = s * this.height / c;
|
|
418
|
+
return new $(this.width / c, this.height / c, (h, u) => this.get(h + m, u + f));
|
|
419
|
+
}, this.subsamplePixelCenters = (a) => {
|
|
420
|
+
const l = (m, f, h) => isNaN(m) ? f : isNaN(f) ? m : m + (f - m) * h;
|
|
421
|
+
if (a <= 1)
|
|
422
422
|
return this;
|
|
423
|
-
const s = 0.5 - 1 / (2 *
|
|
424
|
-
const
|
|
425
|
-
return l(pt, X,
|
|
423
|
+
const s = 0.5 - 1 / (2 * a), c = (m, f) => {
|
|
424
|
+
const h = m / a - s, u = f / a - s, _ = Math.floor(h), F = Math.floor(u), P = this.get(_, F), M = this.get(_ + 1, F), I = this.get(_, F + 1), R = this.get(_ + 1, F + 1), V = h - _, dt = u - F, pt = l(P, M, V), X = l(I, R, V);
|
|
425
|
+
return l(pt, X, dt);
|
|
426
426
|
};
|
|
427
|
-
return new $(this.width *
|
|
428
|
-
}, this.averagePixelCentersToGrid = (
|
|
429
|
-
let c = 0, m = 0,
|
|
430
|
-
for (let
|
|
431
|
-
for (let
|
|
432
|
-
isNaN(
|
|
427
|
+
return new $(this.width * a, this.height * a, c);
|
|
428
|
+
}, this.averagePixelCentersToGrid = (a = 1) => new $(this.width + 1, this.height + 1, (l, s) => {
|
|
429
|
+
let c = 0, m = 0, f = 0;
|
|
430
|
+
for (let h = l - a; h < l + a; h++)
|
|
431
|
+
for (let u = s - a; u < s + a; u++)
|
|
432
|
+
isNaN(f = this.get(h, u)) || (m++, c += f);
|
|
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
|
|
439
|
-
s[c++] = this.get(
|
|
440
|
-
return new $(this.width, this.height, (m,
|
|
437
|
+
for (let m = -a; m < this.height + a; m++)
|
|
438
|
+
for (let f = -a; f < this.width + a; f++)
|
|
439
|
+
s[c++] = this.get(f, m);
|
|
440
|
+
return new $(this.width, this.height, (m, f) => s[(f + a) * l + m + a]);
|
|
441
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
445
|
return new $(e.width, e.height, (i, n) => {
|
|
446
|
-
const
|
|
447
|
-
return re(
|
|
446
|
+
const a = e.data[n * e.width + i];
|
|
447
|
+
return re(a) ? a : NaN;
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
450
|
/**
|
|
@@ -459,10 +459,10 @@ Mt(["exports"], function(o) {
|
|
|
459
459
|
const i = e[4];
|
|
460
460
|
if (!i)
|
|
461
461
|
return;
|
|
462
|
-
const n = i.width,
|
|
463
|
-
return new $(n,
|
|
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
|
});
|
|
@@ -473,43 +473,43 @@ Mt(["exports"], function(o) {
|
|
|
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, n,
|
|
477
|
-
var l, s, c =
|
|
478
|
-
for (
|
|
476
|
+
Et.read = function(t, e, i, n, a) {
|
|
477
|
+
var l, s, c = a * 8 - n - 1, m = (1 << c) - 1, f = m >> 1, h = -7, u = i ? a - 1 : 0, _ = i ? -1 : 1, F = t[e + u];
|
|
478
|
+
for (u += _, l = F & (1 << -h) - 1, F >>= -h, h += c; h > 0; l = l * 256 + t[e + u], u += _, h -= 8)
|
|
479
479
|
;
|
|
480
|
-
for (s = l & (1 << -
|
|
480
|
+
for (s = l & (1 << -h) - 1, l >>= -h, h += n; h > 0; s = s * 256 + t[e + u], u += _, h -= 8)
|
|
481
481
|
;
|
|
482
482
|
if (l === 0)
|
|
483
|
-
l = 1 -
|
|
483
|
+
l = 1 - f;
|
|
484
484
|
else {
|
|
485
485
|
if (l === m)
|
|
486
|
-
return s ? NaN : (
|
|
487
|
-
s = s + Math.pow(2, n), l = l -
|
|
486
|
+
return s ? NaN : (F ? -1 : 1) * (1 / 0);
|
|
487
|
+
s = s + Math.pow(2, n), l = l - f;
|
|
488
488
|
}
|
|
489
|
-
return (
|
|
490
|
-
}, Et.write = function(t, e, i, n,
|
|
491
|
-
var s, c, m,
|
|
492
|
-
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (c = isNaN(e) ? 1 : 0, s =
|
|
489
|
+
return (F ? -1 : 1) * s * Math.pow(2, l - n);
|
|
490
|
+
}, Et.write = function(t, e, i, n, a, l) {
|
|
491
|
+
var s, c, m, f = l * 8 - a - 1, h = (1 << f) - 1, u = h >> 1, _ = a === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, F = n ? 0 : l - 1, P = n ? 1 : -1, M = 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 = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (m = Math.pow(2, -s)) < 1 && (s--, m *= 2), s + u >= 1 ? e += _ / m : e += _ * Math.pow(2, 1 - u), e * m >= 2 && (s++, m /= 2), s + u >= h ? (c = 0, s = h) : s + u >= 1 ? (c = (e * m - 1) * Math.pow(2, a), s = s + u) : (c = e * Math.pow(2, u - 1) * Math.pow(2, a), s = 0)); a >= 8; t[i + F] = c & 255, F += P, c /= 256, a -= 8)
|
|
493
493
|
;
|
|
494
|
-
for (s = s <<
|
|
494
|
+
for (s = s << a | c, f += a; f > 0; t[i + F] = s & 255, F += P, s /= 256, f -= 8)
|
|
495
495
|
;
|
|
496
|
-
t[i +
|
|
496
|
+
t[i + F - P] |= M * 128;
|
|
497
497
|
};
|
|
498
|
-
var ne =
|
|
499
|
-
function
|
|
498
|
+
var ne = v, gt = Et;
|
|
499
|
+
function v(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
|
-
|
|
503
|
-
var Ft = 65536 * 65536,
|
|
504
|
-
|
|
502
|
+
v.Varint = 0, v.Fixed64 = 1, v.Bytes = 2, v.Fixed32 = 5;
|
|
503
|
+
var Ft = 65536 * 65536, Lt = 1 / Ft, le = 12, Bt = typeof TextDecoder > "u" ? null : new TextDecoder("utf8");
|
|
504
|
+
v.prototype = {
|
|
505
505
|
destroy: function() {
|
|
506
506
|
this.buf = null;
|
|
507
507
|
},
|
|
508
508
|
// === READING =================================================================
|
|
509
509
|
readFields: function(t, e, i) {
|
|
510
510
|
for (i = i || this.length; this.pos < i; ) {
|
|
511
|
-
var n = this.readVarint(),
|
|
512
|
-
this.type = n & 7, t(
|
|
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
|
},
|
|
@@ -565,66 +565,66 @@ Mt(["exports"], function(o) {
|
|
|
565
565
|
},
|
|
566
566
|
// verbose for performance reasons; doesn't affect gzipped size
|
|
567
567
|
readPackedVarint: function(t, e) {
|
|
568
|
-
if (this.type !==
|
|
568
|
+
if (this.type !== v.Bytes) return t.push(this.readVarint(e));
|
|
569
569
|
var i = J(this);
|
|
570
570
|
for (t = t || []; this.pos < i; ) t.push(this.readVarint(e));
|
|
571
571
|
return t;
|
|
572
572
|
},
|
|
573
573
|
readPackedSVarint: function(t) {
|
|
574
|
-
if (this.type !==
|
|
574
|
+
if (this.type !== v.Bytes) return t.push(this.readSVarint());
|
|
575
575
|
var e = J(this);
|
|
576
576
|
for (t = t || []; this.pos < e; ) t.push(this.readSVarint());
|
|
577
577
|
return t;
|
|
578
578
|
},
|
|
579
579
|
readPackedBoolean: function(t) {
|
|
580
|
-
if (this.type !==
|
|
580
|
+
if (this.type !== v.Bytes) return t.push(this.readBoolean());
|
|
581
581
|
var e = J(this);
|
|
582
582
|
for (t = t || []; this.pos < e; ) t.push(this.readBoolean());
|
|
583
583
|
return t;
|
|
584
584
|
},
|
|
585
585
|
readPackedFloat: function(t) {
|
|
586
|
-
if (this.type !==
|
|
586
|
+
if (this.type !== v.Bytes) return t.push(this.readFloat());
|
|
587
587
|
var e = J(this);
|
|
588
588
|
for (t = t || []; this.pos < e; ) t.push(this.readFloat());
|
|
589
589
|
return t;
|
|
590
590
|
},
|
|
591
591
|
readPackedDouble: function(t) {
|
|
592
|
-
if (this.type !==
|
|
592
|
+
if (this.type !== v.Bytes) return t.push(this.readDouble());
|
|
593
593
|
var e = J(this);
|
|
594
594
|
for (t = t || []; this.pos < e; ) t.push(this.readDouble());
|
|
595
595
|
return t;
|
|
596
596
|
},
|
|
597
597
|
readPackedFixed32: function(t) {
|
|
598
|
-
if (this.type !==
|
|
598
|
+
if (this.type !== v.Bytes) return t.push(this.readFixed32());
|
|
599
599
|
var e = J(this);
|
|
600
600
|
for (t = t || []; this.pos < e; ) t.push(this.readFixed32());
|
|
601
601
|
return t;
|
|
602
602
|
},
|
|
603
603
|
readPackedSFixed32: function(t) {
|
|
604
|
-
if (this.type !==
|
|
604
|
+
if (this.type !== v.Bytes) return t.push(this.readSFixed32());
|
|
605
605
|
var e = J(this);
|
|
606
606
|
for (t = t || []; this.pos < e; ) t.push(this.readSFixed32());
|
|
607
607
|
return t;
|
|
608
608
|
},
|
|
609
609
|
readPackedFixed64: function(t) {
|
|
610
|
-
if (this.type !==
|
|
610
|
+
if (this.type !== v.Bytes) return t.push(this.readFixed64());
|
|
611
611
|
var e = J(this);
|
|
612
612
|
for (t = t || []; this.pos < e; ) t.push(this.readFixed64());
|
|
613
613
|
return t;
|
|
614
614
|
},
|
|
615
615
|
readPackedSFixed64: function(t) {
|
|
616
|
-
if (this.type !==
|
|
616
|
+
if (this.type !== v.Bytes) return t.push(this.readSFixed64());
|
|
617
617
|
var e = J(this);
|
|
618
618
|
for (t = t || []; this.pos < e; ) t.push(this.readSFixed64());
|
|
619
619
|
return t;
|
|
620
620
|
},
|
|
621
621
|
skip: function(t) {
|
|
622
622
|
var e = t & 7;
|
|
623
|
-
if (e ===
|
|
623
|
+
if (e === v.Varint) for (; this.buf[this.pos++] > 127; )
|
|
624
624
|
;
|
|
625
|
-
else if (e ===
|
|
626
|
-
else if (e ===
|
|
627
|
-
else if (e ===
|
|
625
|
+
else if (e === v.Bytes) this.pos = this.readVarint() + this.pos;
|
|
626
|
+
else if (e === v.Fixed32) this.pos += 4;
|
|
627
|
+
else if (e === v.Fixed64) this.pos += 8;
|
|
628
628
|
else throw new Error("Unimplemented type: " + e);
|
|
629
629
|
},
|
|
630
630
|
// === WRITING =================================================================
|
|
@@ -642,16 +642,16 @@ Mt(["exports"], function(o) {
|
|
|
642
642
|
return this.length = this.pos, this.pos = 0, this.buf.subarray(0, this.length);
|
|
643
643
|
},
|
|
644
644
|
writeFixed32: function(t) {
|
|
645
|
-
this.realloc(4),
|
|
645
|
+
this.realloc(4), ft(this.buf, t, this.pos), this.pos += 4;
|
|
646
646
|
},
|
|
647
647
|
writeSFixed32: function(t) {
|
|
648
|
-
this.realloc(4),
|
|
648
|
+
this.realloc(4), ft(this.buf, t, this.pos), this.pos += 4;
|
|
649
649
|
},
|
|
650
650
|
writeFixed64: function(t) {
|
|
651
|
-
this.realloc(8),
|
|
651
|
+
this.realloc(8), ft(this.buf, t & -1, this.pos), ft(this.buf, Math.floor(t * Lt), this.pos + 4), this.pos += 8;
|
|
652
652
|
},
|
|
653
653
|
writeSFixed64: function(t) {
|
|
654
|
-
this.realloc(8),
|
|
654
|
+
this.realloc(8), ft(this.buf, t & -1, this.pos), ft(this.buf, Math.floor(t * Lt), this.pos + 4), this.pos += 8;
|
|
655
655
|
},
|
|
656
656
|
writeVarint: function(t) {
|
|
657
657
|
if (t = +t || 0, t > 268435455 || t < 0) {
|
|
@@ -692,13 +692,13 @@ Mt(["exports"], function(o) {
|
|
|
692
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
|
-
this.writeTag(t,
|
|
695
|
+
this.writeTag(t, v.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, he, e);
|
|
699
699
|
},
|
|
700
700
|
writePackedSVarint: function(t, e) {
|
|
701
|
-
e.length && this.writeMessage(t,
|
|
701
|
+
e.length && this.writeMessage(t, de, e);
|
|
702
702
|
},
|
|
703
703
|
writePackedBoolean: function(t, e) {
|
|
704
704
|
e.length && this.writeMessage(t, ye, e);
|
|
@@ -722,46 +722,46 @@ Mt(["exports"], function(o) {
|
|
|
722
722
|
e.length && this.writeMessage(t, _e, e);
|
|
723
723
|
},
|
|
724
724
|
writeBytesField: function(t, e) {
|
|
725
|
-
this.writeTag(t,
|
|
725
|
+
this.writeTag(t, v.Bytes), this.writeBytes(e);
|
|
726
726
|
},
|
|
727
727
|
writeFixed32Field: function(t, e) {
|
|
728
|
-
this.writeTag(t,
|
|
728
|
+
this.writeTag(t, v.Fixed32), this.writeFixed32(e);
|
|
729
729
|
},
|
|
730
730
|
writeSFixed32Field: function(t, e) {
|
|
731
|
-
this.writeTag(t,
|
|
731
|
+
this.writeTag(t, v.Fixed32), this.writeSFixed32(e);
|
|
732
732
|
},
|
|
733
733
|
writeFixed64Field: function(t, e) {
|
|
734
|
-
this.writeTag(t,
|
|
734
|
+
this.writeTag(t, v.Fixed64), this.writeFixed64(e);
|
|
735
735
|
},
|
|
736
736
|
writeSFixed64Field: function(t, e) {
|
|
737
|
-
this.writeTag(t,
|
|
737
|
+
this.writeTag(t, v.Fixed64), this.writeSFixed64(e);
|
|
738
738
|
},
|
|
739
739
|
writeVarintField: function(t, e) {
|
|
740
|
-
this.writeTag(t,
|
|
740
|
+
this.writeTag(t, v.Varint), this.writeVarint(e);
|
|
741
741
|
},
|
|
742
742
|
writeSVarintField: function(t, e) {
|
|
743
|
-
this.writeTag(t,
|
|
743
|
+
this.writeTag(t, v.Varint), this.writeSVarint(e);
|
|
744
744
|
},
|
|
745
745
|
writeStringField: function(t, e) {
|
|
746
|
-
this.writeTag(t,
|
|
746
|
+
this.writeTag(t, v.Bytes), this.writeString(e);
|
|
747
747
|
},
|
|
748
748
|
writeFloatField: function(t, e) {
|
|
749
|
-
this.writeTag(t,
|
|
749
|
+
this.writeTag(t, v.Fixed32), this.writeFloat(e);
|
|
750
750
|
},
|
|
751
751
|
writeDoubleField: function(t, e) {
|
|
752
|
-
this.writeTag(t,
|
|
752
|
+
this.writeTag(t, v.Fixed64), this.writeDouble(e);
|
|
753
753
|
},
|
|
754
754
|
writeBooleanField: function(t, e) {
|
|
755
755
|
this.writeVarintField(t, !!e);
|
|
756
756
|
}
|
|
757
757
|
};
|
|
758
758
|
function se(t, e, i) {
|
|
759
|
-
var n = i.buf,
|
|
760
|
-
if (l = n[i.pos++],
|
|
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) {
|
|
764
|
-
return t.type ===
|
|
764
|
+
return t.type === v.Bytes ? t.readVarint() + t.pos : t.pos + 1;
|
|
765
765
|
}
|
|
766
766
|
function mt(t, e, i) {
|
|
767
767
|
return i ? e * 4294967296 + (t >>> 0) : (e >>> 0) * 4294967296 + (t >>> 0);
|
|
@@ -770,24 +770,24 @@ Mt(["exports"], function(o) {
|
|
|
770
770
|
var i, n;
|
|
771
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), me(i, n, e),
|
|
773
|
+
e.realloc(10), me(i, n, e), fe(n, e);
|
|
774
774
|
}
|
|
775
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 fe(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
783
|
var n = e <= 16383 ? 1 : e <= 2097151 ? 2 : e <= 268435455 ? 3 : Math.floor(Math.log(e) / (Math.LN2 * 7));
|
|
784
784
|
i.realloc(n);
|
|
785
|
-
for (var
|
|
785
|
+
for (var a = i.pos - 1; a >= t; a--) i.buf[a + n] = i.buf[a];
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function he(t, e) {
|
|
788
788
|
for (var i = 0; i < t.length; i++) e.writeVarint(t[i]);
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function de(t, e) {
|
|
791
791
|
for (var i = 0; i < t.length; i++) e.writeSVarint(t[i]);
|
|
792
792
|
}
|
|
793
793
|
function ue(t, e) {
|
|
@@ -814,18 +814,18 @@ Mt(["exports"], function(o) {
|
|
|
814
814
|
function wt(t, e) {
|
|
815
815
|
return (t[e] | t[e + 1] << 8 | t[e + 2] << 16) + t[e + 3] * 16777216;
|
|
816
816
|
}
|
|
817
|
-
function
|
|
817
|
+
function ft(t, e, i) {
|
|
818
818
|
t[i] = e, t[i + 1] = e >>> 8, t[i + 2] = e >>> 16, t[i + 3] = e >>> 24;
|
|
819
819
|
}
|
|
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
823
|
function be(t, e, i) {
|
|
824
|
-
for (var n = "",
|
|
825
|
-
var l = t[
|
|
826
|
-
if (
|
|
827
|
-
var m,
|
|
828
|
-
c === 1 ? l < 128 && (s = l) : c === 2 ? (m = t[
|
|
824
|
+
for (var n = "", a = e; a < i; ) {
|
|
825
|
+
var l = t[a], s = null, c = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1;
|
|
826
|
+
if (a + c > i) break;
|
|
827
|
+
var m, f, h;
|
|
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], f = t[a + 2], (m & 192) === 128 && (f & 192) === 128 && (s = (l & 15) << 12 | (m & 63) << 6 | f & 63, (s <= 2047 || s >= 55296 && s <= 57343) && (s = null))) : c === 4 && (m = t[a + 1], f = t[a + 2], h = t[a + 3], (m & 192) === 128 && (f & 192) === 128 && (h & 192) === 128 && (s = (l & 15) << 18 | (m & 63) << 12 | (f & 63) << 6 | h & 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
830
|
return n;
|
|
831
831
|
}
|
|
@@ -833,27 +833,27 @@ Mt(["exports"], function(o) {
|
|
|
833
833
|
return Bt.decode(t.subarray(e, i));
|
|
834
834
|
}
|
|
835
835
|
function Te(t, e, i) {
|
|
836
|
-
for (var n = 0,
|
|
837
|
-
if (
|
|
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 ve = /* @__PURE__ */ ae(ne),
|
|
853
|
+
var ve = /* @__PURE__ */ ae(ne), ht;
|
|
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
|
+
})(ht || (ht = {}));
|
|
857
857
|
function De(t) {
|
|
858
858
|
const e = new ve();
|
|
859
859
|
for (const i in t.layers) {
|
|
@@ -889,17 +889,17 @@ Mt(["exports"], function(o) {
|
|
|
889
889
|
const i = t.feature;
|
|
890
890
|
if (!i || !e)
|
|
891
891
|
throw new Error();
|
|
892
|
-
const n = t.keys,
|
|
892
|
+
const n = t.keys, a = t.values, l = t.keycache, s = t.valuecache;
|
|
893
893
|
for (const c in i.properties) {
|
|
894
|
-
let m = i.properties[c],
|
|
894
|
+
let m = i.properties[c], f = l[c];
|
|
895
895
|
if (m === null)
|
|
896
896
|
continue;
|
|
897
|
-
typeof
|
|
898
|
-
const
|
|
899
|
-
|
|
900
|
-
const
|
|
901
|
-
let
|
|
902
|
-
typeof
|
|
897
|
+
typeof f > "u" && (n.push(c), f = n.length - 1, l[c] = f), e.writeVarint(f);
|
|
898
|
+
const h = typeof m;
|
|
899
|
+
h !== "string" && h !== "boolean" && h !== "number" && (m = JSON.stringify(m));
|
|
900
|
+
const u = `${h}:${m}`;
|
|
901
|
+
let _ = s[u];
|
|
902
|
+
typeof _ > "u" && (a.push(m), _ = a.length - 1, s[u] = _), e.writeVarint(_);
|
|
903
903
|
}
|
|
904
904
|
}
|
|
905
905
|
function St(t, e) {
|
|
@@ -912,17 +912,17 @@ Mt(["exports"], function(o) {
|
|
|
912
912
|
if (!e)
|
|
913
913
|
throw new Error();
|
|
914
914
|
const i = t.geometry, n = t.type;
|
|
915
|
-
let
|
|
915
|
+
let a = 0, l = 0;
|
|
916
916
|
for (const s of i) {
|
|
917
917
|
let c = 1;
|
|
918
|
-
n ===
|
|
919
|
-
const m = s.length / 2,
|
|
920
|
-
for (let
|
|
921
|
-
|
|
922
|
-
const
|
|
923
|
-
e.writeVarint(Vt(
|
|
918
|
+
n === ht.POINT && (c = s.length / 2), e.writeVarint(St(1, c));
|
|
919
|
+
const m = s.length / 2, f = n === ht.POLYGON ? m - 1 : m;
|
|
920
|
+
for (let h = 0; h < f; h++) {
|
|
921
|
+
h === 1 && n !== 1 && e.writeVarint(St(2, f - 1));
|
|
922
|
+
const u = s[h * 2] - a, _ = s[h * 2 + 1] - l;
|
|
923
|
+
e.writeVarint(Vt(u)), e.writeVarint(Vt(_)), a += u, l += _;
|
|
924
924
|
}
|
|
925
|
-
n ===
|
|
925
|
+
n === ht.POLYGON && e.writeVarint(St(7, 1));
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
928
|
function ke(t, e) {
|
|
@@ -931,76 +931,76 @@ Mt(["exports"], function(o) {
|
|
|
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
933
|
class Re {
|
|
934
|
-
constructor(e, i, n,
|
|
935
|
-
this.loaded = Promise.resolve(), this.decodeImage = It, this.fetchAndParseTile = (s, c, m,
|
|
936
|
-
const
|
|
937
|
-
return
|
|
938
|
-
const
|
|
939
|
-
if (B(
|
|
934
|
+
constructor(e, i, n, a, l) {
|
|
935
|
+
this.loaded = Promise.resolve(), this.decodeImage = It, this.fetchAndParseTile = (s, c, m, f, h) => {
|
|
936
|
+
const u = this, _ = this.demUrlPattern.replace("{z}", s.toString()).replace("{x}", c.toString()).replace("{y}", m.toString());
|
|
937
|
+
return h == null || h.useTile(_), this.parsedCache.get(_, async (F, P) => {
|
|
938
|
+
const M = await u.fetchTile(s, c, m, P, h);
|
|
939
|
+
if (B(P))
|
|
940
940
|
throw new Error("canceled");
|
|
941
|
-
const I =
|
|
942
|
-
return
|
|
943
|
-
},
|
|
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 =
|
|
941
|
+
const I = u.decodeImage(M.data, u.encoding, P), R = h == null ? void 0 : h.marker("decode"), V = await I;
|
|
942
|
+
return R == null || R(), V;
|
|
943
|
+
}, f);
|
|
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, n,
|
|
946
|
+
fetchTile(e, i, n, a, l) {
|
|
947
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
|
-
const
|
|
949
|
+
const f = {
|
|
950
950
|
signal: m.signal
|
|
951
951
|
};
|
|
952
952
|
l == null || l.fetchTile(s);
|
|
953
|
-
const
|
|
954
|
-
return
|
|
955
|
-
if (
|
|
956
|
-
throw new Error(`Bad response: ${
|
|
953
|
+
const h = l == null ? void 0 : l.marker("fetch");
|
|
954
|
+
return L(this.timeoutMs, fetch(s, f).then(async (u) => {
|
|
955
|
+
if (h == null || h(), !u.ok)
|
|
956
|
+
throw new Error(`Bad response: ${u.status} for ${s}`);
|
|
957
957
|
return {
|
|
958
|
-
data: await
|
|
959
|
-
expires:
|
|
960
|
-
cacheControl:
|
|
958
|
+
data: await u.blob(),
|
|
959
|
+
expires: u.headers.get("expires") || void 0,
|
|
960
|
+
cacheControl: u.headers.get("cache-control") || void 0
|
|
961
961
|
};
|
|
962
962
|
}), m);
|
|
963
|
-
},
|
|
963
|
+
}, a);
|
|
964
964
|
}
|
|
965
|
-
async fetchDem(e, i, n,
|
|
966
|
-
const c = Math.min(e - (
|
|
967
|
-
return $.fromRawDem(
|
|
965
|
+
async fetchDem(e, i, n, a, l, s) {
|
|
966
|
+
const c = Math.min(e - (a.overzoom || 0), this.maxzoom), m = e - c, f = 1 << m, h = Math.floor(i / f), u = Math.floor(n / f), _ = await this.fetchAndParseTile(c, h, u, l, s);
|
|
967
|
+
return $.fromRawDem(_).split(m, i % f, n % f);
|
|
968
968
|
}
|
|
969
|
-
fetchContourTile(e, i, n,
|
|
970
|
-
const { levels: c, multiplier: m = 1, buffer:
|
|
969
|
+
fetchContourTile(e, i, n, a, l, s) {
|
|
970
|
+
const { levels: c, multiplier: m = 1, buffer: f = 1, extent: h = 4096, contourLayer: u = "contours", elevationKey: _ = "ele", levelKey: F = "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(
|
|
975
|
-
const V = 1 << e,
|
|
973
|
+
const M = [e, i, n, p(a)].join("/");
|
|
974
|
+
return this.contourCache.get(M, async (I, R) => {
|
|
975
|
+
const V = 1 << e, dt = [];
|
|
976
976
|
for (let q = n - 1; q <= n + 1; q++)
|
|
977
977
|
for (let nt = i - 1; nt <= i + 1; nt++)
|
|
978
|
-
|
|
979
|
-
const pt = await Promise.all(
|
|
978
|
+
dt.push(q < 0 || q >= V ? void 0 : this.fetchDem(e, (nt + V) % V, q, a, R, s));
|
|
979
|
+
const pt = await Promise.all(dt);
|
|
980
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 = w(c[0], X, h, f);
|
|
991
991
|
ot == null || ot();
|
|
992
992
|
const At = De({
|
|
993
|
-
extent:
|
|
993
|
+
extent: h,
|
|
994
994
|
layers: {
|
|
995
|
-
[
|
|
996
|
-
features: Object.entries(
|
|
995
|
+
[u]: {
|
|
996
|
+
features: Object.entries(C).map(([q, nt]) => {
|
|
997
997
|
const _t = Number(q);
|
|
998
998
|
return {
|
|
999
|
-
type:
|
|
999
|
+
type: ht.LINESTRING,
|
|
1000
1000
|
geometry: nt,
|
|
1001
1001
|
properties: {
|
|
1002
|
-
[
|
|
1003
|
-
[
|
|
1002
|
+
[_]: _t,
|
|
1003
|
+
[F]: Math.max(...c.map((bt, Y) => _t % bt === 0 ? Y : 0))
|
|
1004
1004
|
}
|
|
1005
1005
|
};
|
|
1006
1006
|
})
|
|
@@ -1019,7 +1019,7 @@ Mt(["exports"], function(o) {
|
|
|
1019
1019
|
function Ut() {
|
|
1020
1020
|
return Q ? Q.now() : (/* @__PURE__ */ new Date()).getTime();
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1022
|
+
function Me(t) {
|
|
1023
1023
|
const e = [];
|
|
1024
1024
|
for (const i of t)
|
|
1025
1025
|
e.push(...i);
|
|
@@ -1030,9 +1030,9 @@ Mt(["exports"], function(o) {
|
|
|
1030
1030
|
this.marks = {}, this.urls = [], this.fetched = [], this.resources = [], this.tilesFetched = 0, this.timeOrigin = Ce, this.finish = (i) => {
|
|
1031
1031
|
this.markFinish();
|
|
1032
1032
|
const n = (m) => {
|
|
1033
|
-
const
|
|
1034
|
-
return Number.isFinite(
|
|
1035
|
-
},
|
|
1033
|
+
const f = this.marks[m] || [], h = Math.max(...f.map((_) => Math.max(..._))), u = Math.min(...f.map((_) => Math.min(..._)));
|
|
1034
|
+
return Number.isFinite(h) ? h - u : void 0;
|
|
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,19 +1040,19 @@ Mt(["exports"], function(o) {
|
|
|
1040
1040
|
marks: this.marks,
|
|
1041
1041
|
resources: [
|
|
1042
1042
|
...this.resources,
|
|
1043
|
-
...
|
|
1043
|
+
...Me(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
1052
|
var n;
|
|
1053
1053
|
this.marks[i] || (this.marks[i] = []);
|
|
1054
|
-
const
|
|
1055
|
-
return (n = this.marks[i]) === null || n === void 0 || n.push(
|
|
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) => {
|
|
@@ -1060,27 +1060,27 @@ Mt(["exports"], function(o) {
|
|
|
1060
1060
|
}, this.addAll = (i) => {
|
|
1061
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(...((n = i.marks[s]) === null || n === void 0 ? void 0 : n.map((m) => m.map((
|
|
1066
|
+
(this.marks[s] || (this.marks[s] = [])).push(...((n = i.marks[s]) === null || n === void 0 ? void 0 : n.map((m) => m.map((f) => f + a))) || []);
|
|
1067
1067
|
}
|
|
1068
|
-
this.resources.push(...i.resources.map((l) => Ie(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
|
|
1072
|
+
const Oe = /(Start$|End$|^start|^end)/;
|
|
1073
1073
|
function Ie(t, e) {
|
|
1074
1074
|
const i = {};
|
|
1075
1075
|
for (const n in t)
|
|
1076
|
-
t[n] !== 0 &&
|
|
1076
|
+
t[n] !== 0 && Oe.test(n) ? i[n] = Number(t[n]) + e : i[n] = t[n];
|
|
1077
1077
|
return i;
|
|
1078
1078
|
}
|
|
1079
|
-
let
|
|
1080
|
-
class
|
|
1079
|
+
let Ge = 0;
|
|
1080
|
+
class Le {
|
|
1081
1081
|
constructor(e, i, n = 2e4) {
|
|
1082
|
-
this.callbacks = {}, this.cancels = {}, this.dest = e, this.timeoutMs = n, this.dest.onmessage = async ({ data:
|
|
1083
|
-
const l =
|
|
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();
|
|
@@ -1088,27 +1088,27 @@ Mt(["exports"], function(o) {
|
|
|
1088
1088
|
const s = this.callbacks[l.id];
|
|
1089
1089
|
delete this.callbacks[l.id], s && s(l.error ? new Error(l.error) : void 0, l.response, l.timings);
|
|
1090
1090
|
} else if (l.type === "request") {
|
|
1091
|
-
const s = new Wt("worker"), c = i[l.name], m = new AbortController(),
|
|
1091
|
+
const s = new Wt("worker"), c = i[l.name], m = new AbortController(), f = c.apply(c, [
|
|
1092
1092
|
...l.args,
|
|
1093
1093
|
m,
|
|
1094
1094
|
s
|
|
1095
|
-
]),
|
|
1096
|
-
if (l.id &&
|
|
1095
|
+
]), h = `${l.name}_${l.id}`;
|
|
1096
|
+
if (l.id && f) {
|
|
1097
1097
|
this.cancels[l.id] = m;
|
|
1098
1098
|
try {
|
|
1099
|
-
const
|
|
1099
|
+
const u = await f, _ = u == null ? void 0 : u.transferrables;
|
|
1100
1100
|
this.postMessage({
|
|
1101
1101
|
id: l.id,
|
|
1102
1102
|
type: "response",
|
|
1103
|
-
response:
|
|
1104
|
-
timings: s.finish(
|
|
1105
|
-
},
|
|
1106
|
-
} catch (
|
|
1103
|
+
response: u,
|
|
1104
|
+
timings: s.finish(h)
|
|
1105
|
+
}, _);
|
|
1106
|
+
} catch (u) {
|
|
1107
1107
|
this.postMessage({
|
|
1108
1108
|
id: l.id,
|
|
1109
1109
|
type: "response",
|
|
1110
|
-
error: (
|
|
1111
|
-
timings: s.finish(
|
|
1110
|
+
error: (u == null ? void 0 : u.toString()) || "error",
|
|
1111
|
+
timings: s.finish(h)
|
|
1112
1112
|
});
|
|
1113
1113
|
}
|
|
1114
1114
|
delete this.cancels[l.id];
|
|
@@ -1120,223 +1120,223 @@ 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, n,
|
|
1124
|
-
const s = ++
|
|
1125
|
-
this.postMessage({ id: s, type: "request", name: e, args: l }, i), this.callbacks[s] = (
|
|
1126
|
-
|
|
1123
|
+
send(e, i, n, a, ...l) {
|
|
1124
|
+
const s = ++Ge, c = new Promise((m, f) => {
|
|
1125
|
+
this.postMessage({ id: s, type: "request", name: e, args: l }, i), this.callbacks[s] = (h, u, _) => {
|
|
1126
|
+
a == null || a.addAll(_), h ? f(h) : m(u);
|
|
1127
1127
|
};
|
|
1128
1128
|
});
|
|
1129
1129
|
return U(n, () => {
|
|
1130
1130
|
delete this.callbacks[s], this.postMessage({ id: s, type: "cancel" });
|
|
1131
|
-
}),
|
|
1131
|
+
}), L(this.timeoutMs, c, n);
|
|
1132
1132
|
}
|
|
1133
1133
|
}
|
|
1134
|
-
o.A =
|
|
1134
|
+
o.A = Le, o.H = $, o.L = Re, o.T = Wt, o.a = z, o.b = w, o.c = Dt, o.d = It, o.e = k, o.f = A, o.g = x, o.p = D;
|
|
1135
1135
|
});
|
|
1136
|
-
|
|
1137
|
-
const
|
|
1138
|
-
class
|
|
1136
|
+
Ot(["./shared"], function(o) {
|
|
1137
|
+
const r = (g) => Promise.reject(new Error(`No manager registered for ${g}`));
|
|
1138
|
+
class d {
|
|
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 = (w, b) => (this.managers[w.managerId] = new o.L(w.demUrlPattern, w.cacheSize, w.encoding, w.maxzoom, w.timeoutMs), Promise.resolve()), this.fetchTile = (w, b, S, O, k, z) => {
|
|
1141
|
+
var p;
|
|
1142
|
+
return ((p = this.managers[w]) === null || p === void 0 ? void 0 : p.fetchTile(b, S, O, k, z)) || r(w);
|
|
1143
|
+
}, this.fetchAndParseTile = (w, b, S, O, k, z) => {
|
|
1144
|
+
var p;
|
|
1145
|
+
return o.p(((p = this.managers[w]) === null || p === void 0 ? void 0 : p.fetchAndParseTile(b, S, O, k, z)) || r(w), !0);
|
|
1146
|
+
}, this.fetchContourTile = (w, b, S, O, k, z, p) => {
|
|
1147
|
+
var x;
|
|
1148
|
+
return o.f(((x = this.managers[w]) === null || x === void 0 ? void 0 : x.fetchContourTile(b, S, O, k, z, p)) || r(w));
|
|
1149
1149
|
};
|
|
1150
1150
|
}
|
|
1151
1151
|
}
|
|
1152
|
-
const
|
|
1153
|
-
|
|
1152
|
+
const y = typeof self < "u" ? self : typeof window < "u" ? window : global;
|
|
1153
|
+
y.actor = new o.A(y, new d());
|
|
1154
1154
|
});
|
|
1155
|
-
|
|
1156
|
-
const
|
|
1157
|
-
let
|
|
1158
|
-
class
|
|
1155
|
+
Ot(["./shared"], function(o) {
|
|
1156
|
+
const r = { workerUrl: "" };
|
|
1157
|
+
let d, y = 0;
|
|
1158
|
+
class g {
|
|
1159
1159
|
constructor() {
|
|
1160
|
-
this.decodeImage = (
|
|
1160
|
+
this.decodeImage = (x, T, D) => o.p(o.d(x, T, D), !1);
|
|
1161
1161
|
}
|
|
1162
1162
|
}
|
|
1163
|
-
function
|
|
1164
|
-
if (!
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1163
|
+
function w() {
|
|
1164
|
+
if (!d) {
|
|
1165
|
+
const p = new Worker(r.workerUrl), x = new g();
|
|
1166
|
+
d = new o.A(p, x);
|
|
1167
1167
|
}
|
|
1168
|
-
return
|
|
1169
|
-
}
|
|
1170
|
-
class
|
|
1171
|
-
constructor(
|
|
1172
|
-
this.fetchTile = (H,
|
|
1173
|
-
const tt = this.managerId = ++
|
|
1174
|
-
this.actor = ct ||
|
|
1175
|
-
cacheSize:
|
|
1176
|
-
demUrlPattern:
|
|
1177
|
-
encoding:
|
|
1178
|
-
maxzoom:
|
|
1168
|
+
return d;
|
|
1169
|
+
}
|
|
1170
|
+
class b {
|
|
1171
|
+
constructor(x, T, D, A, j, ct) {
|
|
1172
|
+
this.fetchTile = (H, L, U, B, E) => this.actor.send("fetchTile", [], B, E, this.managerId, H, L, U), this.fetchAndParseTile = (H, L, U, B, E) => this.actor.send("fetchAndParseTile", [], B, E, this.managerId, H, L, U), this.fetchContourTile = (H, L, U, B, E, Z) => this.actor.send("fetchContourTile", [], E, Z, this.managerId, H, L, U, B);
|
|
1173
|
+
const tt = this.managerId = ++y;
|
|
1174
|
+
this.actor = ct || w(), this.loaded = this.actor.send("init", [], new AbortController(), void 0, {
|
|
1175
|
+
cacheSize: T,
|
|
1176
|
+
demUrlPattern: x,
|
|
1177
|
+
encoding: D,
|
|
1178
|
+
maxzoom: A,
|
|
1179
1179
|
managerId: tt,
|
|
1180
1180
|
timeoutMs: j
|
|
1181
1181
|
});
|
|
1182
1182
|
}
|
|
1183
1183
|
}
|
|
1184
1184
|
Blob.prototype.arrayBuffer || (Blob.prototype.arrayBuffer = function() {
|
|
1185
|
-
return new Promise((
|
|
1186
|
-
const
|
|
1187
|
-
|
|
1185
|
+
return new Promise((x, T) => {
|
|
1186
|
+
const D = new FileReader();
|
|
1187
|
+
D.onload = (A) => {
|
|
1188
1188
|
var j;
|
|
1189
|
-
return
|
|
1190
|
-
},
|
|
1189
|
+
return x((j = A.target) === null || j === void 0 ? void 0 : j.result);
|
|
1190
|
+
}, D.onerror = T, D.readAsArrayBuffer(this);
|
|
1191
1191
|
});
|
|
1192
1192
|
});
|
|
1193
|
-
const
|
|
1194
|
-
if (
|
|
1195
|
-
return
|
|
1193
|
+
const S = (p) => (x, T) => {
|
|
1194
|
+
if (T instanceof AbortController)
|
|
1195
|
+
return p(x, T);
|
|
1196
1196
|
{
|
|
1197
|
-
const
|
|
1198
|
-
return
|
|
1197
|
+
const D = new AbortController();
|
|
1198
|
+
return p(x, D).then((A) => T(void 0, A.data, A.cacheControl, A.expires), (A) => T(A)), { cancel: () => D.abort() };
|
|
1199
1199
|
}
|
|
1200
1200
|
}, O = /* @__PURE__ */ new Set();
|
|
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(
|
|
1201
|
+
class k {
|
|
1202
|
+
constructor({ url: x, cacheSize: T = 100, id: D = "dem", encoding: A = "terrarium", maxzoom: j = 12, worker: ct = !0, timeoutMs: tt = 1e4, actor: H }) {
|
|
1203
|
+
this.timingCallbacks = [], this.onTiming = (E) => {
|
|
1204
|
+
this.timingCallbacks.push(E);
|
|
1205
|
+
}, this.setupMaplibre = (E) => {
|
|
1206
|
+
E.addProtocol(this.sharedDemProtocolId, this.sharedDemProtocol), E.addProtocol(this.contourProtocolId, this.contourProtocol);
|
|
1207
|
+
}, this.sharedDemProtocolV4 = async (E, Z) => {
|
|
1208
|
+
const [K, et, N] = this.parseUrl(E.url), it = new o.T("main");
|
|
1209
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(E.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(E.url), W;
|
|
1219
1219
|
} finally {
|
|
1220
1220
|
this.timingCallbacks.forEach((W) => W(at));
|
|
1221
1221
|
}
|
|
1222
|
-
}, this.contourProtocolV4 = async (
|
|
1222
|
+
}, this.contourProtocolV4 = async (E, 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(E.url), W = o.a(E.url), xt = await this.manager.fetchContourTile(N, it, at, o.g(W, N), Z, K);
|
|
1227
|
+
return et = K.finish(E.url), { data: xt.arrayBuffer };
|
|
1228
1228
|
} catch (N) {
|
|
1229
|
-
throw et = K.error(
|
|
1229
|
+
throw et = K.error(E.url), N;
|
|
1230
1230
|
} finally {
|
|
1231
1231
|
this.timingCallbacks.forEach((N) => N(et));
|
|
1232
1232
|
}
|
|
1233
|
-
}, this.contourProtocol =
|
|
1234
|
-
let
|
|
1235
|
-
for (; O.has(
|
|
1236
|
-
|
|
1237
|
-
O.add(
|
|
1238
|
-
const B = ct ?
|
|
1239
|
-
this.manager = new B(
|
|
1233
|
+
}, this.contourProtocol = S(this.contourProtocolV4), this.sharedDemProtocol = S(this.sharedDemProtocolV4), this.contourProtocolUrl = (E) => `${this.contourProtocolUrlBase}?${o.e(E)}`;
|
|
1234
|
+
let L = D, U = 1;
|
|
1235
|
+
for (; O.has(L); )
|
|
1236
|
+
L = D + U++;
|
|
1237
|
+
O.add(L), this.sharedDemProtocolId = `${L}-shared`, this.contourProtocolId = `${L}-contour`, this.sharedDemProtocolUrl = `${this.sharedDemProtocolId}://{z}/{x}/{y}`, this.contourProtocolUrlBase = `${this.contourProtocolId}://{z}/{x}/{y}`;
|
|
1238
|
+
const B = ct ? b : o.L;
|
|
1239
|
+
this.manager = new B(x, T, A, j, tt, H);
|
|
1240
1240
|
}
|
|
1241
|
-
getDemTile(
|
|
1242
|
-
return this.manager.fetchAndParseTile(
|
|
1241
|
+
getDemTile(x, T, D, A) {
|
|
1242
|
+
return this.manager.fetchAndParseTile(x, T, D, A || new AbortController());
|
|
1243
1243
|
}
|
|
1244
|
-
parseUrl(
|
|
1245
|
-
const [,
|
|
1246
|
-
return [Number(
|
|
1244
|
+
parseUrl(x) {
|
|
1245
|
+
const [, T, D, A] = /\/\/(\d+)\/(\d+)\/(\d+)/.exec(x) || [];
|
|
1246
|
+
return [Number(T), Number(D), Number(A)];
|
|
1247
1247
|
}
|
|
1248
1248
|
}
|
|
1249
1249
|
return {
|
|
1250
1250
|
generateIsolines: o.b,
|
|
1251
|
-
DemSource:
|
|
1251
|
+
DemSource: k,
|
|
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 Be =
|
|
1263
|
+
var Be = Mt;
|
|
1264
1264
|
function Xe(o) {
|
|
1265
1265
|
return o;
|
|
1266
1266
|
}
|
|
1267
1267
|
function Ne(o) {
|
|
1268
1268
|
if (o == null) return Xe;
|
|
1269
|
-
var
|
|
1270
|
-
return function(
|
|
1271
|
-
O || (
|
|
1272
|
-
var
|
|
1273
|
-
for (
|
|
1274
|
-
return
|
|
1269
|
+
var r, d, y = o.scale[0], g = o.scale[1], w = o.translate[0], b = o.translate[1];
|
|
1270
|
+
return function(S, O) {
|
|
1271
|
+
O || (r = d = 0);
|
|
1272
|
+
var k = 2, z = S.length, p = new Array(z);
|
|
1273
|
+
for (p[0] = (r += S[0]) * y + w, p[1] = (d += S[1]) * g + b; k < z; ) p[k] = S[k], ++k;
|
|
1274
|
+
return p;
|
|
1275
1275
|
};
|
|
1276
1276
|
}
|
|
1277
|
-
function Ve(o,
|
|
1278
|
-
for (var
|
|
1277
|
+
function Ve(o, r) {
|
|
1278
|
+
for (var d, y = o.length, g = y - r; g < --y; ) d = o[g], o[g++] = o[y], o[y] = d;
|
|
1279
1279
|
}
|
|
1280
|
-
function $t(o,
|
|
1281
|
-
return typeof
|
|
1282
|
-
return Kt(o,
|
|
1283
|
-
}) } : Kt(o,
|
|
1280
|
+
function $t(o, r) {
|
|
1281
|
+
return typeof r == "string" && (r = o.objects[r]), r.type === "GeometryCollection" ? { type: "FeatureCollection", features: r.geometries.map(function(d) {
|
|
1282
|
+
return Kt(o, d);
|
|
1283
|
+
}) } : Kt(o, r);
|
|
1284
1284
|
}
|
|
1285
|
-
function Kt(o,
|
|
1286
|
-
var
|
|
1287
|
-
return
|
|
1285
|
+
function Kt(o, r) {
|
|
1286
|
+
var d = r.id, y = r.bbox, g = r.properties == null ? {} : r.properties, w = Ue(o, r);
|
|
1287
|
+
return d == null && y == null ? { type: "Feature", properties: g, geometry: w } : y == null ? { type: "Feature", id: d, properties: g, geometry: w } : { type: "Feature", id: d, bbox: y, properties: g, geometry: w };
|
|
1288
1288
|
}
|
|
1289
|
-
function Ue(o,
|
|
1290
|
-
var
|
|
1291
|
-
function
|
|
1292
|
-
|
|
1293
|
-
for (var
|
|
1294
|
-
|
|
1295
|
-
z < 0 && Ve(
|
|
1289
|
+
function Ue(o, r) {
|
|
1290
|
+
var d = Ne(o.transform), y = o.arcs;
|
|
1291
|
+
function g(z, p) {
|
|
1292
|
+
p.length && p.pop();
|
|
1293
|
+
for (var x = y[z < 0 ? ~z : z], T = 0, D = x.length; T < D; ++T)
|
|
1294
|
+
p.push(d(x[T], T));
|
|
1295
|
+
z < 0 && Ve(p, D);
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1298
|
-
return
|
|
1297
|
+
function w(z) {
|
|
1298
|
+
return d(z);
|
|
1299
1299
|
}
|
|
1300
|
-
function
|
|
1301
|
-
for (var
|
|
1302
|
-
return
|
|
1300
|
+
function b(z) {
|
|
1301
|
+
for (var p = [], x = 0, T = z.length; x < T; ++x) g(z[x], p);
|
|
1302
|
+
return p.length < 2 && p.push(p[0]), p;
|
|
1303
1303
|
}
|
|
1304
|
-
function
|
|
1305
|
-
for (var
|
|
1306
|
-
return
|
|
1304
|
+
function S(z) {
|
|
1305
|
+
for (var p = b(z); p.length < 4; ) p.push(p[0]);
|
|
1306
|
+
return p;
|
|
1307
1307
|
}
|
|
1308
1308
|
function O(z) {
|
|
1309
|
-
return z.map(
|
|
1309
|
+
return z.map(S);
|
|
1310
1310
|
}
|
|
1311
|
-
function
|
|
1312
|
-
var
|
|
1313
|
-
switch (
|
|
1311
|
+
function k(z) {
|
|
1312
|
+
var p = z.type, x;
|
|
1313
|
+
switch (p) {
|
|
1314
1314
|
case "GeometryCollection":
|
|
1315
|
-
return { type:
|
|
1315
|
+
return { type: p, geometries: z.geometries.map(k) };
|
|
1316
1316
|
case "Point":
|
|
1317
|
-
|
|
1317
|
+
x = w(z.coordinates);
|
|
1318
1318
|
break;
|
|
1319
1319
|
case "MultiPoint":
|
|
1320
|
-
|
|
1320
|
+
x = z.coordinates.map(w);
|
|
1321
1321
|
break;
|
|
1322
1322
|
case "LineString":
|
|
1323
|
-
|
|
1323
|
+
x = b(z.arcs);
|
|
1324
1324
|
break;
|
|
1325
1325
|
case "MultiLineString":
|
|
1326
|
-
|
|
1326
|
+
x = z.arcs.map(b);
|
|
1327
1327
|
break;
|
|
1328
1328
|
case "Polygon":
|
|
1329
|
-
|
|
1329
|
+
x = O(z.arcs);
|
|
1330
1330
|
break;
|
|
1331
1331
|
case "MultiPolygon":
|
|
1332
|
-
|
|
1332
|
+
x = z.arcs.map(O);
|
|
1333
1333
|
break;
|
|
1334
1334
|
default:
|
|
1335
1335
|
return null;
|
|
1336
1336
|
}
|
|
1337
|
-
return { type:
|
|
1337
|
+
return { type: p, coordinates: x };
|
|
1338
1338
|
}
|
|
1339
|
-
return
|
|
1339
|
+
return k(r);
|
|
1340
1340
|
}
|
|
1341
1341
|
const We = {
|
|
1342
1342
|
airspaceStroke: "#AAB7B8",
|
|
@@ -1351,7 +1351,7 @@ const We = {
|
|
|
1351
1351
|
runway: "#333333"
|
|
1352
1352
|
};
|
|
1353
1353
|
function je() {
|
|
1354
|
-
const o = "navdata",
|
|
1354
|
+
const o = "navdata", r = We;
|
|
1355
1355
|
return [
|
|
1356
1356
|
{
|
|
1357
1357
|
id: "landLaye",
|
|
@@ -1408,7 +1408,7 @@ function je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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
|
},
|
|
@@ -1483,7 +1483,7 @@ function je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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 je() {
|
|
|
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": [
|
|
@@ -2092,7 +2092,7 @@ const $e = {
|
|
|
2092
2092
|
runway: "#64748b"
|
|
2093
2093
|
};
|
|
2094
2094
|
function Ke() {
|
|
2095
|
-
const o = "navdata",
|
|
2095
|
+
const o = "navdata", r = $e;
|
|
2096
2096
|
return [
|
|
2097
2097
|
{
|
|
2098
2098
|
id: "landLaye",
|
|
@@ -2149,7 +2149,7 @@ function Ke() {
|
|
|
2149
2149
|
"source-layer": "fir",
|
|
2150
2150
|
minzoom: 2,
|
|
2151
2151
|
layout: { "line-cap": "butt", "line-join": "miter", "line-miter-limit": 0 },
|
|
2152
|
-
paint: { "line-color":
|
|
2152
|
+
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] }
|
|
2153
2153
|
},
|
|
2154
2154
|
{
|
|
2155
2155
|
id: "fir_line_dash",
|
|
@@ -2158,7 +2158,7 @@ function Ke() {
|
|
|
2158
2158
|
"source-layer": "fir",
|
|
2159
2159
|
minzoom: 5,
|
|
2160
2160
|
layout: { "line-miter-limit": 0, "line-cap": "butt", "line-join": "miter" },
|
|
2161
|
-
paint: { "line-color":
|
|
2161
|
+
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] }
|
|
2162
2162
|
},
|
|
2163
2163
|
{
|
|
2164
2164
|
id: "fir-label-lineside",
|
|
@@ -2167,7 +2167,7 @@ function Ke() {
|
|
|
2167
2167
|
"source-layer": "fir",
|
|
2168
2168
|
minzoom: 4,
|
|
2169
2169
|
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 },
|
|
2170
|
-
paint: { "text-color":
|
|
2170
|
+
paint: { "text-color": r.airspaceStroke, "text-halo-color": "#0f172a", "text-halo-width": 1 }
|
|
2171
2171
|
},
|
|
2172
2172
|
{
|
|
2173
2173
|
id: "fir-label",
|
|
@@ -2182,7 +2182,7 @@ function Ke() {
|
|
|
2182
2182
|
"text-max-width": 8
|
|
2183
2183
|
},
|
|
2184
2184
|
paint: {
|
|
2185
|
-
"text-color":
|
|
2185
|
+
"text-color": r.airspaceStroke,
|
|
2186
2186
|
"text-halo-color": "#0f172a",
|
|
2187
2187
|
"text-halo-width": 1.5,
|
|
2188
2188
|
"text-opacity": ["interpolate", ["linear"], ["zoom"], 3, 0.85, 8, 0.7, 12, 0.5]
|
|
@@ -2201,7 +2201,7 @@ function Ke() {
|
|
|
2201
2201
|
type: "line",
|
|
2202
2202
|
source: o,
|
|
2203
2203
|
"source-layer": "restricted",
|
|
2204
|
-
paint: { "line-color":
|
|
2204
|
+
paint: { "line-color": r.restrictedStroke, "line-width": 1, "line-dasharray": [2, 2], "line-opacity": ["interpolate", ["linear"], ["zoom"], 4, 0.6, 8, 1] }
|
|
2205
2205
|
},
|
|
2206
2206
|
{
|
|
2207
2207
|
id: "restricted-label",
|
|
@@ -2210,7 +2210,7 @@ function Ke() {
|
|
|
2210
2210
|
"source-layer": "restricted",
|
|
2211
2211
|
minzoom: 6,
|
|
2212
2212
|
layout: { "text-field": ["coalesce", ["get", "TXT_NAME"], ["get", "CODE_ID"]], "text-size": 10, "symbol-placement": "line", "text-max-width": 8, "text-offset": [0, 1] },
|
|
2213
|
-
paint: { "text-color":
|
|
2213
|
+
paint: { "text-color": r.restrictedStroke, "text-halo-color": "#0f172a", "text-halo-width": 1 }
|
|
2214
2214
|
},
|
|
2215
2215
|
{
|
|
2216
2216
|
id: "controlled-fill",
|
|
@@ -2218,14 +2218,14 @@ function Ke() {
|
|
|
2218
2218
|
source: o,
|
|
2219
2219
|
"source-layer": "controlled-fill",
|
|
2220
2220
|
minzoom: 4,
|
|
2221
|
-
paint: { "fill-color":
|
|
2221
|
+
paint: { "fill-color": r.controlledFill, "fill-opacity": 0.03 }
|
|
2222
2222
|
},
|
|
2223
2223
|
{
|
|
2224
2224
|
id: "controlled-stroke",
|
|
2225
2225
|
type: "line",
|
|
2226
2226
|
source: o,
|
|
2227
2227
|
"source-layer": "controlled",
|
|
2228
|
-
paint: { "line-color":
|
|
2228
|
+
paint: { "line-color": r.controlledStroke, "line-width": 1, "line-opacity": ["interpolate", ["linear"], ["zoom"], 4, 0.6, 8, 1], "line-dasharray": [2, 2] }
|
|
2229
2229
|
},
|
|
2230
2230
|
{
|
|
2231
2231
|
id: "controlled-label",
|
|
@@ -2234,7 +2234,7 @@ function Ke() {
|
|
|
2234
2234
|
"source-layer": "controlled",
|
|
2235
2235
|
minzoom: 6,
|
|
2236
2236
|
layout: { "text-field": ["coalesce", ["get", "TXT_NAME"], ["get", "CODE_ID"]], "text-size": 10, "symbol-placement": "point", "text-max-width": 8 },
|
|
2237
|
-
paint: { "text-color":
|
|
2237
|
+
paint: { "text-color": r.controlledStroke, "text-halo-color": "#0f172a", "text-halo-width": 1.5 }
|
|
2238
2238
|
},
|
|
2239
2239
|
{
|
|
2240
2240
|
id: "segment-line",
|
|
@@ -2243,7 +2243,7 @@ function Ke() {
|
|
|
2243
2243
|
"source-layer": "segment",
|
|
2244
2244
|
minzoom: 5,
|
|
2245
2245
|
paint: {
|
|
2246
|
-
"line-color": ["case", ["==", ["get", "HAS_REMARK"], 1], "#fbbf24",
|
|
2246
|
+
"line-color": ["case", ["==", ["get", "HAS_REMARK"], 1], "#fbbf24", r.segment],
|
|
2247
2247
|
"line-width": ["interpolate", ["linear"], ["zoom"], 5, 0.2, 8, 0.8],
|
|
2248
2248
|
"line-blur": 0,
|
|
2249
2249
|
"line-opacity": [
|
|
@@ -2315,7 +2315,7 @@ function Ke() {
|
|
|
2315
2315
|
"text-size": ["interpolate", ["linear"], ["zoom"], 6, 9, 10, 10],
|
|
2316
2316
|
"icon-text-fit-padding": [0, 3, 0, 3]
|
|
2317
2317
|
},
|
|
2318
|
-
paint: { "icon-color":
|
|
2318
|
+
paint: { "icon-color": r.segment }
|
|
2319
2319
|
},
|
|
2320
2320
|
{
|
|
2321
2321
|
id: "segment-radial",
|
|
@@ -2324,7 +2324,7 @@ function Ke() {
|
|
|
2324
2324
|
"source-layer": "segment-radial",
|
|
2325
2325
|
minzoom: 10,
|
|
2326
2326
|
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] },
|
|
2327
|
-
paint: { "text-color":
|
|
2327
|
+
paint: { "text-color": r.segment, "text-halo-color": "#0f172a", "text-halo-width": 1 }
|
|
2328
2328
|
},
|
|
2329
2329
|
{
|
|
2330
2330
|
id: "airport-circle",
|
|
@@ -2369,7 +2369,7 @@ function Ke() {
|
|
|
2369
2369
|
"case",
|
|
2370
2370
|
["has", "has_amm"],
|
|
2371
2371
|
"#4B2D6E",
|
|
2372
|
-
|
|
2372
|
+
r.airport
|
|
2373
2373
|
],
|
|
2374
2374
|
"icon-opacity": [
|
|
2375
2375
|
"interpolate",
|
|
@@ -2435,7 +2435,7 @@ function Ke() {
|
|
|
2435
2435
|
"source-layer": "runway",
|
|
2436
2436
|
filter: ["!", ["has", "has_amm"]],
|
|
2437
2437
|
minzoom: 4,
|
|
2438
|
-
paint: { "line-color":
|
|
2438
|
+
paint: { "line-color": r.runway, "line-width": ["interpolate", ["linear"], ["zoom"], 4, 1, 10, 3] }
|
|
2439
2439
|
},
|
|
2440
2440
|
{
|
|
2441
2441
|
id: "runway-line-amm",
|
|
@@ -2444,7 +2444,7 @@ function Ke() {
|
|
|
2444
2444
|
"source-layer": "runway",
|
|
2445
2445
|
filter: ["has", "has_amm"],
|
|
2446
2446
|
minzoom: 4,
|
|
2447
|
-
paint: { "line-color":
|
|
2447
|
+
paint: { "line-color": r.runway, "line-width": ["interpolate", ["linear"], ["zoom"], 4, 1, 10, 3], "line-opacity": ["interpolate", ["linear"], ["zoom"], 10.5, 1, 11, 0] }
|
|
2448
2448
|
},
|
|
2449
2449
|
{
|
|
2450
2450
|
id: "runway-label",
|
|
@@ -2453,7 +2453,7 @@ function Ke() {
|
|
|
2453
2453
|
"source-layer": "runway",
|
|
2454
2454
|
minzoom: 10,
|
|
2455
2455
|
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 },
|
|
2456
|
-
paint: { "text-color":
|
|
2456
|
+
paint: { "text-color": r.runway, "text-halo-color": "#0f172a", "text-halo-width": 1, "text-opacity": ["interpolate", ["linear"], ["zoom"], 10.5, 1, 11, 0] }
|
|
2457
2457
|
},
|
|
2458
2458
|
{
|
|
2459
2459
|
id: "vor-symbol",
|
|
@@ -2470,7 +2470,7 @@ function Ke() {
|
|
|
2470
2470
|
"source-layer": "vor",
|
|
2471
2471
|
minzoom: 5,
|
|
2472
2472
|
layout: { "text-field": ["get", "CODE_ID"], "text-size": 10, "text-anchor": "bottom", "text-offset": [0, -0.8] },
|
|
2473
|
-
paint: { "text-color":
|
|
2473
|
+
paint: { "text-color": r.vor, "text-halo-color": "#0f172a", "text-halo-width": 1 }
|
|
2474
2474
|
},
|
|
2475
2475
|
{
|
|
2476
2476
|
id: "ndb-symbol",
|
|
@@ -2480,7 +2480,7 @@ function Ke() {
|
|
|
2480
2480
|
"source-layer": "ndb",
|
|
2481
2481
|
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"], `
|
|
2482
2482
|
`, ["get", "VAL_FREQ"], "kHz"], "text-size": 10, "text-offset": [0, 1.4], "text-letter-spacing": 0.05, "text-optional": !0, "icon-allow-overlap": !0 },
|
|
2483
|
-
paint: { "text-color":
|
|
2483
|
+
paint: { "text-color": r.ndb, "text-halo-color": "#0f172a", "text-halo-width": 1, "icon-color": r.ndb }
|
|
2484
2484
|
},
|
|
2485
2485
|
{
|
|
2486
2486
|
id: "waypoint-symbol",
|
|
@@ -2489,7 +2489,7 @@ function Ke() {
|
|
|
2489
2489
|
"source-layer": "waypoint",
|
|
2490
2490
|
minzoom: 5,
|
|
2491
2491
|
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 },
|
|
2492
|
-
paint: { "icon-color":
|
|
2492
|
+
paint: { "icon-color": r.waypoint, "text-color": r.waypoint, "text-halo-color": "#0f172a", "text-halo-width": 1 }
|
|
2493
2493
|
},
|
|
2494
2494
|
{
|
|
2495
2495
|
id: "waypoint-off-airway-symbol",
|
|
@@ -2498,7 +2498,7 @@ function Ke() {
|
|
|
2498
2498
|
"source-layer": "waypoint-off-airway",
|
|
2499
2499
|
minzoom: 7,
|
|
2500
2500
|
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 },
|
|
2501
|
-
paint: { "icon-color":
|
|
2501
|
+
paint: { "icon-color": r.waypoint, "text-color": r.waypoint, "text-halo-color": "#0f172a", "text-halo-width": 1 }
|
|
2502
2502
|
}
|
|
2503
2503
|
];
|
|
2504
2504
|
}
|
|
@@ -2548,7 +2548,7 @@ const Ct = {
|
|
|
2548
2548
|
hotspot: "#ea580c"
|
|
2549
2549
|
};
|
|
2550
2550
|
function He(o = "amm") {
|
|
2551
|
-
const
|
|
2551
|
+
const r = Ye;
|
|
2552
2552
|
return [
|
|
2553
2553
|
// ── 机场边界轮廓(z11+)
|
|
2554
2554
|
{
|
|
@@ -2558,7 +2558,7 @@ function He(o = "amm") {
|
|
|
2558
2558
|
"source-layer": "amm-airport",
|
|
2559
2559
|
minzoom: 11,
|
|
2560
2560
|
paint: {
|
|
2561
|
-
"fill-color":
|
|
2561
|
+
"fill-color": r.airport,
|
|
2562
2562
|
"fill-opacity": 0.4
|
|
2563
2563
|
// 适当调高不透明度,确保白底可见
|
|
2564
2564
|
}
|
|
@@ -2570,7 +2570,7 @@ function He(o = "amm") {
|
|
|
2570
2570
|
"source-layer": "amm-airport",
|
|
2571
2571
|
minzoom: 11,
|
|
2572
2572
|
paint: {
|
|
2573
|
-
"line-color":
|
|
2573
|
+
"line-color": r.airport,
|
|
2574
2574
|
"line-width": 1
|
|
2575
2575
|
}
|
|
2576
2576
|
},
|
|
@@ -2582,7 +2582,7 @@ function He(o = "amm") {
|
|
|
2582
2582
|
"source-layer": "amm-runway",
|
|
2583
2583
|
minzoom: 11,
|
|
2584
2584
|
paint: {
|
|
2585
|
-
"fill-color":
|
|
2585
|
+
"fill-color": r.runway,
|
|
2586
2586
|
"fill-opacity": 0.9
|
|
2587
2587
|
}
|
|
2588
2588
|
},
|
|
@@ -2606,7 +2606,7 @@ function He(o = "amm") {
|
|
|
2606
2606
|
"source-layer": "amm-apron",
|
|
2607
2607
|
minzoom: 11,
|
|
2608
2608
|
paint: {
|
|
2609
|
-
"fill-color":
|
|
2609
|
+
"fill-color": r.apron,
|
|
2610
2610
|
"fill-opacity": 0.6
|
|
2611
2611
|
// 提高透明度浓度
|
|
2612
2612
|
}
|
|
@@ -2631,7 +2631,7 @@ function He(o = "amm") {
|
|
|
2631
2631
|
"source-layer": "amm-taxiway",
|
|
2632
2632
|
minzoom: 11,
|
|
2633
2633
|
paint: {
|
|
2634
|
-
"fill-color":
|
|
2634
|
+
"fill-color": r.taxiway,
|
|
2635
2635
|
"fill-opacity": 0.7
|
|
2636
2636
|
}
|
|
2637
2637
|
},
|
|
@@ -2643,7 +2643,7 @@ function He(o = "amm") {
|
|
|
2643
2643
|
"source-layer": "amm-taxiway-line",
|
|
2644
2644
|
minzoom: 11,
|
|
2645
2645
|
paint: {
|
|
2646
|
-
"line-color":
|
|
2646
|
+
"line-color": r.taxiwayLine,
|
|
2647
2647
|
"line-width": ["interpolate", ["linear"], ["zoom"], 15, 0.8, 18, 2]
|
|
2648
2648
|
}
|
|
2649
2649
|
},
|
|
@@ -2671,7 +2671,7 @@ function He(o = "amm") {
|
|
|
2671
2671
|
},
|
|
2672
2672
|
paint: {
|
|
2673
2673
|
"text-color": "#FFF",
|
|
2674
|
-
"icon-color":
|
|
2674
|
+
"icon-color": r.taxiwayLine
|
|
2675
2675
|
}
|
|
2676
2676
|
},
|
|
2677
2677
|
// ── 等待位(z11+)─────
|
|
@@ -2682,7 +2682,7 @@ function He(o = "amm") {
|
|
|
2682
2682
|
"source-layer": "amm-holding",
|
|
2683
2683
|
minzoom: 11,
|
|
2684
2684
|
paint: {
|
|
2685
|
-
"line-color":
|
|
2685
|
+
"line-color": r.holding,
|
|
2686
2686
|
"line-width": 1.5
|
|
2687
2687
|
}
|
|
2688
2688
|
},
|
|
@@ -2694,7 +2694,7 @@ function He(o = "amm") {
|
|
|
2694
2694
|
"source-layer": "amm-runway-marking",
|
|
2695
2695
|
minzoom: 13,
|
|
2696
2696
|
paint: {
|
|
2697
|
-
"fill-color":
|
|
2697
|
+
"fill-color": r.runwayMarking,
|
|
2698
2698
|
"fill-opacity": 0.9
|
|
2699
2699
|
}
|
|
2700
2700
|
},
|
|
@@ -2706,7 +2706,7 @@ function He(o = "amm") {
|
|
|
2706
2706
|
"source-layer": "amm-restricted",
|
|
2707
2707
|
minzoom: 11,
|
|
2708
2708
|
paint: {
|
|
2709
|
-
"fill-color":
|
|
2709
|
+
"fill-color": r.restricted,
|
|
2710
2710
|
"fill-opacity": 0.08
|
|
2711
2711
|
// 针对白底降低面纯度
|
|
2712
2712
|
}
|
|
@@ -2718,7 +2718,7 @@ function He(o = "amm") {
|
|
|
2718
2718
|
"source-layer": "amm-restricted",
|
|
2719
2719
|
minzoom: 11,
|
|
2720
2720
|
paint: {
|
|
2721
|
-
"line-color":
|
|
2721
|
+
"line-color": r.restricted,
|
|
2722
2722
|
"line-width": 1.5,
|
|
2723
2723
|
"line-dasharray": [4, 2]
|
|
2724
2724
|
}
|
|
@@ -2731,7 +2731,7 @@ function He(o = "amm") {
|
|
|
2731
2731
|
"source-layer": "amm-hotspot",
|
|
2732
2732
|
minzoom: 11,
|
|
2733
2733
|
paint: {
|
|
2734
|
-
"fill-color":
|
|
2734
|
+
"fill-color": r.hotspot,
|
|
2735
2735
|
"fill-opacity": 0.1
|
|
2736
2736
|
// 针对白底轻微淡化面
|
|
2737
2737
|
}
|
|
@@ -2743,7 +2743,7 @@ function He(o = "amm") {
|
|
|
2743
2743
|
"source-layer": "amm-hotspot",
|
|
2744
2744
|
minzoom: 11,
|
|
2745
2745
|
paint: {
|
|
2746
|
-
"line-color":
|
|
2746
|
+
"line-color": r.hotspot,
|
|
2747
2747
|
"line-width": 1.5
|
|
2748
2748
|
}
|
|
2749
2749
|
},
|
|
@@ -2755,7 +2755,7 @@ function He(o = "amm") {
|
|
|
2755
2755
|
"source-layer": "amm-runway-centerline",
|
|
2756
2756
|
minzoom: 11,
|
|
2757
2757
|
paint: {
|
|
2758
|
-
"line-color":
|
|
2758
|
+
"line-color": r.runwayCenterline,
|
|
2759
2759
|
"line-width": 1,
|
|
2760
2760
|
"line-dasharray": [6, 3]
|
|
2761
2761
|
}
|
|
@@ -2807,7 +2807,7 @@ function He(o = "amm") {
|
|
|
2807
2807
|
"source-layer": "amm-stand-line",
|
|
2808
2808
|
minzoom: 13,
|
|
2809
2809
|
paint: {
|
|
2810
|
-
"line-color":
|
|
2810
|
+
"line-color": r.standLine,
|
|
2811
2811
|
"line-width": 1
|
|
2812
2812
|
}
|
|
2813
2813
|
},
|
|
@@ -2846,7 +2846,7 @@ function He(o = "amm") {
|
|
|
2846
2846
|
"source-layer": "amm-stand",
|
|
2847
2847
|
minzoom: 12,
|
|
2848
2848
|
paint: {
|
|
2849
|
-
"circle-color":
|
|
2849
|
+
"circle-color": r.stand,
|
|
2850
2850
|
"circle-radius": 1.5
|
|
2851
2851
|
}
|
|
2852
2852
|
},
|
|
@@ -2865,7 +2865,7 @@ function He(o = "amm") {
|
|
|
2865
2865
|
"text-allow-overlap": !1
|
|
2866
2866
|
},
|
|
2867
2867
|
paint: {
|
|
2868
|
-
"text-color":
|
|
2868
|
+
"text-color": r.standLine
|
|
2869
2869
|
// 改为深墨绿字,白底/浅灰底上高可读
|
|
2870
2870
|
}
|
|
2871
2871
|
},
|
|
@@ -2987,16 +2987,16 @@ const Ze = {
|
|
|
2987
2987
|
hotspot: "#fb923c"
|
|
2988
2988
|
};
|
|
2989
2989
|
function Je(o = "amm") {
|
|
2990
|
-
const
|
|
2990
|
+
const r = Ze;
|
|
2991
2991
|
return [
|
|
2992
|
-
{ id: "amm-airport-fill", type: "fill", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "fill-color":
|
|
2992
|
+
{ id: "amm-airport-fill", type: "fill", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "fill-color": r.airport, "fill-opacity": 0.3 } },
|
|
2993
2993
|
{ id: "amm-airport-stroke", type: "line", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "line-color": "#475569", "line-width": 1 } },
|
|
2994
|
-
{ id: "amm-runway-fill", type: "fill", source: o, "source-layer": "amm-runway", minzoom: 11, paint: { "fill-color":
|
|
2994
|
+
{ id: "amm-runway-fill", type: "fill", source: o, "source-layer": "amm-runway", minzoom: 11, paint: { "fill-color": r.runway, "fill-opacity": 1 } },
|
|
2995
2995
|
{ id: "amm-runway-stroke", type: "line", source: o, "source-layer": "amm-runway", minzoom: 11, paint: { "line-color": "#64748b", "line-width": 0.5 } },
|
|
2996
|
-
{ id: "amm-apron-fill", type: "fill", source: o, "source-layer": "amm-apron", minzoom: 11, paint: { "fill-color":
|
|
2996
|
+
{ id: "amm-apron-fill", type: "fill", source: o, "source-layer": "amm-apron", minzoom: 11, paint: { "fill-color": r.apron, "fill-opacity": 1 } },
|
|
2997
2997
|
{ id: "amm-apron-stroke", type: "line", source: o, "source-layer": "amm-apron", minzoom: 11, paint: { "line-color": "#334155", "line-width": 0.5 } },
|
|
2998
|
-
{ id: "amm-taxiway-fill", type: "fill", source: o, "source-layer": "amm-taxiway", minzoom: 11, paint: { "fill-color":
|
|
2999
|
-
{ id: "amm-taxiway-line", type: "line", source: o, "source-layer": "amm-taxiway-line", minzoom: 11, paint: { "line-color":
|
|
2998
|
+
{ id: "amm-taxiway-fill", type: "fill", source: o, "source-layer": "amm-taxiway", minzoom: 11, paint: { "fill-color": r.taxiway, "fill-opacity": 0.8 } },
|
|
2999
|
+
{ 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] } },
|
|
3000
3000
|
{
|
|
3001
3001
|
id: "amm-taxiway-label",
|
|
3002
3002
|
type: "symbol",
|
|
@@ -3004,15 +3004,15 @@ function Je(o = "amm") {
|
|
|
3004
3004
|
"source-layer": "amm-taxiway-line",
|
|
3005
3005
|
minzoom: 14,
|
|
3006
3006
|
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 },
|
|
3007
|
-
paint: { "text-color": "#0f172a", "icon-color":
|
|
3007
|
+
paint: { "text-color": "#0f172a", "icon-color": r.taxiwayLine }
|
|
3008
3008
|
},
|
|
3009
|
-
{ id: "amm-holding", type: "line", source: o, "source-layer": "amm-holding", minzoom: 11, paint: { "line-color":
|
|
3010
|
-
{ id: "amm-runway-marking", type: "fill", source: o, "source-layer": "amm-runway-marking", minzoom: 13, paint: { "fill-color":
|
|
3011
|
-
{ id: "amm-restricted-fill", type: "fill", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "fill-color":
|
|
3012
|
-
{ id: "amm-restricted-stroke", type: "line", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "line-color":
|
|
3013
|
-
{ id: "amm-hotspot-fill", type: "fill", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "fill-color":
|
|
3014
|
-
{ id: "amm-hotspot-stroke", type: "line", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "line-color":
|
|
3015
|
-
{ id: "amm-runway-centerline", type: "line", source: o, "source-layer": "amm-runway-centerline", minzoom: 11, paint: { "line-color":
|
|
3009
|
+
{ id: "amm-holding", type: "line", source: o, "source-layer": "amm-holding", minzoom: 11, paint: { "line-color": r.holding, "line-width": 1.5 } },
|
|
3010
|
+
{ id: "amm-runway-marking", type: "fill", source: o, "source-layer": "amm-runway-marking", minzoom: 13, paint: { "fill-color": r.runwayMarking, "fill-opacity": 0.8 } },
|
|
3011
|
+
{ id: "amm-restricted-fill", type: "fill", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "fill-color": r.restricted, "fill-opacity": 0.12 } },
|
|
3012
|
+
{ 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] } },
|
|
3013
|
+
{ id: "amm-hotspot-fill", type: "fill", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "fill-color": r.hotspot, "fill-opacity": 0.15 } },
|
|
3014
|
+
{ id: "amm-hotspot-stroke", type: "line", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "line-color": r.hotspot, "line-width": 1.2 } },
|
|
3015
|
+
{ 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] } },
|
|
3016
3016
|
{
|
|
3017
3017
|
id: "amm-runway-info",
|
|
3018
3018
|
type: "symbol",
|
|
@@ -3022,7 +3022,7 @@ function Je(o = "amm") {
|
|
|
3022
3022
|
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 },
|
|
3023
3023
|
paint: { "text-color": "#e2e8f0", "text-halo-color": "#0f172a", "text-halo-width": 2 }
|
|
3024
3024
|
},
|
|
3025
|
-
{ id: "amm-stand-line", type: "line", source: o, "source-layer": "amm-stand-line", minzoom: 13, paint: { "line-color":
|
|
3025
|
+
{ id: "amm-stand-line", type: "line", source: o, "source-layer": "amm-stand-line", minzoom: 13, paint: { "line-color": r.standLine, "line-width": 1 } },
|
|
3026
3026
|
{
|
|
3027
3027
|
id: "amm-runway-threshold-label",
|
|
3028
3028
|
type: "symbol",
|
|
@@ -3032,7 +3032,7 @@ function Je(o = "amm") {
|
|
|
3032
3032
|
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" },
|
|
3033
3033
|
paint: { "text-color": "#ffffff", "icon-color": "#ef4444" }
|
|
3034
3034
|
},
|
|
3035
|
-
{ id: "amm-stand", type: "circle", source: o, "source-layer": "amm-stand", minzoom: 12, paint: { "circle-color":
|
|
3035
|
+
{ id: "amm-stand", type: "circle", source: o, "source-layer": "amm-stand", minzoom: 12, paint: { "circle-color": r.stand, "circle-radius": 1.5 } },
|
|
3036
3036
|
{
|
|
3037
3037
|
id: "amm-stand-label",
|
|
3038
3038
|
type: "symbol",
|
|
@@ -3040,7 +3040,7 @@ function Je(o = "amm") {
|
|
|
3040
3040
|
"source-layer": "amm-stand",
|
|
3041
3041
|
minzoom: 14,
|
|
3042
3042
|
layout: { "text-field": ["get", "idstd"], "text-size": 9, "text-anchor": "bottom", "text-offset": [0, -0.5], "text-allow-overlap": !1 },
|
|
3043
|
-
paint: { "text-color":
|
|
3043
|
+
paint: { "text-color": r.stand, "text-halo-color": "#0f172a", "text-halo-width": 1 }
|
|
3044
3044
|
},
|
|
3045
3045
|
{ id: "amm-obstacle-region-fill", type: "fill", source: o, "source-layer": "amm-obstacle-region", minzoom: 11, paint: { "fill-color": "#fef08a", "fill-opacity": 0.15 } },
|
|
3046
3046
|
{ 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] } },
|
|
@@ -3083,16 +3083,16 @@ const Qe = {
|
|
|
3083
3083
|
hotspot: "#fb923c"
|
|
3084
3084
|
};
|
|
3085
3085
|
function qe(o = "amm") {
|
|
3086
|
-
const
|
|
3086
|
+
const r = Qe, d = "#1f1f23";
|
|
3087
3087
|
return [
|
|
3088
|
-
{ id: "amm-airport-fill", type: "fill", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "fill-color":
|
|
3088
|
+
{ id: "amm-airport-fill", type: "fill", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "fill-color": r.airport, "fill-opacity": 0.3 } },
|
|
3089
3089
|
{ id: "amm-airport-stroke", type: "line", source: o, "source-layer": "amm-airport", minzoom: 11, paint: { "line-color": "#52525b", "line-width": 1 } },
|
|
3090
|
-
{ id: "amm-runway-fill", type: "fill", source: o, "source-layer": "amm-runway", minzoom: 11, paint: { "fill-color":
|
|
3090
|
+
{ id: "amm-runway-fill", type: "fill", source: o, "source-layer": "amm-runway", minzoom: 11, paint: { "fill-color": r.runway, "fill-opacity": 1 } },
|
|
3091
3091
|
{ id: "amm-runway-stroke", type: "line", source: o, "source-layer": "amm-runway", minzoom: 11, paint: { "line-color": "#52525b", "line-width": 0.5 } },
|
|
3092
|
-
{ id: "amm-apron-fill", type: "fill", source: o, "source-layer": "amm-apron", minzoom: 11, paint: { "fill-color":
|
|
3092
|
+
{ id: "amm-apron-fill", type: "fill", source: o, "source-layer": "amm-apron", minzoom: 11, paint: { "fill-color": r.apron, "fill-opacity": 1 } },
|
|
3093
3093
|
{ id: "amm-apron-stroke", type: "line", source: o, "source-layer": "amm-apron", minzoom: 11, paint: { "line-color": "#3f3f46", "line-width": 0.5 } },
|
|
3094
|
-
{ id: "amm-taxiway-fill", type: "fill", source: o, "source-layer": "amm-taxiway", minzoom: 11, paint: { "fill-color":
|
|
3095
|
-
{ id: "amm-taxiway-line", type: "line", source: o, "source-layer": "amm-taxiway-line", minzoom: 11, paint: { "line-color":
|
|
3094
|
+
{ id: "amm-taxiway-fill", type: "fill", source: o, "source-layer": "amm-taxiway", minzoom: 11, paint: { "fill-color": r.taxiway, "fill-opacity": 0.9 } },
|
|
3095
|
+
{ 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] } },
|
|
3096
3096
|
{
|
|
3097
3097
|
id: "amm-taxiway-label",
|
|
3098
3098
|
type: "symbol",
|
|
@@ -3100,15 +3100,15 @@ function qe(o = "amm") {
|
|
|
3100
3100
|
"source-layer": "amm-taxiway-line",
|
|
3101
3101
|
minzoom: 14,
|
|
3102
3102
|
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 },
|
|
3103
|
-
paint: { "text-color":
|
|
3103
|
+
paint: { "text-color": d, "icon-color": r.taxiwayLine }
|
|
3104
3104
|
},
|
|
3105
|
-
{ id: "amm-holding", type: "line", source: o, "source-layer": "amm-holding", minzoom: 11, paint: { "line-color":
|
|
3106
|
-
{ id: "amm-runway-marking", type: "fill", source: o, "source-layer": "amm-runway-marking", minzoom: 13, paint: { "fill-color":
|
|
3107
|
-
{ id: "amm-restricted-fill", type: "fill", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "fill-color":
|
|
3108
|
-
{ id: "amm-restricted-stroke", type: "line", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "line-color":
|
|
3109
|
-
{ id: "amm-hotspot-fill", type: "fill", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "fill-color":
|
|
3110
|
-
{ id: "amm-hotspot-stroke", type: "line", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "line-color":
|
|
3111
|
-
{ id: "amm-runway-centerline", type: "line", source: o, "source-layer": "amm-runway-centerline", minzoom: 11, paint: { "line-color":
|
|
3105
|
+
{ id: "amm-holding", type: "line", source: o, "source-layer": "amm-holding", minzoom: 11, paint: { "line-color": r.holding, "line-width": 1.5 } },
|
|
3106
|
+
{ id: "amm-runway-marking", type: "fill", source: o, "source-layer": "amm-runway-marking", minzoom: 13, paint: { "fill-color": r.runwayMarking, "fill-opacity": 0.85 } },
|
|
3107
|
+
{ id: "amm-restricted-fill", type: "fill", source: o, "source-layer": "amm-restricted", minzoom: 11, paint: { "fill-color": r.restricted, "fill-opacity": 0.1 } },
|
|
3108
|
+
{ 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] } },
|
|
3109
|
+
{ id: "amm-hotspot-fill", type: "fill", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "fill-color": r.hotspot, "fill-opacity": 0.12 } },
|
|
3110
|
+
{ id: "amm-hotspot-stroke", type: "line", source: o, "source-layer": "amm-hotspot", minzoom: 11, paint: { "line-color": r.hotspot, "line-width": 1.2 } },
|
|
3111
|
+
{ 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] } },
|
|
3112
3112
|
{
|
|
3113
3113
|
id: "amm-runway-info",
|
|
3114
3114
|
type: "symbol",
|
|
@@ -3116,9 +3116,9 @@ function qe(o = "amm") {
|
|
|
3116
3116
|
"source-layer": "amm-runway-label",
|
|
3117
3117
|
minzoom: 13,
|
|
3118
3118
|
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 },
|
|
3119
|
-
paint: { "text-color": "#e4e4e7", "text-halo-color":
|
|
3119
|
+
paint: { "text-color": "#e4e4e7", "text-halo-color": d, "text-halo-width": 2 }
|
|
3120
3120
|
},
|
|
3121
|
-
{ id: "amm-stand-line", type: "line", source: o, "source-layer": "amm-stand-line", minzoom: 13, paint: { "line-color":
|
|
3121
|
+
{ id: "amm-stand-line", type: "line", source: o, "source-layer": "amm-stand-line", minzoom: 13, paint: { "line-color": r.standLine, "line-width": 1 } },
|
|
3122
3122
|
{
|
|
3123
3123
|
id: "amm-runway-threshold-label",
|
|
3124
3124
|
type: "symbol",
|
|
@@ -3126,9 +3126,9 @@ function qe(o = "amm") {
|
|
|
3126
3126
|
"source-layer": "amm-runway-threshold",
|
|
3127
3127
|
minzoom: 12,
|
|
3128
3128
|
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" },
|
|
3129
|
-
paint: { "text-color": "#ffffff", "icon-color":
|
|
3129
|
+
paint: { "text-color": "#ffffff", "icon-color": r.threshold }
|
|
3130
3130
|
},
|
|
3131
|
-
{ id: "amm-stand", type: "circle", source: o, "source-layer": "amm-stand", minzoom: 12, paint: { "circle-color":
|
|
3131
|
+
{ id: "amm-stand", type: "circle", source: o, "source-layer": "amm-stand", minzoom: 12, paint: { "circle-color": r.stand, "circle-radius": 1.5 } },
|
|
3132
3132
|
{
|
|
3133
3133
|
id: "amm-stand-label",
|
|
3134
3134
|
type: "symbol",
|
|
@@ -3136,11 +3136,11 @@ function qe(o = "amm") {
|
|
|
3136
3136
|
"source-layer": "amm-stand",
|
|
3137
3137
|
minzoom: 14,
|
|
3138
3138
|
layout: { "text-field": ["get", "idstd"], "text-size": 9, "text-anchor": "bottom", "text-offset": [0, -0.5], "text-allow-overlap": !1 },
|
|
3139
|
-
paint: { "text-color":
|
|
3139
|
+
paint: { "text-color": r.stand, "text-halo-color": d, "text-halo-width": 1 }
|
|
3140
3140
|
},
|
|
3141
3141
|
{ id: "amm-obstacle-region-fill", type: "fill", source: o, "source-layer": "amm-obstacle-region", minzoom: 11, paint: { "fill-color": "#fef08a", "fill-opacity": 0.1 } },
|
|
3142
3142
|
{ 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] } },
|
|
3143
|
-
{ id: "amm-obstacle-point", type: "circle", source: o, "source-layer": "amm-obstacle-point", minzoom: 11, paint: { "circle-color": "#f97316", "circle-radius": 4, "circle-stroke-color":
|
|
3143
|
+
{ id: "amm-obstacle-point", type: "circle", source: o, "source-layer": "amm-obstacle-point", minzoom: 11, paint: { "circle-color": "#f97316", "circle-radius": 4, "circle-stroke-color": d, "circle-stroke-width": 1 } },
|
|
3144
3144
|
{
|
|
3145
3145
|
id: "amm-obstacle-point-label",
|
|
3146
3146
|
type: "symbol",
|
|
@@ -3148,7 +3148,7 @@ function qe(o = "amm") {
|
|
|
3148
3148
|
"source-layer": "amm-obstacle-point",
|
|
3149
3149
|
minzoom: 14,
|
|
3150
3150
|
layout: { "text-field": ["coalesce", ["get", "ident"], ["get", "LABEL"]], "text-size": 9, "text-anchor": "bottom", "text-offset": [0, -0.5], "text-allow-overlap": !1 },
|
|
3151
|
-
paint: { "text-color": "#fdba74", "text-halo-color":
|
|
3151
|
+
paint: { "text-color": "#fdba74", "text-halo-color": d, "text-halo-width": 1.2 }
|
|
3152
3152
|
},
|
|
3153
3153
|
{ id: "amm-construction-fill", type: "fill", source: o, "source-layer": "amm-construction", minzoom: 11, paint: { "fill-pattern": "normal:passline", "fill-opacity": 0.6 } },
|
|
3154
3154
|
{ id: "amm-construction-stroke", type: "line", source: o, "source-layer": "amm-construction", minzoom: 11, paint: { "line-color": "#ea580c", "line-width": 1.2, "line-dasharray": [4, 2] } },
|
|
@@ -3159,12 +3159,12 @@ function qe(o = "amm") {
|
|
|
3159
3159
|
"source-layer": "amm-construction",
|
|
3160
3160
|
minzoom: 13,
|
|
3161
3161
|
layout: { "text-field": ["get", "text"], "text-size": 9, "text-anchor": "center", "symbol-placement": "point", "text-allow-overlap": !1 },
|
|
3162
|
-
paint: { "text-color": "#f97316", "text-halo-color":
|
|
3162
|
+
paint: { "text-color": "#f97316", "text-halo-color": d, "text-halo-width": 1 }
|
|
3163
3163
|
}
|
|
3164
3164
|
];
|
|
3165
3165
|
}
|
|
3166
|
-
function Ht(o = "amm",
|
|
3167
|
-
return
|
|
3166
|
+
function Ht(o = "amm", r = "light") {
|
|
3167
|
+
return r === "dark" ? Je(o) : r === "neutral" ? qe(o) : He(o);
|
|
3168
3168
|
}
|
|
3169
3169
|
const oi = {
|
|
3170
3170
|
ammAirport: ["amm-airport-fill", "amm-airport-stroke"],
|
|
@@ -3238,13 +3238,13 @@ const oi = {
|
|
|
3238
3238
|
"amm-construction-label"
|
|
3239
3239
|
], Zt = ["terrain-color", "terrain-hillshade"], Jt = ["contour-line", "contour-label"];
|
|
3240
3240
|
async function Qt(o) {
|
|
3241
|
-
const
|
|
3242
|
-
if (!
|
|
3243
|
-
const
|
|
3244
|
-
if (
|
|
3245
|
-
return
|
|
3246
|
-
const
|
|
3247
|
-
return new Response(
|
|
3241
|
+
const r = await fetch(o);
|
|
3242
|
+
if (!r.ok) throw new Error(`fetch ${o} → ${r.status}`);
|
|
3243
|
+
const d = r.headers.get("Content-Encoding"), y = r.headers.get("Content-Type") || "";
|
|
3244
|
+
if (d === "gzip" || y.includes("json"))
|
|
3245
|
+
return r.json();
|
|
3246
|
+
const g = r.body.pipeThrough(new DecompressionStream("gzip"));
|
|
3247
|
+
return new Response(g).json();
|
|
3248
3248
|
}
|
|
3249
3249
|
class ri {
|
|
3250
3250
|
/**
|
|
@@ -3259,19 +3259,19 @@ class ri {
|
|
|
3259
3259
|
* @param {number} [options.zoom] Initial zoom level (default 4)
|
|
3260
3260
|
* @param {string} [options.terrainUrl] Terrain DEM tile URL template (default internal server)
|
|
3261
3261
|
*/
|
|
3262
|
-
constructor(
|
|
3262
|
+
constructor(r = {}) {
|
|
3263
3263
|
const {
|
|
3264
|
-
container:
|
|
3265
|
-
theme:
|
|
3266
|
-
apiUrl:
|
|
3267
|
-
spriteUrl:
|
|
3268
|
-
period:
|
|
3269
|
-
layers:
|
|
3264
|
+
container: d,
|
|
3265
|
+
theme: y = "light",
|
|
3266
|
+
apiUrl: g = ti,
|
|
3267
|
+
spriteUrl: w,
|
|
3268
|
+
period: b = null,
|
|
3269
|
+
layers: S = {},
|
|
3270
3270
|
center: O = [104, 36],
|
|
3271
|
-
zoom:
|
|
3271
|
+
zoom: k = 4,
|
|
3272
3272
|
terrainUrl: z = null
|
|
3273
|
-
} =
|
|
3274
|
-
this._apiUrl =
|
|
3273
|
+
} = r;
|
|
3274
|
+
return this._apiUrl = g.replace(/\/$/, ""), this._spriteUrl = (w ?? g).replace(/\/$/, ""), this._terrainUrl = z ?? `${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`, this._theme = y, this._period = b, this._center = O, this._zoom = k, this._ready = !1, this._layerVisible = {
|
|
3275
3275
|
// aviation groups — all visible by default
|
|
3276
3276
|
adiz: !0,
|
|
3277
3277
|
fir: !0,
|
|
@@ -3289,14 +3289,31 @@ class ri {
|
|
|
3289
3289
|
terrain: !1,
|
|
3290
3290
|
contour: !1,
|
|
3291
3291
|
// user overrides
|
|
3292
|
-
...
|
|
3293
|
-
}, this._initMap(
|
|
3292
|
+
...S
|
|
3293
|
+
}, this._initMap(d), new Proxy(this, {
|
|
3294
|
+
get(p, x) {
|
|
3295
|
+
if (typeof x == "symbol" || Reflect.has(p, x)) {
|
|
3296
|
+
const A = p[x];
|
|
3297
|
+
return typeof A == "function" ? A.bind(p) : A;
|
|
3298
|
+
}
|
|
3299
|
+
const T = p._map;
|
|
3300
|
+
if (!T) return;
|
|
3301
|
+
const D = T[x];
|
|
3302
|
+
return typeof D == "function" ? D.bind(T) : D;
|
|
3303
|
+
},
|
|
3304
|
+
set(p, x, T) {
|
|
3305
|
+
return typeof x == "symbol" || Reflect.has(p, x) || !p._map ? p[x] = T : x in p._map ? p._map[x] = T : p[x] = T, !0;
|
|
3306
|
+
},
|
|
3307
|
+
has(p, x) {
|
|
3308
|
+
return Reflect.has(p, x) || (p._map ? x in p._map : !1);
|
|
3309
|
+
}
|
|
3310
|
+
});
|
|
3294
3311
|
}
|
|
3295
3312
|
// ── Map initialization ────────────────────────────────────────────────────
|
|
3296
|
-
_initMap(
|
|
3297
|
-
const
|
|
3313
|
+
_initMap(r) {
|
|
3314
|
+
const d = ut[this._theme] ?? ut.light;
|
|
3298
3315
|
this._map = new jt.Map({
|
|
3299
|
-
container:
|
|
3316
|
+
container: r,
|
|
3300
3317
|
style: {
|
|
3301
3318
|
version: 8,
|
|
3302
3319
|
glyphs: "https://aips.siniswift.com/mapsdk/glyphs/{fontstack}/{range}.pbf",
|
|
@@ -3310,7 +3327,7 @@ class ri {
|
|
|
3310
3327
|
boundary: { type: "geojson", data: { type: "FeatureCollection", features: [] } }
|
|
3311
3328
|
},
|
|
3312
3329
|
layers: [
|
|
3313
|
-
{ id: "background", type: "background", paint: { "background-color":
|
|
3330
|
+
{ id: "background", type: "background", paint: { "background-color": d.background } }
|
|
3314
3331
|
]
|
|
3315
3332
|
},
|
|
3316
3333
|
center: this._center,
|
|
@@ -3329,10 +3346,10 @@ class ri {
|
|
|
3329
3346
|
async _initSources() {
|
|
3330
3347
|
if (!this._period)
|
|
3331
3348
|
try {
|
|
3332
|
-
const
|
|
3333
|
-
this._period =
|
|
3334
|
-
} catch (
|
|
3335
|
-
console.warn("[AviationChart] fetchPeriods failed:",
|
|
3349
|
+
const y = await (await fetch(`${this._apiUrl}/api/periods`)).json();
|
|
3350
|
+
this._period = y[y.length - 1];
|
|
3351
|
+
} catch (d) {
|
|
3352
|
+
console.warn("[AviationChart] fetchPeriods failed:", d), this._period = "latest";
|
|
3336
3353
|
}
|
|
3337
3354
|
this._map.addSource("navdata", {
|
|
3338
3355
|
type: "vector",
|
|
@@ -3351,15 +3368,15 @@ class ri {
|
|
|
3351
3368
|
encoding: "mapbox",
|
|
3352
3369
|
maxzoom: 8
|
|
3353
3370
|
});
|
|
3354
|
-
const
|
|
3371
|
+
const r = new Be.DemSource({
|
|
3355
3372
|
url: this._terrainUrl,
|
|
3356
3373
|
encoding: "mapbox",
|
|
3357
3374
|
maxzoom: 8,
|
|
3358
3375
|
worker: !0
|
|
3359
3376
|
});
|
|
3360
|
-
|
|
3377
|
+
r.setupMaplibre(jt), this._map.addSource("contour", {
|
|
3361
3378
|
type: "vector",
|
|
3362
|
-
tiles: [
|
|
3379
|
+
tiles: [r.contourProtocolUrl({
|
|
3363
3380
|
thresholds: {
|
|
3364
3381
|
5: [250, 1e3],
|
|
3365
3382
|
7: [125, 500],
|
|
@@ -3375,30 +3392,30 @@ class ri {
|
|
|
3375
3392
|
}), await this._loadBaseData();
|
|
3376
3393
|
}
|
|
3377
3394
|
async _loadBaseData() {
|
|
3378
|
-
var
|
|
3395
|
+
var r, d, y, g;
|
|
3379
3396
|
try {
|
|
3380
|
-
const [
|
|
3397
|
+
const [w, b] = await Promise.all([
|
|
3381
3398
|
Qt(`${this._apiUrl}/topjson/land.topojson.gz`),
|
|
3382
3399
|
Qt(`${this._apiUrl}/topjson/boundary.topojson.gz`)
|
|
3383
3400
|
]);
|
|
3384
|
-
(
|
|
3385
|
-
} catch (
|
|
3386
|
-
console.error("[AviationChart] loadBaseData failed:",
|
|
3401
|
+
(r = w == null ? void 0 : w.objects) != null && r.land ? (d = this._map.getSource("land")) == null || d.setData($t(w, w.objects.land)) : console.warn("[AviationChart] land topojson missing objects.land"), (y = b == null ? void 0 : b.objects) != null && y.boundary ? (g = this._map.getSource("boundary")) == null || g.setData($t(b, b.objects.boundary)) : console.warn("[AviationChart] boundary topojson missing objects.boundary");
|
|
3402
|
+
} catch (w) {
|
|
3403
|
+
console.error("[AviationChart] loadBaseData failed:", w);
|
|
3387
3404
|
}
|
|
3388
3405
|
}
|
|
3389
3406
|
_initLayers() {
|
|
3390
|
-
const
|
|
3407
|
+
const r = this._layerVisible.terrain ? "visible" : "none", d = this._layerVisible.contour ? "visible" : "none";
|
|
3391
3408
|
this._map.addLayer({
|
|
3392
3409
|
id: "terrain-color",
|
|
3393
3410
|
type: "color-relief",
|
|
3394
3411
|
source: "terrain",
|
|
3395
|
-
layout: { visibility:
|
|
3412
|
+
layout: { visibility: r },
|
|
3396
3413
|
paint: { "color-relief-color": ei }
|
|
3397
3414
|
}), this._map.addLayer({
|
|
3398
3415
|
id: "terrain-hillshade",
|
|
3399
3416
|
type: "hillshade",
|
|
3400
3417
|
source: "terrain",
|
|
3401
|
-
layout: { visibility:
|
|
3418
|
+
layout: { visibility: r },
|
|
3402
3419
|
paint: {
|
|
3403
3420
|
"hillshade-shadow-color": "rgba(74,59,42,0.35)",
|
|
3404
3421
|
"hillshade-highlight-color": "rgba(255,246,230,0.25)",
|
|
@@ -3412,7 +3429,7 @@ class ri {
|
|
|
3412
3429
|
type: "line",
|
|
3413
3430
|
source: "contour",
|
|
3414
3431
|
"source-layer": "contours",
|
|
3415
|
-
layout: { visibility:
|
|
3432
|
+
layout: { visibility: d },
|
|
3416
3433
|
paint: {
|
|
3417
3434
|
"line-color": ["case", ["==", ["get", "level"], 1], "rgba(100,70,40,0.40)", "rgba(120,90,60,0.18)"],
|
|
3418
3435
|
"line-width": ["case", ["==", ["get", "level"], 1], 1, 0.5]
|
|
@@ -3424,7 +3441,7 @@ class ri {
|
|
|
3424
3441
|
"source-layer": "contours",
|
|
3425
3442
|
filter: ["==", ["get", "level"], 1],
|
|
3426
3443
|
layout: {
|
|
3427
|
-
visibility:
|
|
3444
|
+
visibility: d,
|
|
3428
3445
|
"symbol-placement": "line",
|
|
3429
3446
|
"text-field": ["concat", ["to-string", ["get", "ele"]], "m"],
|
|
3430
3447
|
"text-size": 10,
|
|
@@ -3438,26 +3455,26 @@ class ri {
|
|
|
3438
3455
|
"text-halo-width": 1
|
|
3439
3456
|
}
|
|
3440
3457
|
}), this._layerVisible.terrain && this._map.setTerrain({ source: "terrain", exaggeration: 4 });
|
|
3441
|
-
for (const
|
|
3442
|
-
this._map.getLayer(
|
|
3443
|
-
for (const
|
|
3444
|
-
this._map.getLayer(
|
|
3458
|
+
for (const y of Yt(this._theme))
|
|
3459
|
+
this._map.getLayer(y.id) || this._map.addLayer(y);
|
|
3460
|
+
for (const y of Ht("amm", this._theme))
|
|
3461
|
+
this._map.getLayer(y.id) || this._map.addLayer(y, "fir-line");
|
|
3445
3462
|
}
|
|
3446
3463
|
_applyVisibility() {
|
|
3447
|
-
for (const [
|
|
3448
|
-
const
|
|
3449
|
-
for (const
|
|
3450
|
-
this._map.getLayer(
|
|
3464
|
+
for (const [g, w] of Object.entries(Ct)) {
|
|
3465
|
+
const b = this._layerVisible[g] !== !1 ? "visible" : "none";
|
|
3466
|
+
for (const S of w)
|
|
3467
|
+
this._map.getLayer(S) && this._map.setLayoutProperty(S, "visibility", b);
|
|
3451
3468
|
}
|
|
3452
|
-
const
|
|
3453
|
-
for (const
|
|
3454
|
-
this._map.getLayer(
|
|
3455
|
-
const
|
|
3456
|
-
for (const
|
|
3457
|
-
this._map.getLayer(
|
|
3458
|
-
const
|
|
3459
|
-
for (const
|
|
3460
|
-
this._map.getLayer(
|
|
3469
|
+
const r = this._layerVisible.amm !== !1 ? "visible" : "none";
|
|
3470
|
+
for (const g of Pt)
|
|
3471
|
+
this._map.getLayer(g) && this._map.setLayoutProperty(g, "visibility", r);
|
|
3472
|
+
const d = this._layerVisible.terrain ? "visible" : "none";
|
|
3473
|
+
for (const g of Zt)
|
|
3474
|
+
this._map.getLayer(g) && this._map.setLayoutProperty(g, "visibility", d);
|
|
3475
|
+
const y = this._layerVisible.contour ? "visible" : "none";
|
|
3476
|
+
for (const g of Jt)
|
|
3477
|
+
this._map.getLayer(g) && this._map.setLayoutProperty(g, "visibility", y);
|
|
3461
3478
|
}
|
|
3462
3479
|
// ── Public API ────────────────────────────────────────────────────────────
|
|
3463
3480
|
/** Raw MapLibre Map instance */
|
|
@@ -3476,23 +3493,23 @@ class ri {
|
|
|
3476
3493
|
* Switch the chart theme.
|
|
3477
3494
|
* @param {'light'|'dark'} theme
|
|
3478
3495
|
*/
|
|
3479
|
-
setTheme(
|
|
3480
|
-
if (
|
|
3481
|
-
this._theme =
|
|
3482
|
-
const
|
|
3483
|
-
this._map.setPaintProperty("background", "background-color",
|
|
3484
|
-
const
|
|
3496
|
+
setTheme(r) {
|
|
3497
|
+
if (r === this._theme) return;
|
|
3498
|
+
this._theme = r;
|
|
3499
|
+
const d = ut[r] ?? ut.light;
|
|
3500
|
+
this._map.setPaintProperty("background", "background-color", d.background);
|
|
3501
|
+
const y = [
|
|
3485
3502
|
"landLaye",
|
|
3486
3503
|
"boundary",
|
|
3487
3504
|
...Object.values(Ct).flat(),
|
|
3488
3505
|
...Pt
|
|
3489
3506
|
];
|
|
3490
|
-
for (const
|
|
3491
|
-
this._map.getLayer(
|
|
3492
|
-
for (const
|
|
3493
|
-
this._map.addLayer(
|
|
3494
|
-
for (const
|
|
3495
|
-
this._map.getLayer(
|
|
3507
|
+
for (const g of y)
|
|
3508
|
+
this._map.getLayer(g) && this._map.removeLayer(g);
|
|
3509
|
+
for (const g of Yt(this._theme))
|
|
3510
|
+
this._map.addLayer(g);
|
|
3511
|
+
for (const g of Ht("amm", this._theme))
|
|
3512
|
+
this._map.getLayer(g.id) || this._map.addLayer(g, "fir-line");
|
|
3496
3513
|
this._applyVisibility();
|
|
3497
3514
|
}
|
|
3498
3515
|
/**
|
|
@@ -3506,52 +3523,66 @@ class ri {
|
|
|
3506
3523
|
* @param {string} key
|
|
3507
3524
|
* @param {boolean} visible
|
|
3508
3525
|
*/
|
|
3509
|
-
setLayerVisible(
|
|
3510
|
-
if (this._layerVisible[
|
|
3511
|
-
const
|
|
3512
|
-
for (const
|
|
3513
|
-
this._map.getLayer(
|
|
3514
|
-
this._map.setTerrain(
|
|
3526
|
+
setLayerVisible(r, d) {
|
|
3527
|
+
if (this._layerVisible[r] = d, r === "terrain") {
|
|
3528
|
+
const w = d ? "visible" : "none";
|
|
3529
|
+
for (const b of Zt)
|
|
3530
|
+
this._map.getLayer(b) && this._map.setLayoutProperty(b, "visibility", w);
|
|
3531
|
+
this._map.setTerrain(d ? { source: "terrain", exaggeration: 4 } : null);
|
|
3515
3532
|
return;
|
|
3516
3533
|
}
|
|
3517
|
-
if (
|
|
3518
|
-
const
|
|
3519
|
-
for (const
|
|
3520
|
-
this._map.getLayer(
|
|
3534
|
+
if (r === "contour") {
|
|
3535
|
+
const w = d ? "visible" : "none";
|
|
3536
|
+
for (const b of Jt)
|
|
3537
|
+
this._map.getLayer(b) && this._map.setLayoutProperty(b, "visibility", w);
|
|
3521
3538
|
return;
|
|
3522
3539
|
}
|
|
3523
|
-
if (
|
|
3524
|
-
const
|
|
3525
|
-
for (const
|
|
3526
|
-
this._map.getLayer(
|
|
3540
|
+
if (r === "amm") {
|
|
3541
|
+
const w = d ? "visible" : "none";
|
|
3542
|
+
for (const b of Pt)
|
|
3543
|
+
this._map.getLayer(b) && this._map.setLayoutProperty(b, "visibility", w);
|
|
3527
3544
|
return;
|
|
3528
3545
|
}
|
|
3529
|
-
const
|
|
3530
|
-
if (!
|
|
3531
|
-
console.warn(`[AviationChart] Unknown layer key: "${
|
|
3546
|
+
const y = Ct[r];
|
|
3547
|
+
if (!y) {
|
|
3548
|
+
console.warn(`[AviationChart] Unknown layer key: "${r}"`);
|
|
3532
3549
|
return;
|
|
3533
3550
|
}
|
|
3534
|
-
const
|
|
3535
|
-
for (const
|
|
3536
|
-
this._map.getLayer(
|
|
3551
|
+
const g = d ? "visible" : "none";
|
|
3552
|
+
for (const w of y)
|
|
3553
|
+
this._map.getLayer(w) && this._map.setLayoutProperty(w, "visibility", g);
|
|
3537
3554
|
}
|
|
3538
3555
|
/**
|
|
3539
3556
|
* Switch the navdata period. Fetches tiles for the new period immediately.
|
|
3540
3557
|
* @param {string} period
|
|
3541
3558
|
*/
|
|
3542
|
-
setPeriod(
|
|
3543
|
-
var
|
|
3544
|
-
this._period =
|
|
3545
|
-
const
|
|
3546
|
-
|
|
3547
|
-
}
|
|
3548
|
-
/**
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3559
|
+
setPeriod(r) {
|
|
3560
|
+
var y;
|
|
3561
|
+
this._period = r;
|
|
3562
|
+
const d = (y = this._map) == null ? void 0 : y.getSource("navdata");
|
|
3563
|
+
d && d.setTiles([`${this._apiUrl}/api/tiles/${r}/{z}/{x}/{y}.pbf`]);
|
|
3564
|
+
}
|
|
3565
|
+
/**
|
|
3566
|
+
* Proxy to map.on. Supports both signatures:
|
|
3567
|
+
* on(event, listener)
|
|
3568
|
+
* on(event, layerId, listener) ← layer-delegated events
|
|
3569
|
+
* Returns `this` for chaining.
|
|
3570
|
+
*/
|
|
3571
|
+
on(r, d, y) {
|
|
3572
|
+
return typeof d == "string" ? this._map.on(r, d, y) : this._map.on(r, d ?? y), this;
|
|
3573
|
+
}
|
|
3574
|
+
/**
|
|
3575
|
+
* Proxy to map.off. Supports both signatures:
|
|
3576
|
+
* off(event, listener)
|
|
3577
|
+
* off(event, layerId, listener)
|
|
3578
|
+
* Returns `this` for chaining.
|
|
3579
|
+
*/
|
|
3580
|
+
off(r, d, y) {
|
|
3581
|
+
return typeof d == "string" ? this._map.off(r, d, y) : this._map.off(r, d ?? y), this;
|
|
3582
|
+
}
|
|
3583
|
+
/** Proxy to map.once — supports layer-delegated signature too. */
|
|
3584
|
+
once(r, d, y) {
|
|
3585
|
+
return typeof d == "string" ? this._map.once(r, d, y) : this._map.once(r, d ?? y), this;
|
|
3555
3586
|
}
|
|
3556
3587
|
/** Remove the map and release all resources */
|
|
3557
3588
|
destroy() {
|