@maptiler/sdk 4.0.2-rc.1 → 4.0.2
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/maptiler-sdk.mjs +264 -260
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/package.json +2 -2
package/dist/maptiler-sdk.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var _o = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var Un = (r) => {
|
|
3
3
|
throw TypeError(r);
|
|
4
4
|
};
|
|
5
5
|
var Mo = (r, e, t) => e in r ? _o(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
6
|
-
var y = (r, e, t) => Mo(r, typeof e != "symbol" ? e + "" : e, t), Er = (r, e, t) => e.has(r) ||
|
|
7
|
-
var E = (r, e, t) => (Er(r, e, "read from private field"), t ? t.call(r) : e.get(r)), W = (r, e, t) => e.has(r) ?
|
|
6
|
+
var y = (r, e, t) => Mo(r, typeof e != "symbol" ? e + "" : e, t), Er = (r, e, t) => e.has(r) || Un("Cannot " + t);
|
|
7
|
+
var E = (r, e, t) => (Er(r, e, "read from private field"), t ? t.call(r) : e.get(r)), W = (r, e, t) => e.has(r) ? Un("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), Q = (r, e, t, n) => (Er(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), ee = (r, e, t) => (Er(r, e, "access private method"), t);
|
|
8
8
|
import k from "maplibre-gl";
|
|
9
9
|
import { Base64 as Po } from "js-base64";
|
|
10
10
|
import Ro from "events";
|
|
11
11
|
import * as Ot from "@maptiler/client";
|
|
12
|
-
import { Language as Oo, getLanguageInfoFromCode as
|
|
12
|
+
import { Language as Oo, getLanguageInfoFromCode as Bn, config as Lr, MapStyle as dt, mapStylePresetList as Cr, expandMapStyle as zo, MapStyleVariant as Fo, ReferenceMapStyle as $o, toLanguageInfo as qn, getLanguageInfoFromFlag as No, geolocation as Vn } from "@maptiler/client";
|
|
13
13
|
import { MapStyle as dd, MapStyleVariant as hd, ReferenceMapStyle as md, ServiceError as yd, areSameLanguages as gd, bufferToPixelDataBrowser as vd, canParsePixelData as bd, circumferenceAtLatitude as wd, coordinates as Sd, data as xd, elevation as kd, expandMapStyle as Ed, geolocation as Ld, getAutoLanguage as Cd, getBufferToPixelDataParser as Ad, getLanguageInfoFromCode as Td, getLanguageInfoFromFlag as Id, getLanguageInfoFromKey as _d, getTileCache as Md, isLanguageInfo as Pd, mapStylePresetList as Rd, math as Od, misc as zd, staticMaps as Fd, styleToStyle as $d, toLanguageInfo as Nd } from "@maptiler/client";
|
|
14
|
-
import { v4 as
|
|
14
|
+
import { v4 as dn } from "uuid";
|
|
15
15
|
(function() {
|
|
16
16
|
typeof window > "u" || (window.requestIdleCallback = window.requestIdleCallback || function(r) {
|
|
17
17
|
const e = Date.now();
|
|
@@ -201,12 +201,12 @@ const O = {
|
|
|
201
201
|
},
|
|
202
202
|
...Oo
|
|
203
203
|
};
|
|
204
|
-
function
|
|
204
|
+
function Gn() {
|
|
205
205
|
if (typeof navigator > "u") {
|
|
206
|
-
const e = Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0], t =
|
|
206
|
+
const e = Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0], t = Bn(e);
|
|
207
207
|
return t || O.ENGLISH;
|
|
208
208
|
}
|
|
209
|
-
return Array.from(new Set(navigator.languages.map((e) => e.split("-")[0]))).map((e) =>
|
|
209
|
+
return Array.from(new Set(navigator.languages.map((e) => e.split("-")[0]))).map((e) => Bn(e)).filter((e) => e)[0] ?? O.LOCAL;
|
|
210
210
|
}
|
|
211
211
|
const Y = {
|
|
212
212
|
maptilerLogoURL: "https://api.maptiler.com/resources/logo.svg",
|
|
@@ -220,7 +220,7 @@ const Y = {
|
|
|
220
220
|
terrainSourceId: "maptiler-terrain"
|
|
221
221
|
};
|
|
222
222
|
Object.freeze(Y);
|
|
223
|
-
const ir =
|
|
223
|
+
const ir = dn();
|
|
224
224
|
class Vo extends Ro {
|
|
225
225
|
constructor() {
|
|
226
226
|
super(...arguments);
|
|
@@ -312,7 +312,7 @@ class Vo extends Ro {
|
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
const j = new Vo();
|
|
315
|
-
class
|
|
315
|
+
class Hn extends Uo {
|
|
316
316
|
constructor(t = {}) {
|
|
317
317
|
super(t);
|
|
318
318
|
y(this, "logoURL", "");
|
|
@@ -325,7 +325,7 @@ class Gn extends Uo {
|
|
|
325
325
|
return n.style.backgroundRepeat = "no-repeat", n.style.cursor = "pointer", n.style.display = "block", n.style.height = "23px", n.style.margin = "0 0 -4px -4px", n.style.overflow = "hidden", n.style.width = "88px", n.style.backgroundImage = `url(${this.logoURL})`, n.style.backgroundSize = "100px 30px", n.style.width = "100px", n.style.height = "30px", n.target = "_blank", n.rel = "noopener", n.href = this.linkURL, n.setAttribute("aria-label", "MapTiler logo"), n.setAttribute("rel", "noopener"), this._container.appendChild(n), this._container.style.display = "block", this._map.on("resize", this._updateCompact), this._updateCompact(), this._container;
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
const qr = "localcache_source", Vr = "localcache", Go = "maptiler_sdk", Ho = 1e3, Ko = 100, Gr = typeof caches < "u", { addProtocol:
|
|
328
|
+
const qr = "localcache_source", Vr = "localcache", Go = "maptiler_sdk", Ho = 1e3, Ko = 100, Gr = typeof caches < "u", { addProtocol: Kn } = k;
|
|
329
329
|
function Zo(r, e) {
|
|
330
330
|
if (Gr && j.caching && j.session && r.host === Y.maptilerApiHost) {
|
|
331
331
|
if (e === "Source" && r.href.includes("tiles.json"))
|
|
@@ -339,14 +339,14 @@ let Ar;
|
|
|
339
339
|
async function Ja() {
|
|
340
340
|
return Ar || (Ar = await caches.open(Go)), Ar;
|
|
341
341
|
}
|
|
342
|
-
let
|
|
342
|
+
let Zn = 0;
|
|
343
343
|
async function Xo() {
|
|
344
344
|
const r = await Ja(), e = await r.keys(), t = e.slice(0, Math.max(e.length - Ho, 0));
|
|
345
345
|
for (const n of t)
|
|
346
346
|
r.delete(n);
|
|
347
347
|
}
|
|
348
348
|
function Wo() {
|
|
349
|
-
|
|
349
|
+
Kn(
|
|
350
350
|
qr,
|
|
351
351
|
async (r, e) => {
|
|
352
352
|
if (!r.url) throw new Error("");
|
|
@@ -360,7 +360,7 @@ function Wo() {
|
|
|
360
360
|
expires: n.headers.get("Expires")
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
|
-
),
|
|
363
|
+
), Kn(Vr, async (r, e) => {
|
|
364
364
|
if (!r.url) throw new Error("");
|
|
365
365
|
r.url = r.url.replace(`${Vr}://`, "https://");
|
|
366
366
|
const t = new URL(r.url), n = new URL(t);
|
|
@@ -378,7 +378,7 @@ function Wo() {
|
|
|
378
378
|
c.signal = e.signal;
|
|
379
379
|
const p = await fetch(o, c);
|
|
380
380
|
return p.status >= 200 && p.status < 300 && (l.put(a, p.clone()).catch(() => {
|
|
381
|
-
}), ++
|
|
381
|
+
}), ++Zn > Ko && (Xo(), Zn = 0)), s(p);
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
384
|
async function Yo(r) {
|
|
@@ -395,7 +395,7 @@ function Jo(r, e) {
|
|
|
395
395
|
for (const t of r)
|
|
396
396
|
typeof e[t] == "function" && (e[t] = e[t].bind(e));
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function Xn(r, e) {
|
|
399
399
|
let t = null;
|
|
400
400
|
try {
|
|
401
401
|
t = new URL(r);
|
|
@@ -408,16 +408,16 @@ function Zn(r, e) {
|
|
|
408
408
|
url: Zo(t, e)
|
|
409
409
|
};
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function Wn(r) {
|
|
412
412
|
return async (e, t) => {
|
|
413
413
|
if (r != null) {
|
|
414
|
-
const n = await r(e, t), a =
|
|
414
|
+
const n = await r(e, t), a = Xn((n == null ? void 0 : n.url) ?? "", t);
|
|
415
415
|
return {
|
|
416
416
|
...n,
|
|
417
417
|
...a
|
|
418
418
|
};
|
|
419
419
|
}
|
|
420
|
-
return
|
|
420
|
+
return Xn(e, t);
|
|
421
421
|
};
|
|
422
422
|
}
|
|
423
423
|
function Qa() {
|
|
@@ -3825,14 +3825,14 @@ class ve extends Error {
|
|
|
3825
3825
|
super(t), this.message = t, this.key = e;
|
|
3826
3826
|
}
|
|
3827
3827
|
}
|
|
3828
|
-
class
|
|
3828
|
+
class hn {
|
|
3829
3829
|
constructor(e, t = []) {
|
|
3830
3830
|
this.parent = e, this.bindings = {};
|
|
3831
3831
|
for (const [n, a] of t)
|
|
3832
3832
|
this.bindings[n] = a;
|
|
3833
3833
|
}
|
|
3834
3834
|
concat(e) {
|
|
3835
|
-
return new
|
|
3835
|
+
return new hn(this, e);
|
|
3836
3836
|
}
|
|
3837
3837
|
get(e) {
|
|
3838
3838
|
if (this.bindings[e])
|
|
@@ -3897,7 +3897,7 @@ function vt(r, e) {
|
|
|
3897
3897
|
}
|
|
3898
3898
|
return `Expected ${D(r)} but found ${D(e)} instead.`;
|
|
3899
3899
|
}
|
|
3900
|
-
function
|
|
3900
|
+
function mn(r, e) {
|
|
3901
3901
|
return e.some((t) => t.kind === r.kind);
|
|
3902
3902
|
}
|
|
3903
3903
|
function Ve(r, e) {
|
|
@@ -4015,9 +4015,9 @@ function ll(r) {
|
|
|
4015
4015
|
et(+s / C, 0, 1),
|
|
4016
4016
|
et(+c / C, 0, 1),
|
|
4017
4017
|
et(+d / C, 0, 1),
|
|
4018
|
-
g ?
|
|
4018
|
+
g ? Yn(+g, b) : 1
|
|
4019
4019
|
];
|
|
4020
|
-
if (
|
|
4020
|
+
if (Jn(L))
|
|
4021
4021
|
return L;
|
|
4022
4022
|
}
|
|
4023
4023
|
}
|
|
@@ -4051,9 +4051,9 @@ function ll(r) {
|
|
|
4051
4051
|
+i,
|
|
4052
4052
|
et(+s, 0, 100),
|
|
4053
4053
|
et(+u, 0, 100),
|
|
4054
|
-
p ?
|
|
4054
|
+
p ? Yn(+p, f) : 1
|
|
4055
4055
|
];
|
|
4056
|
-
if (
|
|
4056
|
+
if (Jn(h))
|
|
4057
4057
|
return ol(h);
|
|
4058
4058
|
}
|
|
4059
4059
|
}
|
|
@@ -4061,13 +4061,13 @@ function ll(r) {
|
|
|
4061
4061
|
function zt(r) {
|
|
4062
4062
|
return parseInt(r.padEnd(2, r), 16) / 255;
|
|
4063
4063
|
}
|
|
4064
|
-
function
|
|
4064
|
+
function Yn(r, e) {
|
|
4065
4065
|
return et(e ? r / 100 : r, 0, 1);
|
|
4066
4066
|
}
|
|
4067
4067
|
function et(r, e, t) {
|
|
4068
4068
|
return Math.min(Math.max(e, r), t);
|
|
4069
4069
|
}
|
|
4070
|
-
function
|
|
4070
|
+
function Jn(r) {
|
|
4071
4071
|
return !r.some(Number.isNaN);
|
|
4072
4072
|
}
|
|
4073
4073
|
const ul = {
|
|
@@ -4354,7 +4354,7 @@ $.black = new $(0, 0, 0, 1);
|
|
|
4354
4354
|
$.white = new $(1, 1, 1, 1);
|
|
4355
4355
|
$.transparent = new $(0, 0, 0, 0);
|
|
4356
4356
|
$.red = new $(1, 0, 0, 1);
|
|
4357
|
-
class
|
|
4357
|
+
class yn {
|
|
4358
4358
|
constructor(e, t, n) {
|
|
4359
4359
|
e ? this.sensitivity = t ? "variant" : "case" : this.sensitivity = t ? "accent" : "base", this.locale = n, this.collator = new Intl.Collator(this.locale ? this.locale : [], {
|
|
4360
4360
|
sensitivity: this.sensitivity,
|
|
@@ -4585,7 +4585,7 @@ function li(r, e, t, n) {
|
|
|
4585
4585
|
return typeof r == "number" && r >= 0 && r <= 255 && typeof e == "number" && e >= 0 && e <= 255 && typeof t == "number" && t >= 0 && t <= 255 ? typeof n > "u" || typeof n == "number" && n >= 0 && n <= 1 ? null : `Invalid rgba value [${[r, e, t, n].join(", ")}]: 'a' must be between 0 and 1.` : `Invalid rgba value [${(typeof n == "number" ? [r, e, t, n] : [r, e, t]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`;
|
|
4586
4586
|
}
|
|
4587
4587
|
function wt(r) {
|
|
4588
|
-
if (r === null || typeof r == "string" || typeof r == "boolean" || typeof r == "number" || r instanceof pe || r instanceof $ || r instanceof
|
|
4588
|
+
if (r === null || typeof r == "string" || typeof r == "boolean" || typeof r == "number" || r instanceof pe || r instanceof $ || r instanceof yn || r instanceof Ee || r instanceof de || r instanceof he || r instanceof ie || r instanceof we || r instanceof je)
|
|
4589
4589
|
return !0;
|
|
4590
4590
|
if (Array.isArray(r)) {
|
|
4591
4591
|
for (const e of r)
|
|
@@ -4613,7 +4613,7 @@ function H(r) {
|
|
|
4613
4613
|
return be;
|
|
4614
4614
|
if (r instanceof pe)
|
|
4615
4615
|
return lr;
|
|
4616
|
-
if (r instanceof
|
|
4616
|
+
if (r instanceof yn)
|
|
4617
4617
|
return ur;
|
|
4618
4618
|
if (r instanceof Ee)
|
|
4619
4619
|
return cr;
|
|
@@ -4734,7 +4734,7 @@ class fe {
|
|
|
4734
4734
|
return this.args.every((e) => e.outputDefined());
|
|
4735
4735
|
}
|
|
4736
4736
|
}
|
|
4737
|
-
const
|
|
4737
|
+
const Qn = {
|
|
4738
4738
|
"to-boolean": P,
|
|
4739
4739
|
"to-color": be,
|
|
4740
4740
|
"to-number": S,
|
|
@@ -4748,11 +4748,11 @@ class Re {
|
|
|
4748
4748
|
if (e.length < 2)
|
|
4749
4749
|
return t.error("Expected at least one argument.");
|
|
4750
4750
|
const n = e[0];
|
|
4751
|
-
if (!
|
|
4751
|
+
if (!Qn[n])
|
|
4752
4752
|
throw new Error(`Can't parse ${n} as it is not part of the known types`);
|
|
4753
4753
|
if ((n === "to-boolean" || n === "to-string") && e.length !== 2)
|
|
4754
4754
|
return t.error("Expected one argument.");
|
|
4755
|
-
const a =
|
|
4755
|
+
const a = Qn[n], i = [];
|
|
4756
4756
|
for (let o = 1; o < e.length; o++) {
|
|
4757
4757
|
const s = t.parse(e[o], o, M);
|
|
4758
4758
|
if (!s)
|
|
@@ -4873,7 +4873,7 @@ class ui {
|
|
|
4873
4873
|
}
|
|
4874
4874
|
}
|
|
4875
4875
|
class hr {
|
|
4876
|
-
constructor(e, t, n = [], a, i = new
|
|
4876
|
+
constructor(e, t, n = [], a, i = new hn(), o = []) {
|
|
4877
4877
|
this.registry = e, this.path = n, this.key = n.map((s) => `[${s}]`).join(""), this.scope = i, this.errors = o, this.expectedType = a, this._isConstant = t;
|
|
4878
4878
|
}
|
|
4879
4879
|
/**
|
|
@@ -5012,7 +5012,7 @@ class yr {
|
|
|
5012
5012
|
return !1;
|
|
5013
5013
|
}
|
|
5014
5014
|
}
|
|
5015
|
-
class
|
|
5015
|
+
class gn {
|
|
5016
5016
|
constructor(e, t, n) {
|
|
5017
5017
|
this.type = e, this.index = t, this.input = n;
|
|
5018
5018
|
}
|
|
@@ -5023,7 +5023,7 @@ class yn {
|
|
|
5023
5023
|
if (!n || !a)
|
|
5024
5024
|
return null;
|
|
5025
5025
|
const i = a.type;
|
|
5026
|
-
return new
|
|
5026
|
+
return new gn(i.itemType, n, a);
|
|
5027
5027
|
}
|
|
5028
5028
|
evaluate(e) {
|
|
5029
5029
|
const t = this.index.evaluate(e), n = this.input.evaluate(e);
|
|
@@ -5042,7 +5042,7 @@ class yn {
|
|
|
5042
5042
|
return !1;
|
|
5043
5043
|
}
|
|
5044
5044
|
}
|
|
5045
|
-
class
|
|
5045
|
+
class vn {
|
|
5046
5046
|
constructor(e, t) {
|
|
5047
5047
|
this.type = P, this.needle = e, this.haystack = t;
|
|
5048
5048
|
}
|
|
@@ -5050,7 +5050,7 @@ class gn {
|
|
|
5050
5050
|
if (e.length !== 3)
|
|
5051
5051
|
return t.error(`Expected 2 arguments, but found ${e.length - 1} instead.`);
|
|
5052
5052
|
const n = t.parse(e[1], 1, M), a = t.parse(e[2], 2, M);
|
|
5053
|
-
return !n || !a ? null :
|
|
5053
|
+
return !n || !a ? null : mn(n.type, [P, I, S, sr, M]) ? new vn(n, a) : t.error(`Expected first argument to be of type boolean, string, number or null, but found ${D(n.type)} instead`);
|
|
5054
5054
|
}
|
|
5055
5055
|
evaluate(e) {
|
|
5056
5056
|
const t = this.needle.evaluate(e), n = this.haystack.evaluate(e);
|
|
@@ -5079,7 +5079,7 @@ class Xt {
|
|
|
5079
5079
|
const n = t.parse(e[1], 1, M), a = t.parse(e[2], 2, M);
|
|
5080
5080
|
if (!n || !a)
|
|
5081
5081
|
return null;
|
|
5082
|
-
if (!
|
|
5082
|
+
if (!mn(n.type, [P, I, S, sr, M]))
|
|
5083
5083
|
return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${D(n.type)} instead`);
|
|
5084
5084
|
if (e.length === 4) {
|
|
5085
5085
|
const i = t.parse(e[3], 3, S);
|
|
@@ -5108,7 +5108,7 @@ class Xt {
|
|
|
5108
5108
|
return !1;
|
|
5109
5109
|
}
|
|
5110
5110
|
}
|
|
5111
|
-
class
|
|
5111
|
+
class bn {
|
|
5112
5112
|
constructor(e, t, n, a, i, o) {
|
|
5113
5113
|
this.inputType = e, this.type = t, this.input = n, this.cases = a, this.outputs = i, this.otherwise = o;
|
|
5114
5114
|
}
|
|
@@ -5151,7 +5151,7 @@ class vn {
|
|
|
5151
5151
|
if (!s)
|
|
5152
5152
|
return null;
|
|
5153
5153
|
const l = t.parse(e[e.length - 1], e.length - 1, a);
|
|
5154
|
-
return !l || s.type.kind !== "value" && t.concat(1).checkSubtype(n, s.type) ? null : new
|
|
5154
|
+
return !l || s.type.kind !== "value" && t.concat(1).checkSubtype(n, s.type) ? null : new bn(n, a, s, i, o, l);
|
|
5155
5155
|
}
|
|
5156
5156
|
evaluate(e) {
|
|
5157
5157
|
const t = this.input.evaluate(e);
|
|
@@ -5164,7 +5164,7 @@ class vn {
|
|
|
5164
5164
|
return this.outputs.every((e) => e.outputDefined()) && this.otherwise.outputDefined();
|
|
5165
5165
|
}
|
|
5166
5166
|
}
|
|
5167
|
-
class
|
|
5167
|
+
class wn {
|
|
5168
5168
|
constructor(e, t, n) {
|
|
5169
5169
|
this.type = e, this.branches = t, this.otherwise = n;
|
|
5170
5170
|
}
|
|
@@ -5190,7 +5190,7 @@ class bn {
|
|
|
5190
5190
|
return null;
|
|
5191
5191
|
if (!n)
|
|
5192
5192
|
throw new Error("Can't infer output type");
|
|
5193
|
-
return new
|
|
5193
|
+
return new wn(n, a, i);
|
|
5194
5194
|
}
|
|
5195
5195
|
evaluate(e) {
|
|
5196
5196
|
for (const [t, n] of this.branches)
|
|
@@ -5217,7 +5217,7 @@ class Wt {
|
|
|
5217
5217
|
const n = t.parse(e[1], 1, M), a = t.parse(e[2], 2, S);
|
|
5218
5218
|
if (!n || !a)
|
|
5219
5219
|
return null;
|
|
5220
|
-
if (!
|
|
5220
|
+
if (!mn(n.type, [J(M), I, M]))
|
|
5221
5221
|
return t.error(`Expected first argument to be of type array or string, but found ${D(n.type)} instead`);
|
|
5222
5222
|
if (e.length === 4) {
|
|
5223
5223
|
const i = t.parse(e[3], 3, S);
|
|
@@ -5310,10 +5310,10 @@ class gr {
|
|
|
5310
5310
|
function dl(r) {
|
|
5311
5311
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
5312
5312
|
}
|
|
5313
|
-
var Pr,
|
|
5313
|
+
var Pr, ea;
|
|
5314
5314
|
function hl() {
|
|
5315
|
-
if (
|
|
5316
|
-
|
|
5315
|
+
if (ea) return Pr;
|
|
5316
|
+
ea = 1, Pr = r;
|
|
5317
5317
|
function r(e, t, n, a) {
|
|
5318
5318
|
this.cx = 3 * e, this.bx = 3 * (n - e) - this.cx, this.ax = 1 - this.cx - this.bx, this.cy = 3 * t, this.by = 3 * (a - t) - this.cy, this.ay = 1 - this.cy - this.by, this.p1x = e, this.p1y = t, this.p2x = n, this.p2y = a;
|
|
5319
5319
|
}
|
|
@@ -5509,7 +5509,7 @@ class St {
|
|
|
5509
5509
|
return this.args.every((e) => e.outputDefined());
|
|
5510
5510
|
}
|
|
5511
5511
|
}
|
|
5512
|
-
function
|
|
5512
|
+
function ta(r, e) {
|
|
5513
5513
|
return r === "==" || r === "!=" ? e.kind === "boolean" || e.kind === "string" || e.kind === "number" || e.kind === "null" || e.kind === "value" : e.kind === "string" || e.kind === "number" || e.kind === "value";
|
|
5514
5514
|
}
|
|
5515
5515
|
function gl(r, e, t) {
|
|
@@ -5561,12 +5561,12 @@ function ut(r, e, t) {
|
|
|
5561
5561
|
let l = o.parse(i[1], 1, M);
|
|
5562
5562
|
if (!l)
|
|
5563
5563
|
return null;
|
|
5564
|
-
if (!
|
|
5564
|
+
if (!ta(s, l.type))
|
|
5565
5565
|
return o.concat(1).error(`"${s}" comparisons are not supported for type '${D(l.type)}'.`);
|
|
5566
5566
|
let u = o.parse(i[2], 2, M);
|
|
5567
5567
|
if (!u)
|
|
5568
5568
|
return null;
|
|
5569
|
-
if (!
|
|
5569
|
+
if (!ta(s, u.type))
|
|
5570
5570
|
return o.concat(2).error(`"${s}" comparisons are not supported for type '${D(u.type)}'.`);
|
|
5571
5571
|
if (l.type.kind !== u.type.kind && l.type.kind !== "value" && u.type.kind !== "value")
|
|
5572
5572
|
return o.error(`Cannot compare types '${D(l.type)}' and '${D(u.type)}'.`);
|
|
@@ -5623,7 +5623,7 @@ class vr {
|
|
|
5623
5623
|
return n.locale && (o = t.parse(n.locale, 1, I), !o) ? null : new vr(a, i, o);
|
|
5624
5624
|
}
|
|
5625
5625
|
evaluate(e) {
|
|
5626
|
-
return new
|
|
5626
|
+
return new yn(this.caseSensitive.evaluate(e), this.diacriticSensitive.evaluate(e), this.locale ? this.locale.evaluate(e) : null);
|
|
5627
5627
|
}
|
|
5628
5628
|
eachChild(e) {
|
|
5629
5629
|
e(this.caseSensitive), e(this.diacriticSensitive), this.locale && e(this.locale);
|
|
@@ -5632,7 +5632,7 @@ class vr {
|
|
|
5632
5632
|
return !1;
|
|
5633
5633
|
}
|
|
5634
5634
|
}
|
|
5635
|
-
class
|
|
5635
|
+
class Sn {
|
|
5636
5636
|
constructor(e, t, n, a, i, o) {
|
|
5637
5637
|
this.type = I, this.number = e, this.locale = t, this.currency = n, this.unit = a, this.minFractionDigits = i, this.maxFractionDigits = o;
|
|
5638
5638
|
}
|
|
@@ -5660,7 +5660,7 @@ class wn {
|
|
|
5660
5660
|
if (a["min-fraction-digits"] && (l = t.parse(a["min-fraction-digits"], 1, S), !l))
|
|
5661
5661
|
return null;
|
|
5662
5662
|
let u = null;
|
|
5663
|
-
return a["max-fraction-digits"] && (u = t.parse(a["max-fraction-digits"], 1, S), !u) ? null : new
|
|
5663
|
+
return a["max-fraction-digits"] && (u = t.parse(a["max-fraction-digits"], 1, S), !u) ? null : new Sn(n, i, o, s, l, u);
|
|
5664
5664
|
}
|
|
5665
5665
|
evaluate(e) {
|
|
5666
5666
|
return new Intl.NumberFormat(this.locale ? this.locale.evaluate(e) : [], {
|
|
@@ -5678,7 +5678,7 @@ class wn {
|
|
|
5678
5678
|
return !1;
|
|
5679
5679
|
}
|
|
5680
5680
|
}
|
|
5681
|
-
class
|
|
5681
|
+
class xn {
|
|
5682
5682
|
constructor(e) {
|
|
5683
5683
|
this.type = cr, this.sections = e;
|
|
5684
5684
|
}
|
|
@@ -5728,7 +5728,7 @@ class Sn {
|
|
|
5728
5728
|
});
|
|
5729
5729
|
}
|
|
5730
5730
|
}
|
|
5731
|
-
return new
|
|
5731
|
+
return new xn(a);
|
|
5732
5732
|
}
|
|
5733
5733
|
evaluate(e) {
|
|
5734
5734
|
const t = (n) => {
|
|
@@ -5745,7 +5745,7 @@ class Sn {
|
|
|
5745
5745
|
return !1;
|
|
5746
5746
|
}
|
|
5747
5747
|
}
|
|
5748
|
-
class
|
|
5748
|
+
class kn {
|
|
5749
5749
|
constructor(e) {
|
|
5750
5750
|
this.type = It, this.input = e;
|
|
5751
5751
|
}
|
|
@@ -5753,7 +5753,7 @@ class xn {
|
|
|
5753
5753
|
if (e.length !== 2)
|
|
5754
5754
|
return t.error("Expected two arguments.");
|
|
5755
5755
|
const n = t.parse(e[1], 1, I);
|
|
5756
|
-
return n ? new
|
|
5756
|
+
return n ? new kn(n) : t.error("No image name provided.");
|
|
5757
5757
|
}
|
|
5758
5758
|
evaluate(e) {
|
|
5759
5759
|
const t = this.input.evaluate(e), n = je.fromString(t);
|
|
@@ -5766,7 +5766,7 @@ class xn {
|
|
|
5766
5766
|
return !1;
|
|
5767
5767
|
}
|
|
5768
5768
|
}
|
|
5769
|
-
class
|
|
5769
|
+
class En {
|
|
5770
5770
|
constructor(e) {
|
|
5771
5771
|
this.type = S, this.input = e;
|
|
5772
5772
|
}
|
|
@@ -5774,7 +5774,7 @@ class kn {
|
|
|
5774
5774
|
if (e.length !== 2)
|
|
5775
5775
|
return t.error(`Expected 1 argument, but found ${e.length - 1} instead.`);
|
|
5776
5776
|
const n = t.parse(e[1], 1);
|
|
5777
|
-
return n ? n.type.kind !== "array" && n.type.kind !== "string" && n.type.kind !== "value" ? t.error(`Expected argument of type string or array, but found ${D(n.type)} instead.`) : new
|
|
5777
|
+
return n ? n.type.kind !== "array" && n.type.kind !== "string" && n.type.kind !== "value" ? t.error(`Expected argument of type string or array, but found ${D(n.type)} instead.`) : new En(n) : null;
|
|
5778
5778
|
}
|
|
5779
5779
|
evaluate(e) {
|
|
5780
5780
|
const t = this.input.evaluate(e);
|
|
@@ -5796,7 +5796,7 @@ function Ol(r, e) {
|
|
|
5796
5796
|
const t = zl(r[0]), n = $l(r[1]), a = Math.pow(2, e.z);
|
|
5797
5797
|
return [Math.round(t * a * xe), Math.round(n * a * xe)];
|
|
5798
5798
|
}
|
|
5799
|
-
function
|
|
5799
|
+
function Ln(r, e) {
|
|
5800
5800
|
const t = Math.pow(2, e.z), n = (r[0] / xe + e.x) / t, a = (r[1] / xe + e.y) / t;
|
|
5801
5801
|
return [Fl(n), Nl(a)];
|
|
5802
5802
|
}
|
|
@@ -5827,7 +5827,7 @@ function Dl(r, e, t) {
|
|
|
5827
5827
|
}
|
|
5828
5828
|
function br(r, e, t, n) {
|
|
5829
5829
|
const a = [e[0] - r[0], e[1] - r[1]], i = [n[0] - t[0], n[1] - t[1]];
|
|
5830
|
-
return Vl(i, a) === 0 ? !1 : !!(
|
|
5830
|
+
return Vl(i, a) === 0 ? !1 : !!(ra(r, e, t, n) && ra(t, n, r, e));
|
|
5831
5831
|
}
|
|
5832
5832
|
function Ul(r, e, t) {
|
|
5833
5833
|
for (const n of t)
|
|
@@ -5870,11 +5870,11 @@ function ql(r, e) {
|
|
|
5870
5870
|
function Vl(r, e) {
|
|
5871
5871
|
return r[0] * e[1] - r[1] * e[0];
|
|
5872
5872
|
}
|
|
5873
|
-
function
|
|
5873
|
+
function ra(r, e, t, n) {
|
|
5874
5874
|
const a = r[0] - t[0], i = r[1] - t[1], o = e[0] - t[0], s = e[1] - t[1], l = n[0] - t[0], u = n[1] - t[1], c = a * u - l * i, p = o * u - l * s;
|
|
5875
5875
|
return c > 0 && p < 0 || c < 0 && p > 0;
|
|
5876
5876
|
}
|
|
5877
|
-
function
|
|
5877
|
+
function Cn(r, e, t) {
|
|
5878
5878
|
const n = [];
|
|
5879
5879
|
for (let a = 0; a < r.length; a++) {
|
|
5880
5880
|
const i = [];
|
|
@@ -5889,7 +5889,7 @@ function Ln(r, e, t) {
|
|
|
5889
5889
|
function hi(r, e, t) {
|
|
5890
5890
|
const n = [];
|
|
5891
5891
|
for (let a = 0; a < r.length; a++) {
|
|
5892
|
-
const i =
|
|
5892
|
+
const i = Cn(r[a], e, t);
|
|
5893
5893
|
n.push(i);
|
|
5894
5894
|
}
|
|
5895
5895
|
return n;
|
|
@@ -5905,7 +5905,7 @@ function mi(r, e, t, n) {
|
|
|
5905
5905
|
function Gl(r) {
|
|
5906
5906
|
r[0] = r[1] = 1 / 0, r[2] = r[3] = -1 / 0;
|
|
5907
5907
|
}
|
|
5908
|
-
function
|
|
5908
|
+
function na(r, e, t, n) {
|
|
5909
5909
|
const a = Math.pow(2, n.z) * xe, i = [n.x * xe, n.y * xe], o = [];
|
|
5910
5910
|
for (const s of r)
|
|
5911
5911
|
for (const l of s) {
|
|
@@ -5914,7 +5914,7 @@ function ra(r, e, t, n) {
|
|
|
5914
5914
|
}
|
|
5915
5915
|
return o;
|
|
5916
5916
|
}
|
|
5917
|
-
function
|
|
5917
|
+
function aa(r, e, t, n) {
|
|
5918
5918
|
const a = Math.pow(2, n.z) * xe, i = [n.x * xe, n.y * xe], o = [];
|
|
5919
5919
|
for (const s of r) {
|
|
5920
5920
|
const l = [];
|
|
@@ -5935,7 +5935,7 @@ function na(r, e, t, n) {
|
|
|
5935
5935
|
function Hl(r, e) {
|
|
5936
5936
|
const t = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n = [1 / 0, 1 / 0, -1 / 0, -1 / 0], a = r.canonicalID();
|
|
5937
5937
|
if (e.type === "Polygon") {
|
|
5938
|
-
const i =
|
|
5938
|
+
const i = Cn(e.coordinates, n, a), o = na(r.geometry(), t, n, a);
|
|
5939
5939
|
if (!xt(t, n))
|
|
5940
5940
|
return !1;
|
|
5941
5941
|
for (const s of o)
|
|
@@ -5943,7 +5943,7 @@ function Hl(r, e) {
|
|
|
5943
5943
|
return !1;
|
|
5944
5944
|
}
|
|
5945
5945
|
if (e.type === "MultiPolygon") {
|
|
5946
|
-
const i = hi(e.coordinates, n, a), o =
|
|
5946
|
+
const i = hi(e.coordinates, n, a), o = na(r.geometry(), t, n, a);
|
|
5947
5947
|
if (!xt(t, n))
|
|
5948
5948
|
return !1;
|
|
5949
5949
|
for (const s of o)
|
|
@@ -5955,7 +5955,7 @@ function Hl(r, e) {
|
|
|
5955
5955
|
function Kl(r, e) {
|
|
5956
5956
|
const t = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n = [1 / 0, 1 / 0, -1 / 0, -1 / 0], a = r.canonicalID();
|
|
5957
5957
|
if (e.type === "Polygon") {
|
|
5958
|
-
const i =
|
|
5958
|
+
const i = Cn(e.coordinates, n, a), o = aa(r.geometry(), t, n, a);
|
|
5959
5959
|
if (!xt(t, n))
|
|
5960
5960
|
return !1;
|
|
5961
5961
|
for (const s of o)
|
|
@@ -5963,7 +5963,7 @@ function Kl(r, e) {
|
|
|
5963
5963
|
return !1;
|
|
5964
5964
|
}
|
|
5965
5965
|
if (e.type === "MultiPolygon") {
|
|
5966
|
-
const i = hi(e.coordinates, n, a), o =
|
|
5966
|
+
const i = hi(e.coordinates, n, a), o = aa(r.geometry(), t, n, a);
|
|
5967
5967
|
if (!xt(t, n))
|
|
5968
5968
|
return !1;
|
|
5969
5969
|
for (const s of o)
|
|
@@ -6071,11 +6071,11 @@ function Xl(r) {
|
|
|
6071
6071
|
i = r[t], o = r[a], e += (o.x - i.x) * (i.y + o.y);
|
|
6072
6072
|
return e;
|
|
6073
6073
|
}
|
|
6074
|
-
const Wl = 6378.137,
|
|
6075
|
-
class
|
|
6074
|
+
const Wl = 6378.137, ia = 1 / 298.257223563, oa = ia * (2 - ia), sa = Math.PI / 180;
|
|
6075
|
+
class An {
|
|
6076
6076
|
constructor(e) {
|
|
6077
|
-
const t =
|
|
6078
|
-
this.kx = t * i * n, this.ky = t * i * a * (1 -
|
|
6077
|
+
const t = sa * Wl * 1e3, n = Math.cos(e * sa), a = 1 / (1 - oa * (1 - n * n)), i = Math.sqrt(a);
|
|
6078
|
+
this.kx = t * i * n, this.ky = t * i * a * (1 - oa);
|
|
6079
6079
|
}
|
|
6080
6080
|
/**
|
|
6081
6081
|
* Given two points of the form [longitude, latitude], returns the distance.
|
|
@@ -6171,11 +6171,11 @@ function Yr(r) {
|
|
|
6171
6171
|
_t(e, n);
|
|
6172
6172
|
return e;
|
|
6173
6173
|
}
|
|
6174
|
-
function
|
|
6174
|
+
function la(r) {
|
|
6175
6175
|
return r[0] !== -1 / 0 && r[1] !== -1 / 0 && r[2] !== 1 / 0 && r[3] !== 1 / 0;
|
|
6176
6176
|
}
|
|
6177
|
-
function
|
|
6178
|
-
if (!
|
|
6177
|
+
function Tn(r, e, t) {
|
|
6178
|
+
if (!la(r) || !la(e))
|
|
6179
6179
|
return NaN;
|
|
6180
6180
|
let n = 0, a = 0;
|
|
6181
6181
|
return r[2] < e[0] && (n = e[0] - r[2]), r[0] > e[2] && (n = r[0] - e[2]), r[1] > e[3] && (a = r[1] - e[3]), r[3] < e[1] && (a = e[1] - r[3]), t.distance([0, 0], [n, a]);
|
|
@@ -6184,7 +6184,7 @@ function Be(r, e, t) {
|
|
|
6184
6184
|
const n = t.pointOnLine(e, r);
|
|
6185
6185
|
return t.distance(r, n.point);
|
|
6186
6186
|
}
|
|
6187
|
-
function
|
|
6187
|
+
function In(r, e, t, n, a) {
|
|
6188
6188
|
const i = Math.min(Be(r, [t, n], a), Be(e, [t, n], a)), o = Math.min(Be(t, [r, e], a), Be(n, [r, e], a));
|
|
6189
6189
|
return Math.min(i, o);
|
|
6190
6190
|
}
|
|
@@ -6198,7 +6198,7 @@ function Yl(r, e, t, n, a) {
|
|
|
6198
6198
|
const p = t[c], f = t[c + 1];
|
|
6199
6199
|
if (br(l, u, p, f))
|
|
6200
6200
|
return 0;
|
|
6201
|
-
o = Math.min(o,
|
|
6201
|
+
o = Math.min(o, In(l, u, p, f, a));
|
|
6202
6202
|
}
|
|
6203
6203
|
}
|
|
6204
6204
|
return o;
|
|
@@ -6241,12 +6241,12 @@ function eu(r, e, t, n) {
|
|
|
6241
6241
|
const f = l[p], d = l[u];
|
|
6242
6242
|
if (br(o, s, f, d))
|
|
6243
6243
|
return 0;
|
|
6244
|
-
a = Math.min(a,
|
|
6244
|
+
a = Math.min(a, In(o, s, f, d, n));
|
|
6245
6245
|
}
|
|
6246
6246
|
}
|
|
6247
6247
|
return a;
|
|
6248
6248
|
}
|
|
6249
|
-
function
|
|
6249
|
+
function ua(r, e) {
|
|
6250
6250
|
for (const t of r)
|
|
6251
6251
|
for (const n of t)
|
|
6252
6252
|
if (ct(n, e, !0))
|
|
@@ -6255,12 +6255,12 @@ function la(r, e) {
|
|
|
6255
6255
|
}
|
|
6256
6256
|
function tu(r, e, t, n = 1 / 0) {
|
|
6257
6257
|
const a = Yr(r), i = Yr(e);
|
|
6258
|
-
if (n !== 1 / 0 &&
|
|
6258
|
+
if (n !== 1 / 0 && Tn(a, i, t) >= n)
|
|
6259
6259
|
return n;
|
|
6260
6260
|
if (xt(a, i)) {
|
|
6261
|
-
if (
|
|
6261
|
+
if (ua(r, e))
|
|
6262
6262
|
return 0;
|
|
6263
|
-
} else if (
|
|
6263
|
+
} else if (ua(e, r))
|
|
6264
6264
|
return 0;
|
|
6265
6265
|
let o = 1 / 0;
|
|
6266
6266
|
for (const s of r)
|
|
@@ -6271,21 +6271,21 @@ function tu(r, e, t, n = 1 / 0) {
|
|
|
6271
6271
|
const b = d[g], v = d[h];
|
|
6272
6272
|
if (br(p, f, b, v))
|
|
6273
6273
|
return 0;
|
|
6274
|
-
o = Math.min(o,
|
|
6274
|
+
o = Math.min(o, In(p, f, b, v, t));
|
|
6275
6275
|
}
|
|
6276
6276
|
}
|
|
6277
6277
|
return o;
|
|
6278
6278
|
}
|
|
6279
|
-
function
|
|
6279
|
+
function ca(r, e, t, n, a, i) {
|
|
6280
6280
|
if (!i)
|
|
6281
6281
|
return;
|
|
6282
|
-
const o =
|
|
6282
|
+
const o = Tn(Wr(n, i), a, t);
|
|
6283
6283
|
o < e && r.push([o, i, [0, 0]]);
|
|
6284
6284
|
}
|
|
6285
6285
|
function $t(r, e, t, n, a, i, o) {
|
|
6286
6286
|
if (!i || !o)
|
|
6287
6287
|
return;
|
|
6288
|
-
const s =
|
|
6288
|
+
const s = Tn(Wr(n, i), Wr(a, o), t);
|
|
6289
6289
|
s < e && r.push([s, i, o]);
|
|
6290
6290
|
}
|
|
6291
6291
|
function Jt(r, e, t, n, a = 1 / 0) {
|
|
@@ -6314,7 +6314,7 @@ function Jt(r, e, t, n, a = 1 / 0) {
|
|
|
6314
6314
|
}
|
|
6315
6315
|
} else {
|
|
6316
6316
|
const p = Xr(u, e);
|
|
6317
|
-
|
|
6317
|
+
ca(o, i, n, r, s, p[0]), ca(o, i, n, r, s, p[1]);
|
|
6318
6318
|
}
|
|
6319
6319
|
}
|
|
6320
6320
|
return i;
|
|
@@ -6355,10 +6355,10 @@ function Qt(r, e, t, n, a, i = 1 / 0) {
|
|
|
6355
6355
|
return o;
|
|
6356
6356
|
}
|
|
6357
6357
|
function ru(r, e) {
|
|
6358
|
-
const t = r.geometry(), n = t.flat().map((o) =>
|
|
6358
|
+
const t = r.geometry(), n = t.flat().map((o) => Ln([o.x, o.y], r.canonical));
|
|
6359
6359
|
if (t.length === 0)
|
|
6360
6360
|
return NaN;
|
|
6361
|
-
const a = new
|
|
6361
|
+
const a = new An(n[0][1]);
|
|
6362
6362
|
let i = 1 / 0;
|
|
6363
6363
|
for (const o of e) {
|
|
6364
6364
|
switch (o.type) {
|
|
@@ -6378,10 +6378,10 @@ function ru(r, e) {
|
|
|
6378
6378
|
return i;
|
|
6379
6379
|
}
|
|
6380
6380
|
function nu(r, e) {
|
|
6381
|
-
const t = r.geometry(), n = t.flat().map((o) =>
|
|
6381
|
+
const t = r.geometry(), n = t.flat().map((o) => Ln([o.x, o.y], r.canonical));
|
|
6382
6382
|
if (t.length === 0)
|
|
6383
6383
|
return NaN;
|
|
6384
|
-
const a = new
|
|
6384
|
+
const a = new An(n[0][1]);
|
|
6385
6385
|
let i = 1 / 0;
|
|
6386
6386
|
for (const o of e) {
|
|
6387
6387
|
switch (o.type) {
|
|
@@ -6404,7 +6404,7 @@ function au(r, e) {
|
|
|
6404
6404
|
const t = r.geometry();
|
|
6405
6405
|
if (t.length === 0 || t[0].length === 0)
|
|
6406
6406
|
return NaN;
|
|
6407
|
-
const n = Zl(t).map((o) => o.map((s) => s.map((l) =>
|
|
6407
|
+
const n = Zl(t).map((o) => o.map((s) => s.map((l) => Ln([l.x, l.y], r.canonical)))), a = new An(n[0][0][0][1]);
|
|
6408
6408
|
let i = 1 / 0;
|
|
6409
6409
|
for (const o of e)
|
|
6410
6410
|
for (const s of n) {
|
|
@@ -6492,7 +6492,7 @@ class Mt {
|
|
|
6492
6492
|
return !1;
|
|
6493
6493
|
}
|
|
6494
6494
|
}
|
|
6495
|
-
const
|
|
6495
|
+
const _n = {
|
|
6496
6496
|
// special forms
|
|
6497
6497
|
"==": Tl,
|
|
6498
6498
|
"!=": Il,
|
|
@@ -6501,24 +6501,24 @@ const In = {
|
|
|
6501
6501
|
">=": Rl,
|
|
6502
6502
|
"<=": Pl,
|
|
6503
6503
|
array: fe,
|
|
6504
|
-
at:
|
|
6504
|
+
at: gn,
|
|
6505
6505
|
boolean: fe,
|
|
6506
|
-
case:
|
|
6506
|
+
case: wn,
|
|
6507
6507
|
coalesce: St,
|
|
6508
6508
|
collator: vr,
|
|
6509
|
-
format:
|
|
6510
|
-
image:
|
|
6511
|
-
in:
|
|
6509
|
+
format: xn,
|
|
6510
|
+
image: kn,
|
|
6511
|
+
in: vn,
|
|
6512
6512
|
"index-of": Xt,
|
|
6513
6513
|
interpolate: Se,
|
|
6514
6514
|
"interpolate-hcl": Se,
|
|
6515
6515
|
"interpolate-lab": Se,
|
|
6516
|
-
length:
|
|
6516
|
+
length: En,
|
|
6517
6517
|
let: mr,
|
|
6518
6518
|
literal: ot,
|
|
6519
|
-
match:
|
|
6519
|
+
match: bn,
|
|
6520
6520
|
number: fe,
|
|
6521
|
-
"number-format":
|
|
6521
|
+
"number-format": Sn,
|
|
6522
6522
|
object: fe,
|
|
6523
6523
|
slice: Wt,
|
|
6524
6524
|
step: gr,
|
|
@@ -6600,14 +6600,14 @@ class me {
|
|
|
6600
6600
|
e[n] = me;
|
|
6601
6601
|
}
|
|
6602
6602
|
}
|
|
6603
|
-
function
|
|
6603
|
+
function pa(r, [e, t, n, a]) {
|
|
6604
6604
|
e = e.evaluate(r), t = t.evaluate(r), n = n.evaluate(r);
|
|
6605
6605
|
const i = a ? a.evaluate(r) : 1, o = li(e, t, n, i);
|
|
6606
6606
|
if (o)
|
|
6607
6607
|
throw new V(o);
|
|
6608
6608
|
return new $(e / 255, t / 255, n / 255, i, !1);
|
|
6609
6609
|
}
|
|
6610
|
-
function
|
|
6610
|
+
function fa(r, e) {
|
|
6611
6611
|
return r in e;
|
|
6612
6612
|
}
|
|
6613
6613
|
function zr(r, e) {
|
|
@@ -6626,7 +6626,7 @@ function iu(r, e, t, n) {
|
|
|
6626
6626
|
function De(r) {
|
|
6627
6627
|
return { type: r };
|
|
6628
6628
|
}
|
|
6629
|
-
me.register(
|
|
6629
|
+
me.register(_n, {
|
|
6630
6630
|
error: [
|
|
6631
6631
|
Qs,
|
|
6632
6632
|
[I],
|
|
@@ -6643,15 +6643,15 @@ me.register(In, {
|
|
|
6643
6643
|
return [t * 255, n * 255, a * 255, i];
|
|
6644
6644
|
}
|
|
6645
6645
|
],
|
|
6646
|
-
rgb: [be, [S, S, S],
|
|
6647
|
-
rgba: [be, [S, S, S, S],
|
|
6646
|
+
rgb: [be, [S, S, S], pa],
|
|
6647
|
+
rgba: [be, [S, S, S, S], pa],
|
|
6648
6648
|
has: {
|
|
6649
6649
|
type: P,
|
|
6650
6650
|
overloads: [
|
|
6651
|
-
[[I], (r, [e]) =>
|
|
6651
|
+
[[I], (r, [e]) => fa(e.evaluate(r), r.properties())],
|
|
6652
6652
|
[
|
|
6653
6653
|
[I, qe],
|
|
6654
|
-
(r, [e, t]) =>
|
|
6654
|
+
(r, [e, t]) => fa(e.evaluate(r), t.evaluate(r))
|
|
6655
6655
|
]
|
|
6656
6656
|
]
|
|
6657
6657
|
},
|
|
@@ -6995,7 +6995,7 @@ function bi(r) {
|
|
|
6995
6995
|
function R(r) {
|
|
6996
6996
|
return r instanceof Number ? "number" : r instanceof String ? "string" : r instanceof Boolean ? "boolean" : Array.isArray(r) ? "array" : r === null ? "null" : typeof r;
|
|
6997
6997
|
}
|
|
6998
|
-
function
|
|
6998
|
+
function Mn(r) {
|
|
6999
6999
|
return typeof r == "object" && r !== null && !Array.isArray(r) && H(r) === qe;
|
|
7000
7000
|
}
|
|
7001
7001
|
class su {
|
|
@@ -7020,15 +7020,15 @@ class su {
|
|
|
7020
7020
|
}
|
|
7021
7021
|
}
|
|
7022
7022
|
function wi(r) {
|
|
7023
|
-
return Array.isArray(r) && r.length > 0 && typeof r[0] == "string" && r[0] in
|
|
7023
|
+
return Array.isArray(r) && r.length > 0 && typeof r[0] == "string" && r[0] in _n;
|
|
7024
7024
|
}
|
|
7025
7025
|
function Si(r, e, t) {
|
|
7026
|
-
const n = new hr(
|
|
7026
|
+
const n = new hr(_n, er, [], e ? uu(e) : void 0), a = n.parse(r, void 0, void 0, void 0, e && e.type === "string" ? { typeAnnotation: "coerce" } : void 0);
|
|
7027
7027
|
return a ? Jr(new su(a, e, t)) : tt(n.errors);
|
|
7028
7028
|
}
|
|
7029
|
-
class
|
|
7029
|
+
class da {
|
|
7030
7030
|
constructor(e, t, n) {
|
|
7031
|
-
this.kind = e, this._styleExpression = t, this.isStateDependent = e !== "constant" && !kt(t.expression), this.globalStateRefs =
|
|
7031
|
+
this.kind = e, this._styleExpression = t, this.isStateDependent = e !== "constant" && !kt(t.expression), this.globalStateRefs = Pn(t.expression), this._globalState = n;
|
|
7032
7032
|
}
|
|
7033
7033
|
evaluateWithoutErrorHandling(e, t, n, a, i, o) {
|
|
7034
7034
|
return this._globalState && (e = st(e, this._globalState)), this._styleExpression.evaluateWithoutErrorHandling(e, t, n, a, i, o);
|
|
@@ -7037,9 +7037,9 @@ class fa {
|
|
|
7037
7037
|
return this._globalState && (e = st(e, this._globalState)), this._styleExpression.evaluate(e, t, n, a, i, o);
|
|
7038
7038
|
}
|
|
7039
7039
|
}
|
|
7040
|
-
class
|
|
7040
|
+
class ha {
|
|
7041
7041
|
constructor(e, t, n, a, i) {
|
|
7042
|
-
this.kind = e, this.zoomStops = n, this._styleExpression = t, this.isStateDependent = e !== "camera" && !kt(t.expression), this.globalStateRefs =
|
|
7042
|
+
this.kind = e, this.zoomStops = n, this._styleExpression = t, this.isStateDependent = e !== "camera" && !kt(t.expression), this.globalStateRefs = Pn(t.expression), this.interpolationType = a, this._globalState = i;
|
|
7043
7043
|
}
|
|
7044
7044
|
evaluateWithoutErrorHandling(e, t, n, a, i, o) {
|
|
7045
7045
|
return this._globalState && (e = st(e, this._globalState)), this._styleExpression.evaluateWithoutErrorHandling(e, t, n, a, i, o);
|
|
@@ -7073,9 +7073,9 @@ function lu(r, e, t) {
|
|
|
7073
7073
|
new ve("", '"interpolate" expressions cannot be used with this property')
|
|
7074
7074
|
]);
|
|
7075
7075
|
if (!s)
|
|
7076
|
-
return Jr(i ? new
|
|
7076
|
+
return Jr(i ? new da("constant", n.value, t) : new da("source", n.value, t));
|
|
7077
7077
|
const l = s instanceof Se ? s.interpolation : void 0;
|
|
7078
|
-
return Jr(i ? new
|
|
7078
|
+
return Jr(i ? new ha("camera", n.value, s.labels, l, t) : new ha("composite", n.value, s.labels, l, t));
|
|
7079
7079
|
}
|
|
7080
7080
|
function Vt(r) {
|
|
7081
7081
|
let e = null;
|
|
@@ -7091,9 +7091,9 @@ function Vt(r) {
|
|
|
7091
7091
|
n instanceof ve ? e = n : !e && n ? e = new ve("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.') : e && n && e !== n && (e = new ve("", 'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'));
|
|
7092
7092
|
}), e;
|
|
7093
7093
|
}
|
|
7094
|
-
function
|
|
7094
|
+
function Pn(r, e = /* @__PURE__ */ new Set()) {
|
|
7095
7095
|
return r instanceof Mt && e.add(r.key), r.eachChild((t) => {
|
|
7096
|
-
|
|
7096
|
+
Pn(t, e);
|
|
7097
7097
|
}), e;
|
|
7098
7098
|
}
|
|
7099
7099
|
function uu(r) {
|
|
@@ -7114,7 +7114,7 @@ function uu(r) {
|
|
|
7114
7114
|
return r.type === "array" ? J(e[r.value] || M, r.length) : e[r.type];
|
|
7115
7115
|
}
|
|
7116
7116
|
function cu(r) {
|
|
7117
|
-
if (r.type === "color" &&
|
|
7117
|
+
if (r.type === "color" && Mn(r.default))
|
|
7118
7118
|
return new $(0, 0, 0, 0);
|
|
7119
7119
|
switch (r.type) {
|
|
7120
7120
|
case "color":
|
|
@@ -7232,7 +7232,7 @@ function oe(r) {
|
|
|
7232
7232
|
a[c] || n[c].required && n[c].default === void 0 && t[c] === void 0 && l.push(new w(e, t, `missing required property "${c}"`));
|
|
7233
7233
|
return l;
|
|
7234
7234
|
}
|
|
7235
|
-
function
|
|
7235
|
+
function Rn(r) {
|
|
7236
7236
|
const e = r.value, t = r.valueSpec, n = r.validateSpec, a = r.style, i = r.styleSpec, o = r.key, s = r.arrayElementValidator || n;
|
|
7237
7237
|
if (R(e) !== "array")
|
|
7238
7238
|
return [new w(o, e, `array expected, ${R(e)} found`)];
|
|
@@ -7291,7 +7291,7 @@ function Ei(r) {
|
|
|
7291
7291
|
];
|
|
7292
7292
|
let g = [];
|
|
7293
7293
|
const b = m.value;
|
|
7294
|
-
return g = g.concat(
|
|
7294
|
+
return g = g.concat(Rn({
|
|
7295
7295
|
key: m.key,
|
|
7296
7296
|
value: b,
|
|
7297
7297
|
valueSpec: m.valueSpec,
|
|
@@ -7430,7 +7430,7 @@ function Et(r) {
|
|
|
7430
7430
|
const e = r.key, t = r.value, n = r.valueSpec, a = [];
|
|
7431
7431
|
return Array.isArray(n.values) ? n.values.indexOf(G(t)) === -1 && a.push(new w(e, t, `expected one of [${n.values.join(", ")}], ${JSON.stringify(t)} found`)) : Object.keys(n.values).indexOf(G(t)) === -1 && a.push(new w(e, t, `expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(t)} found`)), a;
|
|
7432
7432
|
}
|
|
7433
|
-
function
|
|
7433
|
+
function On(r) {
|
|
7434
7434
|
return xi(Xe(r.value)) ? lt(Zt({}, r, {
|
|
7435
7435
|
expressionContext: "filter",
|
|
7436
7436
|
valueSpec: { value: "boolean" }
|
|
@@ -7514,7 +7514,7 @@ function Ci(r, e) {
|
|
|
7514
7514
|
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(p[1])} }\`.`)
|
|
7515
7515
|
];
|
|
7516
7516
|
const f = [];
|
|
7517
|
-
return r.layerType === "symbol" && s === "text-font" &&
|
|
7517
|
+
return r.layerType === "symbol" && s === "text-font" && Mn(Xe(o)) && G(o.type) === "identity" && f.push(new w(t, o, '"text-font" does not support identity functions')), f.concat(n({
|
|
7518
7518
|
key: r.key,
|
|
7519
7519
|
value: o,
|
|
7520
7520
|
valueSpec: c,
|
|
@@ -7587,7 +7587,7 @@ function Ii(r) {
|
|
|
7587
7587
|
objectKey: "type"
|
|
7588
7588
|
});
|
|
7589
7589
|
},
|
|
7590
|
-
filter:
|
|
7590
|
+
filter: On,
|
|
7591
7591
|
layout(c) {
|
|
7592
7592
|
return oe({
|
|
7593
7593
|
layer: a,
|
|
@@ -7646,7 +7646,7 @@ function fu(r) {
|
|
|
7646
7646
|
})) : s.push(new w(d, n[d], `unknown property "${d}"`));
|
|
7647
7647
|
return s;
|
|
7648
7648
|
}
|
|
7649
|
-
const
|
|
7649
|
+
const ma = {
|
|
7650
7650
|
promoteId: du
|
|
7651
7651
|
};
|
|
7652
7652
|
function _i(r) {
|
|
@@ -7664,7 +7664,7 @@ function _i(r) {
|
|
|
7664
7664
|
valueSpec: n[`source_${o.replace("-", "_")}`],
|
|
7665
7665
|
style: r.style,
|
|
7666
7666
|
styleSpec: n,
|
|
7667
|
-
objectElementValidators:
|
|
7667
|
+
objectElementValidators: ma,
|
|
7668
7668
|
validateSpec: i
|
|
7669
7669
|
}), s;
|
|
7670
7670
|
case "raster-dem":
|
|
@@ -7683,7 +7683,7 @@ function _i(r) {
|
|
|
7683
7683
|
style: a,
|
|
7684
7684
|
styleSpec: n,
|
|
7685
7685
|
validateSpec: i,
|
|
7686
|
-
objectElementValidators:
|
|
7686
|
+
objectElementValidators: ma
|
|
7687
7687
|
}), e.cluster)
|
|
7688
7688
|
for (const l in e.clusterProperties) {
|
|
7689
7689
|
const [u, c] = e.clusterProperties[l], p = typeof u == "string" ? [u, ["accumulated"], ["get", l]] : u;
|
|
@@ -7904,7 +7904,7 @@ function bu(r) {
|
|
|
7904
7904
|
key: `${e}[${o}]`,
|
|
7905
7905
|
value: t[o],
|
|
7906
7906
|
valueSpec: a.layout_symbol["text-anchor"]
|
|
7907
|
-
})), i = i.concat(
|
|
7907
|
+
})), i = i.concat(Rn({
|
|
7908
7908
|
key: `${e}[${o + 1}]`,
|
|
7909
7909
|
value: t[o + 1],
|
|
7910
7910
|
valueSpec: {
|
|
@@ -8031,17 +8031,17 @@ function Eu(r) {
|
|
|
8031
8031
|
}
|
|
8032
8032
|
return o;
|
|
8033
8033
|
}
|
|
8034
|
-
const
|
|
8034
|
+
const ya = {
|
|
8035
8035
|
"*"() {
|
|
8036
8036
|
return [];
|
|
8037
8037
|
},
|
|
8038
|
-
array:
|
|
8038
|
+
array: Rn,
|
|
8039
8039
|
boolean: pu,
|
|
8040
8040
|
number: xr,
|
|
8041
8041
|
color: Qr,
|
|
8042
8042
|
constants: ki,
|
|
8043
8043
|
enum: Et,
|
|
8044
|
-
filter:
|
|
8044
|
+
filter: On,
|
|
8045
8045
|
function: Ei,
|
|
8046
8046
|
layer: Ii,
|
|
8047
8047
|
object: oe,
|
|
@@ -8064,7 +8064,7 @@ const ma = {
|
|
|
8064
8064
|
};
|
|
8065
8065
|
function rr(r) {
|
|
8066
8066
|
const e = r.value, t = r.valueSpec, n = r.styleSpec;
|
|
8067
|
-
return r.validateSpec = rr, t.expression &&
|
|
8067
|
+
return r.validateSpec = rr, t.expression && Mn(G(e)) ? Ei(r) : t.expression && wi(Xe(e)) ? lt(r) : t.type && ya[t.type] ? ya[t.type](r) : oe(Zt({}, r, {
|
|
8068
8068
|
valueSpec: t.type ? n[t.type] : t
|
|
8069
8069
|
}));
|
|
8070
8070
|
}
|
|
@@ -8100,7 +8100,7 @@ se.sky = ge(ye(Pi));
|
|
|
8100
8100
|
se.terrain = ge(ye(Ri));
|
|
8101
8101
|
se.state = ge(ye(Fi));
|
|
8102
8102
|
se.layer = ge(ye(Ii));
|
|
8103
|
-
se.filter = ge(ye(
|
|
8103
|
+
se.filter = ge(ye(On));
|
|
8104
8104
|
se.paintProperty = ge(ye(Ai));
|
|
8105
8105
|
se.layoutProperty = ge(ye(Ti));
|
|
8106
8106
|
function ye(r) {
|
|
@@ -8116,7 +8116,7 @@ function ge(r) {
|
|
|
8116
8116
|
return Ni(r.apply(this, e));
|
|
8117
8117
|
};
|
|
8118
8118
|
}
|
|
8119
|
-
function
|
|
8119
|
+
function ga(r) {
|
|
8120
8120
|
if (!r)
|
|
8121
8121
|
return {
|
|
8122
8122
|
style: dt[Cr[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),
|
|
@@ -8244,11 +8244,11 @@ class Tu extends Ya {
|
|
|
8244
8244
|
return a.clickFunction = n, a;
|
|
8245
8245
|
}
|
|
8246
8246
|
}
|
|
8247
|
-
const
|
|
8247
|
+
const va = k.Marker, ba = k.LngLat, Iu = k.LngLatBounds;
|
|
8248
8248
|
class _u extends Do {
|
|
8249
8249
|
constructor() {
|
|
8250
8250
|
super(...arguments);
|
|
8251
|
-
y(this, "lastUpdatedCenter", new
|
|
8251
|
+
y(this, "lastUpdatedCenter", new ba(0, 0));
|
|
8252
8252
|
/**
|
|
8253
8253
|
* Update the camera location to center on the current position
|
|
8254
8254
|
*
|
|
@@ -8257,7 +8257,7 @@ class _u extends Do {
|
|
|
8257
8257
|
*/
|
|
8258
8258
|
y(this, "_updateCamera", (t) => {
|
|
8259
8259
|
var c;
|
|
8260
|
-
const n = new
|
|
8260
|
+
const n = new ba(t.coords.longitude, t.coords.latitude), a = t.coords.accuracy, o = {
|
|
8261
8261
|
bearing: this._map.getBearing(),
|
|
8262
8262
|
...this.options.fitBoundsOptions,
|
|
8263
8263
|
linear: !0
|
|
@@ -8283,7 +8283,7 @@ class _u extends Do {
|
|
|
8283
8283
|
const n = this._map._getUIString("GeolocateControl.FindMyLocation");
|
|
8284
8284
|
this._geolocateButton.disabled = !1, this._geolocateButton.title = n, this._geolocateButton.setAttribute("aria-label", n);
|
|
8285
8285
|
}
|
|
8286
|
-
this.options.trackUserLocation && (this._geolocateButton.setAttribute("aria-pressed", "false"), this._watchState = "OFF"), this.options.showUserLocation && (this._dotElement = Le("div", "maplibregl-user-location-dot"), this._userLocationDotMarker = new
|
|
8286
|
+
this.options.trackUserLocation && (this._geolocateButton.setAttribute("aria-pressed", "false"), this._watchState = "OFF"), this.options.showUserLocation && (this._dotElement = Le("div", "maplibregl-user-location-dot"), this._userLocationDotMarker = new va({ element: this._dotElement }), this._circleElement = Le("div", "maplibregl-user-location-accuracy-circle"), this._accuracyCircleMarker = new va({
|
|
8287
8287
|
element: this._circleElement,
|
|
8288
8288
|
pitchAlignment: "map"
|
|
8289
8289
|
}), this.options.trackUserLocation && (this._watchState = "OFF"), this._map.on("move", this._onZoom)), this._geolocateButton.addEventListener("click", this.trigger.bind(this)), this._setup = !0, this.options.trackUserLocation && this._map.on("moveend", (n) => {
|
|
@@ -8635,7 +8635,7 @@ function Fu(r, e, t) {
|
|
|
8635
8635
|
var n = t[0], a = t[1], i = t[2];
|
|
8636
8636
|
return r[0] = e[0] * n, r[1] = e[1] * n, r[2] = e[2] * n, r[3] = e[3] * n, r[4] = e[4] * a, r[5] = e[5] * a, r[6] = e[6] * a, r[7] = e[7] * a, r[8] = e[8] * i, r[9] = e[9] * i, r[10] = e[10] * i, r[11] = e[11] * i, r[12] = e[12], r[13] = e[13], r[14] = e[14], r[15] = e[15], r;
|
|
8637
8637
|
}
|
|
8638
|
-
function
|
|
8638
|
+
function wa(r, e, t) {
|
|
8639
8639
|
var n = Math.sin(t), a = Math.cos(t), i = e[4], o = e[5], s = e[6], l = e[7], u = e[8], c = e[9], p = e[10], f = e[11];
|
|
8640
8640
|
return e !== r && (r[0] = e[0], r[1] = e[1], r[2] = e[2], r[3] = e[3], r[12] = e[12], r[13] = e[13], r[14] = e[14], r[15] = e[15]), r[4] = i * a + u * n, r[5] = o * a + c * n, r[6] = s * a + p * n, r[7] = l * a + f * n, r[8] = u * a - i * n, r[9] = c * a - o * n, r[10] = p * a - s * n, r[11] = f * a - l * n, r;
|
|
8641
8641
|
}
|
|
@@ -8643,7 +8643,7 @@ function $u(r, e, t) {
|
|
|
8643
8643
|
var n = Math.sin(t), a = Math.cos(t), i = e[0], o = e[1], s = e[2], l = e[3], u = e[8], c = e[9], p = e[10], f = e[11];
|
|
8644
8644
|
return e !== r && (r[4] = e[4], r[5] = e[5], r[6] = e[6], r[7] = e[7], r[12] = e[12], r[13] = e[13], r[14] = e[14], r[15] = e[15]), r[0] = i * a - u * n, r[1] = o * a - c * n, r[2] = s * a - p * n, r[3] = l * a - f * n, r[8] = i * n + u * a, r[9] = o * n + c * a, r[10] = s * n + p * a, r[11] = l * n + f * a, r;
|
|
8645
8645
|
}
|
|
8646
|
-
function
|
|
8646
|
+
function Sa(r, e, t) {
|
|
8647
8647
|
var n = Math.sin(t), a = Math.cos(t), i = e[0], o = e[1], s = e[2], l = e[3], u = e[4], c = e[5], p = e[6], f = e[7];
|
|
8648
8648
|
return e !== r && (r[8] = e[8], r[9] = e[9], r[10] = e[10], r[11] = e[11], r[12] = e[12], r[13] = e[13], r[14] = e[14], r[15] = e[15]), r[0] = i * a + u * n, r[1] = o * a + c * n, r[2] = s * a + p * n, r[3] = l * a + f * n, r[4] = u * a - i * n, r[5] = c * a - o * n, r[6] = p * a - s * n, r[7] = f * a - l * n, r;
|
|
8649
8649
|
}
|
|
@@ -8669,7 +8669,7 @@ function $r(r, e) {
|
|
|
8669
8669
|
var t = e[0], n = e[1], a = e[2], i = t * t + n * n + a * a;
|
|
8670
8670
|
return i > 0 && (i = 1 / Math.sqrt(i)), r[0] = e[0] * i, r[1] = e[1] * i, r[2] = e[2] * i, r;
|
|
8671
8671
|
}
|
|
8672
|
-
function
|
|
8672
|
+
function xa(r, e, t) {
|
|
8673
8673
|
var n = e[0], a = e[1], i = e[2], o = t[0], s = t[1], l = t[2];
|
|
8674
8674
|
return r[0] = a * l - i * s, r[1] = i * o - n * l, r[2] = n * s - a * o, r;
|
|
8675
8675
|
}
|
|
@@ -8685,9 +8685,9 @@ function Sa(r, e, t) {
|
|
|
8685
8685
|
function Uu(r) {
|
|
8686
8686
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
8687
8687
|
}
|
|
8688
|
-
var Nr,
|
|
8688
|
+
var Nr, ka;
|
|
8689
8689
|
function Bu() {
|
|
8690
|
-
return
|
|
8690
|
+
return ka || (ka = 1, Nr = {
|
|
8691
8691
|
aliceblue: [240, 248, 255],
|
|
8692
8692
|
antiquewhite: [250, 235, 215],
|
|
8693
8693
|
aqua: [0, 255, 255],
|
|
@@ -8838,10 +8838,10 @@ function Bu() {
|
|
|
8838
8838
|
yellowgreen: [154, 205, 50]
|
|
8839
8839
|
}), Nr;
|
|
8840
8840
|
}
|
|
8841
|
-
var jr,
|
|
8841
|
+
var jr, Ea;
|
|
8842
8842
|
function qi() {
|
|
8843
|
-
if (
|
|
8844
|
-
|
|
8843
|
+
if (Ea) return jr;
|
|
8844
|
+
Ea = 1;
|
|
8845
8845
|
const r = Bu(), e = {};
|
|
8846
8846
|
for (const a of Object.keys(r))
|
|
8847
8847
|
e[r[a]] = a;
|
|
@@ -9141,10 +9141,10 @@ function qi() {
|
|
|
9141
9141
|
return [(a[0] + a[1] + a[2]) / 3 / 255 * 100];
|
|
9142
9142
|
}, jr;
|
|
9143
9143
|
}
|
|
9144
|
-
var Dr,
|
|
9144
|
+
var Dr, La;
|
|
9145
9145
|
function qu() {
|
|
9146
|
-
if (
|
|
9147
|
-
|
|
9146
|
+
if (La) return Dr;
|
|
9147
|
+
La = 1;
|
|
9148
9148
|
const r = qi();
|
|
9149
9149
|
function e() {
|
|
9150
9150
|
const i = {}, o = Object.keys(r);
|
|
@@ -9189,10 +9189,10 @@ function qu() {
|
|
|
9189
9189
|
return s;
|
|
9190
9190
|
}, Dr;
|
|
9191
9191
|
}
|
|
9192
|
-
var Ur,
|
|
9192
|
+
var Ur, Ca;
|
|
9193
9193
|
function Vu() {
|
|
9194
|
-
if (
|
|
9195
|
-
|
|
9194
|
+
if (Ca) return Ur;
|
|
9195
|
+
Ca = 1;
|
|
9196
9196
|
const r = qi(), e = qu(), t = {}, n = Object.keys(r);
|
|
9197
9197
|
function a(o) {
|
|
9198
9198
|
const s = function(...l) {
|
|
@@ -9226,7 +9226,7 @@ function Vu() {
|
|
|
9226
9226
|
}
|
|
9227
9227
|
var Gu = Vu();
|
|
9228
9228
|
const Hu = /* @__PURE__ */ Uu(Gu);
|
|
9229
|
-
function
|
|
9229
|
+
function Aa({ gl: r, type: e, source: t }) {
|
|
9230
9230
|
const n = r.createShader(e);
|
|
9231
9231
|
if (n === null)
|
|
9232
9232
|
throw new Error("Cannot create shader");
|
|
@@ -9235,11 +9235,11 @@ function Ca({ gl: r, type: e, source: t }) {
|
|
|
9235
9235
|
return n;
|
|
9236
9236
|
}
|
|
9237
9237
|
function Ku({ gl: r, vertexShaderSource: e, fragmentShaderSource: t }) {
|
|
9238
|
-
const n =
|
|
9238
|
+
const n = Aa({
|
|
9239
9239
|
gl: r,
|
|
9240
9240
|
type: r.VERTEX_SHADER,
|
|
9241
9241
|
source: e
|
|
9242
|
-
}), a =
|
|
9242
|
+
}), a = Aa({ gl: r, type: r.FRAGMENT_SHADER, source: t }), i = r.createProgram();
|
|
9243
9243
|
if (r.attachShader(i, n), r.attachShader(i, a), r.linkProgram(i), !r.getProgramParameter(i, r.LINK_STATUS))
|
|
9244
9244
|
throw console.error("Error: ", r.getProgramInfoLog(i)), new Error("Cannot link shader program");
|
|
9245
9245
|
return i;
|
|
@@ -9300,7 +9300,7 @@ let ft;
|
|
|
9300
9300
|
function Xu(r) {
|
|
9301
9301
|
return ft = ft ?? document.createElement("canvas").getContext("2d"), ft ? (ft.fillStyle = r, ft.fillStyle) : "#000000";
|
|
9302
9302
|
}
|
|
9303
|
-
const
|
|
9303
|
+
const zn = 1, U = zn / 2, B = zn / 2, q = zn / 2, Wu = [-U, -B, q, U, -B, q, U, B, q, -U, B, q], Yu = [-U, -B, -q, -U, B, -q, U, B, -q, U, -B, -q], Ju = [-U, B, -q, -U, B, q, U, B, q, U, B, -q], Qu = [-U, -B, -q, U, -B, -q, U, -B, q, -U, -B, q], ec = [U, -B, -q, U, B, -q, U, B, q, U, -B, q], tc = [-U, -B, -q, -U, -B, q, -U, B, q, -U, B, -q], rc = [...Wu, ...Yu, ...Ju, ...Qu, ...ec, ...tc], nc = [
|
|
9304
9304
|
// Front
|
|
9305
9305
|
0,
|
|
9306
9306
|
1,
|
|
@@ -9353,7 +9353,7 @@ void main(void) {
|
|
|
9353
9353
|
vTextureCoord = vec3(-a_vertexPosition.x, a_vertexPosition.y, a_vertexPosition.z);
|
|
9354
9354
|
gl_Position = u_projectionMatrix * u_modelViewMatrix * vec4(a_vertexPosition, 1.0);
|
|
9355
9355
|
}
|
|
9356
|
-
`,
|
|
9356
|
+
`, Ta = `precision mediump float;
|
|
9357
9357
|
|
|
9358
9358
|
varying vec3 vTextureCoord;
|
|
9359
9359
|
|
|
@@ -9416,14 +9416,14 @@ function oc(r) {
|
|
|
9416
9416
|
const e = rt.get(r);
|
|
9417
9417
|
e && (rt.delete(r), r.deleteTexture(e));
|
|
9418
9418
|
}
|
|
9419
|
-
const
|
|
9420
|
-
let
|
|
9419
|
+
const Ia = /* @__PURE__ */ new Map();
|
|
9420
|
+
let _a;
|
|
9421
9421
|
function sc({ gl: r, faces: e, onReady: t, forceRefresh: n }) {
|
|
9422
|
-
if (rt.get(r) && !n &&
|
|
9423
|
-
t(rt.get(r),
|
|
9422
|
+
if (rt.get(r) && !n && _a === JSON.stringify(e)) {
|
|
9423
|
+
t(rt.get(r), Ia.get(r));
|
|
9424
9424
|
return;
|
|
9425
9425
|
}
|
|
9426
|
-
|
|
9426
|
+
_a = JSON.stringify(e);
|
|
9427
9427
|
const a = rt.get(r) ?? r.createTexture();
|
|
9428
9428
|
if (r.bindTexture(r.TEXTURE_CUBE_MAP, a), !e) {
|
|
9429
9429
|
console.warn("[CubemapLayer][loadCubemapTexture]: Faces are null");
|
|
@@ -9461,7 +9461,7 @@ function sc({ gl: r, faces: e, onReady: t, forceRefresh: n }) {
|
|
|
9461
9461
|
}
|
|
9462
9462
|
r.bindTexture(r.TEXTURE_CUBE_MAP, a), r.generateMipmap(r.TEXTURE_CUBE_MAP), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_LINEAR), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MAG_FILTER, r.LINEAR);
|
|
9463
9463
|
const l = s.map((u) => u.image);
|
|
9464
|
-
t(a, l),
|
|
9464
|
+
t(a, l), Ia.set(r, l), rt.set(r, a);
|
|
9465
9465
|
}).catch((s) => {
|
|
9466
9466
|
console.error("[CubemapLayer][loadCubemapTexture]: Error loading cubemap texture", s);
|
|
9467
9467
|
});
|
|
@@ -9498,7 +9498,7 @@ function nr(r) {
|
|
|
9498
9498
|
const e = Object.keys(r).sort().map((t) => [t, r[t]]);
|
|
9499
9499
|
return Object.fromEntries(e);
|
|
9500
9500
|
}
|
|
9501
|
-
const Qe = "https://api.maptiler.com/resources/space", cc = ["vertexPosition"], pc = ["projectionMatrix", "modelViewMatrix", "cubeSampler", "bgColor", "fadeOpacity"],
|
|
9501
|
+
const Qe = "https://api.maptiler.com/resources/space", cc = ["vertexPosition"], pc = ["projectionMatrix", "modelViewMatrix", "cubeSampler", "bgColor", "fadeOpacity"], Ma = "%USE_TEXTURE_MACRO_MARKER%", fc = "#define USE_TEXTURE", Pa = ze.stars;
|
|
9502
9502
|
function dc(r, e) {
|
|
9503
9503
|
if (!tn(r))
|
|
9504
9504
|
return {
|
|
@@ -9647,8 +9647,8 @@ class Nt {
|
|
|
9647
9647
|
throw new Error(`[CubemapLayer]: Invalid cubemap specification:
|
|
9648
9648
|
- ${t.join(`
|
|
9649
9649
|
- `)}`);
|
|
9650
|
-
const n = dc(e,
|
|
9651
|
-
this.options = n, this.currentFacesDefinitionKey = JSON.stringify(n.faces ?? n.preset ?? n.path), this.bgColor = [0, 0, 0, 0], this.targetBgColor = Ht(n.color), this.faces =
|
|
9650
|
+
const n = dc(e, Pa);
|
|
9651
|
+
this.options = n, this.currentFacesDefinitionKey = JSON.stringify(n.faces ?? n.preset ?? n.path), this.bgColor = [0, 0, 0, 0], this.targetBgColor = Ht(n.color), this.faces = Ra(n), this.useCubemapTexture = this.faces !== null;
|
|
9652
9652
|
}
|
|
9653
9653
|
/**
|
|
9654
9654
|
* Updates the cubemap object with the current faces and shader configuration.
|
|
@@ -9665,7 +9665,7 @@ class Nt {
|
|
|
9665
9665
|
gl: this.gl,
|
|
9666
9666
|
vertexShaderSource: ac,
|
|
9667
9667
|
// Because we only want to use the read the texture in gl if we're supposed to
|
|
9668
|
-
fragmentShaderSource: this.useCubemapTexture ?
|
|
9668
|
+
fragmentShaderSource: this.useCubemapTexture ? Ta.replace(Ma, fc) : Ta.replace(Ma, ""),
|
|
9669
9669
|
attributesKeys: cc,
|
|
9670
9670
|
uniformsKeys: t,
|
|
9671
9671
|
vertices: rc,
|
|
@@ -9797,9 +9797,9 @@ class Nt {
|
|
|
9797
9797
|
throw new Error("[CubemapLayer]: Cubemap is undefined");
|
|
9798
9798
|
this.texture, e.disable(e.DEPTH_TEST), e.enable(e.BLEND), e.blendFunc(e.SRC_ALPHA, e.DST_ALPHA), e.useProgram(this.cubemap.shaderProgram), e.bindBuffer(e.ARRAY_BUFFER, this.cubemap.positionBuffer), e.vertexAttribPointer(this.cubemap.programInfo.attributesLocations.vertexPosition, 3, e.FLOAT, !1, 0, 0), e.enableVertexAttribArray(this.cubemap.programInfo.attributesLocations.vertexPosition);
|
|
9799
9799
|
const n = 0.1, a = 1e4, i = e.canvas, o = i.clientWidth / i.clientHeight, s = this.map.transform, l = s.fov * (Math.PI / 180), u = yt();
|
|
9800
|
-
ju(u, l, o, n, a),
|
|
9800
|
+
ju(u, l, o, n, a), Sa(u, u, s.rollInRadians), wa(u, u, -s.pitchInRadians), Sa(u, u, s.bearingInRadians);
|
|
9801
9801
|
const c = s.center.lat * Math.PI / 180, p = s.center.lng * Math.PI / 180;
|
|
9802
|
-
|
|
9802
|
+
wa(u, u, c), $u(u, u, -p), e.uniformMatrix4fv(this.cubemap.programInfo.uniformsLocations.projectionMatrix, !1, u);
|
|
9803
9803
|
const f = yt();
|
|
9804
9804
|
if (e.uniformMatrix4fv(this.cubemap.programInfo.uniformsLocations.modelViewMatrix, !1, f), e.uniform4fv(this.cubemap.programInfo.uniformsLocations.bgColor, new Float32Array(this.bgColor)), e.uniform1f(this.cubemap.programInfo.uniformsLocations.fadeOpacity, this.currentFadeOpacity), this.useCubemapTexture && this.texture && (e.activeTexture(e.TEXTURE0), e.bindTexture(e.TEXTURE_CUBE_MAP, this.texture), e.uniform1i(this.cubemap.programInfo.uniformsLocations.cubeSampler, 0)), this.cubemap.indexBuffer === void 0)
|
|
9805
9805
|
throw new Error("Index buffer is undefined");
|
|
@@ -9835,7 +9835,7 @@ class Nt {
|
|
|
9835
9835
|
this.faces = null, this.useCubemapTexture = !1, this.currentFacesDefinitionKey = "empty", await this.animateIn();
|
|
9836
9836
|
return;
|
|
9837
9837
|
}
|
|
9838
|
-
this.faces =
|
|
9838
|
+
this.faces = Ra(e), this.currentFacesDefinitionKey = JSON.stringify(e.faces ?? e.preset ?? e.path);
|
|
9839
9839
|
}
|
|
9840
9840
|
/**
|
|
9841
9841
|
* Sets the cubemap for the layer based on the provided definition.
|
|
@@ -9855,7 +9855,7 @@ class Nt {
|
|
|
9855
9855
|
throw new Error(`[CubemapLayer]: Invalid cubemap specification:
|
|
9856
9856
|
- ${t.join(`
|
|
9857
9857
|
- `)}`);
|
|
9858
|
-
const n = typeof e == "boolean" ?
|
|
9858
|
+
const n = typeof e == "boolean" ? Pa : e;
|
|
9859
9859
|
this.options = n;
|
|
9860
9860
|
const a = JSON.stringify(n.faces ?? n.preset ?? n.path), i = this.currentFacesDefinitionKey !== a;
|
|
9861
9861
|
i && (await this.setCubemapFaces(n), this.cubeMapNeedsUpdate = !0);
|
|
@@ -9904,7 +9904,7 @@ function tn(r) {
|
|
|
9904
9904
|
`Space specification contains multiple properties for cubemap definition: ${a.join(", ")}. Only one of \`path\`, \`preset\`, or \`faces\` should be defined.`
|
|
9905
9905
|
), r.faces && (!r.faces.pX || !r.faces.nX || !r.faces.pY || !r.faces.nY || !r.faces.pZ || !r.faces.nZ) && e.push("Space specification contains faces but one or more of the faces are undefined."), r.faces && Object.values(r.faces).every((i) => typeof i != "string") && e.push("Space specification contains faces but one or more of the faces are not strings."), e;
|
|
9906
9906
|
}
|
|
9907
|
-
function
|
|
9907
|
+
function Ra(r) {
|
|
9908
9908
|
if (r.faces)
|
|
9909
9909
|
return r.faces;
|
|
9910
9910
|
if (r.preset)
|
|
@@ -10020,7 +10020,7 @@ void main() {
|
|
|
10020
10020
|
[0, "rgba(176, 208, 240, 1)"],
|
|
10021
10021
|
[0.1, "rgba(98, 168, 229, 0.3)"],
|
|
10022
10022
|
[0.2, "rgba(98, 168, 229, 0.0)"]
|
|
10023
|
-
], Dt = 0.9,
|
|
10023
|
+
], Dt = 0.9, Oa = 0.06;
|
|
10024
10024
|
class Ut {
|
|
10025
10025
|
/**
|
|
10026
10026
|
* Creates a new RadialGradientLayer instance.
|
|
@@ -10082,7 +10082,7 @@ class Ut {
|
|
|
10082
10082
|
};
|
|
10083
10083
|
return;
|
|
10084
10084
|
}
|
|
10085
|
-
const t =
|
|
10085
|
+
const t = za(e);
|
|
10086
10086
|
if (t.length > 0)
|
|
10087
10087
|
throw new Error(`[RadialGradientLayer]: Invalid Halo specification:
|
|
10088
10088
|
- ${t.join(`
|
|
@@ -10153,7 +10153,7 @@ class Ut {
|
|
|
10153
10153
|
this.animationDelta = 0;
|
|
10154
10154
|
const t = () => {
|
|
10155
10155
|
if (this.animationDelta <= 1) {
|
|
10156
|
-
this.scale = Oe(0, this.gradient.scale, this.animationDelta), this.animationDelta +=
|
|
10156
|
+
this.scale = Oe(0, this.gradient.scale, this.animationDelta), this.animationDelta += Oa, this.map.triggerRepaint(), requestAnimationFrame(t);
|
|
10157
10157
|
return;
|
|
10158
10158
|
}
|
|
10159
10159
|
e();
|
|
@@ -10178,7 +10178,7 @@ class Ut {
|
|
|
10178
10178
|
return this.animationDelta = 0, new Promise((e) => {
|
|
10179
10179
|
const t = () => {
|
|
10180
10180
|
if (this.animationDelta < 1) {
|
|
10181
|
-
this.scale = Oe(this.gradient.scale, 0, this.animationDelta), this.animationDelta +=
|
|
10181
|
+
this.scale = Oe(this.gradient.scale, 0, this.animationDelta), this.animationDelta += Oa, this.map.triggerRepaint(), requestAnimationFrame(t);
|
|
10182
10182
|
return;
|
|
10183
10183
|
}
|
|
10184
10184
|
e();
|
|
@@ -10208,9 +10208,9 @@ class Ut {
|
|
|
10208
10208
|
const s = this.plane.programInfo.uniformsLocations.matrix;
|
|
10209
10209
|
e.uniformMatrix4fv(s, !1, o);
|
|
10210
10210
|
const l = yt(), u = this.map.transform.cameraPosition, c = $r(Gt(), u), p = Du(0, 1, 0), f = Gt();
|
|
10211
|
-
|
|
10211
|
+
xa(f, p, c), $r(f, f);
|
|
10212
10212
|
const d = Gt();
|
|
10213
|
-
|
|
10213
|
+
xa(d, c, f), $r(d, d), Ou(l, f[0], f[1], f[2], 0, d[0], d[1], d[2], 0, c[0], c[1], c[2], 0, 0, 0, 0, 1);
|
|
10214
10214
|
const h = this.plane.programInfo.uniformsLocations.rotationMatrix;
|
|
10215
10215
|
e.uniformMatrix4fv(h, !1, l);
|
|
10216
10216
|
const m = this.gradient.stops.length, g = [], b = [];
|
|
@@ -10237,7 +10237,7 @@ class Ut {
|
|
|
10237
10237
|
return;
|
|
10238
10238
|
}
|
|
10239
10239
|
await this.animateOut();
|
|
10240
|
-
const t =
|
|
10240
|
+
const t = za(e);
|
|
10241
10241
|
if (t.length > 0)
|
|
10242
10242
|
throw new Error(`[RadialGradientLayer]: Invalid Halo specification:
|
|
10243
10243
|
- ${t.join(`
|
|
@@ -10256,7 +10256,7 @@ class Ut {
|
|
|
10256
10256
|
}
|
|
10257
10257
|
}
|
|
10258
10258
|
const bc = ["scale", "stops"];
|
|
10259
|
-
function
|
|
10259
|
+
function za(r) {
|
|
10260
10260
|
var t;
|
|
10261
10261
|
const e = [];
|
|
10262
10262
|
if (typeof r == "boolean")
|
|
@@ -10289,7 +10289,7 @@ const Sc = {
|
|
|
10289
10289
|
let Gi = class Hi extends k.Map {
|
|
10290
10290
|
constructor(t) {
|
|
10291
10291
|
t.logSDKVersion !== !1 && wc(), rs(t.container, t.canvasContextAttributes), t.apiKey && (j.apiKey = t.apiKey);
|
|
10292
|
-
const { style: n, requiresUrlMonitoring: a, isFallback: i } =
|
|
10292
|
+
const { style: n, requiresUrlMonitoring: a, isFallback: i } = ga(t.style);
|
|
10293
10293
|
i && console.warn(
|
|
10294
10294
|
"Invalid style. A style must be a valid URL to a style.json, a JSON string representing a valid StyleSpecification or a valid StyleSpecification object. Fallback to default MapTiler style."
|
|
10295
10295
|
), j.apiKey || console.warn("MapTiler Cloud API key is not set. Visit https://maptiler.com and try Cloud for free!");
|
|
@@ -10305,7 +10305,7 @@ let Gi = class Hi extends k.Map {
|
|
|
10305
10305
|
...t,
|
|
10306
10306
|
style: n,
|
|
10307
10307
|
maplibreLogo: !1,
|
|
10308
|
-
transformRequest:
|
|
10308
|
+
transformRequest: Wn(t.transformRequest),
|
|
10309
10309
|
attributionControl: t.forceNoAttributionControl === !0 ? !1 : s
|
|
10310
10310
|
};
|
|
10311
10311
|
delete l.style;
|
|
@@ -10356,7 +10356,7 @@ let Gi = class Hi extends k.Map {
|
|
|
10356
10356
|
}), j.caching && !Gr && console.warn("The cache API is only available in secure contexts. More info at https://developer.mozilla.org/en-US/docs/Web/API/Cache"), j.caching && Gr && Wo(), typeof t.language > "u")
|
|
10357
10357
|
this.primaryLanguage = j.primaryLanguage;
|
|
10358
10358
|
else {
|
|
10359
|
-
const h =
|
|
10359
|
+
const h = qn(t.language, O);
|
|
10360
10360
|
this.primaryLanguage = h ?? j.primaryLanguage;
|
|
10361
10361
|
}
|
|
10362
10362
|
this.forceLanguageUpdate = !(this.primaryLanguage === O.STYLE || this.primaryLanguage === O.STYLE_LOCK), this.languageAlwaysBeenStyle = this.primaryLanguage === O.STYLE, this.terrainExaggeration = t.terrainExaggeration ?? this.terrainExaggeration, this.curentProjection = t.projection, this.on("style.load", (h) => {
|
|
@@ -10446,8 +10446,8 @@ let Gi = class Hi extends k.Map {
|
|
|
10446
10446
|
if (t.forceNoAttributionControl !== !0)
|
|
10447
10447
|
if ("logo" in h && h.logo) {
|
|
10448
10448
|
const m = h.logo;
|
|
10449
|
-
this.addControl(new
|
|
10450
|
-
} else t.maptilerLogo && this.addControl(new
|
|
10449
|
+
this.addControl(new Hn({ logoURL: m }), t.logoPosition);
|
|
10450
|
+
} else t.maptilerLogo && this.addControl(new Hn(), t.logoPosition);
|
|
10451
10451
|
if (t.scaleControl) {
|
|
10452
10452
|
const m = t.scaleControl === !0 || t.scaleControl === void 0 ? "bottom-right" : t.scaleControl, g = new Bo({ unit: j.unit });
|
|
10453
10453
|
this.addControl(g, m), j.on("unit", (b) => {
|
|
@@ -10709,7 +10709,11 @@ let Gi = class Hi extends k.Map {
|
|
|
10709
10709
|
return;
|
|
10710
10710
|
}
|
|
10711
10711
|
const i = a;
|
|
10712
|
-
|
|
10712
|
+
if (i) {
|
|
10713
|
+
this.space = new Nt(i), this.addLayer(this.space, n);
|
|
10714
|
+
return;
|
|
10715
|
+
}
|
|
10716
|
+
this.options.space === !0 && (this.space = new Nt(!0), this.addLayer(this.space, n));
|
|
10713
10717
|
}
|
|
10714
10718
|
initHalo({ options: t = this.options, before: n, spec: a }) {
|
|
10715
10719
|
if (this.halo && this.getLayer(this.halo.id) || t.halo === !1) return;
|
|
@@ -10832,7 +10836,7 @@ let Gi = class Hi extends k.Map {
|
|
|
10832
10836
|
this.originalLabelStyle.clear(), (c = this.minimap) == null || c.setStyle(t), this.forceLanguageUpdate = !0, this.once("idle", () => {
|
|
10833
10837
|
this.forceLanguageUpdate = !1;
|
|
10834
10838
|
});
|
|
10835
|
-
const a =
|
|
10839
|
+
const a = ga(t);
|
|
10836
10840
|
if (a.requiresUrlMonitoring && this.monitorStyleUrl(a.style), a.isFallback) {
|
|
10837
10841
|
if (this.getStyle())
|
|
10838
10842
|
return console.warn(
|
|
@@ -11029,7 +11033,7 @@ let Gi = class Hi extends k.Map {
|
|
|
11029
11033
|
* Define the primary language of the map. Note that not all the languages shorthands provided are available.
|
|
11030
11034
|
*/
|
|
11031
11035
|
setPrimaryLanguage(t) {
|
|
11032
|
-
const n = this.getStyleLanguage(), a =
|
|
11036
|
+
const n = this.getStyleLanguage(), a = qn(t, O);
|
|
11033
11037
|
if (!a) {
|
|
11034
11038
|
console.warn(`The language "${a}" is not supported.`);
|
|
11035
11039
|
return;
|
|
@@ -11050,7 +11054,7 @@ let Gi = class Hi extends k.Map {
|
|
|
11050
11054
|
i = n;
|
|
11051
11055
|
}
|
|
11052
11056
|
let o = O.LOCAL.flag, s = ["get", o];
|
|
11053
|
-
i.flag === O.VISITOR.flag ? (o =
|
|
11057
|
+
i.flag === O.VISITOR.flag ? (o = Gn().flag, s = [
|
|
11054
11058
|
"case",
|
|
11055
11059
|
["all", ["has", o], ["has", O.LOCAL.flag]],
|
|
11056
11060
|
[
|
|
@@ -11072,7 +11076,7 @@ let Gi = class Hi extends k.Map {
|
|
|
11072
11076
|
`, ["get", O.LOCAL.flag], { "font-scale": 1.1 }]
|
|
11073
11077
|
],
|
|
11074
11078
|
["get", O.LOCAL.flag]
|
|
11075
|
-
]) : i.flag === O.AUTO.flag ? (o =
|
|
11079
|
+
]) : i.flag === O.AUTO.flag ? (o = Gn().flag, s = ["coalesce", ["get", o], ["get", O.LOCAL.flag]]) : i === O.LOCAL ? (o = O.LOCAL.flag, s = ["get", o]) : (o = i.flag, s = ["coalesce", ["get", o], ["get", O.LOCAL.flag]]);
|
|
11076
11080
|
const { layers: l } = this.getStyle(), u = this.originalLabelStyle.size === 0;
|
|
11077
11081
|
if (u) {
|
|
11078
11082
|
const c = us(l, this);
|
|
@@ -11217,14 +11221,14 @@ let Gi = class Hi extends k.Map {
|
|
|
11217
11221
|
});
|
|
11218
11222
|
}
|
|
11219
11223
|
async fitToIpBounds() {
|
|
11220
|
-
const t = await
|
|
11224
|
+
const t = await Vn.info();
|
|
11221
11225
|
this.fitBounds(t.country_bounds, {
|
|
11222
11226
|
duration: 0,
|
|
11223
11227
|
padding: 100
|
|
11224
11228
|
});
|
|
11225
11229
|
}
|
|
11226
11230
|
async centerOnIpPoint(t) {
|
|
11227
|
-
const n = await
|
|
11231
|
+
const n = await Vn.info();
|
|
11228
11232
|
this.jumpTo({
|
|
11229
11233
|
center: [n.longitude ?? 0, n.latitude ?? 0],
|
|
11230
11234
|
zoom: t || 11
|
|
@@ -11262,7 +11266,7 @@ let Gi = class Hi extends k.Map {
|
|
|
11262
11266
|
* map.setTransformRequest((url: string, resourceType: string) => {});
|
|
11263
11267
|
*/
|
|
11264
11268
|
setTransformRequest(t) {
|
|
11265
|
-
return super.setTransformRequest(
|
|
11269
|
+
return super.setTransformRequest(Wn(t)), this;
|
|
11266
11270
|
}
|
|
11267
11271
|
/**
|
|
11268
11272
|
* Gets the {@link ProjectionSpecification}.
|
|
@@ -11449,7 +11453,7 @@ class Lc extends Error {
|
|
|
11449
11453
|
this.name = "FetchError", this.message = i, this.status = t.status, this.statusText = t.statusText;
|
|
11450
11454
|
}
|
|
11451
11455
|
}
|
|
11452
|
-
const
|
|
11456
|
+
const Fa = 85.051129;
|
|
11453
11457
|
function Cc(r, e) {
|
|
11454
11458
|
return new fn(e.x / r, e.y / r).toLngLat();
|
|
11455
11459
|
}
|
|
@@ -11468,12 +11472,12 @@ function rn(r) {
|
|
|
11468
11472
|
function nn(r) {
|
|
11469
11473
|
return (180 + r) / 360;
|
|
11470
11474
|
}
|
|
11471
|
-
function
|
|
11475
|
+
function $a(r, e, t) {
|
|
11472
11476
|
const n = t - e, a = ((r - e) % n + n) % n + e;
|
|
11473
11477
|
return a === e ? t : a;
|
|
11474
11478
|
}
|
|
11475
11479
|
function Ic(r, e) {
|
|
11476
|
-
const t = to(e.lat, -
|
|
11480
|
+
const t = to(e.lat, -Fa, Fa);
|
|
11477
11481
|
return new xo(nn(e.lng) * r, rn(t) * r);
|
|
11478
11482
|
}
|
|
11479
11483
|
const _c = function(r, e) {
|
|
@@ -11491,7 +11495,7 @@ const _c = function(r, e) {
|
|
|
11491
11495
|
const i = this.tileSize * Ac(t.zoom);
|
|
11492
11496
|
let o = 0, s = i, l = 0, u = i, c = 0, p = 0;
|
|
11493
11497
|
const { x: f, y: d } = this.size, h = 0.5;
|
|
11494
|
-
a && (o = rn(a[1]) * i, s = rn(a[0]) * i, s - o < h * d && (c = h * d / (s - o))), n && (l =
|
|
11498
|
+
a && (o = rn(a[1]) * i, s = rn(a[0]) * i, s - o < h * d && (c = h * d / (s - o))), n && (l = $a(nn(n[0]) * i, 0, i), u = $a(nn(n[1]) * i, 0, i), u < l && (u += i), u - l < h * f && (p = h * f / (u - l)));
|
|
11495
11499
|
const { x: m, y: g } = Ic(i, r);
|
|
11496
11500
|
let b, v;
|
|
11497
11501
|
const x = Math.min(p || 0, c || 0);
|
|
@@ -11585,8 +11589,8 @@ const ro = Symbol("MapTiler:ImageViewer:Internal:lngLatToPxInternal"), no = Symb
|
|
|
11585
11589
|
fitToBoundsControl: !0,
|
|
11586
11590
|
navigationControl: !0
|
|
11587
11591
|
};
|
|
11588
|
-
var
|
|
11589
|
-
class $c extends (
|
|
11592
|
+
var Za, Xa, Wa;
|
|
11593
|
+
class $c extends (Wa = Oc, Xa = ro, Za = no, Wa) {
|
|
11590
11594
|
//#region constructor
|
|
11591
11595
|
/**
|
|
11592
11596
|
* The constructor for the ImageViewer.
|
|
@@ -11663,8 +11667,8 @@ class $c extends (Xa = Oc, Za = ro, Ka = no, Xa) {
|
|
|
11663
11667
|
y(this, "shouldFitImageToViewport", !0);
|
|
11664
11668
|
// aliases for methods that are not exposed by the SDK
|
|
11665
11669
|
// but used internally (ImageMarkers)
|
|
11666
|
-
y(this,
|
|
11667
|
-
y(this,
|
|
11670
|
+
y(this, Xa, this.lngLatToPx.bind(this));
|
|
11671
|
+
y(this, Za, this.pxToLngLat.bind(this));
|
|
11668
11672
|
if (!t.imageUUID)
|
|
11669
11673
|
throw new Error("[ImageViewer]: `imageUUID` is required");
|
|
11670
11674
|
if (typeof t.container != "string" && !(t.container instanceof HTMLElement))
|
|
@@ -12462,7 +12466,7 @@ function Vc(r, e, t) {
|
|
|
12462
12466
|
});
|
|
12463
12467
|
});
|
|
12464
12468
|
}
|
|
12465
|
-
function
|
|
12469
|
+
function Fn(r) {
|
|
12466
12470
|
if (typeof DOMParser < "u") {
|
|
12467
12471
|
const e = new DOMParser().parseFromString(r, "application/xml");
|
|
12468
12472
|
if (e.querySelector("parsererror"))
|
|
@@ -12481,13 +12485,13 @@ function io(r, e) {
|
|
|
12481
12485
|
}
|
|
12482
12486
|
return !1;
|
|
12483
12487
|
}
|
|
12484
|
-
function
|
|
12488
|
+
function Na(r) {
|
|
12485
12489
|
if (typeof XMLSerializer < "u")
|
|
12486
12490
|
return new XMLSerializer().serializeToString(r);
|
|
12487
12491
|
throw new Error("No XML serializer found");
|
|
12488
12492
|
}
|
|
12489
12493
|
function oo(r) {
|
|
12490
|
-
const e = typeof r == "string" ?
|
|
12494
|
+
const e = typeof r == "string" ? Fn(r) : r;
|
|
12491
12495
|
if (!io(e, "gpx"))
|
|
12492
12496
|
throw new Error("The XML document is not valid GPX");
|
|
12493
12497
|
const t = Z(e, "trk"), n = Z(e, "rte"), a = Z(e, "wpt"), i = {
|
|
@@ -12508,18 +12512,18 @@ function oo(r) {
|
|
|
12508
12512
|
}
|
|
12509
12513
|
function so(r, e) {
|
|
12510
12514
|
let t = r;
|
|
12511
|
-
if (typeof t == "string" && (t =
|
|
12515
|
+
if (typeof t == "string" && (t = Fn(t)), !io(t, "kml"))
|
|
12512
12516
|
throw new Error("The XML document is not valid KML");
|
|
12513
12517
|
const n = {
|
|
12514
12518
|
type: "FeatureCollection",
|
|
12515
12519
|
features: []
|
|
12516
12520
|
}, a = {}, i = {}, o = {}, s = Z(t, "Placemark"), l = Z(t, "Style"), u = Z(t, "StyleMap");
|
|
12517
12521
|
for (const c of Array.from(l)) {
|
|
12518
|
-
const p =
|
|
12522
|
+
const p = Da(e !== void 0 ? e(c) : Na(c)).toString(16);
|
|
12519
12523
|
a[`#${Ze(c, "id")}`] = p, i[p] = c;
|
|
12520
12524
|
}
|
|
12521
12525
|
for (const c of Array.from(u)) {
|
|
12522
|
-
a[`#${Ze(c, "id")}`] =
|
|
12526
|
+
a[`#${Ze(c, "id")}`] = Da(e !== void 0 ? e(c) : Na(c)).toString(16);
|
|
12523
12527
|
const p = Z(c, "Pair"), f = {};
|
|
12524
12528
|
for (const d of Array.from(p))
|
|
12525
12529
|
f[F(_(d, "key")) ?? ""] = F(_(d, "styleUrl"));
|
|
@@ -12529,7 +12533,7 @@ function so(r, e) {
|
|
|
12529
12533
|
n.features = n.features.concat(Kc(c, a, i, o));
|
|
12530
12534
|
return n;
|
|
12531
12535
|
}
|
|
12532
|
-
function
|
|
12536
|
+
function ja(r) {
|
|
12533
12537
|
if (r === null) return ["#000000", 1];
|
|
12534
12538
|
let e = "", t = 1, n = r;
|
|
12535
12539
|
return n.startsWith("#") && (n = n.substring(1)), (n.length === 6 || n.length === 3) && (e = n), n.length === 8 && (t = Number.parseInt(n.substring(0, 2), 16) / 255, e = `#${n.substring(6, 8)}${n.substring(4, 6)}${n.substring(2, 4)}`), [e ?? "#000000", t ?? 1];
|
|
@@ -12571,12 +12575,12 @@ function Kt(r) {
|
|
|
12571
12575
|
else if (e[a] === "LineString")
|
|
12572
12576
|
s.push({
|
|
12573
12577
|
type: "LineString",
|
|
12574
|
-
coordinates:
|
|
12578
|
+
coordinates: Ba(F(_(t, "coordinates")) ?? "")
|
|
12575
12579
|
});
|
|
12576
12580
|
else if (e[a] === "Polygon") {
|
|
12577
12581
|
const u = Z(t, "LinearRing"), c = [];
|
|
12578
12582
|
for (o = 0; o < u.length; o++)
|
|
12579
|
-
c.push(
|
|
12583
|
+
c.push(Ba(F(_(u[o], "coordinates")) ?? ""));
|
|
12580
12584
|
s.push({
|
|
12581
12585
|
type: "Polygon",
|
|
12582
12586
|
coordinates: c
|
|
@@ -12615,11 +12619,11 @@ function Kc(r, e, t, n) {
|
|
|
12615
12619
|
v && x && (i.timespan = { begin: v, end: x });
|
|
12616
12620
|
}
|
|
12617
12621
|
if (c !== null && (i.timestamp = F(_(c, "when")) ?? (/* @__PURE__ */ new Date()).toISOString()), m !== null) {
|
|
12618
|
-
const v =
|
|
12622
|
+
const v = ja(F(_(m, "color"))), x = v[0], C = v[1], L = Number.parseFloat(F(_(m, "width")) ?? "");
|
|
12619
12623
|
x && (i.stroke = x), Number.isNaN(C) || (i["stroke-opacity"] = C), Number.isNaN(L) || (i["stroke-width"] = L);
|
|
12620
12624
|
}
|
|
12621
12625
|
if (g) {
|
|
12622
|
-
const v =
|
|
12626
|
+
const v = ja(F(_(g, "color"))), x = v[0], C = v[1], L = F(_(g, "fill")), A = F(_(g, "outline"));
|
|
12623
12627
|
x && (i.fill = x), Number.isNaN(C) || (i["fill-opacity"] = C), L && (i["fill-opacity"] = L === "1" ? i["fill-opacity"] || 1 : 0), A && (i["stroke-opacity"] = A === "1" ? i["stroke-opacity"] || 1 : 0);
|
|
12624
12628
|
}
|
|
12625
12629
|
if (p) {
|
|
@@ -12668,7 +12672,7 @@ function Zc(r) {
|
|
|
12668
12672
|
}
|
|
12669
12673
|
if (t.length === 0) return;
|
|
12670
12674
|
const o = {
|
|
12671
|
-
|
|
12675
|
+
...$n(r),
|
|
12672
12676
|
...uo(_(r, "extensions"))
|
|
12673
12677
|
};
|
|
12674
12678
|
return n.length !== 0 && (o.coordTimes = t.length === 1 ? n[0] : n), a.length !== 0 && (o.heartRates = t.length === 1 ? a[0] : a), t.length === 1 ? {
|
|
@@ -12692,7 +12696,7 @@ function Xc(r) {
|
|
|
12692
12696
|
return e === void 0 ? void 0 : {
|
|
12693
12697
|
type: "Feature",
|
|
12694
12698
|
properties: {
|
|
12695
|
-
|
|
12699
|
+
...$n(r),
|
|
12696
12700
|
...uo(_(r, "extensions"))
|
|
12697
12701
|
},
|
|
12698
12702
|
geometry: {
|
|
@@ -12704,7 +12708,7 @@ function Xc(r) {
|
|
|
12704
12708
|
function Wc(r) {
|
|
12705
12709
|
return {
|
|
12706
12710
|
type: "Feature",
|
|
12707
|
-
properties: {
|
|
12711
|
+
properties: { ...$n(r), ...an(r, ["sym"]) },
|
|
12708
12712
|
geometry: {
|
|
12709
12713
|
type: "Point",
|
|
12710
12714
|
coordinates: fo(r).coordinates
|
|
@@ -12722,7 +12726,7 @@ function uo(r) {
|
|
|
12722
12726
|
}
|
|
12723
12727
|
return e;
|
|
12724
12728
|
}
|
|
12725
|
-
function
|
|
12729
|
+
function $n(r) {
|
|
12726
12730
|
const e = an(r, ["name", "cmt", "desc", "type", "time", "keywords"]), t = Z(r, "link");
|
|
12727
12731
|
if (t.length !== 0) {
|
|
12728
12732
|
e.links = [];
|
|
@@ -12736,7 +12740,7 @@ function Fn(r) {
|
|
|
12736
12740
|
}
|
|
12737
12741
|
return e;
|
|
12738
12742
|
}
|
|
12739
|
-
function
|
|
12743
|
+
function Da(r) {
|
|
12740
12744
|
let e = 0;
|
|
12741
12745
|
if (!r || !r.length) return e;
|
|
12742
12746
|
for (let t = 0; t < r.length; t++)
|
|
@@ -12749,7 +12753,7 @@ function Z(r, e) {
|
|
|
12749
12753
|
function Ze(r, e) {
|
|
12750
12754
|
return r.getAttribute(e);
|
|
12751
12755
|
}
|
|
12752
|
-
function
|
|
12756
|
+
function Ua(r, e) {
|
|
12753
12757
|
return Number.parseFloat(Ze(r, e) ?? "0");
|
|
12754
12758
|
}
|
|
12755
12759
|
function _(r, e) {
|
|
@@ -12775,13 +12779,13 @@ function an(r, e) {
|
|
|
12775
12779
|
function po(r) {
|
|
12776
12780
|
return co(r.replace(/\s*/g, "").split(","));
|
|
12777
12781
|
}
|
|
12778
|
-
function
|
|
12782
|
+
function Ba(r) {
|
|
12779
12783
|
const e = r.replace(/^\s*|\s*$/g, "").split(/\s+/), t = [];
|
|
12780
12784
|
for (const n of e) t.push(po(n));
|
|
12781
12785
|
return t;
|
|
12782
12786
|
}
|
|
12783
12787
|
function fo(r) {
|
|
12784
|
-
const e = [
|
|
12788
|
+
const e = [Ua(r, "lon"), Ua(r, "lat")], t = _(r, "ele"), n = _(r, "gpxtpx:hr") || _(r, "hr"), a = _(r, "time");
|
|
12785
12789
|
let i;
|
|
12786
12790
|
return t && (i = Number.parseFloat(F(t) ?? "0"), Number.isNaN(i) || e.push(i)), {
|
|
12787
12791
|
coordinates: e,
|
|
@@ -12792,7 +12796,7 @@ function fo(r) {
|
|
|
12792
12796
|
function Jc(r) {
|
|
12793
12797
|
let e = r;
|
|
12794
12798
|
try {
|
|
12795
|
-
typeof e == "string" && (e =
|
|
12799
|
+
typeof e == "string" && (e = Fn(e));
|
|
12796
12800
|
} catch {
|
|
12797
12801
|
return null;
|
|
12798
12802
|
}
|
|
@@ -12892,7 +12896,7 @@ function ho(r, e) {
|
|
|
12892
12896
|
function mo(r, e) {
|
|
12893
12897
|
return ["interpolate", ["linear"], ["get", e], ...r.flatMap((t) => [t.propertyValue, t.value])];
|
|
12894
12898
|
}
|
|
12895
|
-
function
|
|
12899
|
+
function Nn(r) {
|
|
12896
12900
|
const e = r.trimStart(), t = `${e}${" ".repeat(r.length - e.length)}`, n = Array.from(t);
|
|
12897
12901
|
if (!n.every((s) => s === " " || s === "_"))
|
|
12898
12902
|
throw new Error("A dash pattern must be composed only of whitespace and underscore characters.");
|
|
@@ -13946,7 +13950,7 @@ function np(r, e) {
|
|
|
13946
13950
|
const i = e.lineWidth ?? 3, o = e.lineColor ?? kr(), s = e.lineOpacity ?? 1, l = e.lineBlur ?? 0, u = e.lineGapWidth ?? 0;
|
|
13947
13951
|
let c = e.lineDashArray ?? null;
|
|
13948
13952
|
const p = e.outlineWidth ?? 1, f = e.outlineColor ?? "#FFFFFF", d = e.outlineOpacity ?? 1, h = e.outlineBlur ?? 0;
|
|
13949
|
-
if (typeof c == "string" && (c =
|
|
13953
|
+
if (typeof c == "string" && (c = Nn(c)), e.outline === !0) {
|
|
13950
13954
|
const m = `${n}_outline`;
|
|
13951
13955
|
a.polylineOutlineLayerId = m, r.addLayer(
|
|
13952
13956
|
{
|
|
@@ -14014,7 +14018,7 @@ function ap(r, e) {
|
|
|
14014
14018
|
}
|
|
14015
14019
|
let i = e.outlineDashArray ?? null;
|
|
14016
14020
|
const o = e.outlineWidth ?? 1, s = e.outlineColor ?? "#FFFFFF", l = e.outlineOpacity ?? 1, u = e.outlineBlur ?? 0, c = e.fillColor ?? kr(), p = e.fillOpacity ?? 1, f = e.outlinePosition ?? "center", d = e.pattern ?? null;
|
|
14017
|
-
typeof i == "string" && (i =
|
|
14021
|
+
typeof i == "string" && (i = Nn(i));
|
|
14018
14022
|
const h = (m = null) => {
|
|
14019
14023
|
if (r.addLayer(
|
|
14020
14024
|
{
|
|
@@ -14313,7 +14317,7 @@ const pf = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
14313
14317
|
colorDrivenByProperty: ln,
|
|
14314
14318
|
colorPalettes: on,
|
|
14315
14319
|
computeRampedOutlineWidth: ho,
|
|
14316
|
-
dashArrayMaker:
|
|
14320
|
+
dashArrayMaker: Nn,
|
|
14317
14321
|
generateRandomLayerName: Rt,
|
|
14318
14322
|
generateRandomSourceName: Pt,
|
|
14319
14323
|
getRandomColor: kr,
|
|
@@ -14369,7 +14373,7 @@ const cp = {
|
|
|
14369
14373
|
resolution: 20,
|
|
14370
14374
|
epsilon: 5
|
|
14371
14375
|
}
|
|
14372
|
-
},
|
|
14376
|
+
}, qa = ["MultiPoint", "LineString", "MultiLineString", "Polygon"];
|
|
14373
14377
|
function pp(r, e = {}) {
|
|
14374
14378
|
const { defaultEasing: t, pathSmoothing: n, ignoreFields: a } = {
|
|
14375
14379
|
...cp,
|
|
@@ -14379,8 +14383,8 @@ function pp(r, e = {}) {
|
|
|
14379
14383
|
const l = o["@delta"];
|
|
14380
14384
|
if (l || console.warn("[parseGeoJSONFeatureToKeyframes]: No '@delta' property found in GeoJSON properties, delta for each frame will default to its index divided by the total"), !i.type)
|
|
14381
14385
|
throw new Error("[parseGeoJSONFeatureToKeyframes]: No geometry found in feature");
|
|
14382
|
-
if (!
|
|
14383
|
-
throw new Error(`[parseGeoJSONFeatureToKeyframes]: Geometry type '${i.type}' is not supported. Accepted types are: ${
|
|
14386
|
+
if (!qa.includes(i.type))
|
|
14387
|
+
throw new Error(`[parseGeoJSONFeatureToKeyframes]: Geometry type '${i.type}' is not supported. Accepted types are: ${qa.join(", ")}`);
|
|
14384
14388
|
const c = i.type !== "LineString" && i.type !== "MultiPoint" ? i.coordinates.flat() : i.coordinates, p = c.map((g) => g.length > 2 ? g[2] : null), f = p.every((g) => g === null), d = Object.entries({
|
|
14385
14389
|
...o,
|
|
14386
14390
|
...!f && { altitude: p }
|
|
@@ -14389,27 +14393,27 @@ function pp(r, e = {}) {
|
|
|
14389
14393
|
[b]: v
|
|
14390
14394
|
}, {}), h = l ?? c.map((g, b) => b / c.length), m = s ?? h.map(() => t ?? "Linear");
|
|
14391
14395
|
if (c.some((g) => g.length > 2) && console.warn("[parseGeoJSONFeatureToKeyframes]: Smoothing is not supported for 3D paths, only 2D smoothing will be applied, ignoring altitude"), n) {
|
|
14392
|
-
const g = fp(c, n.resolution, n.epsilon), b = bo(
|
|
14396
|
+
const g = fp(c, n.resolution, n.epsilon), b = bo(Va([0, 1], g.length)), v = b.map(() => t ?? "Linear"), x = Object.entries(d).reduce((C, [L, A]) => {
|
|
14393
14397
|
if (!Array.isArray(A))
|
|
14394
14398
|
return C;
|
|
14395
|
-
const N = g.length, le =
|
|
14399
|
+
const N = g.length, le = Va(A, N);
|
|
14396
14400
|
return {
|
|
14397
14401
|
...C,
|
|
14398
14402
|
[L]: le
|
|
14399
14403
|
};
|
|
14400
14404
|
}, {});
|
|
14401
|
-
return
|
|
14405
|
+
return Ga(g, b, v, x);
|
|
14402
14406
|
}
|
|
14403
|
-
return
|
|
14407
|
+
return Ga(c, h, m, d);
|
|
14404
14408
|
}
|
|
14405
|
-
function
|
|
14409
|
+
function Va(r, e) {
|
|
14406
14410
|
const t = r.map((n, a) => {
|
|
14407
14411
|
const i = a / (r.length - 1);
|
|
14408
14412
|
return Math.round(i * (e - 1));
|
|
14409
14413
|
});
|
|
14410
14414
|
return Array.from({ length: e }, (n, a) => t.includes(a) ? r[t.indexOf(a)] : null);
|
|
14411
14415
|
}
|
|
14412
|
-
function
|
|
14416
|
+
function Ga(r, e, t, n = {}) {
|
|
14413
14417
|
if (!sp(r, e, t, ...Object.values(n)))
|
|
14414
14418
|
throw new Error(`
|
|
14415
14419
|
[parseGeoJSONFeatureToKeyframes]: If smoothing is not applied, coordinates, deltas, easings and property arrays must be the same length
|
|
@@ -14497,7 +14501,7 @@ function mp(r, e = 10) {
|
|
|
14497
14501
|
const a = r[r.length - 1], i = t[t.length - 1];
|
|
14498
14502
|
return (i[0] !== a[0] || i[1] !== a[1]) && t.push([a[0], a[1]]), t;
|
|
14499
14503
|
}
|
|
14500
|
-
const
|
|
14504
|
+
const Ha = {
|
|
14501
14505
|
animations: new Array(),
|
|
14502
14506
|
running: !1,
|
|
14503
14507
|
/**
|
|
@@ -14572,7 +14576,7 @@ const Ga = {
|
|
|
14572
14576
|
ElasticOut: Mp,
|
|
14573
14577
|
ElasticInOut: Pp,
|
|
14574
14578
|
BounceIn: wo,
|
|
14575
|
-
BounceOut:
|
|
14579
|
+
BounceOut: jn,
|
|
14576
14580
|
BounceInOut: Rp
|
|
14577
14581
|
};
|
|
14578
14582
|
function gp(r) {
|
|
@@ -14647,9 +14651,9 @@ function Pp(r) {
|
|
|
14647
14651
|
return e * 2 ** (-10 * i) * Math.sin((i - n) * (2 * Math.PI) / t) * 0.5 + 1;
|
|
14648
14652
|
}
|
|
14649
14653
|
function wo(r) {
|
|
14650
|
-
return 1 -
|
|
14654
|
+
return 1 - jn(1 - r);
|
|
14651
14655
|
}
|
|
14652
|
-
function
|
|
14656
|
+
function jn(r) {
|
|
14653
14657
|
if (r < 1 / 2.75)
|
|
14654
14658
|
return 7.5625 * r * r;
|
|
14655
14659
|
if (r < 2 / 2.75) {
|
|
@@ -14663,9 +14667,9 @@ function Nn(r) {
|
|
|
14663
14667
|
return 7.5625 * e * e + 0.984375;
|
|
14664
14668
|
}
|
|
14665
14669
|
function Rp(r) {
|
|
14666
|
-
return r < 0.5 ? wo(r * 2) * 0.5 :
|
|
14670
|
+
return r < 0.5 ? wo(r * 2) * 0.5 : jn(r * 2 - 1) * 0.5 + 0.5;
|
|
14667
14671
|
}
|
|
14668
|
-
class
|
|
14672
|
+
class Dn {
|
|
14669
14673
|
constructor({ keyframes: e, duration: t, iterations: n, manualMode: a, delay: i }) {
|
|
14670
14674
|
y(this, "playing", !1);
|
|
14671
14675
|
/**
|
|
@@ -14723,8 +14727,8 @@ class jn {
|
|
|
14723
14727
|
...c,
|
|
14724
14728
|
props: o.reduce((f, d) => (f[d] = u[d][p], f), {}),
|
|
14725
14729
|
easing: c.easing ?? "Linear",
|
|
14726
|
-
id:
|
|
14727
|
-
})), this.duration = t, this.iterations = n, this.delay = i ?? 0, this.playbackRate = 1, this.effectiveDuration = t / this.playbackRate, this.currentTime = 0, this.currentDelta = 0, a ||
|
|
14730
|
+
id: dn()
|
|
14731
|
+
})), this.duration = t, this.iterations = n, this.delay = i ?? 0, this.playbackRate = 1, this.effectiveDuration = t / this.playbackRate, this.currentTime = 0, this.currentDelta = 0, a || Ha.add(this);
|
|
14728
14732
|
}
|
|
14729
14733
|
/**
|
|
14730
14734
|
* Indicates if the animation is currently playing
|
|
@@ -14931,7 +14935,7 @@ class jn {
|
|
|
14931
14935
|
* @returns A new animation instance with the same properties as this one
|
|
14932
14936
|
*/
|
|
14933
14937
|
clone() {
|
|
14934
|
-
return new
|
|
14938
|
+
return new Dn({
|
|
14935
14939
|
keyframes: structuredClone(this.keyframes),
|
|
14936
14940
|
duration: this.duration,
|
|
14937
14941
|
iterations: this.iterations
|
|
@@ -14941,10 +14945,10 @@ class jn {
|
|
|
14941
14945
|
* Destroys the animation instance, removing all event listeners and stopping playback
|
|
14942
14946
|
*/
|
|
14943
14947
|
destroy() {
|
|
14944
|
-
this.stop(), this.listeners = pn.reduce((e, t) => (e[t] = [], e), {}),
|
|
14948
|
+
this.stop(), this.listeners = pn.reduce((e, t) => (e[t] = [], e), {}), Ha.remove(this);
|
|
14945
14949
|
}
|
|
14946
14950
|
}
|
|
14947
|
-
const
|
|
14951
|
+
const Ka = "animated-route-layer";
|
|
14948
14952
|
class ff {
|
|
14949
14953
|
constructor({
|
|
14950
14954
|
keyframes: e,
|
|
@@ -14962,7 +14966,7 @@ class ff {
|
|
|
14962
14966
|
manualUpdate: c = !1
|
|
14963
14967
|
}) {
|
|
14964
14968
|
/** Unique ID for the layer */
|
|
14965
|
-
y(this, "id", `${
|
|
14969
|
+
y(this, "id", `${Ka}-${dn()}`);
|
|
14966
14970
|
y(this, "type", "custom");
|
|
14967
14971
|
/** The MaptilerAnimation instance that handles the animation */
|
|
14968
14972
|
y(this, "animationInstance", null);
|
|
@@ -15019,10 +15023,10 @@ class ff {
|
|
|
15019
15023
|
*/
|
|
15020
15024
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
15021
15025
|
async onAdd(e) {
|
|
15022
|
-
if (this.map = e, this.map.getLayersOrder().some((n) => n.includes(
|
|
15026
|
+
if (this.map = e, this.map.getLayersOrder().some((n) => n.includes(Ka) && this.id !== n))
|
|
15023
15027
|
throw new Error("[AnimatedRouteLayer.onAdd]: Currently, you can only have one active AnimatedRouteLayer at a time. Please remove the existing one before adding a new one.");
|
|
15024
15028
|
const t = await this.getMaptilerAnimationOptions();
|
|
15025
|
-
this.animationInstance = new
|
|
15029
|
+
this.animationInstance = new Dn({
|
|
15026
15030
|
...t,
|
|
15027
15031
|
manualMode: this.manualUpdate
|
|
15028
15032
|
}), this.animationInstance.addEventListener("timeupdate", this.update), Object.entries(this.enquedEventHandlers).forEach(([n, a]) => {
|
|
@@ -15185,7 +15189,7 @@ class ff {
|
|
|
15185
15189
|
}
|
|
15186
15190
|
}
|
|
15187
15191
|
function So() {
|
|
15188
|
-
return "4.0.2
|
|
15192
|
+
return "4.0.2";
|
|
15189
15193
|
}
|
|
15190
15194
|
const df = k.Map, hf = k.Marker, mf = k.Popup, yf = k.Style, gf = k.CanvasSource, vf = k.GeoJSONSource, bf = k.ImageSource, wf = k.RasterTileSource, Sf = k.RasterDEMTileSource, xf = k.VectorTileSource, kf = k.VideoSource, Ef = k.NavigationControl, Lf = k.GeolocateControl, Cf = k.AttributionControl, Af = k.LogoControl, Tf = k.ScaleControl, If = k.FullscreenControl, _f = k.TerrainControl, Mf = k.BoxZoomHandler, Pf = k.ScrollZoomHandler, Rf = k.CooperativeGesturesHandler, Of = k.KeyboardHandler, zf = k.TwoFingersTouchPitchHandler, Ff = k.MapWheelEvent, $f = k.MapTouchEvent, Nf = k.MapMouseEvent, jf = k.config, Df = k.getVersion, {
|
|
15191
15195
|
setRTLTextPlugin: Uf,
|
|
@@ -15219,7 +15223,7 @@ const df = k.Map, hf = k.Marker, mf = k.Popup, yf = k.Style, gf = k.CanvasSource
|
|
|
15219
15223
|
} = k;
|
|
15220
15224
|
export {
|
|
15221
15225
|
Vf as AJAXError,
|
|
15222
|
-
|
|
15226
|
+
Ka as ANIM_LAYER_PREFIX,
|
|
15223
15227
|
ff as AnimatedRouteLayer,
|
|
15224
15228
|
Yp as AttributionControl,
|
|
15225
15229
|
Cf as AttributionControlMLGL,
|
|
@@ -15272,11 +15276,11 @@ export {
|
|
|
15272
15276
|
$f as MapTouchEventMLGL,
|
|
15273
15277
|
af as MapWheelEvent,
|
|
15274
15278
|
Ff as MapWheelEventMLGL,
|
|
15275
|
-
|
|
15279
|
+
Dn as MaptilerAnimation,
|
|
15276
15280
|
Mu as MaptilerCustomControl,
|
|
15277
15281
|
en as MaptilerExternalControl,
|
|
15278
15282
|
_u as MaptilerGeolocateControl,
|
|
15279
|
-
|
|
15283
|
+
Hn as MaptilerLogoControl,
|
|
15280
15284
|
Tu as MaptilerNavigationControl,
|
|
15281
15285
|
Pu as MaptilerProjectionControl,
|
|
15282
15286
|
Au as MaptilerTerrainControl,
|
|
@@ -15333,7 +15337,7 @@ export {
|
|
|
15333
15337
|
Ld as geolocation,
|
|
15334
15338
|
Cd as getAutoLanguage,
|
|
15335
15339
|
dp as getAverageDistance,
|
|
15336
|
-
|
|
15340
|
+
Gn as getBrowserLanguage,
|
|
15337
15341
|
Ad as getBufferToPixelDataParser,
|
|
15338
15342
|
Td as getLanguageInfoFromCode,
|
|
15339
15343
|
Id as getLanguageInfoFromFlag,
|
|
@@ -15368,12 +15372,12 @@ export {
|
|
|
15368
15372
|
od as setWorkerUrl,
|
|
15369
15373
|
hp as simplifyPath,
|
|
15370
15374
|
Fd as staticMaps,
|
|
15371
|
-
|
|
15372
|
-
|
|
15375
|
+
Fn as str2xml,
|
|
15376
|
+
Va as stretchNumericalArray,
|
|
15373
15377
|
$d as styleToStyle,
|
|
15374
15378
|
Nd as toLanguageInfo,
|
|
15375
15379
|
Di as toggleProjection,
|
|
15376
15380
|
ji as toggleTerrain,
|
|
15377
|
-
|
|
15381
|
+
Na as xml2str
|
|
15378
15382
|
};
|
|
15379
15383
|
//# sourceMappingURL=maptiler-sdk.mjs.map
|