@maptiler/sdk 3.0.0-rc.4 → 3.0.0-rc.5
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 +221 -203
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/dist/src/Map.d.ts +4 -4
- package/dist/src/MaptilerGeolocateControl.d.ts +1 -0
- package/package.json +2 -2
- package/readme.md +35 -2
- package/vite.config-umd.ts +4 -10
package/dist/maptiler-sdk.mjs
CHANGED
|
@@ -3,15 +3,15 @@ var Ir = (r) => {
|
|
|
3
3
|
throw TypeError(r);
|
|
4
4
|
};
|
|
5
5
|
var Ea = (r, e, t) => e in r ? Ia(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
6
|
-
var L = (r, e, t) => Ea(r, typeof e != "symbol" ? e + "" : e, t),
|
|
7
|
-
var I = (r, e, t) => (
|
|
6
|
+
var L = (r, e, t) => Ea(r, typeof e != "symbol" ? e + "" : e, t), Pt = (r, e, t) => e.has(r) || Ir("Cannot " + t);
|
|
7
|
+
var I = (r, e, t) => (Pt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), ye = (r, e, t) => e.has(r) ? Ir("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), Se = (r, e, t, n) => (Pt(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), G = (r, e, t) => (Pt(r, e, "access private method"), t);
|
|
8
8
|
import S from "maplibre-gl";
|
|
9
|
-
import { Language as za, getLanguageInfoFromCode as Er, config as
|
|
9
|
+
import { Language as za, getLanguageInfoFromCode as Er, config as Rt, MapStyle as qe, mapStylePresetList as $t, expandMapStyle as _a, MapStyleVariant as Pa, ReferenceMapStyle as Ra, toLanguageInfo as zr, getLanguageInfoFromFlag as $a, geolocation as _r } from "@maptiler/client";
|
|
10
10
|
import { MapStyle as Gu, MapStyleVariant as Hu, ReferenceMapStyle as Ku, ServiceError as Wu, areSameLanguages as Zu, bufferToPixelDataBrowser as Ju, circumferenceAtLatitude as Yu, coordinates as Xu, data as Qu, elevation as ec, expandMapStyle as tc, geocoding as rc, geolocation as nc, getAutoLanguage as ac, getBufferToPixelDataParser as oc, getLanguageInfoFromCode as ic, getLanguageInfoFromFlag as sc, getLanguageInfoFromKey as lc, getTileCache as uc, isLanguageInfo as cc, mapStylePresetList as pc, math as fc, misc as dc, staticMaps as yc, styleToStyle as mc, toLanguageInfo as hc } from "@maptiler/client";
|
|
11
11
|
import ja from "events";
|
|
12
12
|
import { v4 as Na } from "uuid";
|
|
13
13
|
import { Base64 as Fa } from "js-base64";
|
|
14
|
-
const Oa = "@maptiler/sdk", Da = "3.0.0-rc.
|
|
14
|
+
const Oa = "@maptiler/sdk", Da = "3.0.0-rc.5", qa = "The Javascript & TypeScript map SDK tailored for MapTiler Cloud", Ua = "dist/maptiler-sdk.mjs", Ba = "dist/maptiler-sdk.d.ts", Va = "dist/maptiler-sdk.css", Ga = "module", Ha = {
|
|
15
15
|
".": {
|
|
16
16
|
import: "./dist/maptiler-sdk.mjs",
|
|
17
17
|
types: "./dist/maptiler-sdk.d.ts"
|
|
@@ -62,7 +62,7 @@ const Oa = "@maptiler/sdk", Da = "3.0.0-rc.4", qa = "The Javascript & TypeScript
|
|
|
62
62
|
"@maptiler/client": "^2.2.0",
|
|
63
63
|
events: "^3.3.0",
|
|
64
64
|
"js-base64": "^3.7.4",
|
|
65
|
-
"maplibre-gl": "^5.0.0-pre.
|
|
65
|
+
"maplibre-gl": "^5.0.0-pre.10",
|
|
66
66
|
uuid: "^9.0.0"
|
|
67
67
|
}, Sn = {
|
|
68
68
|
name: Oa,
|
|
@@ -123,7 +123,7 @@ const Oa = "@maptiler/sdk", Da = "3.0.0-rc.4", qa = "The Javascript & TypeScript
|
|
|
123
123
|
},
|
|
124
124
|
...za
|
|
125
125
|
};
|
|
126
|
-
function
|
|
126
|
+
function Pr() {
|
|
127
127
|
if (typeof navigator > "u") {
|
|
128
128
|
const e = Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0], t = Er(e);
|
|
129
129
|
return t || E.ENGLISH;
|
|
@@ -212,7 +212,7 @@ class to extends ja {
|
|
|
212
212
|
* Set the MapTiler Cloud API key
|
|
213
213
|
*/
|
|
214
214
|
set apiKey(t) {
|
|
215
|
-
this._apiKey = t,
|
|
215
|
+
this._apiKey = t, Rt.apiKey = t, this.emit("apiKey", t);
|
|
216
216
|
}
|
|
217
217
|
/**
|
|
218
218
|
* Get the MapTiler Cloud API key
|
|
@@ -224,16 +224,16 @@ class to extends ja {
|
|
|
224
224
|
* Set a the custom fetch function to replace the default one
|
|
225
225
|
*/
|
|
226
226
|
set fetch(t) {
|
|
227
|
-
|
|
227
|
+
Rt.fetch = t;
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
230
230
|
* Get the fetch fucntion
|
|
231
231
|
*/
|
|
232
232
|
get fetch() {
|
|
233
|
-
return
|
|
233
|
+
return Rt.fetch;
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
const F = new to(), { addProtocol:
|
|
236
|
+
const F = new to(), { addProtocol: Rr } = S, Ht = "localcache_source", Kt = "localcache", ro = "maptiler_sdk", no = 1e3, ao = 100, Wt = typeof caches < "u";
|
|
237
237
|
function oo(r, e) {
|
|
238
238
|
if (Wt && F.caching && F.session && r.host === V.maptilerApiHost) {
|
|
239
239
|
if (e === "Source" && r.href.includes("tiles.json"))
|
|
@@ -247,14 +247,14 @@ let jt;
|
|
|
247
247
|
async function xn() {
|
|
248
248
|
return jt || (jt = await caches.open(ro)), jt;
|
|
249
249
|
}
|
|
250
|
-
let
|
|
250
|
+
let $r = 0;
|
|
251
251
|
async function io() {
|
|
252
252
|
const r = await xn(), e = await r.keys(), t = e.slice(0, Math.max(e.length - no, 0));
|
|
253
253
|
for (const n of t)
|
|
254
254
|
r.delete(n);
|
|
255
255
|
}
|
|
256
256
|
function so() {
|
|
257
|
-
|
|
257
|
+
Rr(
|
|
258
258
|
Ht,
|
|
259
259
|
async (r, e) => {
|
|
260
260
|
if (!r.url) throw new Error("");
|
|
@@ -268,7 +268,7 @@ function so() {
|
|
|
268
268
|
expires: n.headers.get("Expires")
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
|
-
),
|
|
271
|
+
), Rr(
|
|
272
272
|
Kt,
|
|
273
273
|
async (r, e) => {
|
|
274
274
|
if (!r.url) throw new Error("");
|
|
@@ -288,7 +288,7 @@ function so() {
|
|
|
288
288
|
c.signal = e.signal;
|
|
289
289
|
const p = await fetch(i, c);
|
|
290
290
|
return p.status >= 200 && p.status < 300 && (l.put(a, p.clone()).catch(() => {
|
|
291
|
-
}),
|
|
291
|
+
}), ++$r > ao && (io(), $r = 0)), s(p);
|
|
292
292
|
}
|
|
293
293
|
);
|
|
294
294
|
}
|
|
@@ -540,22 +540,22 @@ class zl extends S.BoxZoomHandler {
|
|
|
540
540
|
super(e, t);
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
|
-
class
|
|
543
|
+
class _l extends S.ScrollZoomHandler {
|
|
544
544
|
constructor(e, t) {
|
|
545
545
|
super(e, t);
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
class
|
|
548
|
+
class Pl extends S.CooperativeGesturesHandler {
|
|
549
549
|
constructor(e, t) {
|
|
550
550
|
super(e, t);
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
|
-
class
|
|
553
|
+
class Rl extends S.KeyboardHandler {
|
|
554
554
|
constructor(e) {
|
|
555
555
|
super(e);
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
|
-
class
|
|
558
|
+
class $l extends S.TwoFingersTouchPitchHandler {
|
|
559
559
|
constructor(e) {
|
|
560
560
|
super(e);
|
|
561
561
|
}
|
|
@@ -724,7 +724,7 @@ var To = 8, Mo = {
|
|
|
724
724
|
"*": {
|
|
725
725
|
type: "*"
|
|
726
726
|
}
|
|
727
|
-
},
|
|
727
|
+
}, _o = {
|
|
728
728
|
type: {
|
|
729
729
|
required: !0,
|
|
730
730
|
type: "enum",
|
|
@@ -781,7 +781,7 @@ var To = 8, Mo = {
|
|
|
781
781
|
"*": {
|
|
782
782
|
type: "*"
|
|
783
783
|
}
|
|
784
|
-
},
|
|
784
|
+
}, Po = {
|
|
785
785
|
type: {
|
|
786
786
|
required: !0,
|
|
787
787
|
type: "enum",
|
|
@@ -855,7 +855,7 @@ var To = 8, Mo = {
|
|
|
855
855
|
"*": {
|
|
856
856
|
type: "*"
|
|
857
857
|
}
|
|
858
|
-
},
|
|
858
|
+
}, Ro = {
|
|
859
859
|
type: {
|
|
860
860
|
required: !0,
|
|
861
861
|
type: "enum",
|
|
@@ -916,7 +916,7 @@ var To = 8, Mo = {
|
|
|
916
916
|
promoteId: {
|
|
917
917
|
type: "promoteId"
|
|
918
918
|
}
|
|
919
|
-
},
|
|
919
|
+
}, $o = {
|
|
920
920
|
type: {
|
|
921
921
|
required: !0,
|
|
922
922
|
type: "enum",
|
|
@@ -3336,10 +3336,10 @@ var To = 8, Mo = {
|
|
|
3336
3336
|
sources: Io,
|
|
3337
3337
|
source: Eo,
|
|
3338
3338
|
source_vector: zo,
|
|
3339
|
-
source_raster:
|
|
3340
|
-
source_raster_dem:
|
|
3341
|
-
source_geojson:
|
|
3342
|
-
source_video:
|
|
3339
|
+
source_raster: _o,
|
|
3340
|
+
source_raster_dem: Po,
|
|
3341
|
+
source_geojson: Ro,
|
|
3342
|
+
source_video: $o,
|
|
3343
3343
|
source_image: jo,
|
|
3344
3344
|
layer: No,
|
|
3345
3345
|
layout: Fo,
|
|
@@ -3610,7 +3610,7 @@ class or {
|
|
|
3610
3610
|
return this.bindings[e] ? !0 : this.parent ? this.parent.has(e) : !1;
|
|
3611
3611
|
}
|
|
3612
3612
|
}
|
|
3613
|
-
const gt = { kind: "null" }, g = { kind: "number" }, M = { kind: "string" }, C = { kind: "boolean" }, ie = { kind: "color" }, vt = { kind: "projectionDefinition" },
|
|
3613
|
+
const gt = { kind: "null" }, g = { kind: "number" }, M = { kind: "string" }, C = { kind: "boolean" }, ie = { kind: "color" }, vt = { kind: "projectionDefinition" }, Re = { kind: "object" }, A = { kind: "value" }, yi = { kind: "error" }, bt = { kind: "collator" }, wt = { kind: "formatted" }, St = { kind: "padding" }, Xe = { kind: "resolvedImage" }, xt = { kind: "variableAnchorOffsetCollection" };
|
|
3614
3614
|
function W(r, e) {
|
|
3615
3615
|
return {
|
|
3616
3616
|
kind: "array",
|
|
@@ -3633,7 +3633,7 @@ const mi = [
|
|
|
3633
3633
|
ie,
|
|
3634
3634
|
vt,
|
|
3635
3635
|
wt,
|
|
3636
|
-
|
|
3636
|
+
Re,
|
|
3637
3637
|
W(A),
|
|
3638
3638
|
St,
|
|
3639
3639
|
Xe,
|
|
@@ -3665,7 +3665,7 @@ function Le(r, e) {
|
|
|
3665
3665
|
function ze(r, e) {
|
|
3666
3666
|
return r.kind === "array" && e.kind === "array" ? r.itemType.kind === e.itemType.kind && typeof r.N == "number" : r.kind === e.kind;
|
|
3667
3667
|
}
|
|
3668
|
-
const Ln = 0.96422, Cn = 1, An = 0.82521, Tn = 4 / 29,
|
|
3668
|
+
const Ln = 0.96422, Cn = 1, An = 0.82521, Tn = 4 / 29, $e = 6 / 29, Mn = 3 * $e * $e, hi = $e * $e * $e, gi = Math.PI / 180, vi = 180 / Math.PI;
|
|
3669
3669
|
function In(r) {
|
|
3670
3670
|
return r = r % 360, r < 0 && (r += 360), r;
|
|
3671
3671
|
}
|
|
@@ -3697,7 +3697,7 @@ function Ot(r) {
|
|
|
3697
3697
|
return r = r <= 304e-5 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - 0.055, r < 0 ? 0 : r > 1 ? 1 : r;
|
|
3698
3698
|
}
|
|
3699
3699
|
function Dt(r) {
|
|
3700
|
-
return r >
|
|
3700
|
+
return r > $e ? r * r * r : Mn * (r - Tn);
|
|
3701
3701
|
}
|
|
3702
3702
|
function bi(r) {
|
|
3703
3703
|
const [e, t, n, a] = En(r), o = Math.sqrt(t * t + n * n);
|
|
@@ -3764,14 +3764,14 @@ function xi(r) {
|
|
|
3764
3764
|
if (b === " " || b === " /" || b === ",," || b === ",,,") {
|
|
3765
3765
|
const T = [l, p, d].join(""), j = T === "%%%" ? 100 : T === "" ? 255 : 0;
|
|
3766
3766
|
if (j) {
|
|
3767
|
-
const
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3767
|
+
const R = [
|
|
3768
|
+
_e(+s / j, 0, 1),
|
|
3769
|
+
_e(+c / j, 0, 1),
|
|
3770
|
+
_e(+f / j, 0, 1),
|
|
3771
3771
|
v ? Dr(+v, w) : 1
|
|
3772
3772
|
];
|
|
3773
|
-
if (qr(
|
|
3774
|
-
return
|
|
3773
|
+
if (qr(R))
|
|
3774
|
+
return R;
|
|
3775
3775
|
}
|
|
3776
3776
|
}
|
|
3777
3777
|
return;
|
|
@@ -3802,8 +3802,8 @@ function xi(r) {
|
|
|
3802
3802
|
if (f === " " || f === " /" || f === ",," || f === ",,,") {
|
|
3803
3803
|
const d = [
|
|
3804
3804
|
+o,
|
|
3805
|
-
|
|
3806
|
-
|
|
3805
|
+
_e(+s, 0, 100),
|
|
3806
|
+
_e(+u, 0, 100),
|
|
3807
3807
|
p ? Dr(+p, m) : 1
|
|
3808
3808
|
];
|
|
3809
3809
|
if (qr(d))
|
|
@@ -3815,9 +3815,9 @@ function rt(r) {
|
|
|
3815
3815
|
return parseInt(r.padEnd(2, r), 16) / 255;
|
|
3816
3816
|
}
|
|
3817
3817
|
function Dr(r, e) {
|
|
3818
|
-
return
|
|
3818
|
+
return _e(e ? r / 100 : r, 0, 1);
|
|
3819
3819
|
}
|
|
3820
|
-
function
|
|
3820
|
+
function _e(r, e, t) {
|
|
3821
3821
|
return Math.min(Math.max(e, r), t);
|
|
3822
3822
|
}
|
|
3823
3823
|
function qr(r) {
|
|
@@ -3979,7 +3979,7 @@ function ve(r, e, t) {
|
|
|
3979
3979
|
function Ge(r, e, t) {
|
|
3980
3980
|
return r.map((n, a) => ve(n, e[a], t));
|
|
3981
3981
|
}
|
|
3982
|
-
class
|
|
3982
|
+
class $ {
|
|
3983
3983
|
/**
|
|
3984
3984
|
* @param r Red component premultiplied by `alpha` 0..1
|
|
3985
3985
|
* @param g Green component premultiplied by `alpha` 0..1
|
|
@@ -4004,13 +4004,13 @@ class R {
|
|
|
4004
4004
|
* @returns A `Color` instance, or `undefined` if the input is not a valid color string.
|
|
4005
4005
|
*/
|
|
4006
4006
|
static parse(e) {
|
|
4007
|
-
if (e instanceof
|
|
4007
|
+
if (e instanceof $)
|
|
4008
4008
|
return e;
|
|
4009
4009
|
if (typeof e != "string")
|
|
4010
4010
|
return;
|
|
4011
4011
|
const t = xi(e);
|
|
4012
4012
|
if (t)
|
|
4013
|
-
return new
|
|
4013
|
+
return new $(...t, !1);
|
|
4014
4014
|
}
|
|
4015
4015
|
/**
|
|
4016
4016
|
* Used in color interpolation and by 'to-rgba' expression.
|
|
@@ -4079,7 +4079,7 @@ class R {
|
|
|
4079
4079
|
switch (a) {
|
|
4080
4080
|
case "rgb": {
|
|
4081
4081
|
const [o, i, s, l] = Ge(e.rgb, t.rgb, n);
|
|
4082
|
-
return new
|
|
4082
|
+
return new $(o, i, s, l, !1);
|
|
4083
4083
|
}
|
|
4084
4084
|
case "hcl": {
|
|
4085
4085
|
const [o, i, s, l] = e.hcl, [u, c, p, m] = t.hcl;
|
|
@@ -4094,19 +4094,19 @@ class R {
|
|
|
4094
4094
|
ve(s, p, n),
|
|
4095
4095
|
ve(l, m, n)
|
|
4096
4096
|
]);
|
|
4097
|
-
return new
|
|
4097
|
+
return new $(y, v, w, b, !1);
|
|
4098
4098
|
}
|
|
4099
4099
|
case "lab": {
|
|
4100
4100
|
const [o, i, s, l] = zn(Ge(e.lab, t.lab, n));
|
|
4101
|
-
return new
|
|
4101
|
+
return new $(o, i, s, l, !1);
|
|
4102
4102
|
}
|
|
4103
4103
|
}
|
|
4104
4104
|
}
|
|
4105
4105
|
}
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4106
|
+
$.black = new $(0, 0, 0, 1);
|
|
4107
|
+
$.white = new $(1, 1, 1, 1);
|
|
4108
|
+
$.transparent = new $(0, 0, 0, 0);
|
|
4109
|
+
$.red = new $(1, 0, 0, 1);
|
|
4110
4110
|
class sr {
|
|
4111
4111
|
constructor(e, t, n) {
|
|
4112
4112
|
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" });
|
|
@@ -4251,11 +4251,11 @@ class ee {
|
|
|
4251
4251
|
return new ee(e, e, 1);
|
|
4252
4252
|
}
|
|
4253
4253
|
}
|
|
4254
|
-
function
|
|
4254
|
+
function _n(r, e, t, n) {
|
|
4255
4255
|
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.`;
|
|
4256
4256
|
}
|
|
4257
4257
|
function He(r) {
|
|
4258
|
-
if (r === null || typeof r == "string" || typeof r == "boolean" || typeof r == "number" || r instanceof ee || r instanceof
|
|
4258
|
+
if (r === null || typeof r == "string" || typeof r == "boolean" || typeof r == "number" || r instanceof ee || r instanceof $ || r instanceof sr || r instanceof fe || r instanceof J || r instanceof ne || r instanceof be)
|
|
4259
4259
|
return !0;
|
|
4260
4260
|
if (Array.isArray(r)) {
|
|
4261
4261
|
for (const e of r)
|
|
@@ -4279,7 +4279,7 @@ function q(r) {
|
|
|
4279
4279
|
return C;
|
|
4280
4280
|
if (typeof r == "number")
|
|
4281
4281
|
return g;
|
|
4282
|
-
if (r instanceof
|
|
4282
|
+
if (r instanceof $)
|
|
4283
4283
|
return ie;
|
|
4284
4284
|
if (r instanceof ee)
|
|
4285
4285
|
return vt;
|
|
@@ -4309,11 +4309,11 @@ function q(r) {
|
|
|
4309
4309
|
}
|
|
4310
4310
|
return W(t || A, e);
|
|
4311
4311
|
} else
|
|
4312
|
-
return
|
|
4312
|
+
return Re;
|
|
4313
4313
|
}
|
|
4314
4314
|
function Ue(r) {
|
|
4315
4315
|
const e = typeof r;
|
|
4316
|
-
return r === null ? "" : e === "string" || e === "number" || e === "boolean" ? String(r) : r instanceof
|
|
4316
|
+
return r === null ? "" : e === "string" || e === "number" || e === "boolean" ? String(r) : r instanceof $ || r instanceof ee || r instanceof fe || r instanceof J || r instanceof ne || r instanceof be ? r.toString() : JSON.stringify(r);
|
|
4317
4317
|
}
|
|
4318
4318
|
class je {
|
|
4319
4319
|
constructor(e, t) {
|
|
@@ -4342,7 +4342,7 @@ const nt = {
|
|
|
4342
4342
|
string: M,
|
|
4343
4343
|
number: g,
|
|
4344
4344
|
boolean: C,
|
|
4345
|
-
object:
|
|
4345
|
+
object: Re
|
|
4346
4346
|
};
|
|
4347
4347
|
class te {
|
|
4348
4348
|
constructor(e, t) {
|
|
@@ -4434,14 +4434,14 @@ class ge {
|
|
|
4434
4434
|
case "color": {
|
|
4435
4435
|
let t, n;
|
|
4436
4436
|
for (const a of this.args) {
|
|
4437
|
-
if (t = a.evaluate(e), n = null, t instanceof
|
|
4437
|
+
if (t = a.evaluate(e), n = null, t instanceof $)
|
|
4438
4438
|
return t;
|
|
4439
4439
|
if (typeof t == "string") {
|
|
4440
4440
|
const o = e.parseColor(t);
|
|
4441
4441
|
if (o)
|
|
4442
4442
|
return o;
|
|
4443
|
-
} 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 =
|
|
4444
|
-
return new
|
|
4443
|
+
} 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 = _n(t[0], t[1], t[2], t[3]), !n))
|
|
4444
|
+
return new $(t[0] / 255, t[1] / 255, t[2] / 255, t[3]);
|
|
4445
4445
|
}
|
|
4446
4446
|
throw new D(n || `Could not parse color from value '${typeof t == "string" ? t : JSON.stringify(t)}'`);
|
|
4447
4447
|
}
|
|
@@ -4499,12 +4499,12 @@ function Ci(r, e) {
|
|
|
4499
4499
|
const n = [];
|
|
4500
4500
|
let a, o;
|
|
4501
4501
|
for (const i of r) {
|
|
4502
|
-
const s =
|
|
4502
|
+
const s = Pn(i);
|
|
4503
4503
|
s !== 0 && (i.area = Math.abs(s), o === void 0 && (o = s < 0), o === s < 0 ? (a && n.push(a), a = [i]) : a.push(i));
|
|
4504
4504
|
}
|
|
4505
4505
|
return a && n.push(a), n;
|
|
4506
4506
|
}
|
|
4507
|
-
function
|
|
4507
|
+
function Pn(r) {
|
|
4508
4508
|
let e = 0;
|
|
4509
4509
|
for (let t = 0, n = r.length, a = n - 1, o, i; t < n; a = t++)
|
|
4510
4510
|
o = r[t], i = r[a], e += (i.x - o.x) * (o.y + i.y);
|
|
@@ -4513,7 +4513,7 @@ function _n(r) {
|
|
|
4513
4513
|
function Ai(r) {
|
|
4514
4514
|
const e = r.length;
|
|
4515
4515
|
for (let t = 0, n; t < e; t++) {
|
|
4516
|
-
const a =
|
|
4516
|
+
const a = Pn(r[t]);
|
|
4517
4517
|
if (a !== 0) {
|
|
4518
4518
|
if (n === void 0)
|
|
4519
4519
|
n = a < 0;
|
|
@@ -4532,7 +4532,7 @@ const Br = ["Unknown", "Point", "LineString", "Polygon"], Ti = {
|
|
|
4532
4532
|
Polygon: "Polygon",
|
|
4533
4533
|
MultiPolygon: "Polygon"
|
|
4534
4534
|
};
|
|
4535
|
-
class
|
|
4535
|
+
class Rn {
|
|
4536
4536
|
constructor() {
|
|
4537
4537
|
this.globals = null, this.feature = null, this.featureState = null, this.formattedSection = null, this._parseColorCache = {}, this.availableImages = null, this.canonical = null;
|
|
4538
4538
|
}
|
|
@@ -4560,7 +4560,7 @@ class $n {
|
|
|
4560
4560
|
}
|
|
4561
4561
|
parseColor(e) {
|
|
4562
4562
|
let t = this._parseColorCache[e];
|
|
4563
|
-
return t || (t = this._parseColorCache[e] =
|
|
4563
|
+
return t || (t = this._parseColorCache[e] = $.parse(e)), t;
|
|
4564
4564
|
}
|
|
4565
4565
|
}
|
|
4566
4566
|
class kt {
|
|
@@ -4609,7 +4609,7 @@ class kt {
|
|
|
4609
4609
|
return null;
|
|
4610
4610
|
}
|
|
4611
4611
|
if (!(i instanceof je) && i.type.kind !== "resolvedImage" && this._isConstant(i)) {
|
|
4612
|
-
const s = new
|
|
4612
|
+
const s = new Rn();
|
|
4613
4613
|
try {
|
|
4614
4614
|
i = new je(i.type, i.evaluate(s));
|
|
4615
4615
|
} catch (l) {
|
|
@@ -4938,7 +4938,7 @@ class ct {
|
|
|
4938
4938
|
return !1;
|
|
4939
4939
|
}
|
|
4940
4940
|
}
|
|
4941
|
-
function
|
|
4941
|
+
function $n(r, e) {
|
|
4942
4942
|
const t = r.length - 1;
|
|
4943
4943
|
let n = 0, a = t, o = 0, i, s;
|
|
4944
4944
|
for (; n <= a; )
|
|
@@ -4992,7 +4992,7 @@ class At {
|
|
|
4992
4992
|
const o = t.length;
|
|
4993
4993
|
if (a >= t[o - 1])
|
|
4994
4994
|
return n[o - 1].evaluate(e);
|
|
4995
|
-
const i =
|
|
4995
|
+
const i = $n(t, a);
|
|
4996
4996
|
return n[i].evaluate(e);
|
|
4997
4997
|
}
|
|
4998
4998
|
eachChild(e) {
|
|
@@ -5119,14 +5119,14 @@ class se {
|
|
|
5119
5119
|
const o = t.length;
|
|
5120
5120
|
if (a >= t[o - 1])
|
|
5121
5121
|
return n[o - 1].evaluate(e);
|
|
5122
|
-
const i =
|
|
5122
|
+
const i = $n(t, a), s = t[i], l = t[i + 1], u = se.interpolationFactor(this.interpolation, a, s, l), c = n[i].evaluate(e), p = n[i + 1].evaluate(e);
|
|
5123
5123
|
switch (this.operator) {
|
|
5124
5124
|
case "interpolate":
|
|
5125
5125
|
switch (this.type.kind) {
|
|
5126
5126
|
case "number":
|
|
5127
5127
|
return ve(c, p, u);
|
|
5128
5128
|
case "color":
|
|
5129
|
-
return
|
|
5129
|
+
return $.interpolate(c, p, u);
|
|
5130
5130
|
case "padding":
|
|
5131
5131
|
return J.interpolate(c, p, u);
|
|
5132
5132
|
case "variableAnchorOffsetCollection":
|
|
@@ -5137,9 +5137,9 @@ class se {
|
|
|
5137
5137
|
return ee.interpolate(c, p, u);
|
|
5138
5138
|
}
|
|
5139
5139
|
case "interpolate-hcl":
|
|
5140
|
-
return
|
|
5140
|
+
return $.interpolate(c, p, u, "hcl");
|
|
5141
5141
|
case "interpolate-lab":
|
|
5142
|
-
return
|
|
5142
|
+
return $.interpolate(c, p, u, "lab");
|
|
5143
5143
|
}
|
|
5144
5144
|
}
|
|
5145
5145
|
eachChild(e) {
|
|
@@ -5155,7 +5155,7 @@ function Ut(r, e, t, n) {
|
|
|
5155
5155
|
const a = n - t, o = r - t;
|
|
5156
5156
|
return a === 0 ? 0 : e === 1 ? o / a : (Math.pow(e, o) - 1) / (Math.pow(e, a) - 1);
|
|
5157
5157
|
}
|
|
5158
|
-
|
|
5158
|
+
$.interpolate, J.interpolate, ne.interpolate;
|
|
5159
5159
|
class Ke {
|
|
5160
5160
|
constructor(e, t) {
|
|
5161
5161
|
this.type = e, this.args = t;
|
|
@@ -5194,16 +5194,16 @@ class Ke {
|
|
|
5194
5194
|
function Gr(r, e) {
|
|
5195
5195
|
return r === "==" || r === "!=" ? e.kind === "boolean" || e.kind === "string" || e.kind === "number" || e.kind === "null" || e.kind === "value" : e.kind === "string" || e.kind === "number" || e.kind === "value";
|
|
5196
5196
|
}
|
|
5197
|
-
function
|
|
5197
|
+
function _i(r, e, t) {
|
|
5198
5198
|
return e === t;
|
|
5199
5199
|
}
|
|
5200
|
-
function
|
|
5200
|
+
function Pi(r, e, t) {
|
|
5201
5201
|
return e !== t;
|
|
5202
5202
|
}
|
|
5203
|
-
function
|
|
5203
|
+
function Ri(r, e, t) {
|
|
5204
5204
|
return e < t;
|
|
5205
5205
|
}
|
|
5206
|
-
function
|
|
5206
|
+
function $i(r, e, t) {
|
|
5207
5207
|
return e > t;
|
|
5208
5208
|
}
|
|
5209
5209
|
function ji(r, e, t) {
|
|
@@ -5284,7 +5284,7 @@ function Fe(r, e, t) {
|
|
|
5284
5284
|
}
|
|
5285
5285
|
};
|
|
5286
5286
|
}
|
|
5287
|
-
const Bi = Fe("==",
|
|
5287
|
+
const Bi = Fe("==", _i, jn), Vi = Fe("!=", Pi, Fi), Gi = Fe("<", Ri, Oi), Hi = Fe(">", $i, Di), Ki = Fe("<=", ji, qi), Wi = Fe(">=", Ni, Ui);
|
|
5288
5288
|
class Tt {
|
|
5289
5289
|
constructor(e, t, n) {
|
|
5290
5290
|
this.type = bt, this.locale = n, this.caseSensitive = e, this.diacriticSensitive = t;
|
|
@@ -6223,10 +6223,10 @@ class re {
|
|
|
6223
6223
|
}
|
|
6224
6224
|
function tn(r, [e, t, n, a]) {
|
|
6225
6225
|
e = e.evaluate(r), t = t.evaluate(r), n = n.evaluate(r);
|
|
6226
|
-
const o = a ? a.evaluate(r) : 1, i =
|
|
6226
|
+
const o = a ? a.evaluate(r) : 1, i = _n(e, t, n, o);
|
|
6227
6227
|
if (i)
|
|
6228
6228
|
throw new D(i);
|
|
6229
|
-
return new
|
|
6229
|
+
return new $(e / 255, t / 255, n / 255, o, !1);
|
|
6230
6230
|
}
|
|
6231
6231
|
function rn(r, e) {
|
|
6232
6232
|
return r in e;
|
|
@@ -6286,7 +6286,7 @@ re.register(Sr, {
|
|
|
6286
6286
|
(r, [e]) => rn(e.evaluate(r), r.properties())
|
|
6287
6287
|
],
|
|
6288
6288
|
[
|
|
6289
|
-
[M,
|
|
6289
|
+
[M, Re],
|
|
6290
6290
|
(r, [e, t]) => rn(e.evaluate(r), t.evaluate(r))
|
|
6291
6291
|
]
|
|
6292
6292
|
]
|
|
@@ -6299,7 +6299,7 @@ re.register(Sr, {
|
|
|
6299
6299
|
(r, [e]) => Vt(e.evaluate(r), r.properties())
|
|
6300
6300
|
],
|
|
6301
6301
|
[
|
|
6302
|
-
[M,
|
|
6302
|
+
[M, Re],
|
|
6303
6303
|
(r, [e, t]) => Vt(e.evaluate(r), t.evaluate(r))
|
|
6304
6304
|
]
|
|
6305
6305
|
]
|
|
@@ -6310,7 +6310,7 @@ re.register(Sr, {
|
|
|
6310
6310
|
(r, [e]) => Vt(e.evaluate(r), r.featureState || {})
|
|
6311
6311
|
],
|
|
6312
6312
|
properties: [
|
|
6313
|
-
|
|
6313
|
+
Re,
|
|
6314
6314
|
[],
|
|
6315
6315
|
(r) => r.properties()
|
|
6316
6316
|
],
|
|
@@ -6731,7 +6731,7 @@ function Et(r, e) {
|
|
|
6731
6731
|
function tr(r) {
|
|
6732
6732
|
return { result: "success", value: r };
|
|
6733
6733
|
}
|
|
6734
|
-
function
|
|
6734
|
+
function Pe(r) {
|
|
6735
6735
|
return { result: "error", value: r };
|
|
6736
6736
|
}
|
|
6737
6737
|
function mt(r) {
|
|
@@ -6751,7 +6751,7 @@ function xr(r) {
|
|
|
6751
6751
|
}
|
|
6752
6752
|
class ws {
|
|
6753
6753
|
constructor(e, t) {
|
|
6754
|
-
this.expression = e, this._warningHistory = {}, this._evaluator = new
|
|
6754
|
+
this.expression = e, this._warningHistory = {}, this._evaluator = new Rn(), this._defaultValue = t ? ks(t) : null, this._enumValues = t && t.type === "enum" ? t.values : null;
|
|
6755
6755
|
}
|
|
6756
6756
|
evaluateWithoutErrorHandling(e, t, n, a, o, i) {
|
|
6757
6757
|
return this._evaluator.globals = e, this._evaluator.feature = t, this._evaluator.featureState = n, this._evaluator.canonical = a, this._evaluator.availableImages = o || null, this._evaluator.formattedSection = i, this.expression.evaluate(this._evaluator);
|
|
@@ -6775,7 +6775,7 @@ function Gn(r) {
|
|
|
6775
6775
|
}
|
|
6776
6776
|
function Hn(r, e) {
|
|
6777
6777
|
const t = new kt(Sr, yt, [], e ? xs(e) : void 0), n = t.parse(r, void 0, void 0, void 0, e && e.type === "string" ? { typeAnnotation: "coerce" } : void 0);
|
|
6778
|
-
return n ? tr(new ws(n, e)) :
|
|
6778
|
+
return n ? tr(new ws(n, e)) : Pe(t.errors);
|
|
6779
6779
|
}
|
|
6780
6780
|
class nn {
|
|
6781
6781
|
constructor(e, t) {
|
|
@@ -6808,17 +6808,17 @@ function Ss(r, e) {
|
|
|
6808
6808
|
return t;
|
|
6809
6809
|
const n = t.value.expression, a = It(n);
|
|
6810
6810
|
if (!a && !mt(e))
|
|
6811
|
-
return
|
|
6811
|
+
return Pe([new oe("", "data expressions not supported")]);
|
|
6812
6812
|
const o = Et(n, ["zoom"]);
|
|
6813
6813
|
if (!o && !Bn(e))
|
|
6814
|
-
return
|
|
6814
|
+
return Pe([new oe("", "zoom expressions not supported")]);
|
|
6815
6815
|
const i = it(n);
|
|
6816
6816
|
if (!i && !o)
|
|
6817
|
-
return
|
|
6817
|
+
return Pe([new oe("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);
|
|
6818
6818
|
if (i instanceof oe)
|
|
6819
|
-
return
|
|
6819
|
+
return Pe([i]);
|
|
6820
6820
|
if (i instanceof se && !Vn(e))
|
|
6821
|
-
return
|
|
6821
|
+
return Pe([new oe("", '"interpolate" expressions cannot be used with this property')]);
|
|
6822
6822
|
if (!i)
|
|
6823
6823
|
return tr(a ? new nn("constant", t.value) : new nn("source", t.value));
|
|
6824
6824
|
const s = i instanceof se ? i.interpolation : void 0;
|
|
@@ -6854,7 +6854,7 @@ function xs(r) {
|
|
|
6854
6854
|
return r.type === "array" ? W(e[r.value] || A, r.length) : e[r.type];
|
|
6855
6855
|
}
|
|
6856
6856
|
function ks(r) {
|
|
6857
|
-
return r.type === "color" && xr(r.default) ? new
|
|
6857
|
+
return r.type === "color" && xr(r.default) ? new $(0, 0, 0, 0) : r.type === "color" ? $.parse(r.default) || null : r.type === "padding" ? J.parse(r.default) || null : r.type === "variableAnchorOffsetCollection" ? ne.parse(r.default) || null : r.type === "projectionDefinition" ? ee.parse(r.default) || null : r.default === void 0 ? null : r.default;
|
|
6858
6858
|
}
|
|
6859
6859
|
function Kn(r) {
|
|
6860
6860
|
if (r === !0 || r === !1)
|
|
@@ -7097,7 +7097,7 @@ function Ls(r) {
|
|
|
7097
7097
|
}
|
|
7098
7098
|
function Cs(r) {
|
|
7099
7099
|
const e = r.key, t = r.value, n = z(t);
|
|
7100
|
-
return n !== "string" ? [new h(e, t, `color expected, ${n} found`)] :
|
|
7100
|
+
return n !== "string" ? [new h(e, t, `color expected, ${n} found`)] : $.parse(String(t)) ? [] : [new h(e, t, `color expected, "${t}" found`)];
|
|
7101
7101
|
}
|
|
7102
7102
|
function Je(r) {
|
|
7103
7103
|
const e = r.key, t = r.value, n = r.valueSpec, a = [];
|
|
@@ -7555,7 +7555,7 @@ function oa(r) {
|
|
|
7555
7555
|
value: t
|
|
7556
7556
|
});
|
|
7557
7557
|
}
|
|
7558
|
-
function
|
|
7558
|
+
function _s(r) {
|
|
7559
7559
|
const e = r.value, t = r.styleSpec, n = t.projection, a = r.style, o = z(e);
|
|
7560
7560
|
if (e === void 0)
|
|
7561
7561
|
return [];
|
|
@@ -7572,17 +7572,17 @@ function Ps(r) {
|
|
|
7572
7572
|
})) : i = i.concat([new h(s, e[s], `unknown property "${s}"`)]);
|
|
7573
7573
|
return i;
|
|
7574
7574
|
}
|
|
7575
|
-
function
|
|
7575
|
+
function Ps(r) {
|
|
7576
7576
|
const e = r.key;
|
|
7577
7577
|
let t = r.value;
|
|
7578
7578
|
t = t instanceof String ? t.valueOf() : t;
|
|
7579
7579
|
const n = z(t);
|
|
7580
|
-
return n === "array" &&
|
|
7580
|
+
return n === "array" && !$s(t) && !Rs(t) ? [new h(e, t, `projection expected, invalid array ${JSON.stringify(t)} found`)] : ["array", "string"].includes(n) ? [] : [new h(e, t, `projection expected, invalid type "${n}" found`)];
|
|
7581
7581
|
}
|
|
7582
|
-
function
|
|
7582
|
+
function Rs(r) {
|
|
7583
7583
|
return !!["interpolate", "step", "literal"].includes(r[0]);
|
|
7584
7584
|
}
|
|
7585
|
-
function
|
|
7585
|
+
function $s(r) {
|
|
7586
7586
|
return Array.isArray(r) && r.length === 3 && typeof r[0] == "string" && typeof r[1] == "string" && typeof r[2] == "number";
|
|
7587
7587
|
}
|
|
7588
7588
|
const sn = {
|
|
@@ -7603,8 +7603,8 @@ const sn = {
|
|
|
7603
7603
|
light: ra,
|
|
7604
7604
|
sky: na,
|
|
7605
7605
|
terrain: aa,
|
|
7606
|
-
projection:
|
|
7607
|
-
projectionDefinition:
|
|
7606
|
+
projection: _s,
|
|
7607
|
+
projectionDefinition: Ps,
|
|
7608
7608
|
string: Ee,
|
|
7609
7609
|
formatted: Ms,
|
|
7610
7610
|
resolvedImage: Is,
|
|
@@ -7674,7 +7674,7 @@ function ce(r) {
|
|
|
7674
7674
|
function ln(r) {
|
|
7675
7675
|
if (!r)
|
|
7676
7676
|
return {
|
|
7677
|
-
style: qe[
|
|
7677
|
+
style: qe[$t[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),
|
|
7678
7678
|
requiresUrlMonitoring: !1,
|
|
7679
7679
|
// default styles don't require URL monitoring
|
|
7680
7680
|
isFallback: !0
|
|
@@ -7686,13 +7686,13 @@ function ln(r) {
|
|
|
7686
7686
|
requiresUrlMonitoring: !1,
|
|
7687
7687
|
isFallback: !1
|
|
7688
7688
|
} : t.isValidJSON ? {
|
|
7689
|
-
style: qe[
|
|
7689
|
+
style: qe[$t[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),
|
|
7690
7690
|
requiresUrlMonitoring: !1,
|
|
7691
7691
|
// default styles don't require URL monitoring
|
|
7692
7692
|
isFallback: !0
|
|
7693
|
-
} : r.startsWith("http") ? { style: r, requiresUrlMonitoring: !0, isFallback: !1 } : r.toLowerCase().includes(".json") ? { style: js(r), requiresUrlMonitoring: !0, isFallback: !1 } : { style:
|
|
7693
|
+
} : r.startsWith("http") ? { style: r, requiresUrlMonitoring: !0, isFallback: !1 } : r.toLowerCase().includes(".json") ? { style: js(r), requiresUrlMonitoring: !0, isFallback: !1 } : { style: _a(r), requiresUrlMonitoring: !0, isFallback: !1 };
|
|
7694
7694
|
}
|
|
7695
|
-
return r instanceof
|
|
7695
|
+
return r instanceof Pa ? { style: r.getExpandedStyleURL(), requiresUrlMonitoring: !1, isFallback: !1 } : r instanceof Ra ? {
|
|
7696
7696
|
style: r.getDefaultVariant().getExpandedStyleURL(),
|
|
7697
7697
|
requiresUrlMonitoring: !1,
|
|
7698
7698
|
isFallback: !1
|
|
@@ -7701,7 +7701,7 @@ function ln(r) {
|
|
|
7701
7701
|
requiresUrlMonitoring: !1,
|
|
7702
7702
|
isFallback: !1
|
|
7703
7703
|
} : {
|
|
7704
|
-
style: qe[
|
|
7704
|
+
style: qe[$t[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),
|
|
7705
7705
|
requiresUrlMonitoring: !1,
|
|
7706
7706
|
// default styles don't require URL monitoring
|
|
7707
7707
|
isFallback: !0
|
|
@@ -7840,6 +7840,28 @@ class qs extends ko {
|
|
|
7840
7840
|
], n = this._map.project(t), a = this._map.unproject([n.x, n.y]), o = this._map.unproject([n.x + 20, n.y]), i = a.distanceTo(o) / 20, s = Math.ceil(2 * this._accuracy / i);
|
|
7841
7841
|
this._circleElement.style.width = `${s}px`, this._circleElement.style.height = `${s}px`;
|
|
7842
7842
|
}
|
|
7843
|
+
// We are overwriting the method _setErrorState from Maplibre's GeolocateControl because the
|
|
7844
|
+
// case BACKGROUND_ERROR is not dealt with in the original function and yields an error.
|
|
7845
|
+
// Related issue: https://github.com/maplibre/maplibre-gl-js/issues/2294
|
|
7846
|
+
_setErrorState() {
|
|
7847
|
+
switch (this._watchState) {
|
|
7848
|
+
case "WAITING_ACTIVE":
|
|
7849
|
+
this._watchState = "ACTIVE_ERROR", this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"), this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");
|
|
7850
|
+
break;
|
|
7851
|
+
case "ACTIVE_LOCK":
|
|
7852
|
+
this._watchState = "ACTIVE_ERROR", this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"), this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"), this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");
|
|
7853
|
+
break;
|
|
7854
|
+
case "BACKGROUND":
|
|
7855
|
+
this._watchState = "BACKGROUND_ERROR", this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"), this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"), this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");
|
|
7856
|
+
break;
|
|
7857
|
+
case "ACTIVE_ERROR":
|
|
7858
|
+
break;
|
|
7859
|
+
case "BACKGROUND_ERROR":
|
|
7860
|
+
break;
|
|
7861
|
+
default:
|
|
7862
|
+
throw new Error(`Unexpected watchState ${this._watchState}`);
|
|
7863
|
+
}
|
|
7864
|
+
}
|
|
7843
7865
|
}
|
|
7844
7866
|
var H, Q, me, he, K, Ye, U, la, Z, ua;
|
|
7845
7867
|
class Gt {
|
|
@@ -8097,7 +8119,7 @@ class Gs extends S.Map {
|
|
|
8097
8119
|
const v = d.error.url, w = new URL(v);
|
|
8098
8120
|
w.search = "";
|
|
8099
8121
|
const b = w.href;
|
|
8100
|
-
this.monitoredStyleUrls.has(b) && (this.monitoredStyleUrls.delete(b), u());
|
|
8122
|
+
this.monitoredStyleUrls && this.monitoredStyleUrls.has(b) && (this.monitoredStyleUrls.delete(b), u());
|
|
8101
8123
|
return;
|
|
8102
8124
|
}
|
|
8103
8125
|
if (this.styleInProcess)
|
|
@@ -8111,7 +8133,7 @@ class Gs extends S.Map {
|
|
|
8111
8133
|
this.primaryLanguage = d ?? F.primaryLanguage;
|
|
8112
8134
|
}
|
|
8113
8135
|
this.forceLanguageUpdate = !(this.primaryLanguage === E.STYLE || this.primaryLanguage === E.STYLE_LOCK), this.languageAlwaysBeenStyle = this.primaryLanguage === E.STYLE, this.terrainExaggeration = t.terrainExaggeration ?? this.terrainExaggeration, this.curentProjection = t.projection, this.on("styledata", () => {
|
|
8114
|
-
this.curentProjection === "mercator" ? this.setProjection({ type: "mercator" }) : this.curentProjection === "globe" &&
|
|
8136
|
+
this.curentProjection === "mercator" ? this.setProjection({ type: "mercator" }) : this.curentProjection === "globe" && this.setProjection({ type: "globe" });
|
|
8115
8137
|
}), this.once("styledata", async () => {
|
|
8116
8138
|
if (!t.geolocate || t.center || t.hash && i)
|
|
8117
8139
|
return;
|
|
@@ -8232,7 +8254,7 @@ class Gs extends S.Map {
|
|
|
8232
8254
|
language: b,
|
|
8233
8255
|
apiKey: T,
|
|
8234
8256
|
maptilerLogo: j,
|
|
8235
|
-
|
|
8257
|
+
canvasContextAttributes: R,
|
|
8236
8258
|
refreshExpiredTiles: ae,
|
|
8237
8259
|
maxBounds: we,
|
|
8238
8260
|
scrollZoom: De,
|
|
@@ -8256,7 +8278,7 @@ class Gs extends S.Map {
|
|
|
8256
8278
|
apiKey: T,
|
|
8257
8279
|
container: "null",
|
|
8258
8280
|
maptilerLogo: j,
|
|
8259
|
-
|
|
8281
|
+
canvasContextAttributes: R,
|
|
8260
8282
|
refreshExpiredTiles: ae,
|
|
8261
8283
|
maxBounds: we,
|
|
8262
8284
|
scrollZoom: De,
|
|
@@ -8510,7 +8532,7 @@ class Gs extends S.Map {
|
|
|
8510
8532
|
return (a = this.minimap) == null || a.setGlyphs(t, n), super.setGlyphs(t, n);
|
|
8511
8533
|
}
|
|
8512
8534
|
getStyleLanguage() {
|
|
8513
|
-
return !this.style.stylesheet.metadata || typeof this.style.stylesheet.metadata != "object" ? null : "maptiler:language" in this.style.stylesheet.metadata && typeof this.style.stylesheet.metadata["maptiler:language"] == "string" ?
|
|
8535
|
+
return !this.style || !this.style.stylesheet || !this.style.stylesheet.metadata || typeof this.style.stylesheet.metadata != "object" ? null : "maptiler:language" in this.style.stylesheet.metadata && typeof this.style.stylesheet.metadata["maptiler:language"] == "string" ? $a(this.style.stylesheet.metadata["maptiler:language"]) : null;
|
|
8514
8536
|
}
|
|
8515
8537
|
/**
|
|
8516
8538
|
* Define the primary language of the map. Note that not all the languages shorthands provided are available.
|
|
@@ -8548,7 +8570,7 @@ class Gs extends S.Map {
|
|
|
8548
8570
|
o = n;
|
|
8549
8571
|
}
|
|
8550
8572
|
let i = E.LOCAL.flag, s = ["get", i];
|
|
8551
|
-
o.flag === E.VISITOR.flag ? (i =
|
|
8573
|
+
o.flag === E.VISITOR.flag ? (i = Pr().flag, s = [
|
|
8552
8574
|
"case",
|
|
8553
8575
|
["all", ["has", i], ["has", E.LOCAL.flag]],
|
|
8554
8576
|
[
|
|
@@ -8584,7 +8606,7 @@ class Gs extends S.Map {
|
|
|
8584
8606
|
]
|
|
8585
8607
|
],
|
|
8586
8608
|
["get", E.LOCAL.flag]
|
|
8587
|
-
]) : o.flag === E.AUTO.flag ? (i =
|
|
8609
|
+
]) : o.flag === E.AUTO.flag ? (i = Pr().flag, s = ["coalesce", ["get", i], ["get", E.LOCAL.flag]]) : o === E.LOCAL ? (i = E.LOCAL.flag, s = ["get", i]) : (i = o.flag, s = ["coalesce", ["get", i], ["get", E.LOCAL.flag]]);
|
|
8588
8610
|
const { layers: l } = this.getStyle(), u = this.originalLabelStyle.size === 0;
|
|
8589
8611
|
if (u) {
|
|
8590
8612
|
const c = So(l, this);
|
|
@@ -8720,14 +8742,14 @@ class Gs extends S.Map {
|
|
|
8720
8742
|
});
|
|
8721
8743
|
}
|
|
8722
8744
|
async fitToIpBounds() {
|
|
8723
|
-
const t = await
|
|
8745
|
+
const t = await _r.info();
|
|
8724
8746
|
this.fitBounds(t.country_bounds, {
|
|
8725
8747
|
duration: 0,
|
|
8726
8748
|
padding: 100
|
|
8727
8749
|
});
|
|
8728
8750
|
}
|
|
8729
8751
|
async centerOnIpPoint(t) {
|
|
8730
|
-
const n = await
|
|
8752
|
+
const n = await _r.info();
|
|
8731
8753
|
this.jumpTo({
|
|
8732
8754
|
center: [(n == null ? void 0 : n.longitude) ?? 0, (n == null ? void 0 : n.latitude) ?? 0],
|
|
8733
8755
|
zoom: t || 11
|
|
@@ -8772,23 +8794,19 @@ class Gs extends S.Map {
|
|
|
8772
8794
|
*/
|
|
8773
8795
|
isGlobeProjection() {
|
|
8774
8796
|
const t = this.getProjection();
|
|
8775
|
-
return t ? t.type === "globe"
|
|
8797
|
+
return (t == null ? void 0 : t.type) === "globe";
|
|
8776
8798
|
}
|
|
8777
8799
|
/**
|
|
8778
|
-
*
|
|
8800
|
+
* Activate the globe projection.
|
|
8779
8801
|
*/
|
|
8780
|
-
enableGlobeProjection(
|
|
8781
|
-
this.isGlobeProjection()
|
|
8782
|
-
this.transform.setGlobeViewAllowed(!0, !0);
|
|
8783
|
-
})) : this.transform.setGlobeViewAllowed(!0, !0), this.curentProjection = "globe");
|
|
8802
|
+
enableGlobeProjection() {
|
|
8803
|
+
this.isGlobeProjection() !== !0 && (this.setProjection({ type: "globe" }), this.curentProjection = "globe");
|
|
8784
8804
|
}
|
|
8785
8805
|
/**
|
|
8786
|
-
*
|
|
8806
|
+
* Activate the mercator projection.
|
|
8787
8807
|
*/
|
|
8788
|
-
enableMercatorProjection(
|
|
8789
|
-
this.isGlobeProjection()
|
|
8790
|
-
this.setProjection({ type: "mercator" });
|
|
8791
|
-
})) : this.setProjection({ type: "mercator" }), this.curentProjection = "mercator");
|
|
8808
|
+
enableMercatorProjection() {
|
|
8809
|
+
this.isGlobeProjection() !== !1 && (this.setProjection({ type: "mercator" }), this.curentProjection = "mercator");
|
|
8792
8810
|
}
|
|
8793
8811
|
/**
|
|
8794
8812
|
* Returns `true` is the language was ever updated, meaning changed
|
|
@@ -8862,7 +8880,7 @@ function fa(r, e) {
|
|
|
8862
8880
|
).toString(16);
|
|
8863
8881
|
const p = B(c, "Pair"), m = {};
|
|
8864
8882
|
for (const f of Array.from(p))
|
|
8865
|
-
m[
|
|
8883
|
+
m[_(k(f, "key")) ?? ""] = _(k(f, "styleUrl"));
|
|
8866
8884
|
i[`#${Te(c, "id")}`] = m;
|
|
8867
8885
|
}
|
|
8868
8886
|
for (const c of Array.from(s))
|
|
@@ -8882,9 +8900,9 @@ function Ks(r) {
|
|
|
8882
8900
|
const t = [], n = [];
|
|
8883
8901
|
e.length === 0 && (e = B(r, "gx:coord"));
|
|
8884
8902
|
for (const o of Array.from(e))
|
|
8885
|
-
t.push(Hs(
|
|
8903
|
+
t.push(Hs(_(o) ?? ""));
|
|
8886
8904
|
const a = B(r, "when");
|
|
8887
|
-
for (const o of Array.from(a)) n.push(
|
|
8905
|
+
for (const o of Array.from(a)) n.push(_(o));
|
|
8888
8906
|
return {
|
|
8889
8907
|
coords: t,
|
|
8890
8908
|
times: n
|
|
@@ -8906,17 +8924,17 @@ function st(r) {
|
|
|
8906
8924
|
if (t = n[o], e[a] === "Point")
|
|
8907
8925
|
s.push({
|
|
8908
8926
|
type: "Point",
|
|
8909
|
-
coordinates: ha(
|
|
8927
|
+
coordinates: ha(_(k(t, "coordinates")) ?? "")
|
|
8910
8928
|
});
|
|
8911
8929
|
else if (e[a] === "LineString")
|
|
8912
8930
|
s.push({
|
|
8913
8931
|
type: "LineString",
|
|
8914
|
-
coordinates: mn(
|
|
8932
|
+
coordinates: mn(_(k(t, "coordinates")) ?? "")
|
|
8915
8933
|
});
|
|
8916
8934
|
else if (e[a] === "Polygon") {
|
|
8917
8935
|
const u = B(t, "LinearRing"), c = [];
|
|
8918
8936
|
for (i = 0; i < u.length; i++)
|
|
8919
|
-
c.push(mn(
|
|
8937
|
+
c.push(mn(_(k(u[i], "coordinates")) ?? ""));
|
|
8920
8938
|
s.push({
|
|
8921
8939
|
type: "Polygon",
|
|
8922
8940
|
coordinates: c
|
|
@@ -8932,8 +8950,8 @@ function st(r) {
|
|
|
8932
8950
|
return { geoms: s, coordTimes: l };
|
|
8933
8951
|
}
|
|
8934
8952
|
function Ws(r, e, t, n) {
|
|
8935
|
-
const a = st(r), o = {}, i =
|
|
8936
|
-
let f, d =
|
|
8953
|
+
const a = st(r), o = {}, i = _(k(r, "name")), s = _(k(r, "address")), l = _(k(r, "description")), u = k(r, "TimeSpan"), c = k(r, "TimeStamp"), p = k(r, "ExtendedData"), m = k(r, "visibility");
|
|
8954
|
+
let f, d = _(k(r, "styleUrl")), y = k(r, "LineStyle"), v = k(r, "PolyStyle");
|
|
8937
8955
|
if (!a.geoms.length) return [];
|
|
8938
8956
|
if (i && (o.name = i), s && (o.address = s), d) {
|
|
8939
8957
|
d[0] !== "#" && (d = `#${d}`), o.styleUrl = d, e[d] && (o.styleHash = e[d]), n[d] && (o.styleMapHash = n[d], o.styleHash = e[n[d].normal ?? ""]);
|
|
@@ -8944,32 +8962,32 @@ function Ws(r, e, t, n) {
|
|
|
8944
8962
|
if (T) {
|
|
8945
8963
|
const j = k(T, "Icon");
|
|
8946
8964
|
if (j) {
|
|
8947
|
-
const
|
|
8948
|
-
|
|
8965
|
+
const R = _(k(j, "href"));
|
|
8966
|
+
R && (o.icon = R);
|
|
8949
8967
|
}
|
|
8950
8968
|
}
|
|
8951
8969
|
}
|
|
8952
8970
|
}
|
|
8953
8971
|
if (l && (o.description = l), u) {
|
|
8954
|
-
const b =
|
|
8972
|
+
const b = _(k(u, "begin")), T = _(k(u, "end"));
|
|
8955
8973
|
b && T && (o.timespan = { begin: b, end: T });
|
|
8956
8974
|
}
|
|
8957
|
-
if (c !== null && (o.timestamp =
|
|
8958
|
-
const b = fn(
|
|
8959
|
-
T && (o.stroke = T), Number.isNaN(j) || (o["stroke-opacity"] = j), Number.isNaN(
|
|
8975
|
+
if (c !== null && (o.timestamp = _(k(c, "when")) ?? (/* @__PURE__ */ new Date()).toISOString()), y !== null) {
|
|
8976
|
+
const b = fn(_(k(y, "color"))), T = b[0], j = b[1], R = Number.parseFloat(_(k(y, "width")) ?? "");
|
|
8977
|
+
T && (o.stroke = T), Number.isNaN(j) || (o["stroke-opacity"] = j), Number.isNaN(R) || (o["stroke-width"] = R);
|
|
8960
8978
|
}
|
|
8961
8979
|
if (v) {
|
|
8962
|
-
const b = fn(
|
|
8963
|
-
T && (o.fill = T), Number.isNaN(j) || (o["fill-opacity"] = j),
|
|
8980
|
+
const b = fn(_(k(v, "color"))), T = b[0], j = b[1], R = _(k(v, "fill")), ae = _(k(v, "outline"));
|
|
8981
|
+
T && (o.fill = T), Number.isNaN(j) || (o["fill-opacity"] = j), R && (o["fill-opacity"] = R === "1" ? o["fill-opacity"] || 1 : 0), ae && (o["stroke-opacity"] = ae === "1" ? o["stroke-opacity"] || 1 : 0);
|
|
8964
8982
|
}
|
|
8965
8983
|
if (p) {
|
|
8966
8984
|
const b = B(p, "Data"), T = B(p, "SimpleData");
|
|
8967
8985
|
for (f = 0; f < b.length; f++)
|
|
8968
|
-
o[b[f].getAttribute("name") ?? ""] =
|
|
8986
|
+
o[b[f].getAttribute("name") ?? ""] = _(k(b[f], "value")) ?? "";
|
|
8969
8987
|
for (f = 0; f < T.length; f++)
|
|
8970
|
-
o[T[f].getAttribute("name") ?? ""] =
|
|
8988
|
+
o[T[f].getAttribute("name") ?? ""] = _(T[f]) ?? "";
|
|
8971
8989
|
}
|
|
8972
|
-
m !== null && (o.visibility =
|
|
8990
|
+
m !== null && (o.visibility = _(m) ?? ""), a.coordTimes.length !== 0 && (o.coordTimes = a.coordTimes.length === 1 ? a.coordTimes[0] : a.coordTimes);
|
|
8973
8991
|
const w = {
|
|
8974
8992
|
type: "Feature",
|
|
8975
8993
|
geometry: a.geoms.length === 1 ? a.geoms[0] : {
|
|
@@ -9056,7 +9074,7 @@ function ya(r) {
|
|
|
9056
9074
|
if (r) {
|
|
9057
9075
|
const t = k(r, "line");
|
|
9058
9076
|
if (t) {
|
|
9059
|
-
const n =
|
|
9077
|
+
const n = _(k(t, "color")), a = Number.parseFloat(_(k(t, "opacity")) ?? "0"), o = Number.parseFloat(_(k(t, "width")) ?? "0");
|
|
9060
9078
|
n && (e.stroke = n), Number.isNaN(a) || (e["stroke-opacity"] = a), Number.isNaN(o) || (e["stroke-width"] = o * 96 / 25.4);
|
|
9061
9079
|
}
|
|
9062
9080
|
}
|
|
@@ -9109,14 +9127,14 @@ function Xs(r) {
|
|
|
9109
9127
|
function ma(r) {
|
|
9110
9128
|
return r.map(Number.parseFloat).map((e) => Number.isNaN(e) ? null : e);
|
|
9111
9129
|
}
|
|
9112
|
-
function
|
|
9130
|
+
function _(r) {
|
|
9113
9131
|
return r && Xs(r), r && r.textContent;
|
|
9114
9132
|
}
|
|
9115
9133
|
function rr(r, e) {
|
|
9116
9134
|
const t = {};
|
|
9117
9135
|
let n, a;
|
|
9118
9136
|
for (a = 0; a < e.length; a++)
|
|
9119
|
-
n = k(r, e[a]), n && (t[e[a]] =
|
|
9137
|
+
n = k(r, e[a]), n && (t[e[a]] = _(n) ?? "");
|
|
9120
9138
|
return t;
|
|
9121
9139
|
}
|
|
9122
9140
|
function ha(r) {
|
|
@@ -9130,10 +9148,10 @@ function mn(r) {
|
|
|
9130
9148
|
function ga(r) {
|
|
9131
9149
|
const e = [yn(r, "lon"), yn(r, "lat")], t = k(r, "ele"), n = k(r, "gpxtpx:hr") || k(r, "hr"), a = k(r, "time");
|
|
9132
9150
|
let o;
|
|
9133
|
-
return t && (o = Number.parseFloat(
|
|
9151
|
+
return t && (o = Number.parseFloat(_(t) ?? "0"), Number.isNaN(o) || e.push(o)), {
|
|
9134
9152
|
coordinates: e,
|
|
9135
|
-
time: a ?
|
|
9136
|
-
heartRate: n !== null ? Number.parseFloat(
|
|
9153
|
+
time: a ? _(a) : null,
|
|
9154
|
+
heartRate: n !== null ? Number.parseFloat(_(n) ?? "0") : null
|
|
9137
9155
|
};
|
|
9138
9156
|
}
|
|
9139
9157
|
function Qs(r) {
|
|
@@ -10143,7 +10161,7 @@ function Mr() {
|
|
|
10143
10161
|
function zt() {
|
|
10144
10162
|
return `maptiler_source_${kn()}`;
|
|
10145
10163
|
}
|
|
10146
|
-
function
|
|
10164
|
+
function _t() {
|
|
10147
10165
|
return `maptiler_layer_${kn()}`;
|
|
10148
10166
|
}
|
|
10149
10167
|
function gn(r, e) {
|
|
@@ -10161,7 +10179,7 @@ function gn(r, e) {
|
|
|
10161
10179
|
function Me(r) {
|
|
10162
10180
|
return ["interpolate", ["linear"], ["zoom"], ...r.flatMap((e) => [e.zoom, e.value])];
|
|
10163
10181
|
}
|
|
10164
|
-
function
|
|
10182
|
+
function P(r) {
|
|
10165
10183
|
return ["interpolate", ["linear"], ["zoom"], ...r.flatMap((e) => [e.zoom, e.value])];
|
|
10166
10184
|
}
|
|
10167
10185
|
function nl(r, e) {
|
|
@@ -10288,7 +10306,7 @@ async function sl(r, e, t = {}) {
|
|
|
10288
10306
|
function ll(r, e) {
|
|
10289
10307
|
if (e.layerId && r.getLayer(e.layerId))
|
|
10290
10308
|
throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
|
|
10291
|
-
const t = e.sourceId ?? zt(), n = e.layerId ??
|
|
10309
|
+
const t = e.sourceId ?? zt(), n = e.layerId ?? _t(), a = {
|
|
10292
10310
|
polylineLayerId: n,
|
|
10293
10311
|
polylineOutlineLayerId: "",
|
|
10294
10312
|
polylineSourceId: t
|
|
@@ -10314,10 +10332,10 @@ function ll(r, e) {
|
|
|
10314
10332
|
minzoom: e.minzoom ?? 0,
|
|
10315
10333
|
maxzoom: e.maxzoom ?? 23,
|
|
10316
10334
|
paint: {
|
|
10317
|
-
"line-opacity": typeof f == "number" ? f :
|
|
10335
|
+
"line-opacity": typeof f == "number" ? f : P(f),
|
|
10318
10336
|
"line-color": typeof m == "string" ? m : Me(m),
|
|
10319
10337
|
"line-width": nl(o, p),
|
|
10320
|
-
"line-blur": typeof d == "number" ? d :
|
|
10338
|
+
"line-blur": typeof d == "number" ? d : P(d)
|
|
10321
10339
|
}
|
|
10322
10340
|
},
|
|
10323
10341
|
e.beforeId
|
|
@@ -10335,11 +10353,11 @@ function ll(r, e) {
|
|
|
10335
10353
|
minzoom: e.minzoom ?? 0,
|
|
10336
10354
|
maxzoom: e.maxzoom ?? 23,
|
|
10337
10355
|
paint: {
|
|
10338
|
-
"line-opacity": typeof s == "number" ? s :
|
|
10356
|
+
"line-opacity": typeof s == "number" ? s : P(s),
|
|
10339
10357
|
"line-color": typeof i == "string" ? i : Me(i),
|
|
10340
|
-
"line-width": typeof o == "number" ? o :
|
|
10341
|
-
"line-blur": typeof l == "number" ? l :
|
|
10342
|
-
"line-gap-width": typeof u == "number" ? u :
|
|
10358
|
+
"line-width": typeof o == "number" ? o : P(o),
|
|
10359
|
+
"line-blur": typeof l == "number" ? l : P(l),
|
|
10360
|
+
"line-gap-width": typeof u == "number" ? u : P(u),
|
|
10343
10361
|
// For some reasons passing "line-dasharray" with the value "undefined"
|
|
10344
10362
|
// results in no showing the line while it should have the same behavior
|
|
10345
10363
|
// of not adding the property "line-dasharray" as all.
|
|
@@ -10354,7 +10372,7 @@ function ll(r, e) {
|
|
|
10354
10372
|
function ul(r, e) {
|
|
10355
10373
|
if (e.layerId && r.getLayer(e.layerId))
|
|
10356
10374
|
throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
|
|
10357
|
-
const t = e.sourceId ?? zt(), n = e.layerId ??
|
|
10375
|
+
const t = e.sourceId ?? zt(), n = e.layerId ?? _t(), a = {
|
|
10358
10376
|
polygonLayerId: n,
|
|
10359
10377
|
polygonOutlineLayerId: e.outline ? `${n}_outline` : "",
|
|
10360
10378
|
polygonSourceId: t
|
|
@@ -10379,7 +10397,7 @@ function ul(r, e) {
|
|
|
10379
10397
|
maxzoom: e.maxzoom ?? 23,
|
|
10380
10398
|
paint: {
|
|
10381
10399
|
"fill-color": typeof c == "string" ? c : Me(c),
|
|
10382
|
-
"fill-opacity": typeof p == "number" ? p :
|
|
10400
|
+
"fill-opacity": typeof p == "number" ? p : P(p),
|
|
10383
10401
|
// Adding a pattern if provided
|
|
10384
10402
|
...y && { "fill-pattern": y }
|
|
10385
10403
|
}
|
|
@@ -10387,12 +10405,12 @@ function ul(r, e) {
|
|
|
10387
10405
|
e.beforeId
|
|
10388
10406
|
), e.outline === !0) {
|
|
10389
10407
|
let v;
|
|
10390
|
-
m === "inside" ? typeof i == "number" ? v = 0.5 * i : v =
|
|
10408
|
+
m === "inside" ? typeof i == "number" ? v = 0.5 * i : v = P(
|
|
10391
10409
|
i.map(({ zoom: w, value: b }) => ({
|
|
10392
10410
|
zoom: w,
|
|
10393
10411
|
value: 0.5 * b
|
|
10394
10412
|
}))
|
|
10395
|
-
) : m === "outside" ? typeof i == "number" ? v = -0.5 * i : v =
|
|
10413
|
+
) : m === "outside" ? typeof i == "number" ? v = -0.5 * i : v = P(
|
|
10396
10414
|
i.map((w) => ({
|
|
10397
10415
|
zoom: w.zoom,
|
|
10398
10416
|
value: -0.5 * w.value
|
|
@@ -10409,10 +10427,10 @@ function ul(r, e) {
|
|
|
10409
10427
|
minzoom: e.minzoom ?? 0,
|
|
10410
10428
|
maxzoom: e.maxzoom ?? 23,
|
|
10411
10429
|
paint: {
|
|
10412
|
-
"line-opacity": typeof l == "number" ? l :
|
|
10430
|
+
"line-opacity": typeof l == "number" ? l : P(l),
|
|
10413
10431
|
"line-color": typeof s == "string" ? s : Me(s),
|
|
10414
|
-
"line-width": typeof i == "number" ? i :
|
|
10415
|
-
"line-blur": typeof u == "number" ? u :
|
|
10432
|
+
"line-width": typeof i == "number" ? i : P(i),
|
|
10433
|
+
"line-blur": typeof u == "number" ? u : P(u),
|
|
10416
10434
|
"line-offset": v,
|
|
10417
10435
|
// For some reasons passing "line-dasharray" with the value "undefined"
|
|
10418
10436
|
// results in no showing the line while it should have the same behavior
|
|
@@ -10435,10 +10453,10 @@ function ul(r, e) {
|
|
|
10435
10453
|
function cl(r, e) {
|
|
10436
10454
|
if (e.layerId && r.getLayer(e.layerId))
|
|
10437
10455
|
throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
|
|
10438
|
-
const t = e.minPointRadius ?? 10, n = e.maxPointRadius ?? 50, a = e.cluster ?? !1, o = 20, i = Array.isArray(e.pointColor) ? e.pointColor : va.TURBO.scale(10, e.cluster ? 1e4 : 1e3).resample("ease-out-square"), s = i.getBounds(), l = e.sourceId ?? zt(), u = e.layerId ??
|
|
10456
|
+
const t = e.minPointRadius ?? 10, n = e.maxPointRadius ?? 50, a = e.cluster ?? !1, o = 20, i = Array.isArray(e.pointColor) ? e.pointColor : va.TURBO.scale(10, e.cluster ? 1e4 : 1e3).resample("ease-out-square"), s = i.getBounds(), l = e.sourceId ?? zt(), u = e.layerId ?? _t(), c = e.showLabel ?? a, p = e.alignOnViewport ?? !0, m = e.outline ?? !1, f = e.outlineOpacity ?? 1, d = e.outlineWidth ?? 1, y = e.outlineColor ?? "#FFFFFF";
|
|
10439
10457
|
let v;
|
|
10440
10458
|
const w = e.zoomCompensation ?? !0, b = e.minzoom ?? 0, T = e.maxzoom ?? 23;
|
|
10441
|
-
typeof e.pointOpacity == "number" ? v = e.pointOpacity : Array.isArray(e.pointOpacity) ? v =
|
|
10459
|
+
typeof e.pointOpacity == "number" ? v = e.pointOpacity : Array.isArray(e.pointOpacity) ? v = P(e.pointOpacity) : e.cluster ? v = wn(i, "point_count") : e.property ? v = wn(i, e.property) : v = P([
|
|
10442
10460
|
{ zoom: b, value: 0 },
|
|
10443
10461
|
{ zoom: b + 0.25, value: 1 },
|
|
10444
10462
|
{ zoom: T - 0.25, value: 1 },
|
|
@@ -10451,16 +10469,16 @@ function cl(r, e) {
|
|
|
10451
10469
|
pointSourceId: l
|
|
10452
10470
|
};
|
|
10453
10471
|
if (e.data && !r.getSource(l)) {
|
|
10454
|
-
let
|
|
10455
|
-
typeof
|
|
10472
|
+
let R = e.data;
|
|
10473
|
+
typeof R == "string" && ht(R) && (R = `https://api.maptiler.com/data/${R}/features.json?key=${F.apiKey}`), r.addSource(l, {
|
|
10456
10474
|
type: "geojson",
|
|
10457
|
-
data:
|
|
10475
|
+
data: R,
|
|
10458
10476
|
cluster: a
|
|
10459
10477
|
});
|
|
10460
10478
|
}
|
|
10461
10479
|
if (a) {
|
|
10462
10480
|
j.clusterLayerId = `${u}_cluster`;
|
|
10463
|
-
const
|
|
10481
|
+
const R = Array.from({ length: o }, (ae, we) => {
|
|
10464
10482
|
const De = s.min + we * (s.max - s.min) / (o - 1);
|
|
10465
10483
|
return {
|
|
10466
10484
|
value: De,
|
|
@@ -10476,15 +10494,15 @@ function cl(r, e) {
|
|
|
10476
10494
|
filter: ["has", "point_count"],
|
|
10477
10495
|
paint: {
|
|
10478
10496
|
// 'circle-color': options.pointColor ?? colorDrivenByProperty(clusterStyle, "point_count"),
|
|
10479
|
-
"circle-color": typeof e.pointColor == "string" ? e.pointColor : vn(
|
|
10480
|
-
"circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ?
|
|
10497
|
+
"circle-color": typeof e.pointColor == "string" ? e.pointColor : vn(R, "point_count"),
|
|
10498
|
+
"circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ? P(e.pointRadius) : bn(R, "point_count", !1),
|
|
10481
10499
|
"circle-pitch-alignment": p ? "viewport" : "map",
|
|
10482
10500
|
"circle-pitch-scale": "map",
|
|
10483
10501
|
// scale with camera distance regardless of viewport/biewport alignement
|
|
10484
10502
|
"circle-opacity": v,
|
|
10485
10503
|
...m && {
|
|
10486
|
-
"circle-stroke-opacity": typeof f == "number" ? f :
|
|
10487
|
-
"circle-stroke-width": typeof d == "number" ? d :
|
|
10504
|
+
"circle-stroke-opacity": typeof f == "number" ? f : P(f),
|
|
10505
|
+
"circle-stroke-width": typeof d == "number" ? d : P(d),
|
|
10488
10506
|
"circle-stroke-color": typeof y == "string" ? y : Me(y)
|
|
10489
10507
|
}
|
|
10490
10508
|
},
|
|
@@ -10504,11 +10522,11 @@ function cl(r, e) {
|
|
|
10504
10522
|
// scale with camera distance regardless of viewport/biewport alignement
|
|
10505
10523
|
// 'circle-color': options.pointColor ?? clusterStyle[0].color,
|
|
10506
10524
|
"circle-color": typeof e.pointColor == "string" ? e.pointColor : i.getColorHex(i.getBounds().min),
|
|
10507
|
-
"circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ?
|
|
10525
|
+
"circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ? P(e.pointRadius) : R[0].pointRadius * 0.75,
|
|
10508
10526
|
"circle-opacity": v,
|
|
10509
10527
|
...m && {
|
|
10510
|
-
"circle-stroke-opacity": typeof f == "number" ? f :
|
|
10511
|
-
"circle-stroke-width": typeof d == "number" ? d :
|
|
10528
|
+
"circle-stroke-opacity": typeof f == "number" ? f : P(f),
|
|
10529
|
+
"circle-stroke-width": typeof d == "number" ? d : P(d),
|
|
10512
10530
|
"circle-stroke-color": typeof y == "string" ? y : Me(y)
|
|
10513
10531
|
}
|
|
10514
10532
|
},
|
|
@@ -10518,13 +10536,13 @@ function cl(r, e) {
|
|
|
10518
10536
|
e.beforeId
|
|
10519
10537
|
);
|
|
10520
10538
|
} else {
|
|
10521
|
-
let
|
|
10539
|
+
let R = typeof e.pointColor == "string" ? e.pointColor : Array.isArray(e.pointColor) ? e.pointColor.getColorHex(e.pointColor.getBounds().min) : Mr(), ae = typeof e.pointRadius == "number" ? w ? P([
|
|
10522
10540
|
{ zoom: 0, value: e.pointRadius * 0.025 },
|
|
10523
10541
|
{ zoom: 2, value: e.pointRadius * 0.05 },
|
|
10524
10542
|
{ zoom: 4, value: e.pointRadius * 0.1 },
|
|
10525
10543
|
{ zoom: 8, value: e.pointRadius * 0.25 },
|
|
10526
10544
|
{ zoom: 16, value: e.pointRadius * 1 }
|
|
10527
|
-
]) : e.pointRadius : Array.isArray(e.pointRadius) ?
|
|
10545
|
+
]) : e.pointRadius : Array.isArray(e.pointRadius) ? P(e.pointRadius) : w ? P([
|
|
10528
10546
|
{ zoom: 0, value: t * 0.05 },
|
|
10529
10547
|
{ zoom: 2, value: t * 0.1 },
|
|
10530
10548
|
{ zoom: 4, value: t * 0.2 },
|
|
@@ -10540,7 +10558,7 @@ function cl(r, e) {
|
|
|
10540
10558
|
color: typeof e.pointColor == "string" ? e.pointColor : i.getColorHex(tt)
|
|
10541
10559
|
};
|
|
10542
10560
|
});
|
|
10543
|
-
|
|
10561
|
+
R = vn(we, e.property), ae = bn(we, e.property, w);
|
|
10544
10562
|
}
|
|
10545
10563
|
r.addLayer(
|
|
10546
10564
|
{
|
|
@@ -10555,12 +10573,12 @@ function cl(r, e) {
|
|
|
10555
10573
|
"circle-pitch-alignment": p ? "viewport" : "map",
|
|
10556
10574
|
"circle-pitch-scale": "map",
|
|
10557
10575
|
// scale with camera distance regardless of viewport/biewport alignement
|
|
10558
|
-
"circle-color":
|
|
10576
|
+
"circle-color": R,
|
|
10559
10577
|
"circle-opacity": v,
|
|
10560
10578
|
"circle-radius": ae,
|
|
10561
10579
|
...m && {
|
|
10562
|
-
"circle-stroke-opacity": typeof f == "number" ? f :
|
|
10563
|
-
"circle-stroke-width": typeof d == "number" ? d :
|
|
10580
|
+
"circle-stroke-opacity": typeof f == "number" ? f : P(f),
|
|
10581
|
+
"circle-stroke-width": typeof d == "number" ? d : P(d),
|
|
10564
10582
|
"circle-stroke-color": typeof y == "string" ? y : Me(y)
|
|
10565
10583
|
}
|
|
10566
10584
|
},
|
|
@@ -10572,7 +10590,7 @@ function cl(r, e) {
|
|
|
10572
10590
|
}
|
|
10573
10591
|
if (c !== !1 && (e.cluster || e.property)) {
|
|
10574
10592
|
j.labelLayerId = `${u}_label`;
|
|
10575
|
-
const
|
|
10593
|
+
const R = e.labelColor ?? "#fff", ae = e.labelSize ?? 12;
|
|
10576
10594
|
r.addLayer(
|
|
10577
10595
|
{
|
|
10578
10596
|
id: j.labelLayerId,
|
|
@@ -10588,7 +10606,7 @@ function cl(r, e) {
|
|
|
10588
10606
|
// so that the largest value goes on top
|
|
10589
10607
|
},
|
|
10590
10608
|
paint: {
|
|
10591
|
-
"text-color":
|
|
10609
|
+
"text-color": R,
|
|
10592
10610
|
"text-opacity": v
|
|
10593
10611
|
},
|
|
10594
10612
|
minzoom: b,
|
|
@@ -10602,7 +10620,7 @@ function cl(r, e) {
|
|
|
10602
10620
|
function pl(r, e) {
|
|
10603
10621
|
if (e.layerId && r.getLayer(e.layerId))
|
|
10604
10622
|
throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
|
|
10605
|
-
const t = e.sourceId ?? zt(), n = e.layerId ??
|
|
10623
|
+
const t = e.sourceId ?? zt(), n = e.layerId ?? _t(), a = e.minzoom ?? 0, o = e.maxzoom ?? 23, i = e.zoomCompensation ?? !0, s = e.opacity ?? [
|
|
10606
10624
|
{ zoom: a, value: 0 },
|
|
10607
10625
|
{ zoom: a + 0.25, value: 1 },
|
|
10608
10626
|
{ zoom: o - 0.25, value: 1 },
|
|
@@ -10630,7 +10648,7 @@ function pl(r, e) {
|
|
|
10630
10648
|
{ zoom: 16, value: 50 }
|
|
10631
10649
|
], y = e.radius ?? (i ? d : 10);
|
|
10632
10650
|
let v = 1;
|
|
10633
|
-
typeof y == "number" ? v = y : Array.isArray(y) && "zoom" in y[0] ? v =
|
|
10651
|
+
typeof y == "number" ? v = y : Array.isArray(y) && "zoom" in y[0] ? v = P(y) : p && Array.isArray(y) && "propertyValue" in y[0] ? v = ol(y, p, i) : !p && Array.isArray(y) && "propertyValue" in y[0] ? (v = P(d), console.warn("The option `.radius` can only be property-driven if the option `.property` is provided.")) : v = P(d);
|
|
10634
10652
|
const w = {
|
|
10635
10653
|
heatmapLayerId: n,
|
|
10636
10654
|
heatmapSourceId: t
|
|
@@ -10651,10 +10669,10 @@ function pl(r, e) {
|
|
|
10651
10669
|
maxzoom: o,
|
|
10652
10670
|
paint: {
|
|
10653
10671
|
"heatmap-weight": f,
|
|
10654
|
-
"heatmap-intensity": typeof c == "number" ? c :
|
|
10672
|
+
"heatmap-intensity": typeof c == "number" ? c : P(c),
|
|
10655
10673
|
"heatmap-color": il(l),
|
|
10656
10674
|
"heatmap-radius": v,
|
|
10657
|
-
"heatmap-opacity": typeof s == "number" ? s :
|
|
10675
|
+
"heatmap-opacity": typeof s == "number" ? s : P(s)
|
|
10658
10676
|
}
|
|
10659
10677
|
},
|
|
10660
10678
|
e.beforeId
|
|
@@ -10689,10 +10707,10 @@ const ql = S.Map, Ul = S.Marker, Bl = S.Popup, Vl = S.Style, Gl = S.CanvasSource
|
|
|
10689
10707
|
TwoFingersTouchZoomRotateHandler: Iu,
|
|
10690
10708
|
DoubleClickZoomHandler: Eu,
|
|
10691
10709
|
TwoFingersTouchZoomHandler: zu,
|
|
10692
|
-
TwoFingersTouchRotateHandler:
|
|
10693
|
-
getWorkerCount:
|
|
10694
|
-
setWorkerCount:
|
|
10695
|
-
getMaxParallelImageRequests:
|
|
10710
|
+
TwoFingersTouchRotateHandler: _u,
|
|
10711
|
+
getWorkerCount: Pu,
|
|
10712
|
+
setWorkerCount: Ru,
|
|
10713
|
+
getMaxParallelImageRequests: $u,
|
|
10696
10714
|
setMaxParallelImageRequests: ju,
|
|
10697
10715
|
getWorkerUrl: Nu,
|
|
10698
10716
|
setWorkerUrl: Fu,
|
|
@@ -10711,7 +10729,7 @@ export {
|
|
|
10711
10729
|
Gl as CanvasSourceMLGL,
|
|
10712
10730
|
x as ColorRamp,
|
|
10713
10731
|
va as ColorRampCollection,
|
|
10714
|
-
|
|
10732
|
+
Pl as CooperativeGesturesHandler,
|
|
10715
10733
|
su as CooperativeGesturesHandlerMLGL,
|
|
10716
10734
|
Eu as DoubleClickZoomHandler,
|
|
10717
10735
|
Mu as DragPanHandler,
|
|
@@ -10728,7 +10746,7 @@ export {
|
|
|
10728
10746
|
Lu as Hash,
|
|
10729
10747
|
Ll as ImageSource,
|
|
10730
10748
|
Kl as ImageSourceMLGL,
|
|
10731
|
-
|
|
10749
|
+
Rl as KeyboardHandler,
|
|
10732
10750
|
lu as KeyboardHandlerMLGL,
|
|
10733
10751
|
E as Language,
|
|
10734
10752
|
gu as LngLat,
|
|
@@ -10765,7 +10783,7 @@ export {
|
|
|
10765
10783
|
Ku as ReferenceMapStyle,
|
|
10766
10784
|
Co as ScaleControl,
|
|
10767
10785
|
ru as ScaleControlMLGL,
|
|
10768
|
-
|
|
10786
|
+
_l as ScrollZoomHandler,
|
|
10769
10787
|
iu as ScrollZoomHandlerMLGL,
|
|
10770
10788
|
to as SdkConfig,
|
|
10771
10789
|
Wu as ServiceError,
|
|
@@ -10773,9 +10791,9 @@ export {
|
|
|
10773
10791
|
Vl as StyleMLGL,
|
|
10774
10792
|
au as TerrainControMLGL,
|
|
10775
10793
|
El as TerrainControl,
|
|
10776
|
-
|
|
10794
|
+
$l as TwoFingersTouchPitchHandler,
|
|
10777
10795
|
uu as TwoFingersTouchPitchHandlerMLGL,
|
|
10778
|
-
|
|
10796
|
+
_u as TwoFingersTouchRotateHandler,
|
|
10779
10797
|
zu as TwoFingersTouchZoomHandler,
|
|
10780
10798
|
Iu as TwoFingersTouchZoomRotateHandler,
|
|
10781
10799
|
Tl as VectorTileSource,
|
|
@@ -10797,18 +10815,18 @@ export {
|
|
|
10797
10815
|
rc as geocoding,
|
|
10798
10816
|
nc as geolocation,
|
|
10799
10817
|
ac as getAutoLanguage,
|
|
10800
|
-
|
|
10818
|
+
Pr as getBrowserLanguage,
|
|
10801
10819
|
oc as getBufferToPixelDataParser,
|
|
10802
10820
|
ic as getLanguageInfoFromCode,
|
|
10803
10821
|
sc as getLanguageInfoFromFlag,
|
|
10804
10822
|
lc as getLanguageInfoFromKey,
|
|
10805
10823
|
yu as getMapLibreVersion,
|
|
10806
|
-
|
|
10824
|
+
$u as getMaxParallelImageRequests,
|
|
10807
10825
|
hu as getRTLTextPluginStatus,
|
|
10808
10826
|
uc as getTileCache,
|
|
10809
10827
|
Dl as getVersion,
|
|
10810
10828
|
po as getWebGLSupportError,
|
|
10811
|
-
|
|
10829
|
+
Pu as getWorkerCount,
|
|
10812
10830
|
Nu as getWorkerUrl,
|
|
10813
10831
|
pa as gpx,
|
|
10814
10832
|
Qs as gpxOrKml,
|
|
@@ -10824,7 +10842,7 @@ export {
|
|
|
10824
10842
|
Uu as removeProtocol,
|
|
10825
10843
|
ju as setMaxParallelImageRequests,
|
|
10826
10844
|
mu as setRTLTextPlugin,
|
|
10827
|
-
|
|
10845
|
+
Ru as setWorkerCount,
|
|
10828
10846
|
Fu as setWorkerUrl,
|
|
10829
10847
|
yc as staticMaps,
|
|
10830
10848
|
Ar as str2xml,
|