@maptiler/sdk 3.5.0 → 3.5.1-rc1
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 +310 -291
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/package.json +1 -1
package/dist/maptiler-sdk.mjs
CHANGED
|
@@ -6,8 +6,8 @@ var To = (r, e, t) => e in r ? Eo(r, e, { enumerable: !0, configurable: !0, writ
|
|
|
6
6
|
var S = (r, e, t) => To(r, typeof e != "symbol" ? e + "" : e, t), tr = (r, e, t) => e.has(r) || dn("Cannot " + t);
|
|
7
7
|
var P = (r, e, t) => (tr(r, e, "read from private field"), t ? t.call(r) : e.get(r)), be = (r, e, t) => e.has(r) ? dn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), _e = (r, e, t, n) => (tr(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), H = (r, e, t) => (tr(r, e, "access private method"), t);
|
|
8
8
|
import k from "maplibre-gl";
|
|
9
|
-
import { Language as _o, getLanguageInfoFromCode as hn, config as rr, MapStyle as Qe, mapStylePresetList as nr, expandMapStyle as
|
|
10
|
-
import { MapStyle as _p, MapStyleVariant as
|
|
9
|
+
import { Language as _o, getLanguageInfoFromCode as hn, config as rr, MapStyle as Qe, mapStylePresetList as nr, expandMapStyle as Io, MapStyleVariant as Mo, ReferenceMapStyle as Po, toLanguageInfo as yn, getLanguageInfoFromFlag as Ro, geolocation as mn } from "@maptiler/client";
|
|
10
|
+
import { MapStyle as _p, MapStyleVariant as Ip, ReferenceMapStyle as Mp, ServiceError as Pp, areSameLanguages as Rp, bufferToPixelDataBrowser as zp, circumferenceAtLatitude as Fp, coordinates as $p, data as Op, elevation as jp, expandMapStyle as Np, geocoding as Dp, geolocation as Up, getAutoLanguage as Bp, getBufferToPixelDataParser as qp, getLanguageInfoFromCode as Gp, getLanguageInfoFromFlag as Vp, getLanguageInfoFromKey as Hp, getTileCache as Kp, isLanguageInfo as Xp, mapStylePresetList as Wp, math as Zp, misc as Yp, staticMaps as Jp, styleToStyle as Qp, toLanguageInfo as ef } from "@maptiler/client";
|
|
11
11
|
import zo from "events";
|
|
12
12
|
import { v4 as Fo } from "uuid";
|
|
13
13
|
import { Base64 as $o } from "js-base64";
|
|
@@ -79,7 +79,7 @@ const V = {
|
|
|
79
79
|
terrainSourceId: "maptiler-terrain"
|
|
80
80
|
};
|
|
81
81
|
Object.freeze(V);
|
|
82
|
-
const
|
|
82
|
+
const Nr = Fo();
|
|
83
83
|
class Oo extends zo {
|
|
84
84
|
constructor() {
|
|
85
85
|
super(...arguments);
|
|
@@ -170,7 +170,7 @@ class Oo extends zo {
|
|
|
170
170
|
return rr.fetch;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
const D = new Oo(), xr = "localcache_source", kr = "localcache",
|
|
173
|
+
const D = new Oo(), xr = "localcache_source", kr = "localcache", jo = "maptiler_sdk", No = 1e3, Do = 100, Cr = typeof caches < "u", { addProtocol: vn } = k;
|
|
174
174
|
function Uo(r, e) {
|
|
175
175
|
if (Cr && D.caching && D.session && r.host === V.maptilerApiHost) {
|
|
176
176
|
if (e === "Source" && r.href.includes("tiles.json"))
|
|
@@ -182,11 +182,11 @@ function Uo(r, e) {
|
|
|
182
182
|
}
|
|
183
183
|
let ar;
|
|
184
184
|
async function da() {
|
|
185
|
-
return ar || (ar = await caches.open(
|
|
185
|
+
return ar || (ar = await caches.open(jo)), ar;
|
|
186
186
|
}
|
|
187
187
|
let bn = 0;
|
|
188
188
|
async function Bo() {
|
|
189
|
-
const r = await da(), e = await r.keys(), t = e.slice(0, Math.max(e.length -
|
|
189
|
+
const r = await da(), e = await r.keys(), t = e.slice(0, Math.max(e.length - No, 0));
|
|
190
190
|
for (const n of t)
|
|
191
191
|
r.delete(n);
|
|
192
192
|
}
|
|
@@ -248,7 +248,7 @@ function wn(r, e) {
|
|
|
248
248
|
url: r
|
|
249
249
|
};
|
|
250
250
|
}
|
|
251
|
-
return t.host === V.maptilerApiHost && (t.searchParams.has("key") || t.searchParams.append("key", D.apiKey), D.session && t.searchParams.append("mtsid",
|
|
251
|
+
return t.host === V.maptilerApiHost && (t.searchParams.has("key") || t.searchParams.append("key", D.apiKey), D.session && t.searchParams.append("mtsid", Nr)), {
|
|
252
252
|
url: Uo(t, e)
|
|
253
253
|
};
|
|
254
254
|
}
|
|
@@ -1968,7 +1968,7 @@ var si = 8, li = {
|
|
|
1968
1968
|
LineString: {},
|
|
1969
1969
|
Polygon: {}
|
|
1970
1970
|
}
|
|
1971
|
-
},
|
|
1971
|
+
}, Ii = {
|
|
1972
1972
|
type: "array",
|
|
1973
1973
|
minimum: 0,
|
|
1974
1974
|
maximum: 24,
|
|
@@ -1977,7 +1977,7 @@ var si = 8, li = {
|
|
|
1977
1977
|
"color"
|
|
1978
1978
|
],
|
|
1979
1979
|
length: 2
|
|
1980
|
-
},
|
|
1980
|
+
}, Mi = {
|
|
1981
1981
|
type: "array",
|
|
1982
1982
|
value: "*",
|
|
1983
1983
|
minimum: 1
|
|
@@ -2285,7 +2285,7 @@ var si = 8, li = {
|
|
|
2285
2285
|
},
|
|
2286
2286
|
"property-type": "cross-faded-data-driven"
|
|
2287
2287
|
}
|
|
2288
|
-
},
|
|
2288
|
+
}, ji = {
|
|
2289
2289
|
"line-opacity": {
|
|
2290
2290
|
type: "number",
|
|
2291
2291
|
default: 1,
|
|
@@ -2476,7 +2476,7 @@ var si = 8, li = {
|
|
|
2476
2476
|
},
|
|
2477
2477
|
"property-type": "color-ramp"
|
|
2478
2478
|
}
|
|
2479
|
-
},
|
|
2479
|
+
}, Ni = {
|
|
2480
2480
|
"circle-radius": {
|
|
2481
2481
|
type: "number",
|
|
2482
2482
|
default: 5,
|
|
@@ -3377,8 +3377,8 @@ var si = 8, li = {
|
|
|
3377
3377
|
required: !1
|
|
3378
3378
|
}
|
|
3379
3379
|
},
|
|
3380
|
-
function_stop:
|
|
3381
|
-
expression:
|
|
3380
|
+
function_stop: Ii,
|
|
3381
|
+
expression: Mi,
|
|
3382
3382
|
light: Pi,
|
|
3383
3383
|
sky: Ri,
|
|
3384
3384
|
terrain: zi,
|
|
@@ -3515,8 +3515,8 @@ var si = 8, li = {
|
|
|
3515
3515
|
"property-type": "data-constant"
|
|
3516
3516
|
}
|
|
3517
3517
|
},
|
|
3518
|
-
paint_line:
|
|
3519
|
-
paint_circle:
|
|
3518
|
+
paint_line: ji,
|
|
3519
|
+
paint_circle: Ni,
|
|
3520
3520
|
paint_heatmap: Di,
|
|
3521
3521
|
paint_symbol: Ui,
|
|
3522
3522
|
paint_raster: Bi,
|
|
@@ -3608,7 +3608,7 @@ class Dr {
|
|
|
3608
3608
|
return this.bindings[e] ? !0 : this.parent ? this.parent.has(e) : !1;
|
|
3609
3609
|
}
|
|
3610
3610
|
}
|
|
3611
|
-
const
|
|
3611
|
+
const jt = { kind: "null" }, b = { kind: "number" }, I = { kind: "string" }, _ = { kind: "boolean" }, de = { kind: "color" }, Nt = { kind: "projectionDefinition" }, Re = { kind: "object" }, T = { kind: "value" }, Xi = { kind: "error" }, Dt = { kind: "collator" }, Ut = { kind: "formatted" }, Bt = { kind: "padding" }, nt = { kind: "colorArray" }, qt = { kind: "numberArray" }, ft = { kind: "resolvedImage" }, Gt = { kind: "variableAnchorOffsetCollection" };
|
|
3612
3612
|
function Z(r, e) {
|
|
3613
3613
|
return {
|
|
3614
3614
|
kind: "array",
|
|
@@ -3616,20 +3616,20 @@ function Z(r, e) {
|
|
|
3616
3616
|
N: e
|
|
3617
3617
|
};
|
|
3618
3618
|
}
|
|
3619
|
-
function
|
|
3619
|
+
function j(r) {
|
|
3620
3620
|
if (r.kind === "array") {
|
|
3621
|
-
const e =
|
|
3621
|
+
const e = j(r.itemType);
|
|
3622
3622
|
return typeof r.N == "number" ? `array<${e}, ${r.N}>` : r.itemType.kind === "value" ? "array" : `array<${e}>`;
|
|
3623
3623
|
} else
|
|
3624
3624
|
return r.kind;
|
|
3625
3625
|
}
|
|
3626
3626
|
const Wi = [
|
|
3627
|
-
|
|
3627
|
+
jt,
|
|
3628
3628
|
b,
|
|
3629
|
-
|
|
3629
|
+
I,
|
|
3630
3630
|
_,
|
|
3631
3631
|
de,
|
|
3632
|
-
|
|
3632
|
+
Nt,
|
|
3633
3633
|
Ut,
|
|
3634
3634
|
Re,
|
|
3635
3635
|
Z(T),
|
|
@@ -3654,7 +3654,7 @@ function at(r, e) {
|
|
|
3654
3654
|
return null;
|
|
3655
3655
|
}
|
|
3656
3656
|
}
|
|
3657
|
-
return `Expected ${
|
|
3657
|
+
return `Expected ${j(r)} but found ${j(e)} instead.`;
|
|
3658
3658
|
}
|
|
3659
3659
|
function Ur(r, e) {
|
|
3660
3660
|
return e.some((t) => t.kind === r.kind);
|
|
@@ -4255,7 +4255,7 @@ class X {
|
|
|
4255
4255
|
return new X(o);
|
|
4256
4256
|
}
|
|
4257
4257
|
}
|
|
4258
|
-
class
|
|
4258
|
+
class N extends Error {
|
|
4259
4259
|
constructor(e) {
|
|
4260
4260
|
super(e), this.name = "RuntimeError";
|
|
4261
4261
|
}
|
|
@@ -4286,11 +4286,11 @@ class ue {
|
|
|
4286
4286
|
static interpolate(e, t, n) {
|
|
4287
4287
|
const a = e.values, o = t.values;
|
|
4288
4288
|
if (a.length !== o.length)
|
|
4289
|
-
throw new
|
|
4289
|
+
throw new N(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);
|
|
4290
4290
|
const i = [];
|
|
4291
4291
|
for (let s = 0; s < a.length; s += 2) {
|
|
4292
4292
|
if (a[s] !== o[s])
|
|
4293
|
-
throw new
|
|
4293
|
+
throw new N(`Cannot interpolate values containing mismatched anchors. from[${s}]: ${a[s]}, to[${s}]: ${o[s]}`);
|
|
4294
4294
|
i.push(a[s]);
|
|
4295
4295
|
const [l, u] = a[s + 1], [c, p] = o[s + 1];
|
|
4296
4296
|
i.push([Le(l, c, n), Le(u, p, n)]);
|
|
@@ -4348,9 +4348,9 @@ function ot(r) {
|
|
|
4348
4348
|
}
|
|
4349
4349
|
function B(r) {
|
|
4350
4350
|
if (r === null)
|
|
4351
|
-
return
|
|
4351
|
+
return jt;
|
|
4352
4352
|
if (typeof r == "string")
|
|
4353
|
-
return
|
|
4353
|
+
return I;
|
|
4354
4354
|
if (typeof r == "boolean")
|
|
4355
4355
|
return _;
|
|
4356
4356
|
if (typeof r == "number")
|
|
@@ -4358,7 +4358,7 @@ function B(r) {
|
|
|
4358
4358
|
if (r instanceof F)
|
|
4359
4359
|
return de;
|
|
4360
4360
|
if (r instanceof ie)
|
|
4361
|
-
return
|
|
4361
|
+
return Nt;
|
|
4362
4362
|
if (r instanceof Br)
|
|
4363
4363
|
return Dt;
|
|
4364
4364
|
if (r instanceof me)
|
|
@@ -4419,7 +4419,7 @@ class He {
|
|
|
4419
4419
|
}
|
|
4420
4420
|
}
|
|
4421
4421
|
const wt = {
|
|
4422
|
-
string:
|
|
4422
|
+
string: I,
|
|
4423
4423
|
number: b,
|
|
4424
4424
|
boolean: _,
|
|
4425
4425
|
object: Re
|
|
@@ -4468,7 +4468,7 @@ class se {
|
|
|
4468
4468
|
const n = this.args[t].evaluate(e);
|
|
4469
4469
|
if (at(this.type, B(n))) {
|
|
4470
4470
|
if (t === this.args.length - 1)
|
|
4471
|
-
throw new
|
|
4471
|
+
throw new N(`Expected value to be of type ${j(this.type)}, but found ${j(B(n))} instead.`);
|
|
4472
4472
|
} else return n;
|
|
4473
4473
|
}
|
|
4474
4474
|
throw new Error();
|
|
@@ -4484,7 +4484,7 @@ const An = {
|
|
|
4484
4484
|
"to-boolean": _,
|
|
4485
4485
|
"to-color": de,
|
|
4486
4486
|
"to-number": b,
|
|
4487
|
-
"to-string":
|
|
4487
|
+
"to-string": I
|
|
4488
4488
|
};
|
|
4489
4489
|
class ke {
|
|
4490
4490
|
constructor(e, t) {
|
|
@@ -4523,7 +4523,7 @@ class ke {
|
|
|
4523
4523
|
} else if (Array.isArray(t) && (t.length < 3 || t.length > 4 ? n = `Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.` : n = ka(t[0], t[1], t[2], t[3]), !n))
|
|
4524
4524
|
return new F(t[0] / 255, t[1] / 255, t[2] / 255, t[3]);
|
|
4525
4525
|
}
|
|
4526
|
-
throw new
|
|
4526
|
+
throw new N(n || `Could not parse color from value '${typeof t == "string" ? t : JSON.stringify(t)}'`);
|
|
4527
4527
|
}
|
|
4528
4528
|
case "padding": {
|
|
4529
4529
|
let t;
|
|
@@ -4533,7 +4533,7 @@ class ke {
|
|
|
4533
4533
|
if (a)
|
|
4534
4534
|
return a;
|
|
4535
4535
|
}
|
|
4536
|
-
throw new
|
|
4536
|
+
throw new N(`Could not parse padding from value '${typeof t == "string" ? t : JSON.stringify(t)}'`);
|
|
4537
4537
|
}
|
|
4538
4538
|
case "numberArray": {
|
|
4539
4539
|
let t;
|
|
@@ -4543,7 +4543,7 @@ class ke {
|
|
|
4543
4543
|
if (a)
|
|
4544
4544
|
return a;
|
|
4545
4545
|
}
|
|
4546
|
-
throw new
|
|
4546
|
+
throw new N(`Could not parse numberArray from value '${typeof t == "string" ? t : JSON.stringify(t)}'`);
|
|
4547
4547
|
}
|
|
4548
4548
|
case "colorArray": {
|
|
4549
4549
|
let t;
|
|
@@ -4553,7 +4553,7 @@ class ke {
|
|
|
4553
4553
|
if (a)
|
|
4554
4554
|
return a;
|
|
4555
4555
|
}
|
|
4556
|
-
throw new
|
|
4556
|
+
throw new N(`Could not parse colorArray from value '${typeof t == "string" ? t : JSON.stringify(t)}'`);
|
|
4557
4557
|
}
|
|
4558
4558
|
case "variableAnchorOffsetCollection": {
|
|
4559
4559
|
let t;
|
|
@@ -4563,7 +4563,7 @@ class ke {
|
|
|
4563
4563
|
if (a)
|
|
4564
4564
|
return a;
|
|
4565
4565
|
}
|
|
4566
|
-
throw new
|
|
4566
|
+
throw new N(`Could not parse variableAnchorOffsetCollection from value '${typeof t == "string" ? t : JSON.stringify(t)}'`);
|
|
4567
4567
|
}
|
|
4568
4568
|
case "number": {
|
|
4569
4569
|
let t = null;
|
|
@@ -4574,7 +4574,7 @@ class ke {
|
|
|
4574
4574
|
if (!isNaN(a))
|
|
4575
4575
|
return a;
|
|
4576
4576
|
}
|
|
4577
|
-
throw new
|
|
4577
|
+
throw new N(`Could not convert ${JSON.stringify(t)} to number.`);
|
|
4578
4578
|
}
|
|
4579
4579
|
case "formatted":
|
|
4580
4580
|
return me.fromString(tt(this.args[0].evaluate(e)));
|
|
@@ -4774,11 +4774,11 @@ class qr {
|
|
|
4774
4774
|
evaluate(e) {
|
|
4775
4775
|
const t = this.index.evaluate(e), n = this.input.evaluate(e);
|
|
4776
4776
|
if (t < 0)
|
|
4777
|
-
throw new
|
|
4777
|
+
throw new N(`Array index out of bounds: ${t} < 0.`);
|
|
4778
4778
|
if (t >= n.length)
|
|
4779
|
-
throw new
|
|
4779
|
+
throw new N(`Array index out of bounds: ${t} > ${n.length - 1}.`);
|
|
4780
4780
|
if (t !== Math.floor(t))
|
|
4781
|
-
throw new
|
|
4781
|
+
throw new N(`Array index must be an integer, but found ${t} instead.`);
|
|
4782
4782
|
return n[t];
|
|
4783
4783
|
}
|
|
4784
4784
|
eachChild(e) {
|
|
@@ -4796,16 +4796,16 @@ class Gr {
|
|
|
4796
4796
|
if (e.length !== 3)
|
|
4797
4797
|
return t.error(`Expected 2 arguments, but found ${e.length - 1} instead.`);
|
|
4798
4798
|
const n = t.parse(e[1], 1, T), a = t.parse(e[2], 2, T);
|
|
4799
|
-
return !n || !a ? null : Ur(n.type, [_,
|
|
4799
|
+
return !n || !a ? null : Ur(n.type, [_, I, b, jt, T]) ? new Gr(n, a) : t.error(`Expected first argument to be of type boolean, string, number or null, but found ${j(n.type)} instead`);
|
|
4800
4800
|
}
|
|
4801
4801
|
evaluate(e) {
|
|
4802
4802
|
const t = this.needle.evaluate(e), n = this.haystack.evaluate(e);
|
|
4803
4803
|
if (!n)
|
|
4804
4804
|
return !1;
|
|
4805
4805
|
if (!ze(t, ["boolean", "string", "number", "null"]))
|
|
4806
|
-
throw new
|
|
4806
|
+
throw new N(`Expected first argument to be of type boolean, string, number or null, but found ${j(B(t))} instead.`);
|
|
4807
4807
|
if (!ze(n, ["string", "array"]))
|
|
4808
|
-
throw new
|
|
4808
|
+
throw new N(`Expected second argument to be of type array or string, but found ${j(B(n))} instead.`);
|
|
4809
4809
|
return n.indexOf(t) >= 0;
|
|
4810
4810
|
}
|
|
4811
4811
|
eachChild(e) {
|
|
@@ -4825,8 +4825,8 @@ class _t {
|
|
|
4825
4825
|
const n = t.parse(e[1], 1, T), a = t.parse(e[2], 2, T);
|
|
4826
4826
|
if (!n || !a)
|
|
4827
4827
|
return null;
|
|
4828
|
-
if (!Ur(n.type, [_,
|
|
4829
|
-
return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${
|
|
4828
|
+
if (!Ur(n.type, [_, I, b, jt, T]))
|
|
4829
|
+
return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${j(n.type)} instead`);
|
|
4830
4830
|
if (e.length === 4) {
|
|
4831
4831
|
const o = t.parse(e[3], 3, b);
|
|
4832
4832
|
return o ? new _t(n, a, o) : null;
|
|
@@ -4836,7 +4836,7 @@ class _t {
|
|
|
4836
4836
|
evaluate(e) {
|
|
4837
4837
|
const t = this.needle.evaluate(e), n = this.haystack.evaluate(e);
|
|
4838
4838
|
if (!ze(t, ["boolean", "string", "number", "null"]))
|
|
4839
|
-
throw new
|
|
4839
|
+
throw new N(`Expected first argument to be of type boolean, string, number or null, but found ${j(B(t))} instead.`);
|
|
4840
4840
|
let a;
|
|
4841
4841
|
if (this.fromIndex && (a = this.fromIndex.evaluate(e)), ze(n, ["string"])) {
|
|
4842
4842
|
const o = n.indexOf(t, a);
|
|
@@ -4844,7 +4844,7 @@ class _t {
|
|
|
4844
4844
|
} else {
|
|
4845
4845
|
if (ze(n, ["array"]))
|
|
4846
4846
|
return n.indexOf(t, a);
|
|
4847
|
-
throw new
|
|
4847
|
+
throw new N(`Expected second argument to be of type array or string, but found ${j(B(n))} instead.`);
|
|
4848
4848
|
}
|
|
4849
4849
|
}
|
|
4850
4850
|
eachChild(e) {
|
|
@@ -4953,7 +4953,7 @@ class Hr {
|
|
|
4953
4953
|
return this.branches.every(([e, t]) => t.outputDefined()) && this.otherwise.outputDefined();
|
|
4954
4954
|
}
|
|
4955
4955
|
}
|
|
4956
|
-
class
|
|
4956
|
+
class It {
|
|
4957
4957
|
constructor(e, t, n, a) {
|
|
4958
4958
|
this.type = e, this.input = t, this.beginIndex = n, this.endIndex = a;
|
|
4959
4959
|
}
|
|
@@ -4963,13 +4963,13 @@ class Mt {
|
|
|
4963
4963
|
const n = t.parse(e[1], 1, T), a = t.parse(e[2], 2, b);
|
|
4964
4964
|
if (!n || !a)
|
|
4965
4965
|
return null;
|
|
4966
|
-
if (!Ur(n.type, [Z(T),
|
|
4967
|
-
return t.error(`Expected first argument to be of type array or string, but found ${
|
|
4966
|
+
if (!Ur(n.type, [Z(T), I, T]))
|
|
4967
|
+
return t.error(`Expected first argument to be of type array or string, but found ${j(n.type)} instead`);
|
|
4968
4968
|
if (e.length === 4) {
|
|
4969
4969
|
const o = t.parse(e[3], 3, b);
|
|
4970
|
-
return o ? new
|
|
4970
|
+
return o ? new It(n.type, n, a, o) : null;
|
|
4971
4971
|
} else
|
|
4972
|
-
return new
|
|
4972
|
+
return new It(n.type, n, a);
|
|
4973
4973
|
}
|
|
4974
4974
|
evaluate(e) {
|
|
4975
4975
|
const t = this.input.evaluate(e), n = this.beginIndex.evaluate(e);
|
|
@@ -4978,7 +4978,7 @@ class Mt {
|
|
|
4978
4978
|
return [...t].slice(n, a).join("");
|
|
4979
4979
|
if (ze(t, ["array"]))
|
|
4980
4980
|
return t.slice(n, a);
|
|
4981
|
-
throw new
|
|
4981
|
+
throw new N(`Expected first argument to be of type array or string, but found ${j(B(t))} instead.`);
|
|
4982
4982
|
}
|
|
4983
4983
|
eachChild(e) {
|
|
4984
4984
|
e(this.input), e(this.beginIndex), this.endIndex && e(this.endIndex);
|
|
@@ -4998,7 +4998,7 @@ function La(r, e) {
|
|
|
4998
4998
|
} else if (i > e)
|
|
4999
4999
|
a = o - 1;
|
|
5000
5000
|
else
|
|
5001
|
-
throw new
|
|
5001
|
+
throw new N("Input is not a number.");
|
|
5002
5002
|
return 0;
|
|
5003
5003
|
}
|
|
5004
5004
|
class Xt {
|
|
@@ -5156,7 +5156,7 @@ class he {
|
|
|
5156
5156
|
return null;
|
|
5157
5157
|
l = l || h.type, s.push([c, h]);
|
|
5158
5158
|
}
|
|
5159
|
-
return !we(l, b) && !we(l,
|
|
5159
|
+
return !we(l, b) && !we(l, Nt) && !we(l, de) && !we(l, Bt) && !we(l, qt) && !we(l, nt) && !we(l, Gt) && !we(l, Z(b)) ? t.error(`Type ${j(l)} is not interpolatable.`) : new he(l, n, a, o, s);
|
|
5160
5160
|
}
|
|
5161
5161
|
evaluate(e) {
|
|
5162
5162
|
const t = this.labels, n = this.outputs;
|
|
@@ -5307,14 +5307,14 @@ function Xe(r, e, t) {
|
|
|
5307
5307
|
if (!l)
|
|
5308
5308
|
return null;
|
|
5309
5309
|
if (!Tn(s, l.type))
|
|
5310
|
-
return i.concat(1).error(`"${s}" comparisons are not supported for type '${
|
|
5310
|
+
return i.concat(1).error(`"${s}" comparisons are not supported for type '${j(l.type)}'.`);
|
|
5311
5311
|
let u = i.parse(o[2], 2, T);
|
|
5312
5312
|
if (!u)
|
|
5313
5313
|
return null;
|
|
5314
5314
|
if (!Tn(s, u.type))
|
|
5315
|
-
return i.concat(2).error(`"${s}" comparisons are not supported for type '${
|
|
5315
|
+
return i.concat(2).error(`"${s}" comparisons are not supported for type '${j(u.type)}'.`);
|
|
5316
5316
|
if (l.type.kind !== u.type.kind && l.type.kind !== "value" && u.type.kind !== "value")
|
|
5317
|
-
return i.error(`Cannot compare types '${
|
|
5317
|
+
return i.error(`Cannot compare types '${j(l.type)}' and '${j(u.type)}'.`);
|
|
5318
5318
|
n && (l.type.kind === "value" && u.type.kind !== "value" ? l = new se(u.type, [l]) : l.type.kind !== "value" && u.type.kind === "value" && (u = new se(l.type, [u])));
|
|
5319
5319
|
let c = null;
|
|
5320
5320
|
if (o.length === 4) {
|
|
@@ -5330,7 +5330,7 @@ function Xe(r, e, t) {
|
|
|
5330
5330
|
if (n && this.hasUntypedArgument) {
|
|
5331
5331
|
const l = B(i), u = B(s);
|
|
5332
5332
|
if (l.kind !== u.kind || !(l.kind === "string" || l.kind === "number"))
|
|
5333
|
-
throw new
|
|
5333
|
+
throw new N(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`);
|
|
5334
5334
|
}
|
|
5335
5335
|
if (this.collator && !n && this.hasUntypedArgument) {
|
|
5336
5336
|
const l = B(i), u = B(s);
|
|
@@ -5365,7 +5365,7 @@ class Wt {
|
|
|
5365
5365
|
if (!o)
|
|
5366
5366
|
return null;
|
|
5367
5367
|
let i = null;
|
|
5368
|
-
return n.locale && (i = t.parse(n.locale, 1,
|
|
5368
|
+
return n.locale && (i = t.parse(n.locale, 1, I), !i) ? null : new Wt(a, o, i);
|
|
5369
5369
|
}
|
|
5370
5370
|
evaluate(e) {
|
|
5371
5371
|
return new Br(this.caseSensitive.evaluate(e), this.diacriticSensitive.evaluate(e), this.locale ? this.locale.evaluate(e) : null);
|
|
@@ -5379,7 +5379,7 @@ class Wt {
|
|
|
5379
5379
|
}
|
|
5380
5380
|
class Kr {
|
|
5381
5381
|
constructor(e, t, n, a, o) {
|
|
5382
|
-
this.type =
|
|
5382
|
+
this.type = I, this.number = e, this.locale = t, this.currency = n, this.minFractionDigits = a, this.maxFractionDigits = o;
|
|
5383
5383
|
}
|
|
5384
5384
|
static parse(e, t) {
|
|
5385
5385
|
if (e.length !== 3)
|
|
@@ -5391,10 +5391,10 @@ class Kr {
|
|
|
5391
5391
|
if (typeof a != "object" || Array.isArray(a))
|
|
5392
5392
|
return t.error("NumberFormat options argument must be an object.");
|
|
5393
5393
|
let o = null;
|
|
5394
|
-
if (a.locale && (o = t.parse(a.locale, 1,
|
|
5394
|
+
if (a.locale && (o = t.parse(a.locale, 1, I), !o))
|
|
5395
5395
|
return null;
|
|
5396
5396
|
let i = null;
|
|
5397
|
-
if (a.currency && (i = t.parse(a.currency, 1,
|
|
5397
|
+
if (a.currency && (i = t.parse(a.currency, 1, I), !i))
|
|
5398
5398
|
return null;
|
|
5399
5399
|
let s = null;
|
|
5400
5400
|
if (a["min-fraction-digits"] && (s = t.parse(a["min-fraction-digits"], 1, b), !s))
|
|
@@ -5437,7 +5437,7 @@ class Xr {
|
|
|
5437
5437
|
if (s["font-scale"] && (l = t.parse(s["font-scale"], 1, b), !l))
|
|
5438
5438
|
return null;
|
|
5439
5439
|
let u = null;
|
|
5440
|
-
if (s["text-font"] && (u = t.parse(s["text-font"], 1, Z(
|
|
5440
|
+
if (s["text-font"] && (u = t.parse(s["text-font"], 1, Z(I)), !u))
|
|
5441
5441
|
return null;
|
|
5442
5442
|
let c = null;
|
|
5443
5443
|
if (s["text-color"] && (c = t.parse(s["text-color"], 1, de), !c))
|
|
@@ -5446,7 +5446,7 @@ class Xr {
|
|
|
5446
5446
|
if (s["vertical-align"]) {
|
|
5447
5447
|
if (typeof s["vertical-align"] == "string" && !os.includes(s["vertical-align"]))
|
|
5448
5448
|
return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${s["vertical-align"]}' instead.`);
|
|
5449
|
-
if (p = t.parse(s["vertical-align"], 1,
|
|
5449
|
+
if (p = t.parse(s["vertical-align"], 1, I), !p)
|
|
5450
5450
|
return null;
|
|
5451
5451
|
}
|
|
5452
5452
|
const f = a[a.length - 1];
|
|
@@ -5485,7 +5485,7 @@ class Wr {
|
|
|
5485
5485
|
static parse(e, t) {
|
|
5486
5486
|
if (e.length !== 2)
|
|
5487
5487
|
return t.error("Expected two arguments.");
|
|
5488
|
-
const n = t.parse(e[1], 1,
|
|
5488
|
+
const n = t.parse(e[1], 1, I);
|
|
5489
5489
|
return n ? new Wr(n) : t.error("No image name provided.");
|
|
5490
5490
|
}
|
|
5491
5491
|
evaluate(e) {
|
|
@@ -5507,7 +5507,7 @@ class Zr {
|
|
|
5507
5507
|
if (e.length !== 2)
|
|
5508
5508
|
return t.error(`Expected 1 argument, but found ${e.length - 1} instead.`);
|
|
5509
5509
|
const n = t.parse(e[1], 1);
|
|
5510
|
-
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 ${
|
|
5510
|
+
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 ${j(n.type)} instead.`) : new Zr(n) : null;
|
|
5511
5511
|
}
|
|
5512
5512
|
evaluate(e) {
|
|
5513
5513
|
const t = this.input.evaluate(e);
|
|
@@ -5515,7 +5515,7 @@ class Zr {
|
|
|
5515
5515
|
return [...t].length;
|
|
5516
5516
|
if (Array.isArray(t))
|
|
5517
5517
|
return t.length;
|
|
5518
|
-
throw new
|
|
5518
|
+
throw new N(`Expected value to be of type string or array, but found ${j(B(t))} instead.`);
|
|
5519
5519
|
}
|
|
5520
5520
|
eachChild(e) {
|
|
5521
5521
|
e(this.input);
|
|
@@ -5526,17 +5526,17 @@ class Zr {
|
|
|
5526
5526
|
}
|
|
5527
5527
|
const ye = 8192;
|
|
5528
5528
|
function _s(r, e) {
|
|
5529
|
-
const t =
|
|
5529
|
+
const t = Is(r[0]), n = Ps(r[1]), a = Math.pow(2, e.z);
|
|
5530
5530
|
return [Math.round(t * a * ye), Math.round(n * a * ye)];
|
|
5531
5531
|
}
|
|
5532
5532
|
function Yr(r, e) {
|
|
5533
5533
|
const t = Math.pow(2, e.z), n = (r[0] / ye + e.x) / t, a = (r[1] / ye + e.y) / t;
|
|
5534
|
-
return [
|
|
5534
|
+
return [Ms(n), Rs(a)];
|
|
5535
5535
|
}
|
|
5536
|
-
function
|
|
5536
|
+
function Is(r) {
|
|
5537
5537
|
return (180 + r) / 360;
|
|
5538
5538
|
}
|
|
5539
|
-
function
|
|
5539
|
+
function Ms(r) {
|
|
5540
5540
|
return r * 360 - 180;
|
|
5541
5541
|
}
|
|
5542
5542
|
function Ps(r) {
|
|
@@ -5560,7 +5560,7 @@ function Fs(r, e, t) {
|
|
|
5560
5560
|
}
|
|
5561
5561
|
function Zt(r, e, t, n) {
|
|
5562
5562
|
const a = [e[0] - r[0], e[1] - r[1]], o = [n[0] - t[0], n[1] - t[1]];
|
|
5563
|
-
return
|
|
5563
|
+
return Ns(o, a) === 0 ? !1 : !!(_n(r, e, t, n) && _n(t, n, r, e));
|
|
5564
5564
|
}
|
|
5565
5565
|
function $s(r, e, t) {
|
|
5566
5566
|
for (const n of t)
|
|
@@ -5594,13 +5594,13 @@ function Ta(r, e) {
|
|
|
5594
5594
|
return !1;
|
|
5595
5595
|
return !0;
|
|
5596
5596
|
}
|
|
5597
|
-
function
|
|
5597
|
+
function js(r, e) {
|
|
5598
5598
|
for (const t of e)
|
|
5599
5599
|
if (Ta(r, t))
|
|
5600
5600
|
return !0;
|
|
5601
5601
|
return !1;
|
|
5602
5602
|
}
|
|
5603
|
-
function
|
|
5603
|
+
function Ns(r, e) {
|
|
5604
5604
|
return r[0] * e[1] - r[1] * e[0];
|
|
5605
5605
|
}
|
|
5606
5606
|
function _n(r, e, t, n) {
|
|
@@ -5627,7 +5627,7 @@ function _a(r, e, t) {
|
|
|
5627
5627
|
}
|
|
5628
5628
|
return n;
|
|
5629
5629
|
}
|
|
5630
|
-
function
|
|
5630
|
+
function Ia(r, e, t, n) {
|
|
5631
5631
|
if (r[0] < t[0] || r[0] > t[2]) {
|
|
5632
5632
|
const a = n * 0.5;
|
|
5633
5633
|
let o = r[0] - t[0] > a ? -n : t[0] - r[0] > a ? n : 0;
|
|
@@ -5638,16 +5638,16 @@ function Ma(r, e, t, n) {
|
|
|
5638
5638
|
function Ds(r) {
|
|
5639
5639
|
r[0] = r[1] = 1 / 0, r[2] = r[3] = -1 / 0;
|
|
5640
5640
|
}
|
|
5641
|
-
function
|
|
5641
|
+
function In(r, e, t, n) {
|
|
5642
5642
|
const a = Math.pow(2, n.z) * ye, o = [n.x * ye, n.y * ye], i = [];
|
|
5643
5643
|
for (const s of r)
|
|
5644
5644
|
for (const l of s) {
|
|
5645
5645
|
const u = [l.x + o[0], l.y + o[1]];
|
|
5646
|
-
|
|
5646
|
+
Ia(u, e, t, a), i.push(u);
|
|
5647
5647
|
}
|
|
5648
5648
|
return i;
|
|
5649
5649
|
}
|
|
5650
|
-
function
|
|
5650
|
+
function Mn(r, e, t, n) {
|
|
5651
5651
|
const a = Math.pow(2, n.z) * ye, o = [n.x * ye, n.y * ye], i = [];
|
|
5652
5652
|
for (const s of r) {
|
|
5653
5653
|
const l = [];
|
|
@@ -5661,14 +5661,14 @@ function In(r, e, t, n) {
|
|
|
5661
5661
|
Ds(e);
|
|
5662
5662
|
for (const s of i)
|
|
5663
5663
|
for (const l of s)
|
|
5664
|
-
|
|
5664
|
+
Ia(l, e, t, a);
|
|
5665
5665
|
}
|
|
5666
5666
|
return i;
|
|
5667
5667
|
}
|
|
5668
5668
|
function Us(r, e) {
|
|
5669
5669
|
const t = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n = [1 / 0, 1 / 0, -1 / 0, -1 / 0], a = r.canonicalID();
|
|
5670
5670
|
if (e.type === "Polygon") {
|
|
5671
|
-
const o = Jr(e.coordinates, n, a), i =
|
|
5671
|
+
const o = Jr(e.coordinates, n, a), i = In(r.geometry(), t, n, a);
|
|
5672
5672
|
if (!st(t, n))
|
|
5673
5673
|
return !1;
|
|
5674
5674
|
for (const s of i)
|
|
@@ -5676,7 +5676,7 @@ function Us(r, e) {
|
|
|
5676
5676
|
return !1;
|
|
5677
5677
|
}
|
|
5678
5678
|
if (e.type === "MultiPolygon") {
|
|
5679
|
-
const o = _a(e.coordinates, n, a), i =
|
|
5679
|
+
const o = _a(e.coordinates, n, a), i = In(r.geometry(), t, n, a);
|
|
5680
5680
|
if (!st(t, n))
|
|
5681
5681
|
return !1;
|
|
5682
5682
|
for (const s of i)
|
|
@@ -5688,7 +5688,7 @@ function Us(r, e) {
|
|
|
5688
5688
|
function Bs(r, e) {
|
|
5689
5689
|
const t = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n = [1 / 0, 1 / 0, -1 / 0, -1 / 0], a = r.canonicalID();
|
|
5690
5690
|
if (e.type === "Polygon") {
|
|
5691
|
-
const o = Jr(e.coordinates, n, a), i =
|
|
5691
|
+
const o = Jr(e.coordinates, n, a), i = Mn(r.geometry(), t, n, a);
|
|
5692
5692
|
if (!st(t, n))
|
|
5693
5693
|
return !1;
|
|
5694
5694
|
for (const s of i)
|
|
@@ -5696,11 +5696,11 @@ function Bs(r, e) {
|
|
|
5696
5696
|
return !1;
|
|
5697
5697
|
}
|
|
5698
5698
|
if (e.type === "MultiPolygon") {
|
|
5699
|
-
const o = _a(e.coordinates, n, a), i =
|
|
5699
|
+
const o = _a(e.coordinates, n, a), i = Mn(r.geometry(), t, n, a);
|
|
5700
5700
|
if (!st(t, n))
|
|
5701
5701
|
return !1;
|
|
5702
5702
|
for (const s of i)
|
|
5703
|
-
if (!
|
|
5703
|
+
if (!js(s, o))
|
|
5704
5704
|
return !1;
|
|
5705
5705
|
}
|
|
5706
5706
|
return !0;
|
|
@@ -5751,7 +5751,7 @@ class Fe {
|
|
|
5751
5751
|
return !0;
|
|
5752
5752
|
}
|
|
5753
5753
|
}
|
|
5754
|
-
class
|
|
5754
|
+
class Ma {
|
|
5755
5755
|
constructor(e = [], t = (n, a) => n < a ? -1 : n > a ? 1 : 0) {
|
|
5756
5756
|
if (this.data = e, this.length = this.data.length, this.compare = t, this.length > 0)
|
|
5757
5757
|
for (let n = (this.length >> 1) - 1; n >= 0; n--) this._down(n);
|
|
@@ -5862,7 +5862,7 @@ const Ar = 100, Er = 50;
|
|
|
5862
5862
|
function Pa(r, e) {
|
|
5863
5863
|
return e[0] - r[0];
|
|
5864
5864
|
}
|
|
5865
|
-
function
|
|
5865
|
+
function Mt(r) {
|
|
5866
5866
|
return r[1] - r[0] + 1;
|
|
5867
5867
|
}
|
|
5868
5868
|
function ve(r, e) {
|
|
@@ -5871,7 +5871,7 @@ function ve(r, e) {
|
|
|
5871
5871
|
function Tr(r, e) {
|
|
5872
5872
|
if (r[0] > r[1])
|
|
5873
5873
|
return [null, null];
|
|
5874
|
-
const t =
|
|
5874
|
+
const t = Mt(r);
|
|
5875
5875
|
if (e) {
|
|
5876
5876
|
if (t === 2)
|
|
5877
5877
|
return [r, null];
|
|
@@ -5897,7 +5897,7 @@ function _r(r, e) {
|
|
|
5897
5897
|
dt(t, r[n]);
|
|
5898
5898
|
return t;
|
|
5899
5899
|
}
|
|
5900
|
-
function
|
|
5900
|
+
function Ir(r) {
|
|
5901
5901
|
const e = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
|
|
5902
5902
|
for (const t of r)
|
|
5903
5903
|
for (const n of t)
|
|
@@ -5987,7 +5987,7 @@ function $n(r, e) {
|
|
|
5987
5987
|
return !1;
|
|
5988
5988
|
}
|
|
5989
5989
|
function Zs(r, e, t, n = 1 / 0) {
|
|
5990
|
-
const a =
|
|
5990
|
+
const a = Ir(r), o = Ir(e);
|
|
5991
5991
|
if (n !== 1 / 0 && en(a, o, t) >= n)
|
|
5992
5992
|
return n;
|
|
5993
5993
|
if (st(a, o)) {
|
|
@@ -6025,13 +6025,13 @@ function Pt(r, e, t, n, a = 1 / 0) {
|
|
|
6025
6025
|
let o = Math.min(n.distance(r[0], t[0][0]), a);
|
|
6026
6026
|
if (o === 0)
|
|
6027
6027
|
return o;
|
|
6028
|
-
const i = new
|
|
6028
|
+
const i = new Ma([[0, [0, r.length - 1], [0, 0]]], Pa), s = Ir(t);
|
|
6029
6029
|
for (; i.length > 0; ) {
|
|
6030
6030
|
const l = i.pop();
|
|
6031
6031
|
if (l[0] >= o)
|
|
6032
6032
|
continue;
|
|
6033
6033
|
const u = l[1], c = e ? Er : Ar;
|
|
6034
|
-
if (
|
|
6034
|
+
if (Mt(u) <= c) {
|
|
6035
6035
|
if (!ve(u, r.length))
|
|
6036
6036
|
return NaN;
|
|
6037
6037
|
if (e) {
|
|
@@ -6056,13 +6056,13 @@ function Rt(r, e, t, n, a, o = 1 / 0) {
|
|
|
6056
6056
|
let i = Math.min(o, a.distance(r[0], t[0]));
|
|
6057
6057
|
if (i === 0)
|
|
6058
6058
|
return i;
|
|
6059
|
-
const s = new
|
|
6059
|
+
const s = new Ma([[0, [0, r.length - 1], [0, t.length - 1]]], Pa);
|
|
6060
6060
|
for (; s.length > 0; ) {
|
|
6061
6061
|
const l = s.pop();
|
|
6062
6062
|
if (l[0] >= i)
|
|
6063
6063
|
continue;
|
|
6064
6064
|
const u = l[1], c = l[2], p = e ? Er : Ar, f = n ? Er : Ar;
|
|
6065
|
-
if (
|
|
6065
|
+
if (Mt(u) <= p && Mt(c) <= f) {
|
|
6066
6066
|
if (!ve(u, r.length) && ve(c, t.length))
|
|
6067
6067
|
return NaN;
|
|
6068
6068
|
let d;
|
|
@@ -6253,7 +6253,7 @@ const rn = {
|
|
|
6253
6253
|
number: se,
|
|
6254
6254
|
"number-format": Kr,
|
|
6255
6255
|
object: se,
|
|
6256
|
-
slice:
|
|
6256
|
+
slice: It,
|
|
6257
6257
|
step: Xt,
|
|
6258
6258
|
string: se,
|
|
6259
6259
|
"to-boolean": ke,
|
|
@@ -6318,7 +6318,7 @@ class le {
|
|
|
6318
6318
|
const d = t.parse(e[f], 1 + p.length);
|
|
6319
6319
|
if (!d)
|
|
6320
6320
|
return null;
|
|
6321
|
-
p.push(
|
|
6321
|
+
p.push(j(d.type));
|
|
6322
6322
|
}
|
|
6323
6323
|
t.error(`Expected arguments of type ${c}, but found (${p.join(", ")}) instead.`);
|
|
6324
6324
|
}
|
|
@@ -6330,14 +6330,14 @@ class le {
|
|
|
6330
6330
|
e[n] = le;
|
|
6331
6331
|
}
|
|
6332
6332
|
}
|
|
6333
|
-
function
|
|
6333
|
+
function jn(r, [e, t, n, a]) {
|
|
6334
6334
|
e = e.evaluate(r), t = t.evaluate(r), n = n.evaluate(r);
|
|
6335
6335
|
const o = a ? a.evaluate(r) : 1, i = ka(e, t, n, o);
|
|
6336
6336
|
if (i)
|
|
6337
|
-
throw new
|
|
6337
|
+
throw new N(i);
|
|
6338
6338
|
return new F(e / 255, t / 255, n / 255, o, !1);
|
|
6339
6339
|
}
|
|
6340
|
-
function
|
|
6340
|
+
function Nn(r, e) {
|
|
6341
6341
|
return r in e;
|
|
6342
6342
|
}
|
|
6343
6343
|
function fr(r, e) {
|
|
@@ -6353,21 +6353,21 @@ function el(r, e, t, n) {
|
|
|
6353
6353
|
}
|
|
6354
6354
|
return !1;
|
|
6355
6355
|
}
|
|
6356
|
-
function
|
|
6356
|
+
function Ie(r) {
|
|
6357
6357
|
return { type: r };
|
|
6358
6358
|
}
|
|
6359
6359
|
le.register(rn, {
|
|
6360
6360
|
error: [
|
|
6361
6361
|
Xi,
|
|
6362
|
-
[
|
|
6362
|
+
[I],
|
|
6363
6363
|
(r, [e]) => {
|
|
6364
|
-
throw new
|
|
6364
|
+
throw new N(e.evaluate(r));
|
|
6365
6365
|
}
|
|
6366
6366
|
],
|
|
6367
6367
|
typeof: [
|
|
6368
|
-
|
|
6368
|
+
I,
|
|
6369
6369
|
[T],
|
|
6370
|
-
(r, [e]) =>
|
|
6370
|
+
(r, [e]) => j(B(e.evaluate(r)))
|
|
6371
6371
|
],
|
|
6372
6372
|
"to-rgba": [
|
|
6373
6373
|
Z(b, 4),
|
|
@@ -6380,23 +6380,23 @@ le.register(rn, {
|
|
|
6380
6380
|
rgb: [
|
|
6381
6381
|
de,
|
|
6382
6382
|
[b, b, b],
|
|
6383
|
-
|
|
6383
|
+
jn
|
|
6384
6384
|
],
|
|
6385
6385
|
rgba: [
|
|
6386
6386
|
de,
|
|
6387
6387
|
[b, b, b, b],
|
|
6388
|
-
|
|
6388
|
+
jn
|
|
6389
6389
|
],
|
|
6390
6390
|
has: {
|
|
6391
6391
|
type: _,
|
|
6392
6392
|
overloads: [
|
|
6393
6393
|
[
|
|
6394
|
-
[
|
|
6395
|
-
(r, [e]) =>
|
|
6394
|
+
[I],
|
|
6395
|
+
(r, [e]) => Nn(e.evaluate(r), r.properties())
|
|
6396
6396
|
],
|
|
6397
6397
|
[
|
|
6398
|
-
[
|
|
6399
|
-
(r, [e, t]) =>
|
|
6398
|
+
[I, Re],
|
|
6399
|
+
(r, [e, t]) => Nn(e.evaluate(r), t.evaluate(r))
|
|
6400
6400
|
]
|
|
6401
6401
|
]
|
|
6402
6402
|
},
|
|
@@ -6404,18 +6404,18 @@ le.register(rn, {
|
|
|
6404
6404
|
type: T,
|
|
6405
6405
|
overloads: [
|
|
6406
6406
|
[
|
|
6407
|
-
[
|
|
6407
|
+
[I],
|
|
6408
6408
|
(r, [e]) => fr(e.evaluate(r), r.properties())
|
|
6409
6409
|
],
|
|
6410
6410
|
[
|
|
6411
|
-
[
|
|
6411
|
+
[I, Re],
|
|
6412
6412
|
(r, [e, t]) => fr(e.evaluate(r), t.evaluate(r))
|
|
6413
6413
|
]
|
|
6414
6414
|
]
|
|
6415
6415
|
},
|
|
6416
6416
|
"feature-state": [
|
|
6417
6417
|
T,
|
|
6418
|
-
[
|
|
6418
|
+
[I],
|
|
6419
6419
|
(r, [e]) => fr(e.evaluate(r), r.featureState || {})
|
|
6420
6420
|
],
|
|
6421
6421
|
properties: [
|
|
@@ -6424,7 +6424,7 @@ le.register(rn, {
|
|
|
6424
6424
|
(r) => r.properties()
|
|
6425
6425
|
],
|
|
6426
6426
|
"geometry-type": [
|
|
6427
|
-
|
|
6427
|
+
I,
|
|
6428
6428
|
[],
|
|
6429
6429
|
(r) => r.geometryType()
|
|
6430
6430
|
],
|
|
@@ -6460,7 +6460,7 @@ le.register(rn, {
|
|
|
6460
6460
|
],
|
|
6461
6461
|
"+": [
|
|
6462
6462
|
b,
|
|
6463
|
-
|
|
6463
|
+
Ie(b),
|
|
6464
6464
|
(r, e) => {
|
|
6465
6465
|
let t = 0;
|
|
6466
6466
|
for (const n of e)
|
|
@@ -6470,7 +6470,7 @@ le.register(rn, {
|
|
|
6470
6470
|
],
|
|
6471
6471
|
"*": [
|
|
6472
6472
|
b,
|
|
6473
|
-
|
|
6473
|
+
Ie(b),
|
|
6474
6474
|
(r, e) => {
|
|
6475
6475
|
let t = 1;
|
|
6476
6476
|
for (const n of e)
|
|
@@ -6573,12 +6573,12 @@ le.register(rn, {
|
|
|
6573
6573
|
],
|
|
6574
6574
|
min: [
|
|
6575
6575
|
b,
|
|
6576
|
-
|
|
6576
|
+
Ie(b),
|
|
6577
6577
|
(r, e) => Math.min(...e.map((t) => t.evaluate(r)))
|
|
6578
6578
|
],
|
|
6579
6579
|
max: [
|
|
6580
6580
|
b,
|
|
6581
|
-
|
|
6581
|
+
Ie(b),
|
|
6582
6582
|
(r, e) => Math.max(...e.map((t) => t.evaluate(r)))
|
|
6583
6583
|
],
|
|
6584
6584
|
abs: [
|
|
@@ -6606,7 +6606,7 @@ le.register(rn, {
|
|
|
6606
6606
|
],
|
|
6607
6607
|
"filter-==": [
|
|
6608
6608
|
_,
|
|
6609
|
-
[
|
|
6609
|
+
[I, T],
|
|
6610
6610
|
(r, [e, t]) => r.properties()[e.value] === t.value
|
|
6611
6611
|
],
|
|
6612
6612
|
"filter-id-==": [
|
|
@@ -6616,12 +6616,12 @@ le.register(rn, {
|
|
|
6616
6616
|
],
|
|
6617
6617
|
"filter-type-==": [
|
|
6618
6618
|
_,
|
|
6619
|
-
[
|
|
6619
|
+
[I],
|
|
6620
6620
|
(r, [e]) => r.geometryType() === e.value
|
|
6621
6621
|
],
|
|
6622
6622
|
"filter-<": [
|
|
6623
6623
|
_,
|
|
6624
|
-
[
|
|
6624
|
+
[I, T],
|
|
6625
6625
|
(r, [e, t]) => {
|
|
6626
6626
|
const n = r.properties()[e.value], a = t.value;
|
|
6627
6627
|
return typeof n == typeof a && n < a;
|
|
@@ -6637,7 +6637,7 @@ le.register(rn, {
|
|
|
6637
6637
|
],
|
|
6638
6638
|
"filter->": [
|
|
6639
6639
|
_,
|
|
6640
|
-
[
|
|
6640
|
+
[I, T],
|
|
6641
6641
|
(r, [e, t]) => {
|
|
6642
6642
|
const n = r.properties()[e.value], a = t.value;
|
|
6643
6643
|
return typeof n == typeof a && n > a;
|
|
@@ -6653,7 +6653,7 @@ le.register(rn, {
|
|
|
6653
6653
|
],
|
|
6654
6654
|
"filter-<=": [
|
|
6655
6655
|
_,
|
|
6656
|
-
[
|
|
6656
|
+
[I, T],
|
|
6657
6657
|
(r, [e, t]) => {
|
|
6658
6658
|
const n = r.properties()[e.value], a = t.value;
|
|
6659
6659
|
return typeof n == typeof a && n <= a;
|
|
@@ -6669,7 +6669,7 @@ le.register(rn, {
|
|
|
6669
6669
|
],
|
|
6670
6670
|
"filter->=": [
|
|
6671
6671
|
_,
|
|
6672
|
-
[
|
|
6672
|
+
[I, T],
|
|
6673
6673
|
(r, [e, t]) => {
|
|
6674
6674
|
const n = r.properties()[e.value], a = t.value;
|
|
6675
6675
|
return typeof n == typeof a && n >= a;
|
|
@@ -6695,7 +6695,7 @@ le.register(rn, {
|
|
|
6695
6695
|
],
|
|
6696
6696
|
"filter-type-in": [
|
|
6697
6697
|
_,
|
|
6698
|
-
[Z(
|
|
6698
|
+
[Z(I)],
|
|
6699
6699
|
(r, [e]) => e.value.indexOf(r.geometryType()) >= 0
|
|
6700
6700
|
],
|
|
6701
6701
|
"filter-id-in": [
|
|
@@ -6705,13 +6705,13 @@ le.register(rn, {
|
|
|
6705
6705
|
],
|
|
6706
6706
|
"filter-in-small": [
|
|
6707
6707
|
_,
|
|
6708
|
-
[
|
|
6708
|
+
[I, Z(T)],
|
|
6709
6709
|
// assumes v is an array literal
|
|
6710
6710
|
(r, [e, t]) => t.value.indexOf(r.properties()[e.value]) >= 0
|
|
6711
6711
|
],
|
|
6712
6712
|
"filter-in-large": [
|
|
6713
6713
|
_,
|
|
6714
|
-
[
|
|
6714
|
+
[I, Z(T)],
|
|
6715
6715
|
// assumes v is a array literal with values sorted in ascending order and of a single type
|
|
6716
6716
|
(r, [e, t]) => el(r.properties()[e.value], t.value, 0, t.value.length - 1)
|
|
6717
6717
|
],
|
|
@@ -6723,7 +6723,7 @@ le.register(rn, {
|
|
|
6723
6723
|
(r, [e, t]) => e.evaluate(r) && t.evaluate(r)
|
|
6724
6724
|
],
|
|
6725
6725
|
[
|
|
6726
|
-
|
|
6726
|
+
Ie(_),
|
|
6727
6727
|
(r, e) => {
|
|
6728
6728
|
for (const t of e)
|
|
6729
6729
|
if (!t.evaluate(r))
|
|
@@ -6741,7 +6741,7 @@ le.register(rn, {
|
|
|
6741
6741
|
(r, [e, t]) => e.evaluate(r) || t.evaluate(r)
|
|
6742
6742
|
],
|
|
6743
6743
|
[
|
|
6744
|
-
|
|
6744
|
+
Ie(_),
|
|
6745
6745
|
(r, e) => {
|
|
6746
6746
|
for (const t of e)
|
|
6747
6747
|
if (t.evaluate(r))
|
|
@@ -6758,7 +6758,7 @@ le.register(rn, {
|
|
|
6758
6758
|
],
|
|
6759
6759
|
"is-supported-script": [
|
|
6760
6760
|
_,
|
|
6761
|
-
[
|
|
6761
|
+
[I],
|
|
6762
6762
|
// At parse time this will always return true, so we need to exclude this expression with isGlobalPropertyConstant
|
|
6763
6763
|
(r, [e]) => {
|
|
6764
6764
|
const t = r.globals && r.globals.isSupportedScript;
|
|
@@ -6766,28 +6766,28 @@ le.register(rn, {
|
|
|
6766
6766
|
}
|
|
6767
6767
|
],
|
|
6768
6768
|
upcase: [
|
|
6769
|
-
|
|
6770
|
-
[
|
|
6769
|
+
I,
|
|
6770
|
+
[I],
|
|
6771
6771
|
(r, [e]) => e.evaluate(r).toUpperCase()
|
|
6772
6772
|
],
|
|
6773
6773
|
downcase: [
|
|
6774
|
-
|
|
6775
|
-
[
|
|
6774
|
+
I,
|
|
6775
|
+
[I],
|
|
6776
6776
|
(r, [e]) => e.evaluate(r).toLowerCase()
|
|
6777
6777
|
],
|
|
6778
6778
|
concat: [
|
|
6779
|
-
|
|
6780
|
-
|
|
6779
|
+
I,
|
|
6780
|
+
Ie(T),
|
|
6781
6781
|
(r, e) => e.map((t) => tt(t.evaluate(r))).join("")
|
|
6782
6782
|
],
|
|
6783
6783
|
"resolved-locale": [
|
|
6784
|
-
|
|
6784
|
+
I,
|
|
6785
6785
|
[Dt],
|
|
6786
6786
|
(r, [e]) => e.evaluate(r).resolvedLocale()
|
|
6787
6787
|
]
|
|
6788
6788
|
});
|
|
6789
6789
|
function tl(r) {
|
|
6790
|
-
return Array.isArray(r) ? `(${r.map(
|
|
6790
|
+
return Array.isArray(r) ? `(${r.map(j).join(", ")})` : `(${j(r.type)}...)`;
|
|
6791
6791
|
}
|
|
6792
6792
|
function zt(r) {
|
|
6793
6793
|
if (r instanceof Kt)
|
|
@@ -6844,7 +6844,7 @@ function Jt(r, e) {
|
|
|
6844
6844
|
t && !Jt(n, e) && (t = !1);
|
|
6845
6845
|
}), t;
|
|
6846
6846
|
}
|
|
6847
|
-
function
|
|
6847
|
+
function Mr(r) {
|
|
6848
6848
|
return { result: "success", value: r };
|
|
6849
6849
|
}
|
|
6850
6850
|
function Be(r) {
|
|
@@ -6859,7 +6859,7 @@ function Ra(r) {
|
|
|
6859
6859
|
function za(r) {
|
|
6860
6860
|
return !!r.expression && r.expression.interpolated;
|
|
6861
6861
|
}
|
|
6862
|
-
function
|
|
6862
|
+
function M(r) {
|
|
6863
6863
|
return r instanceof Number ? "number" : r instanceof String ? "string" : r instanceof Boolean ? "boolean" : Array.isArray(r) ? "array" : r === null ? "null" : typeof r;
|
|
6864
6864
|
}
|
|
6865
6865
|
function nn(r) {
|
|
@@ -6879,7 +6879,7 @@ class rl {
|
|
|
6879
6879
|
if (s == null || typeof s == "number" && s !== s)
|
|
6880
6880
|
return this._defaultValue;
|
|
6881
6881
|
if (this._enumValues && !(s in this._enumValues))
|
|
6882
|
-
throw new
|
|
6882
|
+
throw new N(`Expected value to be one of ${Object.keys(this._enumValues).map((l) => JSON.stringify(l)).join(", ")}, but found ${JSON.stringify(s)} instead.`);
|
|
6883
6883
|
return s;
|
|
6884
6884
|
} catch (s) {
|
|
6885
6885
|
return this._warningHistory[s.message] || (this._warningHistory[s.message] = !0, typeof console < "u" && console.warn(s.message)), this._defaultValue;
|
|
@@ -6891,7 +6891,7 @@ function Fa(r) {
|
|
|
6891
6891
|
}
|
|
6892
6892
|
function $a(r, e) {
|
|
6893
6893
|
const t = new Vt(rn, zt, [], e ? al(e) : void 0), n = t.parse(r, void 0, void 0, void 0, e && e.type === "string" ? { typeAnnotation: "coerce" } : void 0);
|
|
6894
|
-
return n ?
|
|
6894
|
+
return n ? Mr(new rl(n, e)) : Be(t.errors);
|
|
6895
6895
|
}
|
|
6896
6896
|
class Dn {
|
|
6897
6897
|
constructor(e, t) {
|
|
@@ -6936,9 +6936,9 @@ function nl(r, e) {
|
|
|
6936
6936
|
if (i instanceof he && !za(e))
|
|
6937
6937
|
return Be([new fe("", '"interpolate" expressions cannot be used with this property')]);
|
|
6938
6938
|
if (!i)
|
|
6939
|
-
return
|
|
6939
|
+
return Mr(a ? new Dn("constant", t.value) : new Dn("source", t.value));
|
|
6940
6940
|
const s = i instanceof he ? i.interpolation : void 0;
|
|
6941
|
-
return
|
|
6941
|
+
return Mr(a ? new Un("camera", t.value, i.labels, s) : new Un("composite", t.value, i.labels, s));
|
|
6942
6942
|
}
|
|
6943
6943
|
function Ct(r) {
|
|
6944
6944
|
let e = null;
|
|
@@ -6962,15 +6962,15 @@ function an(r, e = /* @__PURE__ */ new Set()) {
|
|
|
6962
6962
|
function al(r) {
|
|
6963
6963
|
const e = {
|
|
6964
6964
|
color: de,
|
|
6965
|
-
string:
|
|
6965
|
+
string: I,
|
|
6966
6966
|
number: b,
|
|
6967
|
-
enum:
|
|
6967
|
+
enum: I,
|
|
6968
6968
|
boolean: _,
|
|
6969
6969
|
formatted: Ut,
|
|
6970
6970
|
padding: Bt,
|
|
6971
6971
|
numberArray: qt,
|
|
6972
6972
|
colorArray: nt,
|
|
6973
|
-
projectionDefinition:
|
|
6973
|
+
projectionDefinition: Nt,
|
|
6974
6974
|
resolvedImage: ft,
|
|
6975
6975
|
variableAnchorOffsetCollection: Gt
|
|
6976
6976
|
};
|
|
@@ -7027,20 +7027,20 @@ function Oa(r) {
|
|
|
7027
7027
|
return !0;
|
|
7028
7028
|
}
|
|
7029
7029
|
}
|
|
7030
|
-
function
|
|
7030
|
+
function ja(r) {
|
|
7031
7031
|
const e = r.key, t = r.value;
|
|
7032
7032
|
return t ? [new g(e, t, "constants have been deprecated as of v8")] : [];
|
|
7033
7033
|
}
|
|
7034
7034
|
function U(r) {
|
|
7035
7035
|
return r instanceof Number || r instanceof String || r instanceof Boolean ? r.valueOf() : r;
|
|
7036
7036
|
}
|
|
7037
|
-
function
|
|
7037
|
+
function je(r) {
|
|
7038
7038
|
if (Array.isArray(r))
|
|
7039
|
-
return r.map(
|
|
7039
|
+
return r.map(je);
|
|
7040
7040
|
if (r instanceof Object && !(r instanceof Number || r instanceof String || r instanceof Boolean)) {
|
|
7041
7041
|
const e = {};
|
|
7042
7042
|
for (const t in r)
|
|
7043
|
-
e[t] =
|
|
7043
|
+
e[t] = je(r[t]);
|
|
7044
7044
|
return e;
|
|
7045
7045
|
}
|
|
7046
7046
|
return U(r);
|
|
@@ -7048,7 +7048,7 @@ function Ne(r) {
|
|
|
7048
7048
|
function te(r) {
|
|
7049
7049
|
const e = r.key, t = r.value, n = r.valueSpec || {}, a = r.objectElementValidators || {}, o = r.style, i = r.styleSpec, s = r.validateSpec;
|
|
7050
7050
|
let l = [];
|
|
7051
|
-
const u =
|
|
7051
|
+
const u = M(t);
|
|
7052
7052
|
if (u !== "object")
|
|
7053
7053
|
return [new g(e, t, `object expected, ${u} found`)];
|
|
7054
7054
|
for (const c in t) {
|
|
@@ -7083,8 +7083,8 @@ function te(r) {
|
|
|
7083
7083
|
}
|
|
7084
7084
|
function on(r) {
|
|
7085
7085
|
const e = r.value, t = r.valueSpec, n = r.validateSpec, a = r.style, o = r.styleSpec, i = r.key, s = r.arrayElementValidator || n;
|
|
7086
|
-
if (
|
|
7087
|
-
return [new g(i, e, `array expected, ${
|
|
7086
|
+
if (M(e) !== "array")
|
|
7087
|
+
return [new g(i, e, `array expected, ${M(e)} found`)];
|
|
7088
7088
|
if (t.length && e.length !== t.length)
|
|
7089
7089
|
return [new g(i, e, `array length ${t.length} expected, length ${e.length} found`)];
|
|
7090
7090
|
if (t["min-length"] && e.length < t["min-length"])
|
|
@@ -7093,7 +7093,7 @@ function on(r) {
|
|
|
7093
7093
|
type: t.value,
|
|
7094
7094
|
values: t.values
|
|
7095
7095
|
};
|
|
7096
|
-
o.$version < 7 && (l.function = t.function),
|
|
7096
|
+
o.$version < 7 && (l.function = t.function), M(t.value) === "object" && (l = t.value);
|
|
7097
7097
|
let u = [];
|
|
7098
7098
|
for (let c = 0; c < e.length; c++)
|
|
7099
7099
|
u = u.concat(s({
|
|
@@ -7110,13 +7110,13 @@ function on(r) {
|
|
|
7110
7110
|
}
|
|
7111
7111
|
function Qt(r) {
|
|
7112
7112
|
const e = r.key, t = r.value, n = r.valueSpec;
|
|
7113
|
-
let a =
|
|
7113
|
+
let a = M(t);
|
|
7114
7114
|
return a === "number" && t !== t && (a = "NaN"), a !== "number" ? [new g(e, t, `number expected, ${a} found`)] : "minimum" in n && t < n.minimum ? [new g(e, t, `${t} is less than the minimum value ${n.minimum}`)] : "maximum" in n && t > n.maximum ? [new g(e, t, `${t} is greater than the maximum value ${n.maximum}`)] : [];
|
|
7115
7115
|
}
|
|
7116
|
-
function
|
|
7116
|
+
function Na(r) {
|
|
7117
7117
|
const e = r.valueSpec, t = U(r.value.type);
|
|
7118
7118
|
let n, a = {}, o, i;
|
|
7119
|
-
const s = t !== "categorical" && r.value.property === void 0, l = !s, u =
|
|
7119
|
+
const s = t !== "categorical" && r.value.property === void 0, l = !s, u = M(r.value.stops) === "array" && M(r.value.stops[0]) === "array" && M(r.value.stops[0][0]) === "object", c = te({
|
|
7120
7120
|
key: r.key,
|
|
7121
7121
|
value: r.value,
|
|
7122
7122
|
valueSpec: r.styleSpec.function,
|
|
@@ -7142,18 +7142,18 @@ function ja(r) {
|
|
|
7142
7142
|
style: y.style,
|
|
7143
7143
|
styleSpec: y.styleSpec,
|
|
7144
7144
|
arrayElementValidator: f
|
|
7145
|
-
})),
|
|
7145
|
+
})), M(w) === "array" && w.length === 0 && m.push(new g(y.key, w, "array must have at least one stop")), m;
|
|
7146
7146
|
}
|
|
7147
7147
|
function f(y) {
|
|
7148
7148
|
let m = [];
|
|
7149
7149
|
const w = y.value, v = y.key;
|
|
7150
|
-
if (
|
|
7151
|
-
return [new g(v, w, `array expected, ${
|
|
7150
|
+
if (M(w) !== "array")
|
|
7151
|
+
return [new g(v, w, `array expected, ${M(w)} found`)];
|
|
7152
7152
|
if (w.length !== 2)
|
|
7153
7153
|
return [new g(v, w, `array length 2 expected, length ${w.length} found`)];
|
|
7154
7154
|
if (u) {
|
|
7155
|
-
if (
|
|
7156
|
-
return [new g(v, w, `object expected, ${
|
|
7155
|
+
if (M(w[0]) !== "object")
|
|
7156
|
+
return [new g(v, w, `object expected, ${M(w[0])} found`)];
|
|
7157
7157
|
if (w[0].zoom === void 0)
|
|
7158
7158
|
return [new g(v, w, "object stop key must have zoom")];
|
|
7159
7159
|
if (w[0].value === void 0)
|
|
@@ -7177,7 +7177,7 @@ function ja(r) {
|
|
|
7177
7177
|
style: y.style,
|
|
7178
7178
|
styleSpec: y.styleSpec
|
|
7179
7179
|
}, w));
|
|
7180
|
-
return Fa(
|
|
7180
|
+
return Fa(je(w[1])) ? m.concat([new g(`${v}[1]`, w[1], "expressions are not allowed in function stops.")]) : m.concat(y.validateSpec({
|
|
7181
7181
|
key: `${v}[1]`,
|
|
7182
7182
|
value: w[1],
|
|
7183
7183
|
valueSpec: e,
|
|
@@ -7187,7 +7187,7 @@ function ja(r) {
|
|
|
7187
7187
|
}));
|
|
7188
7188
|
}
|
|
7189
7189
|
function d(y, m) {
|
|
7190
|
-
const w =
|
|
7190
|
+
const w = M(y.value), v = U(y.value), x = y.value !== null ? y.value : m;
|
|
7191
7191
|
if (!n)
|
|
7192
7192
|
n = w;
|
|
7193
7193
|
else if (w !== n)
|
|
@@ -7212,7 +7212,7 @@ function ja(r) {
|
|
|
7212
7212
|
}
|
|
7213
7213
|
}
|
|
7214
7214
|
function Ke(r) {
|
|
7215
|
-
const e = (r.expressionContext === "property" ? nl : $a)(
|
|
7215
|
+
const e = (r.expressionContext === "property" ? nl : $a)(je(r.value), r.valueSpec);
|
|
7216
7216
|
if (e.result === "error")
|
|
7217
7217
|
return e.value.map((n) => new g(`${r.key}${n.key}`, r.value, n.message));
|
|
7218
7218
|
const t = e.value.expression || e.value._styleExpression.expression;
|
|
@@ -7231,11 +7231,11 @@ function Ke(r) {
|
|
|
7231
7231
|
return [];
|
|
7232
7232
|
}
|
|
7233
7233
|
function il(r) {
|
|
7234
|
-
const e = r.value, t = r.key, n =
|
|
7234
|
+
const e = r.value, t = r.key, n = M(e);
|
|
7235
7235
|
return n !== "boolean" ? [new g(t, e, `boolean expected, ${n} found`)] : [];
|
|
7236
7236
|
}
|
|
7237
7237
|
function Pr(r) {
|
|
7238
|
-
const e = r.key, t = r.value, n =
|
|
7238
|
+
const e = r.key, t = r.value, n = M(t);
|
|
7239
7239
|
return n !== "string" ? [new g(e, t, `color expected, ${n} found`)] : F.parse(String(t)) ? [] : [new g(e, t, `color expected, "${t}" found`)];
|
|
7240
7240
|
}
|
|
7241
7241
|
function ut(r) {
|
|
@@ -7243,15 +7243,15 @@ function ut(r) {
|
|
|
7243
7243
|
return Array.isArray(n.values) ? n.values.indexOf(U(t)) === -1 && a.push(new g(e, t, `expected one of [${n.values.join(", ")}], ${JSON.stringify(t)} found`)) : Object.keys(n.values).indexOf(U(t)) === -1 && a.push(new g(e, t, `expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(t)} found`)), a;
|
|
7244
7244
|
}
|
|
7245
7245
|
function sn(r) {
|
|
7246
|
-
return Oa(
|
|
7246
|
+
return Oa(je(r.value)) ? Ke(Tt({}, r, {
|
|
7247
7247
|
expressionContext: "filter",
|
|
7248
7248
|
valueSpec: { value: "boolean" }
|
|
7249
7249
|
})) : Da(r);
|
|
7250
7250
|
}
|
|
7251
7251
|
function Da(r) {
|
|
7252
7252
|
const e = r.value, t = r.key;
|
|
7253
|
-
if (
|
|
7254
|
-
return [new g(t, e, `array expected, ${
|
|
7253
|
+
if (M(e) !== "array")
|
|
7254
|
+
return [new g(t, e, `array expected, ${M(e)} found`)];
|
|
7255
7255
|
const n = r.styleSpec;
|
|
7256
7256
|
let a, o = [];
|
|
7257
7257
|
if (e.length < 1)
|
|
@@ -7275,9 +7275,9 @@ function Da(r) {
|
|
|
7275
7275
|
/* falls through */
|
|
7276
7276
|
case "in":
|
|
7277
7277
|
case "!in":
|
|
7278
|
-
e.length >= 2 && (a =
|
|
7278
|
+
e.length >= 2 && (a = M(e[1]), a !== "string" && o.push(new g(`${t}[1]`, e[1], `string expected, ${a} found`)));
|
|
7279
7279
|
for (let i = 2; i < e.length; i++)
|
|
7280
|
-
a =
|
|
7280
|
+
a = M(e[i]), U(e[1]) === "$type" ? o = o.concat(ut({
|
|
7281
7281
|
key: `${t}[${i}]`,
|
|
7282
7282
|
value: e[i],
|
|
7283
7283
|
valueSpec: n.geometry_type,
|
|
@@ -7298,7 +7298,7 @@ function Da(r) {
|
|
|
7298
7298
|
break;
|
|
7299
7299
|
case "has":
|
|
7300
7300
|
case "!has":
|
|
7301
|
-
a =
|
|
7301
|
+
a = M(e[1]), e.length !== 2 ? o.push(new g(t, e, `filter array for "${e[0]}" operator must have 2 elements`)) : a !== "string" && o.push(new g(`${t}[1]`, e[1], `string expected, ${a} found`));
|
|
7302
7302
|
break;
|
|
7303
7303
|
}
|
|
7304
7304
|
return o;
|
|
@@ -7320,11 +7320,11 @@ function Ua(r, e) {
|
|
|
7320
7320
|
if (!c)
|
|
7321
7321
|
return [new g(t, i, `unknown property "${s}"`)];
|
|
7322
7322
|
let p;
|
|
7323
|
-
if (
|
|
7323
|
+
if (M(i) === "string" && Ft(c) && !c.tokens && (p = /^{([^}]+)}$/.exec(i)))
|
|
7324
7324
|
return [new g(t, i, `"${s}" does not support interpolation syntax
|
|
7325
7325
|
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(p[1])} }\`.`)];
|
|
7326
7326
|
const f = [];
|
|
7327
|
-
return r.layerType === "symbol" && (s === "text-field" && a && !a.glyphs && f.push(new g(t, i, 'use of "text-field" requires a style "glyphs" property')), s === "text-font" && nn(
|
|
7327
|
+
return r.layerType === "symbol" && (s === "text-field" && a && !a.glyphs && f.push(new g(t, i, 'use of "text-field" requires a style "glyphs" property')), s === "text-font" && nn(je(i)) && U(i.type) === "identity" && f.push(new g(t, i, '"text-font" does not support identity functions'))), f.concat(n({
|
|
7328
7328
|
key: r.key,
|
|
7329
7329
|
value: i,
|
|
7330
7330
|
valueSpec: c,
|
|
@@ -7344,8 +7344,8 @@ function qa(r) {
|
|
|
7344
7344
|
function Ga(r) {
|
|
7345
7345
|
let e = [];
|
|
7346
7346
|
const t = r.value, n = r.key, a = r.style, o = r.styleSpec;
|
|
7347
|
-
if (
|
|
7348
|
-
return [new g(n, t, `object expected, ${
|
|
7347
|
+
if (M(t) !== "object")
|
|
7348
|
+
return [new g(n, t, `object expected, ${M(t)} found`)];
|
|
7349
7349
|
!t.type && !t.ref && e.push(new g(n, t, 'either "type" or "ref" is required'));
|
|
7350
7350
|
let i = U(t.type);
|
|
7351
7351
|
const s = U(t.ref);
|
|
@@ -7430,15 +7430,15 @@ function Ga(r) {
|
|
|
7430
7430
|
}
|
|
7431
7431
|
})), e;
|
|
7432
7432
|
}
|
|
7433
|
-
function
|
|
7434
|
-
const e = r.value, t = r.key, n =
|
|
7433
|
+
function Ne(r) {
|
|
7434
|
+
const e = r.value, t = r.key, n = M(e);
|
|
7435
7435
|
return n !== "string" ? [new g(t, e, `string expected, ${n} found`)] : [];
|
|
7436
7436
|
}
|
|
7437
7437
|
function sl(r) {
|
|
7438
7438
|
var e;
|
|
7439
7439
|
const t = (e = r.sourceName) !== null && e !== void 0 ? e : "", n = r.value, a = r.styleSpec, o = a.source_raster_dem, i = r.style;
|
|
7440
7440
|
let s = [];
|
|
7441
|
-
const l =
|
|
7441
|
+
const l = M(n);
|
|
7442
7442
|
if (n === void 0)
|
|
7443
7443
|
return s;
|
|
7444
7444
|
if (l !== "object")
|
|
@@ -7536,19 +7536,19 @@ function Va(r) {
|
|
|
7536
7536
|
}
|
|
7537
7537
|
}
|
|
7538
7538
|
function ll({ key: r, value: e }) {
|
|
7539
|
-
if (
|
|
7540
|
-
return
|
|
7539
|
+
if (M(e) === "string")
|
|
7540
|
+
return Ne({ key: r, value: e });
|
|
7541
7541
|
{
|
|
7542
7542
|
const t = [];
|
|
7543
7543
|
for (const n in e)
|
|
7544
|
-
t.push(...
|
|
7544
|
+
t.push(...Ne({ key: `${r}.${n}`, value: e[n] }));
|
|
7545
7545
|
return t;
|
|
7546
7546
|
}
|
|
7547
7547
|
}
|
|
7548
7548
|
function Ha(r) {
|
|
7549
7549
|
const e = r.value, t = r.styleSpec, n = t.light, a = r.style;
|
|
7550
7550
|
let o = [];
|
|
7551
|
-
const i =
|
|
7551
|
+
const i = M(e);
|
|
7552
7552
|
if (e === void 0)
|
|
7553
7553
|
return o;
|
|
7554
7554
|
if (i !== "object")
|
|
@@ -7574,7 +7574,7 @@ function Ha(r) {
|
|
|
7574
7574
|
return o;
|
|
7575
7575
|
}
|
|
7576
7576
|
function Ka(r) {
|
|
7577
|
-
const e = r.value, t = r.styleSpec, n = t.sky, a = r.style, o =
|
|
7577
|
+
const e = r.value, t = r.styleSpec, n = t.sky, a = r.style, o = M(e);
|
|
7578
7578
|
if (e === void 0)
|
|
7579
7579
|
return [];
|
|
7580
7580
|
if (o !== "object")
|
|
@@ -7593,7 +7593,7 @@ function Ka(r) {
|
|
|
7593
7593
|
function Xa(r) {
|
|
7594
7594
|
const e = r.value, t = r.styleSpec, n = t.terrain, a = r.style;
|
|
7595
7595
|
let o = [];
|
|
7596
|
-
const i =
|
|
7596
|
+
const i = M(e);
|
|
7597
7597
|
if (e === void 0)
|
|
7598
7598
|
return o;
|
|
7599
7599
|
if (i !== "object")
|
|
@@ -7610,14 +7610,14 @@ function Xa(r) {
|
|
|
7610
7610
|
return o;
|
|
7611
7611
|
}
|
|
7612
7612
|
function ul(r) {
|
|
7613
|
-
return
|
|
7613
|
+
return Ne(r).length === 0 ? [] : Ke(r);
|
|
7614
7614
|
}
|
|
7615
7615
|
function cl(r) {
|
|
7616
|
-
return
|
|
7616
|
+
return Ne(r).length === 0 ? [] : Ke(r);
|
|
7617
7617
|
}
|
|
7618
7618
|
function pl(r) {
|
|
7619
7619
|
const e = r.key, t = r.value;
|
|
7620
|
-
if (
|
|
7620
|
+
if (M(t) === "array") {
|
|
7621
7621
|
if (t.length < 1 || t.length > 4)
|
|
7622
7622
|
return [new g(e, t, `padding requires 1 to 4 values; ${t.length} values found`)];
|
|
7623
7623
|
const a = {
|
|
@@ -7641,7 +7641,7 @@ function pl(r) {
|
|
|
7641
7641
|
}
|
|
7642
7642
|
function fl(r) {
|
|
7643
7643
|
const e = r.key, t = r.value;
|
|
7644
|
-
if (
|
|
7644
|
+
if (M(t) === "array") {
|
|
7645
7645
|
const a = {
|
|
7646
7646
|
type: "number"
|
|
7647
7647
|
};
|
|
@@ -7665,7 +7665,7 @@ function fl(r) {
|
|
|
7665
7665
|
}
|
|
7666
7666
|
function dl(r) {
|
|
7667
7667
|
const e = r.key, t = r.value;
|
|
7668
|
-
if (
|
|
7668
|
+
if (M(t) === "array") {
|
|
7669
7669
|
if (t.length < 1)
|
|
7670
7670
|
return [new g(e, t, "array length at least 1 expected, length 0 found")];
|
|
7671
7671
|
let a = [];
|
|
@@ -7682,7 +7682,7 @@ function dl(r) {
|
|
|
7682
7682
|
});
|
|
7683
7683
|
}
|
|
7684
7684
|
function hl(r) {
|
|
7685
|
-
const e = r.key, t = r.value, n =
|
|
7685
|
+
const e = r.key, t = r.value, n = M(t), a = r.styleSpec;
|
|
7686
7686
|
if (n !== "array" || t.length < 1 || t.length % 2 !== 0)
|
|
7687
7687
|
return [new g(e, t, "variableAnchorOffsetCollection requires a non-empty array of even length")];
|
|
7688
7688
|
let o = [];
|
|
@@ -7730,13 +7730,13 @@ function Wa(r) {
|
|
|
7730
7730
|
}
|
|
7731
7731
|
return e;
|
|
7732
7732
|
} else
|
|
7733
|
-
return
|
|
7733
|
+
return Ne({
|
|
7734
7734
|
key: n,
|
|
7735
7735
|
value: t
|
|
7736
7736
|
});
|
|
7737
7737
|
}
|
|
7738
7738
|
function yl(r) {
|
|
7739
|
-
const e = r.value, t = r.styleSpec, n = t.projection, a = r.style, o =
|
|
7739
|
+
const e = r.value, t = r.styleSpec, n = t.projection, a = r.style, o = M(e);
|
|
7740
7740
|
if (e === void 0)
|
|
7741
7741
|
return [];
|
|
7742
7742
|
if (o !== "object")
|
|
@@ -7756,7 +7756,7 @@ function ml(r) {
|
|
|
7756
7756
|
const e = r.key;
|
|
7757
7757
|
let t = r.value;
|
|
7758
7758
|
t = t instanceof String ? t.valueOf() : t;
|
|
7759
|
-
const n =
|
|
7759
|
+
const n = M(t);
|
|
7760
7760
|
return n === "array" && !vl(t) && !gl(t) ? [new g(e, t, `projection expected, invalid array ${JSON.stringify(t)} found`)] : ["array", "string"].includes(n) ? [] : [new g(e, t, `projection expected, invalid type "${n}" found`)];
|
|
7761
7761
|
}
|
|
7762
7762
|
function gl(r) {
|
|
@@ -7770,7 +7770,7 @@ function bl(r) {
|
|
|
7770
7770
|
}
|
|
7771
7771
|
function Za(r) {
|
|
7772
7772
|
return bl(r.value) ? [] : [
|
|
7773
|
-
new g(r.key, r.value, `object expected, ${
|
|
7773
|
+
new g(r.key, r.value, `object expected, ${M(r.value)} found`)
|
|
7774
7774
|
];
|
|
7775
7775
|
}
|
|
7776
7776
|
const qn = {
|
|
@@ -7781,10 +7781,10 @@ const qn = {
|
|
|
7781
7781
|
boolean: il,
|
|
7782
7782
|
number: Qt,
|
|
7783
7783
|
color: Pr,
|
|
7784
|
-
constants:
|
|
7784
|
+
constants: ja,
|
|
7785
7785
|
enum: ut,
|
|
7786
7786
|
filter: sn,
|
|
7787
|
-
function:
|
|
7787
|
+
function: Na,
|
|
7788
7788
|
layer: Ga,
|
|
7789
7789
|
object: te,
|
|
7790
7790
|
source: Va,
|
|
@@ -7793,7 +7793,7 @@ const qn = {
|
|
|
7793
7793
|
terrain: Xa,
|
|
7794
7794
|
projection: yl,
|
|
7795
7795
|
projectionDefinition: ml,
|
|
7796
|
-
string:
|
|
7796
|
+
string: Ne,
|
|
7797
7797
|
formatted: ul,
|
|
7798
7798
|
resolvedImage: cl,
|
|
7799
7799
|
padding: pl,
|
|
@@ -7805,12 +7805,12 @@ const qn = {
|
|
|
7805
7805
|
};
|
|
7806
7806
|
function $t(r) {
|
|
7807
7807
|
const e = r.value, t = r.valueSpec, n = r.styleSpec;
|
|
7808
|
-
return r.validateSpec = $t, t.expression && nn(U(e)) ?
|
|
7808
|
+
return r.validateSpec = $t, t.expression && nn(U(e)) ? Na(r) : t.expression && Fa(je(e)) ? Ke(r) : t.type && qn[t.type] ? qn[t.type](r) : te(Tt({}, r, {
|
|
7809
7809
|
valueSpec: t.type ? n[t.type] : t
|
|
7810
7810
|
}));
|
|
7811
7811
|
}
|
|
7812
7812
|
function Ya(r) {
|
|
7813
|
-
const e = r.value, t = r.key, n =
|
|
7813
|
+
const e = r.value, t = r.key, n = Ne(r);
|
|
7814
7814
|
return n.length || (e.indexOf("{fontstack}") === -1 && n.push(new g(t, e, '"glyphs" url must include a "{fontstack}" token')), e.indexOf("{range}") === -1 && n.push(new g(t, e, '"glyphs" url must include a "{range}" token'))), n;
|
|
7815
7815
|
}
|
|
7816
7816
|
function Y(r, e = Ki) {
|
|
@@ -7828,7 +7828,7 @@ function Y(r, e = Ki) {
|
|
|
7828
7828
|
return [];
|
|
7829
7829
|
}
|
|
7830
7830
|
}
|
|
7831
|
-
})), r.constants && (t = t.concat(
|
|
7831
|
+
})), r.constants && (t = t.concat(ja({
|
|
7832
7832
|
key: "constants",
|
|
7833
7833
|
value: r.constants
|
|
7834
7834
|
}))), Ja(t);
|
|
@@ -7884,12 +7884,12 @@ function Gn(r) {
|
|
|
7884
7884
|
requiresUrlMonitoring: !0,
|
|
7885
7885
|
isFallback: !1
|
|
7886
7886
|
} : {
|
|
7887
|
-
style:
|
|
7887
|
+
style: Io(r),
|
|
7888
7888
|
requiresUrlMonitoring: !0,
|
|
7889
7889
|
isFallback: !1
|
|
7890
7890
|
};
|
|
7891
7891
|
}
|
|
7892
|
-
return r instanceof
|
|
7892
|
+
return r instanceof Mo ? {
|
|
7893
7893
|
style: r.getExpandedStyleURL(),
|
|
7894
7894
|
requiresUrlMonitoring: !1,
|
|
7895
7895
|
isFallback: !1
|
|
@@ -8228,20 +8228,20 @@ class Al {
|
|
|
8228
8228
|
this.projectionButton.classList.remove("maplibregl-ctrl-projection-globe"), this.projectionButton.classList.remove("maplibregl-ctrl-projection-mercator"), this.map.isGlobeProjection() ? (this.projectionButton.classList.add("maplibregl-ctrl-projection-mercator"), this.projectionButton.title = "Enable Mercator projection") : (this.projectionButton.classList.add("maplibregl-ctrl-projection-globe"), this.projectionButton.title = "Enable Globe projection");
|
|
8229
8229
|
}
|
|
8230
8230
|
}
|
|
8231
|
-
const El = "@maptiler/sdk", Tl = "3.5.
|
|
8231
|
+
const El = "@maptiler/sdk", Tl = "3.5.1-rc1", _l = "The Javascript & TypeScript map SDK tailored for MapTiler Cloud", Il = "MapTiler", Ml = "dist/maptiler-sdk.mjs", Pl = "dist/maptiler-sdk.d.ts", Rl = "dist/maptiler-sdk.css", zl = "module", Fl = "dist/maptiler-sdk.mjs", $l = { ".": { import: "./dist/maptiler-sdk.mjs", types: "./dist/maptiler-sdk.d.ts" }, "./dist/maptiler-sdk.css": { import: "./dist/maptiler-sdk.css" }, "./style.css": { import: "./dist/maptiler-sdk.css" } }, Ol = ["maptiler", "map", "sdk", "webmap", "cloud", "webGL", "maplibre"], jl = "https://docs.maptiler.com/sdk-js/", Nl = "BSD-3-Clause", Dl = { type: "git", url: "https://github.com/maptiler/maptiler-sdk-js.git" }, Ul = { prepare: "husky", doc: "rm -rf docs/* && typedoc --out docs && cp -r images docs/", ncu: "npx npm-check-updates", lint: "tsc --noEmit && eslint src", "lint:fix": "tsc --noEmit && eslint src --fix", "test:watch": "vitest watch -c vite.config-test.ts --dom", test: "vitest run -c vite.config-test.ts --dom", "install:clean": "rm -rf build/ dist/ node_modules/ && npm ci", dev: "npm run build-css && vite -c vite.config-dev.ts", "dev-umd": "npm run build-css && tsc && NODE_ENV=development vite build -w -c vite.config-umd.ts", "build-css": "mkdir -p dist build && node scripts/replace-path-with-content.js src/style/style_template.css dist/tmp_maptiler-sdk.css && cat node_modules/maplibre-gl/dist/maplibre-gl.css dist/tmp_maptiler-sdk.css > dist/maptiler-sdk.css && rm dist/tmp_maptiler-sdk.css && cp dist/maptiler-sdk.css build/maptiler-sdk.css", "build-umd": "tsc && NODE_ENV=production vite build -c vite.config-umd.ts", "build-es": "tsc && NODE_ENV=production vite build -c vite.config-es.ts", build: "npm run build-es; npm run build-umd; npm run build-css", make: "npm run install:clean && npm run build" }, Bl = { "@canvas/image-data": "^1.0.0", "@eslint/js": "^9.21.0", "@types/color-convert": "^2.0.4", "@types/color-name": "^2.0.0", "@types/stats.js": "^0.17.4", "@types/uuid": "^10.0.0", "@types/xmldom": "^0.1.31", "@vitest/web-worker": "^3.0.9", "@xmldom/xmldom": "^0.8.10", concurrently: "^9.1.2", eslint: "^9.21.0", "eslint-config-prettier": "^10.0.2", "eslint-plugin-prettier": "^5.2.3", "happy-dom": "^17.4.4", husky: "^8.0.0", jiti: "^2.4.2", "lint-staged": "^15.4.3", prettier: "3.5.2", "stats.js": "^0.17.0", typedoc: "^0.27.6", typescript: "^5.7.3", "typescript-eslint": "^8.25.0", vite: "^6.0.7", "vite-plugin-dts": "^4.5.0", vitest: "^3.0.9" }, ql = { "@maplibre/maplibre-gl-style-spec": "~23.3.0", "@maptiler/client": "~2.4.0", events: "^3.3.0", "gl-matrix": "^3.4.3", "js-base64": "^3.7.7", "maplibre-gl": "~5.6.0", uuid: "^11.0.5" }, Gl = {
|
|
8232
8232
|
name: El,
|
|
8233
8233
|
version: Tl,
|
|
8234
8234
|
description: _l,
|
|
8235
|
-
author:
|
|
8236
|
-
module:
|
|
8235
|
+
author: Il,
|
|
8236
|
+
module: Ml,
|
|
8237
8237
|
types: Pl,
|
|
8238
8238
|
style: Rl,
|
|
8239
8239
|
type: zl,
|
|
8240
8240
|
main: Fl,
|
|
8241
8241
|
exports: $l,
|
|
8242
8242
|
keywords: Ol,
|
|
8243
|
-
homepage:
|
|
8244
|
-
license:
|
|
8243
|
+
homepage: jl,
|
|
8244
|
+
license: Nl,
|
|
8245
8245
|
repository: Dl,
|
|
8246
8246
|
scripts: Ul,
|
|
8247
8247
|
"lint-staged": { "*.ts": "npm run lint:fix" },
|
|
@@ -8282,7 +8282,7 @@ class Vl {
|
|
|
8282
8282
|
}
|
|
8283
8283
|
preparePayload() {
|
|
8284
8284
|
const e = new URL(V.telemetryURL);
|
|
8285
|
-
return e.searchParams.append("sdk", Gl.version), e.searchParams.append("key", D.apiKey), e.searchParams.append("mtsid",
|
|
8285
|
+
return e.searchParams.append("sdk", Gl.version), e.searchParams.append("key", D.apiKey), e.searchParams.append("mtsid", Nr), e.searchParams.append("session", D.session ? "1" : "0"), e.searchParams.append("caching", D.caching ? "1" : "0"), e.searchParams.append("lang-updated", this.map.isLanguageUpdated() ? "1" : "0"), e.searchParams.append("terrain", this.map.getTerrain() ? "1" : "0"), e.searchParams.append("globe", this.map.isGlobeProjection() ? "1" : "0"), this.registeredModules.size > 0 && e.searchParams.append("modules", Array.from(this.registeredModules).join("|")), e.href;
|
|
8286
8286
|
}
|
|
8287
8287
|
}
|
|
8288
8288
|
var ct = typeof Float32Array < "u" ? Float32Array : Array;
|
|
@@ -9076,7 +9076,7 @@ const Ge = {
|
|
|
9076
9076
|
preset: "milkyway-colored"
|
|
9077
9077
|
}
|
|
9078
9078
|
};
|
|
9079
|
-
var
|
|
9079
|
+
var Me = /* @__PURE__ */ ((r) => (r.POSITIVE_X = "pX", r.NEGATIVE_X = "nX", r.POSITIVE_Y = "pY", r.NEGATIVE_Y = "nY", r.POSITIVE_Z = "pZ", r.NEGATIVE_Z = "nZ", r))(Me || {});
|
|
9080
9080
|
let br, ra, na;
|
|
9081
9081
|
function vu({ gl: r, faces: e, onReady: t, forceRefresh: n }) {
|
|
9082
9082
|
br && !n && na === JSON.stringify(e) && t(br, ra), na = JSON.stringify(e);
|
|
@@ -9112,17 +9112,17 @@ function vu({ gl: r, faces: e, onReady: t, forceRefresh: n }) {
|
|
|
9112
9112
|
});
|
|
9113
9113
|
}
|
|
9114
9114
|
function bu(r, e) {
|
|
9115
|
-
if (e ===
|
|
9115
|
+
if (e === Me.POSITIVE_X)
|
|
9116
9116
|
return r.TEXTURE_CUBE_MAP_POSITIVE_X;
|
|
9117
|
-
if (e ===
|
|
9117
|
+
if (e === Me.NEGATIVE_X)
|
|
9118
9118
|
return r.TEXTURE_CUBE_MAP_NEGATIVE_X;
|
|
9119
|
-
if (e ===
|
|
9119
|
+
if (e === Me.POSITIVE_Y)
|
|
9120
9120
|
return r.TEXTURE_CUBE_MAP_POSITIVE_Y;
|
|
9121
|
-
if (e ===
|
|
9121
|
+
if (e === Me.NEGATIVE_Y)
|
|
9122
9122
|
return r.TEXTURE_CUBE_MAP_NEGATIVE_Y;
|
|
9123
|
-
if (e ===
|
|
9123
|
+
if (e === Me.POSITIVE_Z)
|
|
9124
9124
|
return r.TEXTURE_CUBE_MAP_POSITIVE_Z;
|
|
9125
|
-
if (e ===
|
|
9125
|
+
if (e === Me.NEGATIVE_Z)
|
|
9126
9126
|
return r.TEXTURE_CUBE_MAP_NEGATIVE_Z;
|
|
9127
9127
|
throw new Error(`[CubemapLayer][loadCubemapTexture]: Invalid key ${e}`);
|
|
9128
9128
|
}
|
|
@@ -9574,7 +9574,7 @@ void main() {
|
|
|
9574
9574
|
// gl_FragColor = color;
|
|
9575
9575
|
gl_FragColor = vec4(color.rgb * color.a, color.a);
|
|
9576
9576
|
}
|
|
9577
|
-
`, Je = 2, Tu = ["position"], _u = ["matrix", "rotationMatrix", "stopsNumber", "stops", "colors", "maxDistance", "scale"],
|
|
9577
|
+
`, Je = 2, Tu = ["position"], _u = ["matrix", "rotationMatrix", "stopsNumber", "stops", "colors", "maxDistance", "scale"], Iu = [
|
|
9578
9578
|
-2,
|
|
9579
9579
|
-2,
|
|
9580
9580
|
0,
|
|
@@ -9594,7 +9594,7 @@ void main() {
|
|
|
9594
9594
|
[0.1, "rgba(98, 168, 229, 0.3)"],
|
|
9595
9595
|
[0.2, "rgba(98, 168, 229, 0.0)"]
|
|
9596
9596
|
]
|
|
9597
|
-
}, sa = 0.
|
|
9597
|
+
}, sa = 0.06;
|
|
9598
9598
|
class Sr {
|
|
9599
9599
|
/**
|
|
9600
9600
|
* Creates a new RadialGradientLayer instance.
|
|
@@ -9667,7 +9667,7 @@ class Sr {
|
|
|
9667
9667
|
fragmentShaderSource: Eu,
|
|
9668
9668
|
attributesKeys: Tu,
|
|
9669
9669
|
uniformsKeys: _u,
|
|
9670
|
-
vertices:
|
|
9670
|
+
vertices: Iu
|
|
9671
9671
|
}), this.animateIn();
|
|
9672
9672
|
}
|
|
9673
9673
|
/**
|
|
@@ -9777,7 +9777,7 @@ function xt(r) {
|
|
|
9777
9777
|
const { map: e, property: t } = r, n = e.getStyle();
|
|
9778
9778
|
return n ? (a = n.metadata) != null && a.maptiler ? n.metadata.maptiler[t] ? n.metadata.maptiler[t] : null : (console.warn(`[extractCustomLayerStyle]: No custom layer metadata found in the style for property \`${t}\`. The property will use default values.`), null) : (process.env.NODE_ENV === "development" && console.warn("[extractCustomLayerStyle]: `Map.getStyle()` is returning undefined, are you initiating before style is ready?"), null);
|
|
9779
9779
|
}
|
|
9780
|
-
const
|
|
9780
|
+
const Mu = {
|
|
9781
9781
|
POINT: "POINT",
|
|
9782
9782
|
COUNTRY: "COUNTRY"
|
|
9783
9783
|
};
|
|
@@ -9856,7 +9856,7 @@ let Pu = class no extends k.Map {
|
|
|
9856
9856
|
if (!t.geolocate || t.center || t.hash && i)
|
|
9857
9857
|
return;
|
|
9858
9858
|
try {
|
|
9859
|
-
if (t.geolocate ===
|
|
9859
|
+
if (t.geolocate === Mu.COUNTRY) {
|
|
9860
9860
|
await this.fitToIpBounds();
|
|
9861
9861
|
return;
|
|
9862
9862
|
}
|
|
@@ -10042,56 +10042,61 @@ let Pu = class no extends k.Map {
|
|
|
10042
10042
|
* unless explicitly set when calling.
|
|
10043
10043
|
*/
|
|
10044
10044
|
setSpace(t) {
|
|
10045
|
-
if (this.
|
|
10046
|
-
this.space
|
|
10047
|
-
|
|
10045
|
+
if (this.isGlobeProjection()) {
|
|
10046
|
+
if (this.space) {
|
|
10047
|
+
this.space.setCubemap(t);
|
|
10048
|
+
return;
|
|
10049
|
+
}
|
|
10050
|
+
this.space = new wr(t), this.once("load", () => {
|
|
10051
|
+
const n = this.getLayersOrder()[0];
|
|
10052
|
+
this.space && this.addLayer(this.space, n);
|
|
10053
|
+
});
|
|
10048
10054
|
}
|
|
10049
|
-
this.space = new wr(t), this.once("load", () => {
|
|
10050
|
-
const n = this.getLayersOrder()[0];
|
|
10051
|
-
this.space && this.addLayer(this.space, n);
|
|
10052
|
-
});
|
|
10053
10055
|
}
|
|
10054
10056
|
setSpaceFromStyle({ style: t }) {
|
|
10055
10057
|
var o, i;
|
|
10056
10058
|
if (!((i = (o = t.metadata) == null ? void 0 : o.maptiler) != null && i.space))
|
|
10057
10059
|
return;
|
|
10058
|
-
const n = t.metadata.maptiler.space
|
|
10059
|
-
|
|
10060
|
-
if (this.space) {
|
|
10060
|
+
const n = t.metadata.maptiler.space, a = () => {
|
|
10061
|
+
if (this.space && this.isGlobeProjection()) {
|
|
10061
10062
|
if (!this.getLayer(this.space.id)) {
|
|
10062
10063
|
const s = this.getLayersOrder()[0];
|
|
10063
10064
|
this.addLayer(this.space, s);
|
|
10064
10065
|
}
|
|
10065
10066
|
this.space.setCubemap(n);
|
|
10066
10067
|
}
|
|
10067
|
-
}
|
|
10068
|
+
};
|
|
10069
|
+
this.terrain ? this.once("terrain", a) : a();
|
|
10068
10070
|
}
|
|
10069
10071
|
setHaloFromStyle({ style: t }) {
|
|
10070
10072
|
var o;
|
|
10071
10073
|
const n = (o = t.metadata) == null ? void 0 : o.maptiler;
|
|
10072
|
-
if (!(n != null && n.halo))
|
|
10074
|
+
if (!(n != null && n.halo)) {
|
|
10075
|
+
this.setHalo({
|
|
10076
|
+
stops: [
|
|
10077
|
+
[0, "transparent"],
|
|
10078
|
+
[1, "transparent"]
|
|
10079
|
+
],
|
|
10080
|
+
scale: 0
|
|
10081
|
+
});
|
|
10073
10082
|
return;
|
|
10074
|
-
|
|
10083
|
+
}
|
|
10084
|
+
const a = () => {
|
|
10075
10085
|
var i;
|
|
10076
10086
|
if (this.halo) {
|
|
10077
10087
|
const s = this.getLayersOrder().indexOf(((i = this.space) == null ? void 0 : i.id) ?? "") + 1, l = this.getLayersOrder()[s];
|
|
10078
10088
|
this.addLayer(this.halo, l), this.halo.setGradient(n.halo);
|
|
10079
10089
|
}
|
|
10080
|
-
}
|
|
10090
|
+
};
|
|
10091
|
+
this.terrain ? this.once("terrain", a) : a();
|
|
10081
10092
|
}
|
|
10082
10093
|
setSpaceFromCurrentStyle() {
|
|
10083
10094
|
const t = xt({ map: this, property: "space" });
|
|
10084
|
-
|
|
10085
|
-
this.space.setCubemap(t);
|
|
10086
|
-
return;
|
|
10087
|
-
}
|
|
10095
|
+
t && this.space && this.space.setCubemap(t);
|
|
10088
10096
|
}
|
|
10089
10097
|
setHaloFromCurrentStyle() {
|
|
10090
10098
|
const t = xt({ map: this, property: "halo" });
|
|
10091
|
-
|
|
10092
|
-
this.halo.setGradient(t);
|
|
10093
|
-
return;
|
|
10094
|
-
}
|
|
10099
|
+
t && this.halo && this.halo.setGradient(t);
|
|
10095
10100
|
}
|
|
10096
10101
|
initSpace({ options: t = this.options, before: n }) {
|
|
10097
10102
|
if (this.space) {
|
|
@@ -10119,15 +10124,17 @@ let Pu = class no extends k.Map {
|
|
|
10119
10124
|
return this.halo;
|
|
10120
10125
|
}
|
|
10121
10126
|
setHalo(t) {
|
|
10122
|
-
if (this.
|
|
10123
|
-
this.halo
|
|
10124
|
-
|
|
10127
|
+
if (this.isGlobeProjection()) {
|
|
10128
|
+
if (this.halo) {
|
|
10129
|
+
this.halo.setGradient(t);
|
|
10130
|
+
return;
|
|
10131
|
+
}
|
|
10132
|
+
this.halo = new Sr(t), this.once("load", () => {
|
|
10133
|
+
var s;
|
|
10134
|
+
const n = this.getLayersOrder(), a = n[0], o = n.indexOf(((s = this.space) == null ? void 0 : s.id) ?? "") + 2, i = n[o];
|
|
10135
|
+
this.halo && this.addLayer(this.halo, this.space ? i : a);
|
|
10136
|
+
});
|
|
10125
10137
|
}
|
|
10126
|
-
this.halo = new Sr(t), this.once("load", () => {
|
|
10127
|
-
var s;
|
|
10128
|
-
const n = this.getLayersOrder(), a = n[0], o = n.indexOf(((s = this.space) == null ? void 0 : s.id) ?? "") + 2, i = n[o];
|
|
10129
|
-
this.halo && this.addLayer(this.halo, this.space ? i : a);
|
|
10130
|
-
});
|
|
10131
10138
|
}
|
|
10132
10139
|
/**
|
|
10133
10140
|
* Recreates the map instance with the same options.
|
|
@@ -10218,8 +10225,8 @@ let Pu = class no extends k.Map {
|
|
|
10218
10225
|
* - a longer form with the prefix `"maptiler://"` (eg. `"maptiler://streets-v2"`)
|
|
10219
10226
|
*/
|
|
10220
10227
|
setStyle(t, n) {
|
|
10221
|
-
var
|
|
10222
|
-
this.originalLabelStyle.clear(), (
|
|
10228
|
+
var o;
|
|
10229
|
+
this.originalLabelStyle.clear(), (o = this.minimap) == null || o.setStyle(t), this.forceLanguageUpdate = !0, this.once("idle", () => {
|
|
10223
10230
|
this.forceLanguageUpdate = !1;
|
|
10224
10231
|
});
|
|
10225
10232
|
const a = Gn(t);
|
|
@@ -10235,26 +10242,38 @@ let Pu = class no extends k.Map {
|
|
|
10235
10242
|
this.styleInProcess = !0;
|
|
10236
10243
|
try {
|
|
10237
10244
|
super.setStyle(a.style, n);
|
|
10238
|
-
} catch (
|
|
10239
|
-
console.error("[Map.setStyle]: Error while setting style:",
|
|
10245
|
+
} catch (i) {
|
|
10246
|
+
this.styleInProcess = !1, console.error("[Map.setStyle]: Error while setting style:", i);
|
|
10240
10247
|
}
|
|
10241
|
-
const o = this.getLayersOrder()[0];
|
|
10242
10248
|
if (typeof a.style != "string" && !a.requiresUrlMonitoring) {
|
|
10243
|
-
|
|
10244
|
-
|
|
10245
|
-
this.
|
|
10246
|
-
|
|
10247
|
-
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10249
|
+
const i = a.style, s = () => {
|
|
10250
|
+
var l, u;
|
|
10251
|
+
if (this.halo) {
|
|
10252
|
+
const c = a.style;
|
|
10253
|
+
this.setHaloFromStyle({ style: c });
|
|
10254
|
+
} else {
|
|
10255
|
+
const c = i.metadata, p = this.getLayersOrder()[0] === ((l = this.space) == null ? void 0 : l.id) ? this.getLayersOrder()[1] : this.getLayersOrder()[0];
|
|
10256
|
+
(u = c == null ? void 0 : c.maptiler) != null && u.halo && this.initHalo({
|
|
10257
|
+
before: p,
|
|
10258
|
+
options: {
|
|
10259
|
+
...this.options,
|
|
10260
|
+
halo: c.maptiler.halo
|
|
10261
|
+
}
|
|
10262
|
+
});
|
|
10263
|
+
}
|
|
10264
|
+
if (this.space) {
|
|
10265
|
+
const c = a.style;
|
|
10266
|
+
this.setSpaceFromStyle({ style: c });
|
|
10267
|
+
} else {
|
|
10268
|
+
const c = this.getLayersOrder()[0];
|
|
10269
|
+
this.initSpace({ before: c });
|
|
10270
|
+
}
|
|
10271
|
+
};
|
|
10272
|
+
return this.terrain ? this.once("terrain", s) : this.styleInProcess || s(), this;
|
|
10254
10273
|
}
|
|
10255
10274
|
return this.once("style.load", () => {
|
|
10256
|
-
const
|
|
10257
|
-
this.space ? this.setSpaceFromCurrentStyle() : this.initSpace({ before:
|
|
10275
|
+
const i = this.getLayersOrder()[0];
|
|
10276
|
+
this.space ? this.setSpaceFromCurrentStyle() : this.initSpace({ before: i }), this.halo ? this.setHaloFromCurrentStyle() : this.initHalo({ before: i });
|
|
10258
10277
|
}), this;
|
|
10259
10278
|
}
|
|
10260
10279
|
/**
|
|
@@ -10621,7 +10640,7 @@ let Pu = class no extends k.Map {
|
|
|
10621
10640
|
* @returns
|
|
10622
10641
|
*/
|
|
10623
10642
|
getMaptilerSessionId() {
|
|
10624
|
-
return
|
|
10643
|
+
return Nr;
|
|
10625
10644
|
}
|
|
10626
10645
|
/**
|
|
10627
10646
|
* Updates the requestManager's transform request with a new function.
|
|
@@ -10707,7 +10726,7 @@ function oo(r) {
|
|
|
10707
10726
|
s && o.features.push(s);
|
|
10708
10727
|
}
|
|
10709
10728
|
for (const i of Array.from(a))
|
|
10710
|
-
o.features.push(
|
|
10729
|
+
o.features.push(ju(i));
|
|
10711
10730
|
return o;
|
|
10712
10731
|
}
|
|
10713
10732
|
function io(r, e) {
|
|
@@ -10905,7 +10924,7 @@ function Ou(r) {
|
|
|
10905
10924
|
}
|
|
10906
10925
|
};
|
|
10907
10926
|
}
|
|
10908
|
-
function
|
|
10927
|
+
function ju(r) {
|
|
10909
10928
|
return {
|
|
10910
10929
|
type: "Feature",
|
|
10911
10930
|
properties: { ...pn(r), ...Rr(r, ["sym"]) },
|
|
@@ -10960,14 +10979,14 @@ function E(r, e) {
|
|
|
10960
10979
|
const t = G(r, e);
|
|
10961
10980
|
return t.length ? t[0] : null;
|
|
10962
10981
|
}
|
|
10963
|
-
function
|
|
10982
|
+
function Nu(r) {
|
|
10964
10983
|
return r.normalize && r.normalize(), r;
|
|
10965
10984
|
}
|
|
10966
10985
|
function uo(r) {
|
|
10967
10986
|
return r.map(Number.parseFloat).map((e) => Number.isNaN(e) ? null : e);
|
|
10968
10987
|
}
|
|
10969
10988
|
function O(r) {
|
|
10970
|
-
return r &&
|
|
10989
|
+
return r && Nu(r), r && r.textContent;
|
|
10971
10990
|
}
|
|
10972
10991
|
function Rr(r, e) {
|
|
10973
10992
|
const t = {};
|
|
@@ -11146,7 +11165,7 @@ function yo(r, e, t = !0) {
|
|
|
11146
11165
|
["interpolate", ["linear"], ["get", e], ...r.flatMap((n) => [n.propertyValue, n.value])]
|
|
11147
11166
|
] : ["interpolate", ["linear"], ["get", e], ...r.flatMap((n) => [n.propertyValue, n.value])];
|
|
11148
11167
|
}
|
|
11149
|
-
function
|
|
11168
|
+
function jr(r, e) {
|
|
11150
11169
|
return r.every((t) => t.color[3] === r[0].color[3]) ? r[0].color[3] ? r[0].color[3] / 255 : 1 : [
|
|
11151
11170
|
"interpolate",
|
|
11152
11171
|
["linear"],
|
|
@@ -12290,7 +12309,7 @@ function Ku(r, e) {
|
|
|
12290
12309
|
const t = e.minPointRadius ?? 10, n = e.maxPointRadius ?? 50, a = e.cluster ?? !1, o = 20, i = Array.isArray(e.pointColor) ? e.pointColor : go.TURBO.scale(10, e.cluster ? 1e4 : 1e3).resample("ease-out-square"), s = i.getBounds(), l = e.sourceId ?? yt(), u = e.layerId ?? mt(), c = e.showLabel ?? a, p = e.alignOnViewport ?? !0, f = e.outline ?? !1, d = e.outlineOpacity ?? 1, h = e.outlineWidth ?? 1, y = e.outlineColor ?? "#FFFFFF";
|
|
12291
12310
|
let m;
|
|
12292
12311
|
const w = e.zoomCompensation ?? !0, v = e.minzoom ?? 0, x = e.maxzoom ?? 23;
|
|
12293
|
-
typeof e.pointOpacity == "number" ? m = e.pointOpacity : Array.isArray(e.pointOpacity) ? m = z(e.pointOpacity) : e.cluster ? m =
|
|
12312
|
+
typeof e.pointOpacity == "number" ? m = e.pointOpacity : Array.isArray(e.pointOpacity) ? m = z(e.pointOpacity) : e.cluster ? m = jr(i, "point_count") : e.property ? m = jr(i, e.property) : m = z([
|
|
12294
12313
|
{ zoom: v, value: 0 },
|
|
12295
12314
|
{ zoom: v + 0.25, value: 1 },
|
|
12296
12315
|
{ zoom: x - 0.25, value: 1 },
|
|
@@ -12523,7 +12542,7 @@ const kc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
12523
12542
|
getRandomColor: er,
|
|
12524
12543
|
heatmapIntensityFromColorRamp: mo,
|
|
12525
12544
|
lerpZoomNumberValues: Fr,
|
|
12526
|
-
opacityDrivenByProperty:
|
|
12545
|
+
opacityDrivenByProperty: jr,
|
|
12527
12546
|
paintColorOptionsToPaintSpec: Ae,
|
|
12528
12547
|
radiusDrivenByProperty: Or,
|
|
12529
12548
|
radiusDrivenByPropertyHeatmap: yo,
|
|
@@ -12533,9 +12552,9 @@ const kc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
12533
12552
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
12534
12553
|
Go();
|
|
12535
12554
|
function Cc() {
|
|
12536
|
-
return "3.5.
|
|
12555
|
+
return "3.5.1-rc1";
|
|
12537
12556
|
}
|
|
12538
|
-
const Lc = k.Map, Ac = k.Marker, Ec = k.Popup, Tc = k.Style, _c = k.CanvasSource,
|
|
12557
|
+
const Lc = k.Map, Ac = k.Marker, Ec = k.Popup, Tc = k.Style, _c = k.CanvasSource, Ic = k.GeoJSONSource, Mc = k.ImageSource, Pc = k.RasterTileSource, Rc = k.RasterDEMTileSource, zc = k.VectorTileSource, Fc = k.VideoSource, $c = k.NavigationControl, Oc = k.GeolocateControl, jc = k.AttributionControl, Nc = k.LogoControl, Dc = k.ScaleControl, Uc = k.FullscreenControl, Bc = k.TerrainControl, qc = k.BoxZoomHandler, Gc = k.ScrollZoomHandler, Vc = k.CooperativeGesturesHandler, Hc = k.KeyboardHandler, Kc = k.TwoFingersTouchPitchHandler, Xc = k.MapWheelEvent, Wc = k.MapTouchEvent, Zc = k.MapMouseEvent, Yc = k.config, Jc = k.getVersion, {
|
|
12539
12558
|
setRTLTextPlugin: Qc,
|
|
12540
12559
|
getRTLTextPluginStatus: ep,
|
|
12541
12560
|
LngLat: tp,
|
|
@@ -12568,7 +12587,7 @@ const Lc = k.Map, Ac = k.Marker, Ec = k.Popup, Tc = k.Style, _c = k.CanvasSource
|
|
|
12568
12587
|
export {
|
|
12569
12588
|
op as AJAXError,
|
|
12570
12589
|
dc as AttributionControl,
|
|
12571
|
-
|
|
12590
|
+
jc as AttributionControlMLGL,
|
|
12572
12591
|
yc as BoxZoomHandler,
|
|
12573
12592
|
qc as BoxZoomHandlerMLGL,
|
|
12574
12593
|
ic as CanvasSource,
|
|
@@ -12577,7 +12596,7 @@ export {
|
|
|
12577
12596
|
go as ColorRampCollection,
|
|
12578
12597
|
gc as CooperativeGesturesHandler,
|
|
12579
12598
|
Vc as CooperativeGesturesHandlerMLGL,
|
|
12580
|
-
|
|
12599
|
+
Me as CubemapFaceNames,
|
|
12581
12600
|
gu as CubemapImagesPresets,
|
|
12582
12601
|
wr as CubemapLayer,
|
|
12583
12602
|
ge as DOMcreate,
|
|
@@ -12590,26 +12609,26 @@ export {
|
|
|
12590
12609
|
ii as FullscreenControl,
|
|
12591
12610
|
Uc as FullscreenControlMLGL,
|
|
12592
12611
|
sc as GeoJSONSource,
|
|
12593
|
-
|
|
12612
|
+
Ic as GeoJSONSourceMLGL,
|
|
12594
12613
|
ni as GeolocateControl,
|
|
12595
12614
|
Oc as GeolocateControlMLGL,
|
|
12596
|
-
|
|
12615
|
+
Mu as GeolocationType,
|
|
12597
12616
|
lp as Hash,
|
|
12598
12617
|
lc as ImageSource,
|
|
12599
|
-
|
|
12618
|
+
Mc as ImageSourceMLGL,
|
|
12600
12619
|
vc as KeyboardHandler,
|
|
12601
12620
|
Hc as KeyboardHandlerMLGL,
|
|
12602
12621
|
R as Language,
|
|
12603
12622
|
tp as LngLat,
|
|
12604
12623
|
rp as LngLatBounds,
|
|
12605
12624
|
ai as LogoControl,
|
|
12606
|
-
|
|
12625
|
+
Nc as LogoControlMLGL,
|
|
12607
12626
|
Pu as Map,
|
|
12608
12627
|
Lc as MapMLGL,
|
|
12609
12628
|
xc as MapMouseEvent,
|
|
12610
12629
|
Zc as MapMouseEventMLGL,
|
|
12611
12630
|
_p as MapStyle,
|
|
12612
|
-
|
|
12631
|
+
Ip as MapStyleVariant,
|
|
12613
12632
|
Sc as MapTouchEvent,
|
|
12614
12633
|
Wc as MapTouchEventMLGL,
|
|
12615
12634
|
wc as MapWheelEvent,
|
|
@@ -12632,7 +12651,7 @@ export {
|
|
|
12632
12651
|
Rc as RasterDEMTileSourceMLGL,
|
|
12633
12652
|
uc as RasterTileSource,
|
|
12634
12653
|
Pc as RasterTileSourceMLGL,
|
|
12635
|
-
|
|
12654
|
+
Mp as ReferenceMapStyle,
|
|
12636
12655
|
oi as ScaleControl,
|
|
12637
12656
|
Dc as ScaleControlMLGL,
|
|
12638
12657
|
mc as ScrollZoomHandler,
|
|
@@ -12664,8 +12683,8 @@ export {
|
|
|
12664
12683
|
Ge as cubemapPresets,
|
|
12665
12684
|
Op as data,
|
|
12666
12685
|
tc as displayWebGLContextLostWarning,
|
|
12667
|
-
|
|
12668
|
-
|
|
12686
|
+
jp as elevation,
|
|
12687
|
+
Np as expandMapStyle,
|
|
12669
12688
|
Dp as geocoding,
|
|
12670
12689
|
Up as geolocation,
|
|
12671
12690
|
Bp as getAutoLanguage,
|