@maptiler/sdk 3.6.0 → 3.6.1
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 +188 -185
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/dist/src/Map.d.ts +1 -0
- package/dist/src/utils/webgl-utils.d.ts +1 -1
- package/package.json +1 -1
package/dist/maptiler-sdk.mjs
CHANGED
|
@@ -7,7 +7,7 @@ var S = (r, e, t) => Eo(r, typeof e != "symbol" ? e + "" : e, t), tr = (r, e, 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) ? fn("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
9
|
import { Language as To, getLanguageInfoFromCode as dn, config as rr, MapStyle as Qe, mapStylePresetList as nr, expandMapStyle as _o, MapStyleVariant as Io, ReferenceMapStyle as Mo, toLanguageInfo as hn, getLanguageInfoFromFlag as Po, geolocation as yn } from "@maptiler/client";
|
|
10
|
-
import { MapStyle as Tp, MapStyleVariant as _p, ReferenceMapStyle as Ip, ServiceError as Mp, areSameLanguages as Pp, bufferToPixelDataBrowser as Rp, circumferenceAtLatitude as zp, coordinates as Fp, data as $p, elevation as Op, expandMapStyle as
|
|
10
|
+
import { MapStyle as Tp, MapStyleVariant as _p, ReferenceMapStyle as Ip, ServiceError as Mp, areSameLanguages as Pp, bufferToPixelDataBrowser as Rp, circumferenceAtLatitude as zp, coordinates as Fp, data as $p, elevation as Op, expandMapStyle as jp, geocoding as Np, geolocation as Dp, getAutoLanguage as Up, getBufferToPixelDataParser as Bp, getLanguageInfoFromCode as qp, getLanguageInfoFromFlag as Gp, getLanguageInfoFromKey as Vp, getTileCache as Hp, isLanguageInfo as Kp, mapStylePresetList as Xp, math as Zp, misc as Wp, staticMaps as Yp, styleToStyle as Jp, toLanguageInfo as Qp } from "@maptiler/client";
|
|
11
11
|
import Ro from "events";
|
|
12
12
|
import { v4 as zo } from "uuid";
|
|
13
13
|
import { Base64 as Fo } 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 jr = zo();
|
|
83
83
|
class $o extends Ro {
|
|
84
84
|
constructor() {
|
|
85
85
|
super(...arguments);
|
|
@@ -170,7 +170,7 @@ class $o extends Ro {
|
|
|
170
170
|
return rr.fetch;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
const D = new $o(), Sr = "localcache_source", xr = "localcache", Oo = "maptiler_sdk",
|
|
173
|
+
const D = new $o(), Sr = "localcache_source", xr = "localcache", Oo = "maptiler_sdk", jo = 1e3, No = 100, kr = typeof caches < "u", { addProtocol: gn } = k;
|
|
174
174
|
function Do(r, e) {
|
|
175
175
|
if (kr && D.caching && D.session && r.host === V.maptilerApiHost) {
|
|
176
176
|
if (e === "Source" && r.href.includes("tiles.json"))
|
|
@@ -186,7 +186,7 @@ async function fa() {
|
|
|
186
186
|
}
|
|
187
187
|
let vn = 0;
|
|
188
188
|
async function Uo() {
|
|
189
|
-
const r = await fa(), e = await r.keys(), t = e.slice(0, Math.max(e.length -
|
|
189
|
+
const r = await fa(), e = await r.keys(), t = e.slice(0, Math.max(e.length - jo, 0));
|
|
190
190
|
for (const n of t)
|
|
191
191
|
r.delete(n);
|
|
192
192
|
}
|
|
@@ -223,7 +223,7 @@ function Bo() {
|
|
|
223
223
|
c.signal = e.signal;
|
|
224
224
|
const p = await fetch(i, c);
|
|
225
225
|
return p.status >= 200 && p.status < 300 && (l.put(a, p.clone()).catch(() => {
|
|
226
|
-
}), ++vn >
|
|
226
|
+
}), ++vn > No && (Uo(), vn = 0)), s(p);
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
229
|
function qo() {
|
|
@@ -248,7 +248,7 @@ function bn(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", jr)), {
|
|
252
252
|
url: Do(t, e)
|
|
253
253
|
};
|
|
254
254
|
}
|
|
@@ -2476,7 +2476,7 @@ var ii = 8, si = {
|
|
|
2476
2476
|
},
|
|
2477
2477
|
"property-type": "color-ramp"
|
|
2478
2478
|
}
|
|
2479
|
-
},
|
|
2479
|
+
}, ji = {
|
|
2480
2480
|
"circle-radius": {
|
|
2481
2481
|
type: "number",
|
|
2482
2482
|
default: 5,
|
|
@@ -2649,7 +2649,7 @@ var ii = 8, si = {
|
|
|
2649
2649
|
},
|
|
2650
2650
|
"property-type": "data-driven"
|
|
2651
2651
|
}
|
|
2652
|
-
},
|
|
2652
|
+
}, Ni = {
|
|
2653
2653
|
"heatmap-radius": {
|
|
2654
2654
|
type: "number",
|
|
2655
2655
|
default: 30,
|
|
@@ -3516,8 +3516,8 @@ var ii = 8, si = {
|
|
|
3516
3516
|
}
|
|
3517
3517
|
},
|
|
3518
3518
|
paint_line: Oi,
|
|
3519
|
-
paint_circle:
|
|
3520
|
-
paint_heatmap:
|
|
3519
|
+
paint_circle: ji,
|
|
3520
|
+
paint_heatmap: Ni,
|
|
3521
3521
|
paint_symbol: Di,
|
|
3522
3522
|
paint_raster: Ui,
|
|
3523
3523
|
paint_hillshade: Bi,
|
|
@@ -3588,14 +3588,14 @@ class fe extends Error {
|
|
|
3588
3588
|
super(t), this.message = t, this.key = e;
|
|
3589
3589
|
}
|
|
3590
3590
|
}
|
|
3591
|
-
class
|
|
3591
|
+
class Nr {
|
|
3592
3592
|
constructor(e, t = []) {
|
|
3593
3593
|
this.parent = e, this.bindings = {};
|
|
3594
3594
|
for (const [n, a] of t)
|
|
3595
3595
|
this.bindings[n] = a;
|
|
3596
3596
|
}
|
|
3597
3597
|
concat(e) {
|
|
3598
|
-
return new
|
|
3598
|
+
return new Nr(this, e);
|
|
3599
3599
|
}
|
|
3600
3600
|
get(e) {
|
|
3601
3601
|
if (this.bindings[e])
|
|
@@ -3608,7 +3608,7 @@ class jr {
|
|
|
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" }, Ki = { 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 W(r, e) {
|
|
3613
3613
|
return {
|
|
3614
3614
|
kind: "array",
|
|
@@ -3616,20 +3616,20 @@ function W(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 Xi = [
|
|
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
|
W(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 Dr(r, e) {
|
|
3660
3660
|
return e.some((t) => t.kind === r.kind);
|
|
@@ -3985,7 +3985,7 @@ function Le(r, e, t) {
|
|
|
3985
3985
|
function Ve(r, e, t) {
|
|
3986
3986
|
return r.map((n, a) => Le(n, e[a], t));
|
|
3987
3987
|
}
|
|
3988
|
-
class
|
|
3988
|
+
class $ {
|
|
3989
3989
|
/**
|
|
3990
3990
|
* @param r Red component premultiplied by `alpha` 0..1
|
|
3991
3991
|
* @param g Green component premultiplied by `alpha` 0..1
|
|
@@ -4010,13 +4010,13 @@ class F {
|
|
|
4010
4010
|
* @returns A `Color` instance, or `undefined` if the input is not a valid color string.
|
|
4011
4011
|
*/
|
|
4012
4012
|
static parse(e) {
|
|
4013
|
-
if (e instanceof
|
|
4013
|
+
if (e instanceof $)
|
|
4014
4014
|
return e;
|
|
4015
4015
|
if (typeof e != "string")
|
|
4016
4016
|
return;
|
|
4017
4017
|
const t = rs(e);
|
|
4018
4018
|
if (t)
|
|
4019
|
-
return new
|
|
4019
|
+
return new $(...t, !1);
|
|
4020
4020
|
}
|
|
4021
4021
|
/**
|
|
4022
4022
|
* Used in color interpolation and by 'to-rgba' expression.
|
|
@@ -4085,7 +4085,7 @@ class F {
|
|
|
4085
4085
|
switch (a) {
|
|
4086
4086
|
case "rgb": {
|
|
4087
4087
|
const [o, i, s, l] = Ve(e.rgb, t.rgb, n);
|
|
4088
|
-
return new
|
|
4088
|
+
return new $(o, i, s, l, !1);
|
|
4089
4089
|
}
|
|
4090
4090
|
case "hcl": {
|
|
4091
4091
|
const [o, i, s, l] = e.hcl, [u, c, p, f] = t.hcl;
|
|
@@ -4100,19 +4100,19 @@ class F {
|
|
|
4100
4100
|
Le(s, p, n),
|
|
4101
4101
|
Le(l, f, n)
|
|
4102
4102
|
]);
|
|
4103
|
-
return new
|
|
4103
|
+
return new $(y, m, w, v, !1);
|
|
4104
4104
|
}
|
|
4105
4105
|
case "lab": {
|
|
4106
4106
|
const [o, i, s, l] = Sa(Ve(e.lab, t.lab, n));
|
|
4107
|
-
return new
|
|
4107
|
+
return new $(o, i, s, l, !1);
|
|
4108
4108
|
}
|
|
4109
4109
|
}
|
|
4110
4110
|
}
|
|
4111
4111
|
}
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4112
|
+
$.black = new $(0, 0, 0, 1);
|
|
4113
|
+
$.white = new $(1, 1, 1, 1);
|
|
4114
|
+
$.transparent = new $(0, 0, 0, 0);
|
|
4115
|
+
$.red = new $(1, 0, 0, 1);
|
|
4116
4116
|
class Ur {
|
|
4117
4117
|
constructor(e, t, n) {
|
|
4118
4118
|
e ? this.sensitivity = t ? "variant" : "case" : this.sensitivity = t ? "accent" : "base", this.locale = n, this.collator = new Intl.Collator(this.locale ? this.locale : [], { sensitivity: this.sensitivity, usage: "search" });
|
|
@@ -4227,7 +4227,7 @@ class X {
|
|
|
4227
4227
|
if (e instanceof X)
|
|
4228
4228
|
return e;
|
|
4229
4229
|
if (typeof e == "string") {
|
|
4230
|
-
const n =
|
|
4230
|
+
const n = $.parse(e);
|
|
4231
4231
|
return n ? new X([n]) : void 0;
|
|
4232
4232
|
}
|
|
4233
4233
|
if (!Array.isArray(e))
|
|
@@ -4236,7 +4236,7 @@ class X {
|
|
|
4236
4236
|
for (const n of e) {
|
|
4237
4237
|
if (typeof n != "string")
|
|
4238
4238
|
return;
|
|
4239
|
-
const a =
|
|
4239
|
+
const a = $.parse(n);
|
|
4240
4240
|
if (!a)
|
|
4241
4241
|
return;
|
|
4242
4242
|
t.push(a);
|
|
@@ -4251,11 +4251,11 @@ class X {
|
|
|
4251
4251
|
if (e.values.length != t.values.length)
|
|
4252
4252
|
throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${t.values.length}), cannot interpolate.`);
|
|
4253
4253
|
for (let i = 0; i < e.values.length; i++)
|
|
4254
|
-
o.push(
|
|
4254
|
+
o.push($.interpolate(e.values[i], t.values[i], n, a));
|
|
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)]);
|
|
@@ -4331,7 +4331,7 @@ function xa(r, e, t, n) {
|
|
|
4331
4331
|
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.`;
|
|
4332
4332
|
}
|
|
4333
4333
|
function ot(r) {
|
|
4334
|
-
if (r === null || typeof r == "string" || typeof r == "boolean" || typeof r == "number" || r instanceof ie || r instanceof
|
|
4334
|
+
if (r === null || typeof r == "string" || typeof r == "boolean" || typeof r == "number" || r instanceof ie || r instanceof $ || r instanceof Ur || r instanceof me || r instanceof Q || r instanceof ee || r instanceof X || r instanceof ue || r instanceof Ee)
|
|
4335
4335
|
return !0;
|
|
4336
4336
|
if (Array.isArray(r)) {
|
|
4337
4337
|
for (const e of r)
|
|
@@ -4348,17 +4348,17 @@ 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
4353
|
return I;
|
|
4354
4354
|
if (typeof r == "boolean")
|
|
4355
4355
|
return _;
|
|
4356
4356
|
if (typeof r == "number")
|
|
4357
4357
|
return b;
|
|
4358
|
-
if (r instanceof
|
|
4358
|
+
if (r instanceof $)
|
|
4359
4359
|
return de;
|
|
4360
4360
|
if (r instanceof ie)
|
|
4361
|
-
return
|
|
4361
|
+
return Nt;
|
|
4362
4362
|
if (r instanceof Ur)
|
|
4363
4363
|
return Dt;
|
|
4364
4364
|
if (r instanceof me)
|
|
@@ -4393,7 +4393,7 @@ function B(r) {
|
|
|
4393
4393
|
}
|
|
4394
4394
|
function tt(r) {
|
|
4395
4395
|
const e = typeof r;
|
|
4396
|
-
return r === null ? "" : e === "string" || e === "number" || e === "boolean" ? String(r) : r instanceof
|
|
4396
|
+
return r === null ? "" : e === "string" || e === "number" || e === "boolean" ? String(r) : r instanceof $ || r instanceof ie || r instanceof me || r instanceof Q || r instanceof ee || r instanceof X || r instanceof ue || r instanceof Ee ? r.toString() : JSON.stringify(r);
|
|
4397
4397
|
}
|
|
4398
4398
|
class He {
|
|
4399
4399
|
constructor(e, t) {
|
|
@@ -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();
|
|
@@ -4514,16 +4514,16 @@ class ke {
|
|
|
4514
4514
|
case "color": {
|
|
4515
4515
|
let t, n;
|
|
4516
4516
|
for (const a of this.args) {
|
|
4517
|
-
if (t = a.evaluate(e), n = null, t instanceof
|
|
4517
|
+
if (t = a.evaluate(e), n = null, t instanceof $)
|
|
4518
4518
|
return t;
|
|
4519
4519
|
if (typeof t == "string") {
|
|
4520
4520
|
const o = e.parseColor(t);
|
|
4521
4521
|
if (o)
|
|
4522
4522
|
return o;
|
|
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 = xa(t[0], t[1], t[2], t[3]), !n))
|
|
4524
|
-
return new
|
|
4524
|
+
return new $(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)));
|
|
@@ -4615,11 +4615,11 @@ class ka {
|
|
|
4615
4615
|
}
|
|
4616
4616
|
parseColor(e) {
|
|
4617
4617
|
let t = this._parseColorCache.get(e);
|
|
4618
|
-
return t || (t =
|
|
4618
|
+
return t || (t = $.parse(e), this._parseColorCache.set(e, t)), t;
|
|
4619
4619
|
}
|
|
4620
4620
|
}
|
|
4621
4621
|
class Vt {
|
|
4622
|
-
constructor(e, t, n = [], a, o = new
|
|
4622
|
+
constructor(e, t, n = [], a, o = new Nr(), i = []) {
|
|
4623
4623
|
this.registry = e, this.path = n, this.key = n.map((s) => `[${s}]`).join(""), this.scope = o, this.errors = i, this.expectedType = a, this._isConstant = t;
|
|
4624
4624
|
}
|
|
4625
4625
|
/**
|
|
@@ -4774,11 +4774,11 @@ class Br {
|
|
|
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 qr {
|
|
|
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 : Dr(n.type, [_, I, b,
|
|
4799
|
+
return !n || !a ? null : Dr(n.type, [_, I, b, jt, T]) ? new qr(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 (!Dr(n.type, [_, I, b,
|
|
4829
|
-
return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${
|
|
4828
|
+
if (!Dr(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) {
|
|
@@ -4964,7 +4964,7 @@ class It {
|
|
|
4964
4964
|
if (!n || !a)
|
|
4965
4965
|
return null;
|
|
4966
4966
|
if (!Dr(n.type, [W(T), I, T]))
|
|
4967
|
-
return t.error(`Expected first argument to be of type array or string, but found ${
|
|
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
4970
|
return o ? new It(n.type, n, a, o) : null;
|
|
@@ -4978,7 +4978,7 @@ class It {
|
|
|
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 Ca(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, W(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;
|
|
@@ -5175,7 +5175,7 @@ class he {
|
|
|
5175
5175
|
case "number":
|
|
5176
5176
|
return Le(c, p, u);
|
|
5177
5177
|
case "color":
|
|
5178
|
-
return
|
|
5178
|
+
return $.interpolate(c, p, u);
|
|
5179
5179
|
case "padding":
|
|
5180
5180
|
return Q.interpolate(c, p, u);
|
|
5181
5181
|
case "colorArray":
|
|
@@ -5192,14 +5192,14 @@ class he {
|
|
|
5192
5192
|
case "interpolate-hcl":
|
|
5193
5193
|
switch (this.type.kind) {
|
|
5194
5194
|
case "color":
|
|
5195
|
-
return
|
|
5195
|
+
return $.interpolate(c, p, u, "hcl");
|
|
5196
5196
|
case "colorArray":
|
|
5197
5197
|
return X.interpolate(c, p, u, "hcl");
|
|
5198
5198
|
}
|
|
5199
5199
|
case "interpolate-lab":
|
|
5200
5200
|
switch (this.type.kind) {
|
|
5201
5201
|
case "color":
|
|
5202
|
-
return
|
|
5202
|
+
return $.interpolate(c, p, u, "lab");
|
|
5203
5203
|
case "colorArray":
|
|
5204
5204
|
return X.interpolate(c, p, u, "lab");
|
|
5205
5205
|
}
|
|
@@ -5218,7 +5218,7 @@ function cr(r, e, t, n) {
|
|
|
5218
5218
|
const a = n - t, o = r - t;
|
|
5219
5219
|
return a === 0 ? 0 : e === 1 ? o / a : (Math.pow(e, o) - 1) / (Math.pow(e, a) - 1);
|
|
5220
5220
|
}
|
|
5221
|
-
|
|
5221
|
+
$.interpolate, Q.interpolate, ee.interpolate, X.interpolate, ue.interpolate;
|
|
5222
5222
|
class it {
|
|
5223
5223
|
constructor(e, t) {
|
|
5224
5224
|
this.type = e, this.args = t;
|
|
@@ -5307,14 +5307,14 @@ function Xe(r, e, t) {
|
|
|
5307
5307
|
if (!l)
|
|
5308
5308
|
return null;
|
|
5309
5309
|
if (!En(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 (!En(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);
|
|
@@ -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);
|
|
@@ -5560,7 +5560,7 @@ function zs(r, e, t) {
|
|
|
5560
5560
|
}
|
|
5561
5561
|
function Wt(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 js(o, a) === 0 ? !1 : !!(Tn(r, e, t, n) && Tn(t, n, r, e));
|
|
5564
5564
|
}
|
|
5565
5565
|
function Fs(r, e, t) {
|
|
5566
5566
|
for (const n of t)
|
|
@@ -5600,7 +5600,7 @@ function Os(r, e) {
|
|
|
5600
5600
|
return !0;
|
|
5601
5601
|
return !1;
|
|
5602
5602
|
}
|
|
5603
|
-
function
|
|
5603
|
+
function js(r, e) {
|
|
5604
5604
|
return r[0] * e[1] - r[1] * e[0];
|
|
5605
5605
|
}
|
|
5606
5606
|
function Tn(r, e, t, n) {
|
|
@@ -5635,7 +5635,7 @@ function _a(r, e, t, n) {
|
|
|
5635
5635
|
}
|
|
5636
5636
|
dt(e, r);
|
|
5637
5637
|
}
|
|
5638
|
-
function
|
|
5638
|
+
function Ns(r) {
|
|
5639
5639
|
r[0] = r[1] = 1 / 0, r[2] = r[3] = -1 / 0;
|
|
5640
5640
|
}
|
|
5641
5641
|
function _n(r, e, t, n) {
|
|
@@ -5658,7 +5658,7 @@ function In(r, e, t, n) {
|
|
|
5658
5658
|
i.push(l);
|
|
5659
5659
|
}
|
|
5660
5660
|
if (e[2] - e[0] <= a / 2) {
|
|
5661
|
-
|
|
5661
|
+
Ns(e);
|
|
5662
5662
|
for (const s of i)
|
|
5663
5663
|
for (const l of s)
|
|
5664
5664
|
_a(l, e, t, a);
|
|
@@ -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
|
}
|
|
@@ -6334,10 +6334,10 @@ function On(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 = xa(e, t, n, o);
|
|
6336
6336
|
if (i)
|
|
6337
|
-
throw new
|
|
6338
|
-
return new
|
|
6337
|
+
throw new N(i);
|
|
6338
|
+
return new $(e / 255, t / 255, n / 255, o, !1);
|
|
6339
6339
|
}
|
|
6340
|
-
function
|
|
6340
|
+
function jn(r, e) {
|
|
6341
6341
|
return r in e;
|
|
6342
6342
|
}
|
|
6343
6343
|
function fr(r, e) {
|
|
@@ -6361,13 +6361,13 @@ le.register(tn, {
|
|
|
6361
6361
|
Ki,
|
|
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
|
W(b, 4),
|
|
@@ -6392,11 +6392,11 @@ le.register(tn, {
|
|
|
6392
6392
|
overloads: [
|
|
6393
6393
|
[
|
|
6394
6394
|
[I],
|
|
6395
|
-
(r, [e]) =>
|
|
6395
|
+
(r, [e]) => jn(e.evaluate(r), r.properties())
|
|
6396
6396
|
],
|
|
6397
6397
|
[
|
|
6398
6398
|
[I, Re],
|
|
6399
|
-
(r, [e, t]) =>
|
|
6399
|
+
(r, [e, t]) => jn(e.evaluate(r), t.evaluate(r))
|
|
6400
6400
|
]
|
|
6401
6401
|
]
|
|
6402
6402
|
},
|
|
@@ -6787,7 +6787,7 @@ le.register(tn, {
|
|
|
6787
6787
|
]
|
|
6788
6788
|
});
|
|
6789
6789
|
function el(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)
|
|
@@ -6879,7 +6879,7 @@ class tl {
|
|
|
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;
|
|
@@ -6893,7 +6893,7 @@ function Fa(r, e) {
|
|
|
6893
6893
|
const t = new Vt(tn, zt, [], e ? nl(e) : void 0), n = t.parse(r, void 0, void 0, void 0, e && e.type === "string" ? { typeAnnotation: "coerce" } : void 0);
|
|
6894
6894
|
return n ? Ir(new tl(n, e)) : Be(t.errors);
|
|
6895
6895
|
}
|
|
6896
|
-
class
|
|
6896
|
+
class Nn {
|
|
6897
6897
|
constructor(e, t) {
|
|
6898
6898
|
this.kind = e, this._styleExpression = t, this.isStateDependent = e !== "constant" && !lt(t.expression), this.globalStateRefs = nn(t.expression);
|
|
6899
6899
|
}
|
|
@@ -6936,7 +6936,7 @@ function rl(r, e) {
|
|
|
6936
6936
|
if (i instanceof he && !Ra(e))
|
|
6937
6937
|
return Be([new fe("", '"interpolate" expressions cannot be used with this property')]);
|
|
6938
6938
|
if (!i)
|
|
6939
|
-
return Ir(a ? new
|
|
6939
|
+
return Ir(a ? new Nn("constant", t.value) : new Nn("source", t.value));
|
|
6940
6940
|
const s = i instanceof he ? i.interpolation : void 0;
|
|
6941
6941
|
return Ir(a ? new Dn("camera", t.value, i.labels, s) : new Dn("composite", t.value, i.labels, s));
|
|
6942
6942
|
}
|
|
@@ -6970,7 +6970,7 @@ function nl(r) {
|
|
|
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
|
};
|
|
@@ -6978,10 +6978,10 @@ function nl(r) {
|
|
|
6978
6978
|
}
|
|
6979
6979
|
function al(r) {
|
|
6980
6980
|
if (r.type === "color" && rn(r.default))
|
|
6981
|
-
return new
|
|
6981
|
+
return new $(0, 0, 0, 0);
|
|
6982
6982
|
switch (r.type) {
|
|
6983
6983
|
case "color":
|
|
6984
|
-
return
|
|
6984
|
+
return $.parse(r.default) || null;
|
|
6985
6985
|
case "padding":
|
|
6986
6986
|
return Q.parse(r.default) || null;
|
|
6987
6987
|
case "numberArray":
|
|
@@ -7034,13 +7034,13 @@ function Oa(r) {
|
|
|
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);
|
|
@@ -7113,7 +7113,7 @@ function Qt(r) {
|
|
|
7113
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 ja(r) {
|
|
7117
7117
|
const e = r.valueSpec, t = U(r.value.type);
|
|
7118
7118
|
let n, a = {}, o, i;
|
|
7119
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({
|
|
@@ -7177,7 +7177,7 @@ function Na(r) {
|
|
|
7177
7177
|
style: y.style,
|
|
7178
7178
|
styleSpec: y.styleSpec
|
|
7179
7179
|
}, w));
|
|
7180
|
-
return za(
|
|
7180
|
+
return za(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,
|
|
@@ -7212,7 +7212,7 @@ function Na(r) {
|
|
|
7212
7212
|
}
|
|
7213
7213
|
}
|
|
7214
7214
|
function Ke(r) {
|
|
7215
|
-
const e = (r.expressionContext === "property" ? rl : Fa)(
|
|
7215
|
+
const e = (r.expressionContext === "property" ? rl : Fa)(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;
|
|
@@ -7236,19 +7236,19 @@ function ol(r) {
|
|
|
7236
7236
|
}
|
|
7237
7237
|
function Mr(r) {
|
|
7238
7238
|
const e = r.key, t = r.value, n = M(t);
|
|
7239
|
-
return n !== "string" ? [new g(e, t, `color expected, ${n} found`)] :
|
|
7239
|
+
return n !== "string" ? [new g(e, t, `color expected, ${n} found`)] : $.parse(String(t)) ? [] : [new g(e, t, `color expected, "${t}" found`)];
|
|
7240
7240
|
}
|
|
7241
7241
|
function ut(r) {
|
|
7242
7242
|
const e = r.key, t = r.value, n = r.valueSpec, a = [];
|
|
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 on(r) {
|
|
7246
|
-
return $a(
|
|
7246
|
+
return $a(je(r.value)) ? Ke(Tt({}, r, {
|
|
7247
7247
|
expressionContext: "filter",
|
|
7248
7248
|
valueSpec: { value: "boolean" }
|
|
7249
|
-
})) :
|
|
7249
|
+
})) : Na(r);
|
|
7250
7250
|
}
|
|
7251
|
-
function
|
|
7251
|
+
function Na(r) {
|
|
7252
7252
|
const e = r.value, t = r.key;
|
|
7253
7253
|
if (M(e) !== "array")
|
|
7254
7254
|
return [new g(t, e, `array expected, ${M(e)} found`)];
|
|
@@ -7289,7 +7289,7 @@ function ja(r) {
|
|
|
7289
7289
|
case "all":
|
|
7290
7290
|
case "none":
|
|
7291
7291
|
for (let i = 1; i < e.length; i++)
|
|
7292
|
-
o = o.concat(
|
|
7292
|
+
o = o.concat(Na({
|
|
7293
7293
|
key: `${t}[${i}]`,
|
|
7294
7294
|
value: e[i],
|
|
7295
7295
|
style: r.style,
|
|
@@ -7324,7 +7324,7 @@ function Da(r, e) {
|
|
|
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" && rn(
|
|
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" && rn(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,
|
|
@@ -7430,7 +7430,7 @@ function qa(r) {
|
|
|
7430
7430
|
}
|
|
7431
7431
|
})), e;
|
|
7432
7432
|
}
|
|
7433
|
-
function
|
|
7433
|
+
function Ne(r) {
|
|
7434
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
|
}
|
|
@@ -7537,11 +7537,11 @@ function Ga(r) {
|
|
|
7537
7537
|
}
|
|
7538
7538
|
function sl({ key: r, value: e }) {
|
|
7539
7539
|
if (M(e) === "string")
|
|
7540
|
-
return
|
|
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
|
}
|
|
@@ -7610,10 +7610,10 @@ function Ka(r) {
|
|
|
7610
7610
|
return o;
|
|
7611
7611
|
}
|
|
7612
7612
|
function ll(r) {
|
|
7613
|
-
return
|
|
7613
|
+
return Ne(r).length === 0 ? [] : Ke(r);
|
|
7614
7614
|
}
|
|
7615
7615
|
function ul(r) {
|
|
7616
|
-
return
|
|
7616
|
+
return Ne(r).length === 0 ? [] : Ke(r);
|
|
7617
7617
|
}
|
|
7618
7618
|
function cl(r) {
|
|
7619
7619
|
const e = r.key, t = r.value;
|
|
@@ -7730,7 +7730,7 @@ function Xa(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
|
});
|
|
@@ -7784,7 +7784,7 @@ const Bn = {
|
|
|
7784
7784
|
constants: Oa,
|
|
7785
7785
|
enum: ut,
|
|
7786
7786
|
filter: on,
|
|
7787
|
-
function:
|
|
7787
|
+
function: ja,
|
|
7788
7788
|
layer: qa,
|
|
7789
7789
|
object: te,
|
|
7790
7790
|
source: Ga,
|
|
@@ -7793,7 +7793,7 @@ const Bn = {
|
|
|
7793
7793
|
terrain: Ka,
|
|
7794
7794
|
projection: hl,
|
|
7795
7795
|
projectionDefinition: yl,
|
|
7796
|
-
string:
|
|
7796
|
+
string: Ne,
|
|
7797
7797
|
formatted: ll,
|
|
7798
7798
|
resolvedImage: ul,
|
|
7799
7799
|
padding: cl,
|
|
@@ -7805,12 +7805,12 @@ const Bn = {
|
|
|
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 && rn(U(e)) ?
|
|
7808
|
+
return r.validateSpec = $t, t.expression && rn(U(e)) ? ja(r) : t.expression && za(je(e)) ? Ke(r) : t.type && Bn[t.type] ? Bn[t.type](r) : te(Tt({}, r, {
|
|
7809
7809
|
valueSpec: t.type ? n[t.type] : t
|
|
7810
7810
|
}));
|
|
7811
7811
|
}
|
|
7812
7812
|
function Wa(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 = Hi) {
|
|
@@ -8228,7 +8228,7 @@ class Ll {
|
|
|
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 Al = "@maptiler/sdk", El = "3.6.
|
|
8231
|
+
const Al = "@maptiler/sdk", El = "3.6.1", Tl = "The Javascript & TypeScript map SDK tailored for MapTiler Cloud", _l = "MapTiler", Il = "dist/maptiler-sdk.mjs", Ml = "dist/maptiler-sdk.d.ts", Pl = "dist/maptiler-sdk.css", Rl = "module", zl = "dist/maptiler-sdk.mjs", Fl = { ".": { 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" } }, $l = ["maptiler", "map", "sdk", "webmap", "cloud", "webGL", "maplibre"], Ol = "https://docs.maptiler.com/sdk-js/", jl = "BSD-3-Clause", Nl = { type: "git", url: "https://github.com/maptiler/maptiler-sdk-js.git" }, Dl = { 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" }, Ul = { "@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" }, Bl = { "@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" }, ql = {
|
|
8232
8232
|
name: Al,
|
|
8233
8233
|
version: El,
|
|
8234
8234
|
description: Tl,
|
|
@@ -8241,8 +8241,8 @@ const Al = "@maptiler/sdk", El = "3.6.0", Tl = "The Javascript & TypeScript map
|
|
|
8241
8241
|
exports: Fl,
|
|
8242
8242
|
keywords: $l,
|
|
8243
8243
|
homepage: Ol,
|
|
8244
|
-
license:
|
|
8245
|
-
repository:
|
|
8244
|
+
license: jl,
|
|
8245
|
+
repository: Nl,
|
|
8246
8246
|
scripts: Dl,
|
|
8247
8247
|
"lint-staged": { "*.ts": "npm run lint:fix" },
|
|
8248
8248
|
"ts-typecheck": { "*.ts": "npm tsc --noEmit" },
|
|
@@ -8282,7 +8282,7 @@ class Gl {
|
|
|
8282
8282
|
}
|
|
8283
8283
|
preparePayload() {
|
|
8284
8284
|
const e = new URL(V.telemetryURL);
|
|
8285
|
-
return e.searchParams.append("sdk", ql.version), e.searchParams.append("key", D.apiKey), e.searchParams.append("mtsid",
|
|
8285
|
+
return e.searchParams.append("sdk", ql.version), e.searchParams.append("key", D.apiKey), e.searchParams.append("mtsid", jr), 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;
|
|
@@ -8299,8 +8299,8 @@ function Vl(r, e, t, n, a, o, i, s, l, u, c, p, f, d, h, y, m) {
|
|
|
8299
8299
|
return r[0] = e, r[1] = t, r[2] = n, r[3] = a, r[4] = o, r[5] = i, r[6] = s, r[7] = l, r[8] = u, r[9] = c, r[10] = p, r[11] = f, r[12] = d, r[13] = h, r[14] = y, r[15] = m, r;
|
|
8300
8300
|
}
|
|
8301
8301
|
function Hl(r, e, t) {
|
|
8302
|
-
var n = e[0], a = e[1], o = e[2], i = e[3], s = e[4], l = e[5], u = e[6], c = e[7], p = e[8], f = e[9], d = e[10], h = e[11], y = e[12], m = e[13], w = e[14], v = e[15], x = t[0], A = t[1], L = t[2],
|
|
8303
|
-
return r[0] = x * n + A * s + L * p +
|
|
8302
|
+
var n = e[0], a = e[1], o = e[2], i = e[3], s = e[4], l = e[5], u = e[6], c = e[7], p = e[8], f = e[9], d = e[10], h = e[11], y = e[12], m = e[13], w = e[14], v = e[15], x = t[0], A = t[1], L = t[2], z = t[3];
|
|
8303
|
+
return r[0] = x * n + A * s + L * p + z * y, r[1] = x * a + A * l + L * f + z * m, r[2] = x * o + A * u + L * d + z * w, r[3] = x * i + A * c + L * h + z * v, x = t[4], A = t[5], L = t[6], z = t[7], r[4] = x * n + A * s + L * p + z * y, r[5] = x * a + A * l + L * f + z * m, r[6] = x * o + A * u + L * d + z * w, r[7] = x * i + A * c + L * h + z * v, x = t[8], A = t[9], L = t[10], z = t[11], r[8] = x * n + A * s + L * p + z * y, r[9] = x * a + A * l + L * f + z * m, r[10] = x * o + A * u + L * d + z * w, r[11] = x * i + A * c + L * h + z * v, x = t[12], A = t[13], L = t[14], z = t[15], r[12] = x * n + A * s + L * p + z * y, r[13] = x * a + A * l + L * f + z * m, r[14] = x * o + A * u + L * d + z * w, r[15] = x * i + A * c + L * h + z * v, r;
|
|
8304
8304
|
}
|
|
8305
8305
|
function Kl(r, e, t) {
|
|
8306
8306
|
var n = t[0], a = t[1], o = t[2];
|
|
@@ -9419,6 +9419,8 @@ class br {
|
|
|
9419
9419
|
* @throws Error if the map, cubemap, or texture is undefined.
|
|
9420
9420
|
*/
|
|
9421
9421
|
render(e, t) {
|
|
9422
|
+
if (!this.map.isGlobeProjection())
|
|
9423
|
+
return;
|
|
9422
9424
|
if (this.map === void 0)
|
|
9423
9425
|
throw new Error("[CubemapLayer]: Map is undefined");
|
|
9424
9426
|
if (this.cubemap === void 0)
|
|
@@ -9746,6 +9748,8 @@ class wr {
|
|
|
9746
9748
|
render(e, t) {
|
|
9747
9749
|
if (this.map === void 0)
|
|
9748
9750
|
throw new Error("[RadialGradientLayer]: Map is undefined");
|
|
9751
|
+
if (!this.map.isGlobeProjection())
|
|
9752
|
+
return;
|
|
9749
9753
|
if (this.plane === void 0)
|
|
9750
9754
|
throw new Error("[RadialGradientLayer]: Plane is undefined");
|
|
9751
9755
|
e.disable(e.DEPTH_TEST), e.enable(e.BLEND), e.useProgram(this.plane.shaderProgram), e.bindBuffer(e.ARRAY_BUFFER, this.plane.positionBuffer);
|
|
@@ -9839,6 +9843,9 @@ let Mu = class ro extends k.Map {
|
|
|
9839
9843
|
S(this, "originalLabelStyle", new window.Map());
|
|
9840
9844
|
S(this, "isStyleLocalized", !1);
|
|
9841
9845
|
S(this, "languageIsUpdated", !1);
|
|
9846
|
+
S(this, "spaceboxLoadingState", {
|
|
9847
|
+
styleLoadCallbackSet: !1
|
|
9848
|
+
});
|
|
9842
9849
|
this.options = t, this.setStyle(n), a && this.monitorStyleUrl(n);
|
|
9843
9850
|
const u = () => {
|
|
9844
9851
|
let h = "The distant style could not be loaded.";
|
|
@@ -9985,7 +9992,7 @@ let Mu = class ro extends k.Map {
|
|
|
9985
9992
|
apiKey: x,
|
|
9986
9993
|
maptilerLogo: A,
|
|
9987
9994
|
canvasContextAttributes: L,
|
|
9988
|
-
refreshExpiredTiles:
|
|
9995
|
+
refreshExpiredTiles: z,
|
|
9989
9996
|
maxBounds: Te,
|
|
9990
9997
|
scrollZoom: We,
|
|
9991
9998
|
minZoom: gt,
|
|
@@ -10009,7 +10016,7 @@ let Mu = class ro extends k.Map {
|
|
|
10009
10016
|
container: "null",
|
|
10010
10017
|
maptilerLogo: A,
|
|
10011
10018
|
canvasContextAttributes: L,
|
|
10012
|
-
refreshExpiredTiles:
|
|
10019
|
+
refreshExpiredTiles: z,
|
|
10013
10020
|
maxBounds: Te,
|
|
10014
10021
|
scrollZoom: We,
|
|
10015
10022
|
minZoom: gt,
|
|
@@ -10251,8 +10258,8 @@ let Mu = class ro extends k.Map {
|
|
|
10251
10258
|
* - a longer form with the prefix `"maptiler://"` (eg. `"maptiler://streets-v2"`)
|
|
10252
10259
|
*/
|
|
10253
10260
|
setStyle(t, n) {
|
|
10254
|
-
var
|
|
10255
|
-
this.originalLabelStyle.clear(), (
|
|
10261
|
+
var p, f, d, h, y, m;
|
|
10262
|
+
this.originalLabelStyle.clear(), (p = this.minimap) == null || p.setStyle(t), this.forceLanguageUpdate = !0, this.once("idle", () => {
|
|
10256
10263
|
this.forceLanguageUpdate = !1;
|
|
10257
10264
|
});
|
|
10258
10265
|
const a = qn(t);
|
|
@@ -10266,26 +10273,22 @@ let Mu = class ro extends k.Map {
|
|
|
10266
10273
|
);
|
|
10267
10274
|
}
|
|
10268
10275
|
this.styleInProcess = !0;
|
|
10269
|
-
const o = this.getStyle(), i = a.style
|
|
10276
|
+
const o = this.getStyle(), i = a.style;
|
|
10270
10277
|
try {
|
|
10271
10278
|
super.setStyle(a.style, n);
|
|
10272
|
-
} catch (
|
|
10273
|
-
this.styleInProcess = !1, console.error("[Map.setStyle]: Error while setting style:",
|
|
10279
|
+
} catch (w) {
|
|
10280
|
+
this.styleInProcess = !1, console.error("[Map.setStyle]: Error while setting style:", w);
|
|
10274
10281
|
}
|
|
10275
10282
|
if (typeof a.style == "string" || a.requiresUrlMonitoring)
|
|
10276
10283
|
return this;
|
|
10277
|
-
const
|
|
10284
|
+
const s = () => {
|
|
10278
10285
|
this.setSpaceFromStyle({ style: a.style }), this.setHaloFromStyle({ style: a.style });
|
|
10286
|
+
}, l = () => {
|
|
10287
|
+
var x, A, L, z;
|
|
10288
|
+
const w = this.getLayersOrder()[0], v = a.style;
|
|
10289
|
+
this.space ? this.setSpaceFromStyle({ style: v }) : this.initSpace({ before: w, spec: (A = (x = v.metadata) == null ? void 0 : x.maptiler) == null ? void 0 : A.space }), this.halo ? this.setHaloFromStyle({ style: v }) : this.initHalo({ before: w, spec: (z = (L = v.metadata) == null ? void 0 : L.maptiler) == null ? void 0 : z.halo });
|
|
10279
10290
|
};
|
|
10280
|
-
|
|
10281
|
-
this.once("terrain", l);
|
|
10282
|
-
else
|
|
10283
|
-
return l(), this;
|
|
10284
|
-
return this.styleInProcess && this.once("style.load", () => {
|
|
10285
|
-
var m, w, v, x;
|
|
10286
|
-
const h = this.getLayersOrder()[0], y = a.style;
|
|
10287
|
-
this.space ? this.setSpaceFromStyle({ style: y }) : this.initSpace({ before: h, spec: (w = (m = y.metadata) == null ? void 0 : m.maptiler) == null ? void 0 : w.space }), this.halo ? this.setHaloFromStyle({ style: y }) : this.initHalo({ before: h, spec: (x = (v = y.metadata) == null ? void 0 : v.maptiler) == null ? void 0 : x.halo });
|
|
10288
|
-
}), this;
|
|
10291
|
+
return this.styleInProcess && !this.spaceboxLoadingState.styleLoadCallbackSet ? (this.once("style.load", l), this.spaceboxLoadingState.styleLoadCallbackSet = !0, this) : ((f = o == null ? void 0 : o.terrain) == null ? void 0 : f.source) !== ((d = i == null ? void 0 : i.terrain) == null ? void 0 : d.source) || ((h = o == null ? void 0 : o.terrain) == null ? void 0 : h.exaggeration) !== ((y = i == null ? void 0 : i.terrain) == null ? void 0 : y.exaggeration) ? (this.once("terrain", s), this) : (m = i == null ? void 0 : i.projection) != null && m.type ? (l(), this) : (this.styleInProcess = !0, this);
|
|
10289
10292
|
}
|
|
10290
10293
|
/**
|
|
10291
10294
|
* Adds a [MapLibre style layer](https://maplibre.org/maplibre-style-spec/layers)
|
|
@@ -10660,7 +10663,7 @@ let Mu = class ro extends k.Map {
|
|
|
10660
10663
|
* @returns
|
|
10661
10664
|
*/
|
|
10662
10665
|
getMaptilerSessionId() {
|
|
10663
|
-
return
|
|
10666
|
+
return jr;
|
|
10664
10667
|
}
|
|
10665
10668
|
/**
|
|
10666
10669
|
* Updates the requestManager's transform request with a new function.
|
|
@@ -10862,8 +10865,8 @@ function zu(r, e, t, n) {
|
|
|
10862
10865
|
x && (o.stroke = x), Number.isNaN(A) || (o["stroke-opacity"] = A), Number.isNaN(L) || (o["stroke-width"] = L);
|
|
10863
10866
|
}
|
|
10864
10867
|
if (m) {
|
|
10865
|
-
const v = la(O(E(m, "color"))), x = v[0], A = v[1], L = O(E(m, "fill")),
|
|
10866
|
-
x && (o.fill = x), Number.isNaN(A) || (o["fill-opacity"] = A), L && (o["fill-opacity"] = L === "1" ? o["fill-opacity"] || 1 : 0),
|
|
10868
|
+
const v = la(O(E(m, "color"))), x = v[0], A = v[1], L = O(E(m, "fill")), z = O(E(m, "outline"));
|
|
10869
|
+
x && (o.fill = x), Number.isNaN(A) || (o["fill-opacity"] = A), L && (o["fill-opacity"] = L === "1" ? o["fill-opacity"] || 1 : 0), z && (o["stroke-opacity"] = z === "1" ? o["stroke-opacity"] || 1 : 0);
|
|
10867
10870
|
}
|
|
10868
10871
|
if (p) {
|
|
10869
10872
|
const v = G(p, "Data"), x = G(p, "SimpleData");
|
|
@@ -10999,14 +11002,14 @@ function E(r, e) {
|
|
|
10999
11002
|
const t = G(r, e);
|
|
11000
11003
|
return t.length ? t[0] : null;
|
|
11001
11004
|
}
|
|
11002
|
-
function
|
|
11005
|
+
function ju(r) {
|
|
11003
11006
|
return r.normalize && r.normalize(), r;
|
|
11004
11007
|
}
|
|
11005
11008
|
function lo(r) {
|
|
11006
11009
|
return r.map(Number.parseFloat).map((e) => Number.isNaN(e) ? null : e);
|
|
11007
11010
|
}
|
|
11008
11011
|
function O(r) {
|
|
11009
|
-
return r &&
|
|
11012
|
+
return r && ju(r), r && r.textContent;
|
|
11010
11013
|
}
|
|
11011
11014
|
function Pr(r, e) {
|
|
11012
11015
|
const t = {};
|
|
@@ -11032,7 +11035,7 @@ function co(r) {
|
|
|
11032
11035
|
heartRate: n !== null ? Number.parseFloat(O(n) ?? "0") : null
|
|
11033
11036
|
};
|
|
11034
11037
|
}
|
|
11035
|
-
function
|
|
11038
|
+
function Nu(r) {
|
|
11036
11039
|
let e = r;
|
|
11037
11040
|
try {
|
|
11038
11041
|
typeof e == "string" && (e = un(e));
|
|
@@ -11116,7 +11119,7 @@ function zr(r, e) {
|
|
|
11116
11119
|
function Ae(r) {
|
|
11117
11120
|
return ["interpolate", ["linear"], ["zoom"], ...r.flatMap((e) => [e.zoom, e.value])];
|
|
11118
11121
|
}
|
|
11119
|
-
function
|
|
11122
|
+
function F(r) {
|
|
11120
11123
|
return ["interpolate", ["linear"], ["zoom"], ...r.flatMap((e) => [e.zoom, e.value])];
|
|
11121
11124
|
}
|
|
11122
11125
|
function po(r, e) {
|
|
@@ -12163,7 +12166,7 @@ async function qu(r, e, t = {}) {
|
|
|
12163
12166
|
const s = await (await fetch(n, t)).text();
|
|
12164
12167
|
n = oo(s);
|
|
12165
12168
|
} else {
|
|
12166
|
-
const i = Vo(n) ??
|
|
12169
|
+
const i = Vo(n) ?? Nu(n);
|
|
12167
12170
|
i && (n = i);
|
|
12168
12171
|
}
|
|
12169
12172
|
if (!n)
|
|
@@ -12203,10 +12206,10 @@ function Gu(r, e) {
|
|
|
12203
12206
|
minzoom: e.minzoom ?? 0,
|
|
12204
12207
|
maxzoom: e.maxzoom ?? 23,
|
|
12205
12208
|
paint: {
|
|
12206
|
-
"line-opacity": typeof d == "number" ? d :
|
|
12209
|
+
"line-opacity": typeof d == "number" ? d : F(d),
|
|
12207
12210
|
"line-color": typeof f == "string" ? f : Ae(f),
|
|
12208
12211
|
"line-width": po(o, p),
|
|
12209
|
-
"line-blur": typeof h == "number" ? h :
|
|
12212
|
+
"line-blur": typeof h == "number" ? h : F(h)
|
|
12210
12213
|
}
|
|
12211
12214
|
},
|
|
12212
12215
|
e.beforeId
|
|
@@ -12224,11 +12227,11 @@ function Gu(r, e) {
|
|
|
12224
12227
|
minzoom: e.minzoom ?? 0,
|
|
12225
12228
|
maxzoom: e.maxzoom ?? 23,
|
|
12226
12229
|
paint: {
|
|
12227
|
-
"line-opacity": typeof s == "number" ? s :
|
|
12230
|
+
"line-opacity": typeof s == "number" ? s : F(s),
|
|
12228
12231
|
"line-color": typeof i == "string" ? i : Ae(i),
|
|
12229
|
-
"line-width": typeof o == "number" ? o :
|
|
12230
|
-
"line-blur": typeof l == "number" ? l :
|
|
12231
|
-
"line-gap-width": typeof u == "number" ? u :
|
|
12232
|
+
"line-width": typeof o == "number" ? o : F(o),
|
|
12233
|
+
"line-blur": typeof l == "number" ? l : F(l),
|
|
12234
|
+
"line-gap-width": typeof u == "number" ? u : F(u),
|
|
12232
12235
|
// For some reasons passing "line-dasharray" with the value "undefined"
|
|
12233
12236
|
// results in no showing the line while it should have the same behavior
|
|
12234
12237
|
// of not adding the property "line-dasharray" as all.
|
|
@@ -12268,7 +12271,7 @@ function Vu(r, e) {
|
|
|
12268
12271
|
maxzoom: e.maxzoom ?? 23,
|
|
12269
12272
|
paint: {
|
|
12270
12273
|
"fill-color": typeof c == "string" ? c : Ae(c),
|
|
12271
|
-
"fill-opacity": typeof p == "number" ? p :
|
|
12274
|
+
"fill-opacity": typeof p == "number" ? p : F(p),
|
|
12272
12275
|
// Adding a pattern if provided
|
|
12273
12276
|
...y && { "fill-pattern": y }
|
|
12274
12277
|
}
|
|
@@ -12276,12 +12279,12 @@ function Vu(r, e) {
|
|
|
12276
12279
|
e.beforeId
|
|
12277
12280
|
), e.outline === !0) {
|
|
12278
12281
|
let m;
|
|
12279
|
-
f === "inside" ? typeof i == "number" ? m = 0.5 * i : m =
|
|
12282
|
+
f === "inside" ? typeof i == "number" ? m = 0.5 * i : m = F(
|
|
12280
12283
|
i.map(({ zoom: w, value: v }) => ({
|
|
12281
12284
|
zoom: w,
|
|
12282
12285
|
value: 0.5 * v
|
|
12283
12286
|
}))
|
|
12284
|
-
) : f === "outside" ? typeof i == "number" ? m = -0.5 * i : m =
|
|
12287
|
+
) : f === "outside" ? typeof i == "number" ? m = -0.5 * i : m = F(
|
|
12285
12288
|
i.map((w) => ({
|
|
12286
12289
|
zoom: w.zoom,
|
|
12287
12290
|
value: -0.5 * w.value
|
|
@@ -12298,10 +12301,10 @@ function Vu(r, e) {
|
|
|
12298
12301
|
minzoom: e.minzoom ?? 0,
|
|
12299
12302
|
maxzoom: e.maxzoom ?? 23,
|
|
12300
12303
|
paint: {
|
|
12301
|
-
"line-opacity": typeof l == "number" ? l :
|
|
12304
|
+
"line-opacity": typeof l == "number" ? l : F(l),
|
|
12302
12305
|
"line-color": typeof s == "string" ? s : Ae(s),
|
|
12303
|
-
"line-width": typeof i == "number" ? i :
|
|
12304
|
-
"line-blur": typeof u == "number" ? u :
|
|
12306
|
+
"line-width": typeof i == "number" ? i : F(i),
|
|
12307
|
+
"line-blur": typeof u == "number" ? u : F(u),
|
|
12305
12308
|
"line-offset": m,
|
|
12306
12309
|
// For some reasons passing "line-dasharray" with the value "undefined"
|
|
12307
12310
|
// results in no showing the line while it should have the same behavior
|
|
@@ -12329,7 +12332,7 @@ function Hu(r, e) {
|
|
|
12329
12332
|
const t = e.minPointRadius ?? 10, n = e.maxPointRadius ?? 50, a = e.cluster ?? !1, o = 20, i = Array.isArray(e.pointColor) ? e.pointColor : mo.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";
|
|
12330
12333
|
let m;
|
|
12331
12334
|
const w = e.zoomCompensation ?? !0, v = e.minzoom ?? 0, x = e.maxzoom ?? 23;
|
|
12332
|
-
typeof e.pointOpacity == "number" ? m = e.pointOpacity : Array.isArray(e.pointOpacity) ? m =
|
|
12335
|
+
typeof e.pointOpacity == "number" ? m = e.pointOpacity : Array.isArray(e.pointOpacity) ? m = F(e.pointOpacity) : e.cluster ? m = Or(i, "point_count") : e.property ? m = Or(i, e.property) : m = F([
|
|
12333
12336
|
{ zoom: v, value: 0 },
|
|
12334
12337
|
{ zoom: v + 0.25, value: 1 },
|
|
12335
12338
|
{ zoom: x - 0.25, value: 1 },
|
|
@@ -12351,7 +12354,7 @@ function Hu(r, e) {
|
|
|
12351
12354
|
}
|
|
12352
12355
|
if (a) {
|
|
12353
12356
|
A.clusterLayerId = `${u}_cluster`;
|
|
12354
|
-
const L = Array.from({ length: o }, (
|
|
12357
|
+
const L = Array.from({ length: o }, (z, Te) => {
|
|
12355
12358
|
const We = s.min + Te * (s.max - s.min) / (o - 1);
|
|
12356
12359
|
return {
|
|
12357
12360
|
value: We,
|
|
@@ -12368,14 +12371,14 @@ function Hu(r, e) {
|
|
|
12368
12371
|
paint: {
|
|
12369
12372
|
// 'circle-color': options.pointColor ?? colorDrivenByProperty(clusterStyle, "point_count"),
|
|
12370
12373
|
"circle-color": typeof e.pointColor == "string" ? e.pointColor : Fr(L, "point_count"),
|
|
12371
|
-
"circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ?
|
|
12374
|
+
"circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ? F(e.pointRadius) : $r(L, "point_count", !1),
|
|
12372
12375
|
"circle-pitch-alignment": p ? "viewport" : "map",
|
|
12373
12376
|
"circle-pitch-scale": "map",
|
|
12374
12377
|
// scale with camera distance regardless of viewport/biewport alignement
|
|
12375
12378
|
"circle-opacity": m,
|
|
12376
12379
|
...f && {
|
|
12377
|
-
"circle-stroke-opacity": typeof d == "number" ? d :
|
|
12378
|
-
"circle-stroke-width": typeof h == "number" ? h :
|
|
12380
|
+
"circle-stroke-opacity": typeof d == "number" ? d : F(d),
|
|
12381
|
+
"circle-stroke-width": typeof h == "number" ? h : F(h),
|
|
12379
12382
|
"circle-stroke-color": typeof y == "string" ? y : Ae(y)
|
|
12380
12383
|
}
|
|
12381
12384
|
},
|
|
@@ -12395,11 +12398,11 @@ function Hu(r, e) {
|
|
|
12395
12398
|
// scale with camera distance regardless of viewport/biewport alignement
|
|
12396
12399
|
// 'circle-color': options.pointColor ?? clusterStyle[0].color,
|
|
12397
12400
|
"circle-color": typeof e.pointColor == "string" ? e.pointColor : i.getColorHex(i.getBounds().min),
|
|
12398
|
-
"circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ?
|
|
12401
|
+
"circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ? F(e.pointRadius) : L[0].pointRadius * 0.75,
|
|
12399
12402
|
"circle-opacity": m,
|
|
12400
12403
|
...f && {
|
|
12401
|
-
"circle-stroke-opacity": typeof d == "number" ? d :
|
|
12402
|
-
"circle-stroke-width": typeof h == "number" ? h :
|
|
12404
|
+
"circle-stroke-opacity": typeof d == "number" ? d : F(d),
|
|
12405
|
+
"circle-stroke-width": typeof h == "number" ? h : F(h),
|
|
12403
12406
|
"circle-stroke-color": typeof y == "string" ? y : Ae(y)
|
|
12404
12407
|
}
|
|
12405
12408
|
},
|
|
@@ -12409,13 +12412,13 @@ function Hu(r, e) {
|
|
|
12409
12412
|
e.beforeId
|
|
12410
12413
|
);
|
|
12411
12414
|
} else {
|
|
12412
|
-
let L = typeof e.pointColor == "string" ? e.pointColor : Array.isArray(e.pointColor) ? e.pointColor.getColorHex(e.pointColor.getBounds().min) : er(),
|
|
12415
|
+
let L = typeof e.pointColor == "string" ? e.pointColor : Array.isArray(e.pointColor) ? e.pointColor.getColorHex(e.pointColor.getBounds().min) : er(), z = typeof e.pointRadius == "number" ? w ? F([
|
|
12413
12416
|
{ zoom: 0, value: e.pointRadius * 0.025 },
|
|
12414
12417
|
{ zoom: 2, value: e.pointRadius * 0.05 },
|
|
12415
12418
|
{ zoom: 4, value: e.pointRadius * 0.1 },
|
|
12416
12419
|
{ zoom: 8, value: e.pointRadius * 0.25 },
|
|
12417
12420
|
{ zoom: 16, value: e.pointRadius * 1 }
|
|
12418
|
-
]) : e.pointRadius : Array.isArray(e.pointRadius) ?
|
|
12421
|
+
]) : e.pointRadius : Array.isArray(e.pointRadius) ? F(e.pointRadius) : w ? F([
|
|
12419
12422
|
{ zoom: 0, value: t * 0.05 },
|
|
12420
12423
|
{ zoom: 2, value: t * 0.1 },
|
|
12421
12424
|
{ zoom: 4, value: t * 0.2 },
|
|
@@ -12431,7 +12434,7 @@ function Hu(r, e) {
|
|
|
12431
12434
|
color: typeof e.pointColor == "string" ? e.pointColor : i.getColorHex(vt)
|
|
12432
12435
|
};
|
|
12433
12436
|
});
|
|
12434
|
-
L = Fr(Te, e.property),
|
|
12437
|
+
L = Fr(Te, e.property), z = $r(Te, e.property, w);
|
|
12435
12438
|
}
|
|
12436
12439
|
r.addLayer(
|
|
12437
12440
|
{
|
|
@@ -12448,10 +12451,10 @@ function Hu(r, e) {
|
|
|
12448
12451
|
// scale with camera distance regardless of viewport/biewport alignement
|
|
12449
12452
|
"circle-color": L,
|
|
12450
12453
|
"circle-opacity": m,
|
|
12451
|
-
"circle-radius":
|
|
12454
|
+
"circle-radius": z,
|
|
12452
12455
|
...f && {
|
|
12453
|
-
"circle-stroke-opacity": typeof d == "number" ? d :
|
|
12454
|
-
"circle-stroke-width": typeof h == "number" ? h :
|
|
12456
|
+
"circle-stroke-opacity": typeof d == "number" ? d : F(d),
|
|
12457
|
+
"circle-stroke-width": typeof h == "number" ? h : F(h),
|
|
12455
12458
|
"circle-stroke-color": typeof y == "string" ? y : Ae(y)
|
|
12456
12459
|
}
|
|
12457
12460
|
},
|
|
@@ -12463,7 +12466,7 @@ function Hu(r, e) {
|
|
|
12463
12466
|
}
|
|
12464
12467
|
if (c !== !1 && (e.cluster || e.property)) {
|
|
12465
12468
|
A.labelLayerId = `${u}_label`;
|
|
12466
|
-
const L = e.labelColor ?? "#fff",
|
|
12469
|
+
const L = e.labelColor ?? "#fff", z = e.labelSize ?? 12;
|
|
12467
12470
|
r.addLayer(
|
|
12468
12471
|
{
|
|
12469
12472
|
id: A.labelLayerId,
|
|
@@ -12473,7 +12476,7 @@ function Hu(r, e) {
|
|
|
12473
12476
|
layout: {
|
|
12474
12477
|
"text-field": e.cluster ? "{point_count_abbreviated}" : `{${e.property}}`,
|
|
12475
12478
|
"text-font": ["Noto Sans Regular"],
|
|
12476
|
-
"text-size":
|
|
12479
|
+
"text-size": z,
|
|
12477
12480
|
"text-pitch-alignment": p ? "viewport" : "map",
|
|
12478
12481
|
"symbol-sort-key": ["/", 1, ["get", e.cluster ? "point_count" : e.property]]
|
|
12479
12482
|
// so that the largest value goes on top
|
|
@@ -12517,7 +12520,7 @@ function Ku(r, e) {
|
|
|
12517
12520
|
{ zoom: 16, value: 50 }
|
|
12518
12521
|
], y = e.radius ?? (i ? h : 10);
|
|
12519
12522
|
let m = 1;
|
|
12520
|
-
typeof y == "number" ? m = y : Array.isArray(y) && "zoom" in y[0] ? m =
|
|
12523
|
+
typeof y == "number" ? m = y : Array.isArray(y) && "zoom" in y[0] ? m = F(y) : p && Array.isArray(y) && "propertyValue" in y[0] ? m = ho(y, p, i) : !p && Array.isArray(y) && "propertyValue" in y[0] ? (m = F(h), console.warn("The option `.radius` can only be property-driven if the option `.property` is provided.")) : m = F(h);
|
|
12521
12524
|
const w = {
|
|
12522
12525
|
heatmapLayerId: n,
|
|
12523
12526
|
heatmapSourceId: t
|
|
@@ -12538,10 +12541,10 @@ function Ku(r, e) {
|
|
|
12538
12541
|
maxzoom: o,
|
|
12539
12542
|
paint: {
|
|
12540
12543
|
"heatmap-weight": d,
|
|
12541
|
-
"heatmap-intensity": typeof c == "number" ? c :
|
|
12544
|
+
"heatmap-intensity": typeof c == "number" ? c : F(c),
|
|
12542
12545
|
"heatmap-color": yo(l),
|
|
12543
12546
|
"heatmap-radius": m,
|
|
12544
|
-
"heatmap-opacity": typeof s == "number" ? s :
|
|
12547
|
+
"heatmap-opacity": typeof s == "number" ? s : F(s)
|
|
12545
12548
|
}
|
|
12546
12549
|
},
|
|
12547
12550
|
e.beforeId
|
|
@@ -12566,15 +12569,15 @@ const xc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
12566
12569
|
paintColorOptionsToPaintSpec: Ae,
|
|
12567
12570
|
radiusDrivenByProperty: $r,
|
|
12568
12571
|
radiusDrivenByPropertyHeatmap: ho,
|
|
12569
|
-
rampedOptionsToLayerPaintSpec:
|
|
12572
|
+
rampedOptionsToLayerPaintSpec: F,
|
|
12570
12573
|
rampedPropertyValueWeight: fo,
|
|
12571
12574
|
takeScreenshot: Du
|
|
12572
12575
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
12573
12576
|
qo();
|
|
12574
12577
|
function kc() {
|
|
12575
|
-
return "3.6.
|
|
12578
|
+
return "3.6.1";
|
|
12576
12579
|
}
|
|
12577
|
-
const Cc = k.Map, Lc = k.Marker, Ac = k.Popup, Ec = k.Style, Tc = k.CanvasSource, _c = k.GeoJSONSource, Ic = k.ImageSource, Mc = k.RasterTileSource, Pc = k.RasterDEMTileSource, Rc = k.VectorTileSource, zc = k.VideoSource, Fc = k.NavigationControl, $c = k.GeolocateControl, Oc = k.AttributionControl,
|
|
12580
|
+
const Cc = k.Map, Lc = k.Marker, Ac = k.Popup, Ec = k.Style, Tc = k.CanvasSource, _c = k.GeoJSONSource, Ic = k.ImageSource, Mc = k.RasterTileSource, Pc = k.RasterDEMTileSource, Rc = k.VectorTileSource, zc = k.VideoSource, Fc = k.NavigationControl, $c = k.GeolocateControl, Oc = k.AttributionControl, jc = k.LogoControl, Nc = k.ScaleControl, Dc = k.FullscreenControl, Uc = k.TerrainControl, Bc = k.BoxZoomHandler, qc = k.ScrollZoomHandler, Gc = k.CooperativeGesturesHandler, Vc = k.KeyboardHandler, Hc = k.TwoFingersTouchPitchHandler, Kc = k.MapWheelEvent, Xc = k.MapTouchEvent, Zc = k.MapMouseEvent, Wc = k.config, Yc = k.getVersion, {
|
|
12578
12581
|
setRTLTextPlugin: Jc,
|
|
12579
12582
|
getRTLTextPluginStatus: Qc,
|
|
12580
12583
|
LngLat: ep,
|
|
@@ -12642,7 +12645,7 @@ export {
|
|
|
12642
12645
|
ep as LngLat,
|
|
12643
12646
|
tp as LngLatBounds,
|
|
12644
12647
|
ni as LogoControl,
|
|
12645
|
-
|
|
12648
|
+
jc as LogoControlMLGL,
|
|
12646
12649
|
Mu as Map,
|
|
12647
12650
|
Cc as MapMLGL,
|
|
12648
12651
|
Sc as MapMouseEvent,
|
|
@@ -12673,7 +12676,7 @@ export {
|
|
|
12673
12676
|
Mc as RasterTileSourceMLGL,
|
|
12674
12677
|
Ip as ReferenceMapStyle,
|
|
12675
12678
|
ai as ScaleControl,
|
|
12676
|
-
|
|
12679
|
+
Nc as ScaleControlMLGL,
|
|
12677
12680
|
yc as ScrollZoomHandler,
|
|
12678
12681
|
qc as ScrollZoomHandlerMLGL,
|
|
12679
12682
|
$o as SdkConfig,
|
|
@@ -12704,8 +12707,8 @@ export {
|
|
|
12704
12707
|
$p as data,
|
|
12705
12708
|
ec as displayWebGLContextLostWarning,
|
|
12706
12709
|
Op as elevation,
|
|
12707
|
-
|
|
12708
|
-
|
|
12710
|
+
jp as expandMapStyle,
|
|
12711
|
+
Np as geocoding,
|
|
12709
12712
|
Dp as geolocation,
|
|
12710
12713
|
Up as getAutoLanguage,
|
|
12711
12714
|
mn as getBrowserLanguage,
|
|
@@ -12722,7 +12725,7 @@ export {
|
|
|
12722
12725
|
mp as getWorkerCount,
|
|
12723
12726
|
wp as getWorkerUrl,
|
|
12724
12727
|
ao as gpx,
|
|
12725
|
-
|
|
12728
|
+
Nu as gpxOrKml,
|
|
12726
12729
|
no as hasChildNodeWithName,
|
|
12727
12730
|
xc as helpers,
|
|
12728
12731
|
kp as importScriptInWorkers,
|