@maptiler/sdk 3.0.0 → 3.0.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/{readme.md → README.md} +2 -0
- package/dist/maptiler-sdk.css +1 -1
- package/dist/maptiler-sdk.mjs +909 -937
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/package.json +7 -7
- package/vite.config-dev.ts +3 -0
package/dist/maptiler-sdk.mjs
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Ta = Object.defineProperty;
|
|
2
|
+
var Er = (r) => {
|
|
3
3
|
throw TypeError(r);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var L = (r, e, t) =>
|
|
7
|
-
var
|
|
5
|
+
var Ia = (r, e, t) => e in r ? Ta(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
6
|
+
var L = (r, e, t) => Ia(r, typeof e != "symbol" ? e + "" : e, t), Pt = (r, e, t) => e.has(r) || Er("Cannot " + t);
|
|
7
|
+
var E = (r, e, t) => (Pt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), ye = (r, e, t) => e.has(r) ? Er("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
|
|
10
|
-
import { MapStyle as
|
|
11
|
-
import
|
|
12
|
-
import { v4 as
|
|
13
|
-
import { Base64 as
|
|
14
|
-
const
|
|
15
|
-
name:
|
|
16
|
-
version:
|
|
17
|
-
description:
|
|
18
|
-
module:
|
|
19
|
-
types:
|
|
20
|
-
style:
|
|
21
|
-
type:
|
|
22
|
-
exports:
|
|
23
|
-
keywords:
|
|
24
|
-
homepage:
|
|
25
|
-
license:
|
|
26
|
-
repository:
|
|
27
|
-
scripts:
|
|
28
|
-
author:
|
|
29
|
-
devDependencies:
|
|
30
|
-
dependencies:
|
|
31
|
-
},
|
|
9
|
+
import { Language as Ea, getLanguageInfoFromCode as Mr, config as Rt, MapStyle as qe, mapStylePresetList as $t, expandMapStyle as Ma, MapStyleVariant as za, ReferenceMapStyle as _a, toLanguageInfo as zr, getLanguageInfoFromFlag as Pa, geolocation as _r } from "@maptiler/client";
|
|
10
|
+
import { MapStyle as Uu, MapStyleVariant as Vu, ReferenceMapStyle as Gu, ServiceError as Hu, areSameLanguages as Ku, bufferToPixelDataBrowser as Wu, circumferenceAtLatitude as Zu, coordinates as Ju, data as Yu, elevation as Xu, expandMapStyle as Qu, geocoding as ec, geolocation as tc, getAutoLanguage as rc, getBufferToPixelDataParser as nc, getLanguageInfoFromCode as ac, getLanguageInfoFromFlag as oc, getLanguageInfoFromKey as ic, getTileCache as sc, isLanguageInfo as lc, mapStylePresetList as uc, math as cc, misc as pc, staticMaps as fc, styleToStyle as dc, toLanguageInfo as yc } from "@maptiler/client";
|
|
11
|
+
import Ra from "events";
|
|
12
|
+
import { v4 as $a } from "uuid";
|
|
13
|
+
import { Base64 as ja } from "js-base64";
|
|
14
|
+
const Na = "@maptiler/sdk", Fa = "3.0.1", Oa = "The Javascript & TypeScript map SDK tailored for MapTiler Cloud", Da = "dist/maptiler-sdk.mjs", qa = "dist/maptiler-sdk.d.ts", Ba = "dist/maptiler-sdk.css", Ua = "module", Va = { ".": { 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" } }, Ga = ["maptiler", "map", "sdk", "webmap", "cloud", "webGL", "maplibre"], Ha = "https://docs.maptiler.com/sdk-js/", Ka = "BSD-3-Clause", Wa = { type: "git", url: "https://github.com/maptiler/maptiler-sdk-js.git" }, Za = { biome: "biome check --max-diagnostics=1000", "biome:fix": "npx @biomejs/biome check --max-diagnostics=1000 --write", doc: "rm -rf docs/* && typedoc --out docs && cp -r images docs/", test: "vitest run -c vite.config-test.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 biome:fix && npm run build", dev: 'concurrently "vite -c vite.config-dev.ts" "npm run dev-umd"', "dev-umd": "npm run build-css && tsc && NODE_ENV=development vite build -w -c vite.config-umd.ts", ncu: "npx npm-check-updates" }, Ja = "MapTiler", Ya = { "@biomejs/biome": "1.9.4", "@types/uuid": "^10.0.0", "@types/xmldom": "^0.1.31", "@xmldom/xmldom": "^0.8.10", concurrently: "^9.1.2", typedoc: "^0.27.6", typescript: "^5.7.3", vite: "^6.0.7", "vite-plugin-dts": "^4.5.0", vitest: "^2.1.8" }, Xa = { "@maplibre/maplibre-gl-style-spec": "^23.0.0", "@maptiler/client": "^2.2.0", events: "^3.3.0", "js-base64": "^3.7.7", "maplibre-gl": "^5.0.1", uuid: "^11.0.5" }, wn = {
|
|
15
|
+
name: Na,
|
|
16
|
+
version: Fa,
|
|
17
|
+
description: Oa,
|
|
18
|
+
module: Da,
|
|
19
|
+
types: qa,
|
|
20
|
+
style: Ba,
|
|
21
|
+
type: Ua,
|
|
22
|
+
exports: Va,
|
|
23
|
+
keywords: Ga,
|
|
24
|
+
homepage: Ha,
|
|
25
|
+
license: Ka,
|
|
26
|
+
repository: Wa,
|
|
27
|
+
scripts: Za,
|
|
28
|
+
author: Ja,
|
|
29
|
+
devDependencies: Ya,
|
|
30
|
+
dependencies: Xa
|
|
31
|
+
}, M = {
|
|
32
32
|
/**
|
|
33
33
|
* Language mode to display labels in both the local language and the language of the visitor's device, concatenated.
|
|
34
34
|
* Note that if those two languages are the same, labels won't be duplicated.
|
|
@@ -68,14 +68,14 @@ const Oa = "@maptiler/sdk", Da = "3.0.0", qa = "The Javascript & TypeScript map
|
|
|
68
68
|
isMode: !0,
|
|
69
69
|
geocoding: !1
|
|
70
70
|
},
|
|
71
|
-
...
|
|
71
|
+
...Ea
|
|
72
72
|
};
|
|
73
73
|
function Pr() {
|
|
74
74
|
if (typeof navigator > "u") {
|
|
75
|
-
const e = Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0], t =
|
|
76
|
-
return t ||
|
|
75
|
+
const e = Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0], t = Mr(e);
|
|
76
|
+
return t || M.ENGLISH;
|
|
77
77
|
}
|
|
78
|
-
return Array.from(new Set(navigator.languages.map((e) => e.split("-")[0]))).map((e) =>
|
|
78
|
+
return Array.from(new Set(navigator.languages.map((e) => e.split("-")[0]))).map((e) => Mr(e)).filter((e) => e)[0] ?? M.LOCAL;
|
|
79
79
|
}
|
|
80
80
|
const V = {
|
|
81
81
|
maptilerLogoURL: "https://api.maptiler.com/resources/logo.svg",
|
|
@@ -83,14 +83,14 @@ const V = {
|
|
|
83
83
|
maptilerApiHost: "api.maptiler.com",
|
|
84
84
|
telemetryURL: "https://api.maptiler.com/metrics",
|
|
85
85
|
rtlPluginURL: "https://cdn.maptiler.com/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.min.js",
|
|
86
|
-
primaryLanguage:
|
|
87
|
-
secondaryLanguage:
|
|
86
|
+
primaryLanguage: M.STYLE,
|
|
87
|
+
secondaryLanguage: M.LOCAL,
|
|
88
88
|
terrainSourceURL: "https://api.maptiler.com/tiles/terrain-rgb-v2/tiles.json",
|
|
89
89
|
terrainSourceId: "maptiler-terrain"
|
|
90
90
|
};
|
|
91
91
|
Object.freeze(V);
|
|
92
|
-
const nr =
|
|
93
|
-
class
|
|
92
|
+
const nr = $a();
|
|
93
|
+
class Qa extends Ra {
|
|
94
94
|
constructor() {
|
|
95
95
|
super(...arguments);
|
|
96
96
|
/**
|
|
@@ -180,8 +180,8 @@ class to extends ja {
|
|
|
180
180
|
return Rt.fetch;
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
const F = new
|
|
184
|
-
function
|
|
183
|
+
const F = new Qa(), { addProtocol: Rr } = S, Ht = "localcache_source", Kt = "localcache", eo = "maptiler_sdk", to = 1e3, ro = 100, Wt = typeof caches < "u";
|
|
184
|
+
function no(r, e) {
|
|
185
185
|
if (Wt && F.caching && F.session && r.host === V.maptilerApiHost) {
|
|
186
186
|
if (e === "Source" && r.href.includes("tiles.json"))
|
|
187
187
|
return r.href.replace("https://", `${Ht}://`);
|
|
@@ -191,16 +191,16 @@ function oo(r, e) {
|
|
|
191
191
|
return r.href;
|
|
192
192
|
}
|
|
193
193
|
let jt;
|
|
194
|
-
async function
|
|
195
|
-
return jt || (jt = await caches.open(
|
|
194
|
+
async function Sn() {
|
|
195
|
+
return jt || (jt = await caches.open(eo)), jt;
|
|
196
196
|
}
|
|
197
197
|
let $r = 0;
|
|
198
|
-
async function
|
|
199
|
-
const r = await
|
|
198
|
+
async function ao() {
|
|
199
|
+
const r = await Sn(), e = await r.keys(), t = e.slice(0, Math.max(e.length - to, 0));
|
|
200
200
|
for (const n of t)
|
|
201
201
|
r.delete(n);
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function oo() {
|
|
204
204
|
Rr(
|
|
205
205
|
Ht,
|
|
206
206
|
async (r, e) => {
|
|
@@ -228,18 +228,18 @@ function so() {
|
|
|
228
228
|
data: await m.arrayBuffer(),
|
|
229
229
|
cacheControl: m.headers.get("Cache-Control"),
|
|
230
230
|
expires: m.headers.get("Expires")
|
|
231
|
-
}), l = await
|
|
231
|
+
}), l = await Sn(), u = await l.match(a);
|
|
232
232
|
if (u)
|
|
233
233
|
return s(u);
|
|
234
234
|
const c = r;
|
|
235
235
|
c.signal = e.signal;
|
|
236
236
|
const p = await fetch(i, c);
|
|
237
237
|
return p.status >= 200 && p.status < 300 && (l.put(a, p.clone()).catch(() => {
|
|
238
|
-
}), ++$r >
|
|
238
|
+
}), ++$r > ro && (ao(), $r = 0)), s(p);
|
|
239
239
|
}
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function io() {
|
|
243
243
|
if (typeof window > "u") return;
|
|
244
244
|
const r = S.getRTLTextPluginStatus();
|
|
245
245
|
if (r === "unavailable" || r === "requested")
|
|
@@ -248,7 +248,7 @@ function lo() {
|
|
|
248
248
|
} catch {
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function so(r, e) {
|
|
252
252
|
for (const t of r)
|
|
253
253
|
typeof e[t] == "function" && (e[t] = e[t].bind(e));
|
|
254
254
|
}
|
|
@@ -269,7 +269,7 @@ function jr(r, e) {
|
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
271
|
return t.host === V.maptilerApiHost && (t.searchParams.has("key") || t.searchParams.append("key", F.apiKey), F.session && t.searchParams.append("mtsid", nr)), {
|
|
272
|
-
url:
|
|
272
|
+
url: no(t, e)
|
|
273
273
|
};
|
|
274
274
|
}
|
|
275
275
|
function Nr(r) {
|
|
@@ -284,24 +284,24 @@ function Nr(r) {
|
|
|
284
284
|
return jr(e, t);
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function xn() {
|
|
288
288
|
return Math.random().toString(36).substring(2);
|
|
289
289
|
}
|
|
290
290
|
function ht(r) {
|
|
291
291
|
return /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi.test(r);
|
|
292
292
|
}
|
|
293
|
-
function
|
|
293
|
+
function lo(r) {
|
|
294
294
|
try {
|
|
295
295
|
return JSON.parse(r);
|
|
296
296
|
} catch {
|
|
297
297
|
}
|
|
298
298
|
return null;
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function uo() {
|
|
301
301
|
return document.createElement("canvas").getContext("webgl2") ? null : typeof WebGL2RenderingContext < "u" ? "Graphic rendering with WebGL2 has been disabled or is not supported by your graphic card. The map cannot be displayed." : "Your browser does not support graphic rendering with WebGL2. The map cannot be displayed.";
|
|
302
302
|
}
|
|
303
|
-
function
|
|
304
|
-
const e =
|
|
303
|
+
function co(r) {
|
|
304
|
+
const e = uo();
|
|
305
305
|
if (!e) return;
|
|
306
306
|
let t = null;
|
|
307
307
|
if (typeof r == "string" ? t = document.getElementById(r) : r instanceof HTMLElement && (t = r), !t)
|
|
@@ -309,7 +309,7 @@ function fo(r) {
|
|
|
309
309
|
const n = document.createElement("div");
|
|
310
310
|
throw n.innerHTML = e, n.classList.add("webgl-warning-div"), t.appendChild(n), new Error(e);
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function po(r) {
|
|
313
313
|
const e = "The WebGL context was lost.";
|
|
314
314
|
let t = null;
|
|
315
315
|
if (typeof r == "string" ? t = document.getElementById(r) : r instanceof HTMLElement && (t = r), !t)
|
|
@@ -320,7 +320,7 @@ function yo(r) {
|
|
|
320
320
|
function Fr(r, e) {
|
|
321
321
|
return !(!Array.isArray(r) || r.length !== 2 || r[0] !== "get" || typeof r[1] != "string" || e && !r[1].startsWith("name:") || !e && r[1] !== "name");
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function fo(r, e, t) {
|
|
324
324
|
const n = structuredClone(r), a = (o) => {
|
|
325
325
|
if (typeof o != "string")
|
|
326
326
|
for (let i = 0; i < o.length; i += 1)
|
|
@@ -328,20 +328,20 @@ function mo(r, e, t) {
|
|
|
328
328
|
};
|
|
329
329
|
return Fr(n, t) ? e : (a(n), n);
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function yo(r, e) {
|
|
332
332
|
const t = e ? /\{name:\S+\}/ : /\{name\}/;
|
|
333
333
|
return {
|
|
334
334
|
contains: t.test(r),
|
|
335
335
|
exactMatch: new RegExp(`^${t.source}$`).test(r)
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function mo(r, e, t) {
|
|
339
339
|
const n = t ? /\{name:\S+\}/ : /\{name\}/, a = r.split(n);
|
|
340
340
|
return ["concat", ...a.flatMap(
|
|
341
341
|
(s, l) => l === a.length - 1 ? [s] : [s, e]
|
|
342
342
|
)];
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function ho(r) {
|
|
345
345
|
var n;
|
|
346
346
|
const e = /\{name(?:\:(?<language>\S+))?\}/g, t = [];
|
|
347
347
|
for (; ; ) {
|
|
@@ -352,7 +352,7 @@ function vo(r) {
|
|
|
352
352
|
}
|
|
353
353
|
return t;
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function go(r) {
|
|
356
356
|
return !Array.isArray(r) || r.length !== 2 || r[0] !== "get" || typeof r[1] != "string" ? null : r[1].trim() === "name" ? {
|
|
357
357
|
isLanguage: !0,
|
|
358
358
|
localization: null
|
|
@@ -361,17 +361,17 @@ function bo(r) {
|
|
|
361
361
|
localization: r[1].trim().split(":").pop()
|
|
362
362
|
} : null;
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function vo(r) {
|
|
365
365
|
const e = [], t = structuredClone(r), n = (a) => {
|
|
366
366
|
if (typeof a != "string")
|
|
367
367
|
for (let o = 0; o < a.length; o += 1) {
|
|
368
|
-
const i =
|
|
368
|
+
const i = go(a[o]);
|
|
369
369
|
i ? e.push(i.localization) : n(a[o]);
|
|
370
370
|
}
|
|
371
371
|
};
|
|
372
372
|
return n([t]), e;
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function bo(r, e) {
|
|
375
375
|
const t = [];
|
|
376
376
|
for (const o of r) {
|
|
377
377
|
if (o.type !== "symbol")
|
|
@@ -382,10 +382,10 @@ function So(r, e) {
|
|
|
382
382
|
const u = e.getLayoutProperty(s, "text-field");
|
|
383
383
|
if (u)
|
|
384
384
|
if (typeof u == "string") {
|
|
385
|
-
const c =
|
|
385
|
+
const c = ho(u);
|
|
386
386
|
t.push(c);
|
|
387
387
|
} else {
|
|
388
|
-
const c =
|
|
388
|
+
const c = vo(u);
|
|
389
389
|
t.push(c);
|
|
390
390
|
}
|
|
391
391
|
}
|
|
@@ -397,132 +397,132 @@ function So(r, e) {
|
|
|
397
397
|
o === null ? a.unlocalized += 1 : (o in a.localized || (a.localized[o] = 0), a.localized[o] += 1);
|
|
398
398
|
return a;
|
|
399
399
|
}
|
|
400
|
-
let
|
|
400
|
+
let hl = class extends S.Marker {
|
|
401
401
|
addTo(e) {
|
|
402
402
|
return super.addTo(e);
|
|
403
403
|
}
|
|
404
404
|
};
|
|
405
|
-
class
|
|
405
|
+
class vl extends S.Popup {
|
|
406
406
|
addTo(e) {
|
|
407
407
|
return super.addTo(e);
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
-
class
|
|
410
|
+
class bl extends S.Style {
|
|
411
411
|
constructor(e, t = {}) {
|
|
412
412
|
super(e, t);
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
|
-
class
|
|
415
|
+
class wl extends S.CanvasSource {
|
|
416
416
|
onAdd(e) {
|
|
417
417
|
super.onAdd(e);
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
class
|
|
420
|
+
class Sl extends S.GeoJSONSource {
|
|
421
421
|
onAdd(e) {
|
|
422
422
|
super.onAdd(e);
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
class
|
|
425
|
+
class xl extends S.ImageSource {
|
|
426
426
|
onAdd(e) {
|
|
427
427
|
super.onAdd(e);
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
class
|
|
430
|
+
class kl extends S.RasterTileSource {
|
|
431
431
|
onAdd(e) {
|
|
432
432
|
super.onAdd(e);
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
|
-
class
|
|
435
|
+
class Ll extends S.RasterDEMTileSource {
|
|
436
436
|
onAdd(e) {
|
|
437
437
|
super.onAdd(e);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class
|
|
440
|
+
class Cl extends S.VectorTileSource {
|
|
441
441
|
onAdd(e) {
|
|
442
442
|
super.onAdd(e);
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
|
-
class
|
|
445
|
+
class Al extends S.VideoSource {
|
|
446
446
|
onAdd(e) {
|
|
447
447
|
super.onAdd(e);
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
class
|
|
450
|
+
class wo extends S.NavigationControl {
|
|
451
451
|
onAdd(e) {
|
|
452
452
|
return super.onAdd(e);
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
-
class
|
|
455
|
+
class So extends S.GeolocateControl {
|
|
456
456
|
onAdd(e) {
|
|
457
457
|
return super.onAdd(e);
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
|
-
class
|
|
460
|
+
class Tl extends S.AttributionControl {
|
|
461
461
|
onAdd(e) {
|
|
462
462
|
return super.onAdd(e);
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
|
-
class
|
|
465
|
+
class xo extends S.LogoControl {
|
|
466
466
|
onAdd(e) {
|
|
467
467
|
return super.onAdd(e);
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
|
-
class
|
|
470
|
+
class ko extends S.ScaleControl {
|
|
471
471
|
onAdd(e) {
|
|
472
472
|
return super.onAdd(e);
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
-
class
|
|
475
|
+
class Lo extends S.FullscreenControl {
|
|
476
476
|
onAdd(e) {
|
|
477
477
|
return super.onAdd(e);
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
class
|
|
480
|
+
class Il extends S.TerrainControl {
|
|
481
481
|
onAdd(e) {
|
|
482
482
|
return super.onAdd(e);
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
|
-
class
|
|
485
|
+
class El extends S.BoxZoomHandler {
|
|
486
486
|
constructor(e, t) {
|
|
487
487
|
super(e, t);
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
|
-
class
|
|
490
|
+
class Ml extends S.ScrollZoomHandler {
|
|
491
491
|
constructor(e, t) {
|
|
492
492
|
super(e, t);
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
|
-
class
|
|
495
|
+
class zl extends S.CooperativeGesturesHandler {
|
|
496
496
|
constructor(e, t) {
|
|
497
497
|
super(e, t);
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
class
|
|
500
|
+
class _l extends S.KeyboardHandler {
|
|
501
501
|
constructor(e) {
|
|
502
502
|
super(e);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
class
|
|
505
|
+
class Pl extends S.TwoFingersTouchPitchHandler {
|
|
506
506
|
constructor(e) {
|
|
507
507
|
super(e);
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
|
-
class
|
|
510
|
+
class Rl extends S.MapWheelEvent {
|
|
511
511
|
constructor(e, t, n) {
|
|
512
512
|
super(e, t, n);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
class
|
|
515
|
+
class $l extends S.MapTouchEvent {
|
|
516
516
|
constructor(e, t, n) {
|
|
517
517
|
super(e, t, n);
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
|
-
class
|
|
520
|
+
class jl extends S.MapMouseEvent {
|
|
521
521
|
constructor(e, t, n, a = {}) {
|
|
522
522
|
super(e, t, n, a);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
class Or extends
|
|
525
|
+
class Or extends xo {
|
|
526
526
|
constructor(t = {}) {
|
|
527
527
|
super(t);
|
|
528
528
|
L(this, "logoURL", "");
|
|
@@ -535,7 +535,7 @@ class Or extends Lo {
|
|
|
535
535
|
return n.style.backgroundRepeat = "no-repeat", n.style.cursor = "pointer", n.style.display = "block", n.style.height = "23px", n.style.margin = "0 0 -4px -4px", n.style.overflow = "hidden", n.style.width = "88px", n.style.backgroundImage = `url(${this.logoURL})`, n.style.backgroundSize = "100px 30px", n.style.width = "100px", n.style.height = "30px", n.target = "_blank", n.rel = "noopener", n.href = this.linkURL, n.setAttribute("aria-label", "MapTiler logo"), n.setAttribute("rel", "noopener"), this._container.appendChild(n), this._container.style.display = "block", this._map.on("resize", this._updateCompact), this._updateCompact(), this._container;
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
|
-
var
|
|
538
|
+
var Co = 8, Ao = {
|
|
539
539
|
version: {
|
|
540
540
|
required: !0,
|
|
541
541
|
type: "enum",
|
|
@@ -605,18 +605,18 @@ var To = 8, Mo = {
|
|
|
605
605
|
type: "array",
|
|
606
606
|
value: "layer"
|
|
607
607
|
}
|
|
608
|
-
},
|
|
608
|
+
}, To = {
|
|
609
609
|
"*": {
|
|
610
610
|
type: "source"
|
|
611
611
|
}
|
|
612
|
-
},
|
|
612
|
+
}, Io = [
|
|
613
613
|
"source_vector",
|
|
614
614
|
"source_raster",
|
|
615
615
|
"source_raster_dem",
|
|
616
616
|
"source_geojson",
|
|
617
617
|
"source_video",
|
|
618
618
|
"source_image"
|
|
619
|
-
],
|
|
619
|
+
], Eo = {
|
|
620
620
|
type: {
|
|
621
621
|
required: !0,
|
|
622
622
|
type: "enum",
|
|
@@ -671,7 +671,7 @@ var To = 8, Mo = {
|
|
|
671
671
|
"*": {
|
|
672
672
|
type: "*"
|
|
673
673
|
}
|
|
674
|
-
},
|
|
674
|
+
}, Mo = {
|
|
675
675
|
type: {
|
|
676
676
|
required: !0,
|
|
677
677
|
type: "enum",
|
|
@@ -728,7 +728,7 @@ var To = 8, Mo = {
|
|
|
728
728
|
"*": {
|
|
729
729
|
type: "*"
|
|
730
730
|
}
|
|
731
|
-
},
|
|
731
|
+
}, zo = {
|
|
732
732
|
type: {
|
|
733
733
|
required: !0,
|
|
734
734
|
type: "enum",
|
|
@@ -802,7 +802,7 @@ var To = 8, Mo = {
|
|
|
802
802
|
"*": {
|
|
803
803
|
type: "*"
|
|
804
804
|
}
|
|
805
|
-
},
|
|
805
|
+
}, _o = {
|
|
806
806
|
type: {
|
|
807
807
|
required: !0,
|
|
808
808
|
type: "enum",
|
|
@@ -863,7 +863,7 @@ var To = 8, Mo = {
|
|
|
863
863
|
promoteId: {
|
|
864
864
|
type: "promoteId"
|
|
865
865
|
}
|
|
866
|
-
},
|
|
866
|
+
}, Po = {
|
|
867
867
|
type: {
|
|
868
868
|
required: !0,
|
|
869
869
|
type: "enum",
|
|
@@ -886,7 +886,7 @@ var To = 8, Mo = {
|
|
|
886
886
|
value: "number"
|
|
887
887
|
}
|
|
888
888
|
}
|
|
889
|
-
},
|
|
889
|
+
}, Ro = {
|
|
890
890
|
type: {
|
|
891
891
|
required: !0,
|
|
892
892
|
type: "enum",
|
|
@@ -908,7 +908,7 @@ var To = 8, Mo = {
|
|
|
908
908
|
value: "number"
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
|
-
},
|
|
911
|
+
}, $o = {
|
|
912
912
|
id: {
|
|
913
913
|
type: "string",
|
|
914
914
|
required: !0
|
|
@@ -956,7 +956,7 @@ var To = 8, Mo = {
|
|
|
956
956
|
paint: {
|
|
957
957
|
type: "paint"
|
|
958
958
|
}
|
|
959
|
-
},
|
|
959
|
+
}, jo = [
|
|
960
960
|
"layout_fill",
|
|
961
961
|
"layout_line",
|
|
962
962
|
"layout_circle",
|
|
@@ -966,7 +966,7 @@ var To = 8, Mo = {
|
|
|
966
966
|
"layout_raster",
|
|
967
967
|
"layout_hillshade",
|
|
968
968
|
"layout_background"
|
|
969
|
-
],
|
|
969
|
+
], No = {
|
|
970
970
|
visibility: {
|
|
971
971
|
type: "enum",
|
|
972
972
|
values: {
|
|
@@ -976,7 +976,7 @@ var To = 8, Mo = {
|
|
|
976
976
|
default: "visible",
|
|
977
977
|
"property-type": "constant"
|
|
978
978
|
}
|
|
979
|
-
},
|
|
979
|
+
}, Fo = {
|
|
980
980
|
"fill-sort-key": {
|
|
981
981
|
type: "number",
|
|
982
982
|
expression: {
|
|
@@ -997,7 +997,7 @@ var To = 8, Mo = {
|
|
|
997
997
|
default: "visible",
|
|
998
998
|
"property-type": "constant"
|
|
999
999
|
}
|
|
1000
|
-
},
|
|
1000
|
+
}, Oo = {
|
|
1001
1001
|
"circle-sort-key": {
|
|
1002
1002
|
type: "number",
|
|
1003
1003
|
expression: {
|
|
@@ -1018,7 +1018,7 @@ var To = 8, Mo = {
|
|
|
1018
1018
|
default: "visible",
|
|
1019
1019
|
"property-type": "constant"
|
|
1020
1020
|
}
|
|
1021
|
-
},
|
|
1021
|
+
}, Do = {
|
|
1022
1022
|
visibility: {
|
|
1023
1023
|
type: "enum",
|
|
1024
1024
|
values: {
|
|
@@ -1028,7 +1028,7 @@ var To = 8, Mo = {
|
|
|
1028
1028
|
default: "visible",
|
|
1029
1029
|
"property-type": "constant"
|
|
1030
1030
|
}
|
|
1031
|
-
},
|
|
1031
|
+
}, qo = {
|
|
1032
1032
|
"line-cap": {
|
|
1033
1033
|
type: "enum",
|
|
1034
1034
|
values: {
|
|
@@ -1114,7 +1114,7 @@ var To = 8, Mo = {
|
|
|
1114
1114
|
default: "visible",
|
|
1115
1115
|
"property-type": "constant"
|
|
1116
1116
|
}
|
|
1117
|
-
},
|
|
1117
|
+
}, Bo = {
|
|
1118
1118
|
"symbol-placement": {
|
|
1119
1119
|
type: "enum",
|
|
1120
1120
|
values: {
|
|
@@ -1941,7 +1941,7 @@ var To = 8, Mo = {
|
|
|
1941
1941
|
default: "visible",
|
|
1942
1942
|
"property-type": "constant"
|
|
1943
1943
|
}
|
|
1944
|
-
},
|
|
1944
|
+
}, Uo = {
|
|
1945
1945
|
visibility: {
|
|
1946
1946
|
type: "enum",
|
|
1947
1947
|
values: {
|
|
@@ -1951,7 +1951,7 @@ var To = 8, Mo = {
|
|
|
1951
1951
|
default: "visible",
|
|
1952
1952
|
"property-type": "constant"
|
|
1953
1953
|
}
|
|
1954
|
-
},
|
|
1954
|
+
}, Vo = {
|
|
1955
1955
|
visibility: {
|
|
1956
1956
|
type: "enum",
|
|
1957
1957
|
values: {
|
|
@@ -1961,10 +1961,10 @@ var To = 8, Mo = {
|
|
|
1961
1961
|
default: "visible",
|
|
1962
1962
|
"property-type": "constant"
|
|
1963
1963
|
}
|
|
1964
|
-
},
|
|
1964
|
+
}, Go = {
|
|
1965
1965
|
type: "array",
|
|
1966
1966
|
value: "*"
|
|
1967
|
-
},
|
|
1967
|
+
}, Ho = {
|
|
1968
1968
|
type: "enum",
|
|
1969
1969
|
values: {
|
|
1970
1970
|
"==": {},
|
|
@@ -1981,14 +1981,14 @@ var To = 8, Mo = {
|
|
|
1981
1981
|
has: {},
|
|
1982
1982
|
"!has": {}
|
|
1983
1983
|
}
|
|
1984
|
-
},
|
|
1984
|
+
}, Ko = {
|
|
1985
1985
|
type: "enum",
|
|
1986
1986
|
values: {
|
|
1987
1987
|
Point: {},
|
|
1988
1988
|
LineString: {},
|
|
1989
1989
|
Polygon: {}
|
|
1990
1990
|
}
|
|
1991
|
-
},
|
|
1991
|
+
}, Wo = {
|
|
1992
1992
|
type: "array",
|
|
1993
1993
|
minimum: 0,
|
|
1994
1994
|
maximum: 24,
|
|
@@ -1997,11 +1997,11 @@ var To = 8, Mo = {
|
|
|
1997
1997
|
"color"
|
|
1998
1998
|
],
|
|
1999
1999
|
length: 2
|
|
2000
|
-
},
|
|
2000
|
+
}, Zo = {
|
|
2001
2001
|
type: "array",
|
|
2002
2002
|
value: "*",
|
|
2003
2003
|
minimum: 1
|
|
2004
|
-
},
|
|
2004
|
+
}, Jo = {
|
|
2005
2005
|
anchor: {
|
|
2006
2006
|
type: "enum",
|
|
2007
2007
|
default: "viewport",
|
|
@@ -2062,7 +2062,7 @@ var To = 8, Mo = {
|
|
|
2062
2062
|
},
|
|
2063
2063
|
transition: !0
|
|
2064
2064
|
}
|
|
2065
|
-
},
|
|
2065
|
+
}, Yo = {
|
|
2066
2066
|
"sky-color": {
|
|
2067
2067
|
type: "color",
|
|
2068
2068
|
"property-type": "data-constant",
|
|
@@ -2155,7 +2155,7 @@ var To = 8, Mo = {
|
|
|
2155
2155
|
},
|
|
2156
2156
|
transition: !0
|
|
2157
2157
|
}
|
|
2158
|
-
},
|
|
2158
|
+
}, Xo = {
|
|
2159
2159
|
source: {
|
|
2160
2160
|
type: "string",
|
|
2161
2161
|
required: !0
|
|
@@ -2165,7 +2165,7 @@ var To = 8, Mo = {
|
|
|
2165
2165
|
minimum: 0,
|
|
2166
2166
|
default: 1
|
|
2167
2167
|
}
|
|
2168
|
-
},
|
|
2168
|
+
}, Qo = {
|
|
2169
2169
|
type: {
|
|
2170
2170
|
type: "projectionDefinition",
|
|
2171
2171
|
default: "mercator",
|
|
@@ -2178,7 +2178,7 @@ var To = 8, Mo = {
|
|
|
2178
2178
|
]
|
|
2179
2179
|
}
|
|
2180
2180
|
}
|
|
2181
|
-
},
|
|
2181
|
+
}, ei = [
|
|
2182
2182
|
"paint_fill",
|
|
2183
2183
|
"paint_line",
|
|
2184
2184
|
"paint_circle",
|
|
@@ -2188,7 +2188,7 @@ var To = 8, Mo = {
|
|
|
2188
2188
|
"paint_raster",
|
|
2189
2189
|
"paint_hillshade",
|
|
2190
2190
|
"paint_background"
|
|
2191
|
-
],
|
|
2191
|
+
], ti = {
|
|
2192
2192
|
"fill-antialias": {
|
|
2193
2193
|
type: "boolean",
|
|
2194
2194
|
default: !0,
|
|
@@ -2304,7 +2304,7 @@ var To = 8, Mo = {
|
|
|
2304
2304
|
},
|
|
2305
2305
|
"property-type": "cross-faded-data-driven"
|
|
2306
2306
|
}
|
|
2307
|
-
},
|
|
2307
|
+
}, ri = {
|
|
2308
2308
|
"line-opacity": {
|
|
2309
2309
|
type: "number",
|
|
2310
2310
|
default: 1,
|
|
@@ -2495,7 +2495,7 @@ var To = 8, Mo = {
|
|
|
2495
2495
|
},
|
|
2496
2496
|
"property-type": "color-ramp"
|
|
2497
2497
|
}
|
|
2498
|
-
},
|
|
2498
|
+
}, ni = {
|
|
2499
2499
|
"circle-radius": {
|
|
2500
2500
|
type: "number",
|
|
2501
2501
|
default: 5,
|
|
@@ -2668,7 +2668,7 @@ var To = 8, Mo = {
|
|
|
2668
2668
|
},
|
|
2669
2669
|
"property-type": "data-driven"
|
|
2670
2670
|
}
|
|
2671
|
-
},
|
|
2671
|
+
}, ai = {
|
|
2672
2672
|
"heatmap-radius": {
|
|
2673
2673
|
type: "number",
|
|
2674
2674
|
default: 30,
|
|
@@ -2759,7 +2759,7 @@ var To = 8, Mo = {
|
|
|
2759
2759
|
},
|
|
2760
2760
|
"property-type": "data-constant"
|
|
2761
2761
|
}
|
|
2762
|
-
},
|
|
2762
|
+
}, oi = {
|
|
2763
2763
|
"icon-opacity": {
|
|
2764
2764
|
type: "number",
|
|
2765
2765
|
default: 1,
|
|
@@ -3023,7 +3023,7 @@ var To = 8, Mo = {
|
|
|
3023
3023
|
},
|
|
3024
3024
|
"property-type": "data-constant"
|
|
3025
3025
|
}
|
|
3026
|
-
},
|
|
3026
|
+
}, ii = {
|
|
3027
3027
|
"raster-opacity": {
|
|
3028
3028
|
type: "number",
|
|
3029
3029
|
default: 1,
|
|
@@ -3137,7 +3137,7 @@ var To = 8, Mo = {
|
|
|
3137
3137
|
},
|
|
3138
3138
|
"property-type": "data-constant"
|
|
3139
3139
|
}
|
|
3140
|
-
},
|
|
3140
|
+
}, si = {
|
|
3141
3141
|
"hillshade-illumination-direction": {
|
|
3142
3142
|
type: "number",
|
|
3143
3143
|
default: 335,
|
|
@@ -3217,7 +3217,7 @@ var To = 8, Mo = {
|
|
|
3217
3217
|
},
|
|
3218
3218
|
"property-type": "data-constant"
|
|
3219
3219
|
}
|
|
3220
|
-
},
|
|
3220
|
+
}, li = {
|
|
3221
3221
|
"background-color": {
|
|
3222
3222
|
type: "color",
|
|
3223
3223
|
default: "#000000",
|
|
@@ -3260,7 +3260,7 @@ var To = 8, Mo = {
|
|
|
3260
3260
|
},
|
|
3261
3261
|
"property-type": "data-constant"
|
|
3262
3262
|
}
|
|
3263
|
-
},
|
|
3263
|
+
}, ui = {
|
|
3264
3264
|
duration: {
|
|
3265
3265
|
type: "number",
|
|
3266
3266
|
default: 300,
|
|
@@ -3273,27 +3273,27 @@ var To = 8, Mo = {
|
|
|
3273
3273
|
minimum: 0,
|
|
3274
3274
|
units: "milliseconds"
|
|
3275
3275
|
}
|
|
3276
|
-
},
|
|
3276
|
+
}, ci = {
|
|
3277
3277
|
"*": {
|
|
3278
3278
|
type: "string"
|
|
3279
3279
|
}
|
|
3280
|
-
},
|
|
3281
|
-
$version:
|
|
3282
|
-
$root:
|
|
3283
|
-
sources:
|
|
3284
|
-
source:
|
|
3285
|
-
source_vector:
|
|
3286
|
-
source_raster:
|
|
3287
|
-
source_raster_dem:
|
|
3288
|
-
source_geojson:
|
|
3289
|
-
source_video:
|
|
3290
|
-
source_image:
|
|
3291
|
-
layer:
|
|
3292
|
-
layout:
|
|
3293
|
-
layout_background:
|
|
3294
|
-
layout_fill:
|
|
3295
|
-
layout_circle:
|
|
3296
|
-
layout_heatmap:
|
|
3280
|
+
}, pi = {
|
|
3281
|
+
$version: Co,
|
|
3282
|
+
$root: Ao,
|
|
3283
|
+
sources: To,
|
|
3284
|
+
source: Io,
|
|
3285
|
+
source_vector: Eo,
|
|
3286
|
+
source_raster: Mo,
|
|
3287
|
+
source_raster_dem: zo,
|
|
3288
|
+
source_geojson: _o,
|
|
3289
|
+
source_video: Po,
|
|
3290
|
+
source_image: Ro,
|
|
3291
|
+
layer: $o,
|
|
3292
|
+
layout: jo,
|
|
3293
|
+
layout_background: No,
|
|
3294
|
+
layout_fill: Fo,
|
|
3295
|
+
layout_circle: Oo,
|
|
3296
|
+
layout_heatmap: Do,
|
|
3297
3297
|
"layout_fill-extrusion": {
|
|
3298
3298
|
visibility: {
|
|
3299
3299
|
type: "enum",
|
|
@@ -3305,13 +3305,13 @@ var To = 8, Mo = {
|
|
|
3305
3305
|
"property-type": "constant"
|
|
3306
3306
|
}
|
|
3307
3307
|
},
|
|
3308
|
-
layout_line:
|
|
3309
|
-
layout_symbol:
|
|
3310
|
-
layout_raster:
|
|
3311
|
-
layout_hillshade:
|
|
3312
|
-
filter:
|
|
3313
|
-
filter_operator:
|
|
3314
|
-
geometry_type:
|
|
3308
|
+
layout_line: qo,
|
|
3309
|
+
layout_symbol: Bo,
|
|
3310
|
+
layout_raster: Uo,
|
|
3311
|
+
layout_hillshade: Vo,
|
|
3312
|
+
filter: Go,
|
|
3313
|
+
filter_operator: Ho,
|
|
3314
|
+
geometry_type: Ko,
|
|
3315
3315
|
function: {
|
|
3316
3316
|
expression: {
|
|
3317
3317
|
type: "expression"
|
|
@@ -3353,14 +3353,14 @@ var To = 8, Mo = {
|
|
|
3353
3353
|
required: !1
|
|
3354
3354
|
}
|
|
3355
3355
|
},
|
|
3356
|
-
function_stop:
|
|
3357
|
-
expression:
|
|
3358
|
-
light:
|
|
3359
|
-
sky:
|
|
3360
|
-
terrain:
|
|
3361
|
-
projection:
|
|
3362
|
-
paint:
|
|
3363
|
-
paint_fill:
|
|
3356
|
+
function_stop: Wo,
|
|
3357
|
+
expression: Zo,
|
|
3358
|
+
light: Jo,
|
|
3359
|
+
sky: Yo,
|
|
3360
|
+
terrain: Xo,
|
|
3361
|
+
projection: Qo,
|
|
3362
|
+
paint: ei,
|
|
3363
|
+
paint_fill: ti,
|
|
3364
3364
|
"paint_fill-extrusion": {
|
|
3365
3365
|
"fill-extrusion-opacity": {
|
|
3366
3366
|
type: "number",
|
|
@@ -3491,14 +3491,14 @@ var To = 8, Mo = {
|
|
|
3491
3491
|
"property-type": "data-constant"
|
|
3492
3492
|
}
|
|
3493
3493
|
},
|
|
3494
|
-
paint_line:
|
|
3495
|
-
paint_circle:
|
|
3496
|
-
paint_heatmap:
|
|
3497
|
-
paint_symbol:
|
|
3498
|
-
paint_raster:
|
|
3499
|
-
paint_hillshade:
|
|
3500
|
-
paint_background:
|
|
3501
|
-
transition:
|
|
3494
|
+
paint_line: ri,
|
|
3495
|
+
paint_circle: ni,
|
|
3496
|
+
paint_heatmap: ai,
|
|
3497
|
+
paint_symbol: oi,
|
|
3498
|
+
paint_raster: ii,
|
|
3499
|
+
paint_hillshade: si,
|
|
3500
|
+
paint_background: li,
|
|
3501
|
+
transition: ui,
|
|
3502
3502
|
"property-type": {
|
|
3503
3503
|
"data-driven": {
|
|
3504
3504
|
type: "property-type"
|
|
@@ -3519,7 +3519,7 @@ var To = 8, Mo = {
|
|
|
3519
3519
|
type: "property-type"
|
|
3520
3520
|
}
|
|
3521
3521
|
},
|
|
3522
|
-
promoteId:
|
|
3522
|
+
promoteId: ci
|
|
3523
3523
|
};
|
|
3524
3524
|
class h {
|
|
3525
3525
|
constructor(e, t, n, a) {
|
|
@@ -3557,7 +3557,7 @@ class or {
|
|
|
3557
3557
|
return this.bindings[e] ? !0 : this.parent ? this.parent.has(e) : !1;
|
|
3558
3558
|
}
|
|
3559
3559
|
}
|
|
3560
|
-
const gt = { kind: "null" }, g = { kind: "number" },
|
|
3560
|
+
const gt = { kind: "null" }, g = { kind: "number" }, I = { kind: "string" }, C = { kind: "boolean" }, ie = { kind: "color" }, vt = { kind: "projectionDefinition" }, Re = { kind: "object" }, A = { kind: "value" }, fi = { kind: "error" }, bt = { kind: "collator" }, wt = { kind: "formatted" }, St = { kind: "padding" }, Xe = { kind: "resolvedImage" }, xt = { kind: "variableAnchorOffsetCollection" };
|
|
3561
3561
|
function W(r, e) {
|
|
3562
3562
|
return {
|
|
3563
3563
|
kind: "array",
|
|
@@ -3572,10 +3572,10 @@ function N(r) {
|
|
|
3572
3572
|
} else
|
|
3573
3573
|
return r.kind;
|
|
3574
3574
|
}
|
|
3575
|
-
const
|
|
3575
|
+
const di = [
|
|
3576
3576
|
gt,
|
|
3577
3577
|
g,
|
|
3578
|
-
|
|
3578
|
+
I,
|
|
3579
3579
|
C,
|
|
3580
3580
|
ie,
|
|
3581
3581
|
vt,
|
|
@@ -3596,7 +3596,7 @@ function Ve(r, e) {
|
|
|
3596
3596
|
if (r.kind === e.kind)
|
|
3597
3597
|
return null;
|
|
3598
3598
|
if (r.kind === "value") {
|
|
3599
|
-
for (const t of
|
|
3599
|
+
for (const t of di)
|
|
3600
3600
|
if (!Ve(t, e))
|
|
3601
3601
|
return null;
|
|
3602
3602
|
}
|
|
@@ -3612,15 +3612,15 @@ function Le(r, e) {
|
|
|
3612
3612
|
function ze(r, e) {
|
|
3613
3613
|
return r.kind === "array" && e.kind === "array" ? r.itemType.kind === e.itemType.kind && typeof r.N == "number" : r.kind === e.kind;
|
|
3614
3614
|
}
|
|
3615
|
-
const
|
|
3615
|
+
const kn = 0.96422, Ln = 1, Cn = 0.82521, An = 4 / 29, $e = 6 / 29, Tn = 3 * $e * $e, yi = $e * $e * $e, mi = Math.PI / 180, hi = 180 / Math.PI;
|
|
3616
3616
|
function In(r) {
|
|
3617
3617
|
return r = r % 360, r < 0 && (r += 360), r;
|
|
3618
3618
|
}
|
|
3619
3619
|
function En([r, e, t, n]) {
|
|
3620
3620
|
r = Nt(r), e = Nt(e), t = Nt(t);
|
|
3621
3621
|
let a, o;
|
|
3622
|
-
const i = Ft((0.2225045 * r + 0.7168786 * e + 0.0606169 * t) /
|
|
3623
|
-
r === e && e === t ? a = o = i : (a = Ft((0.4360747 * r + 0.3850649 * e + 0.1430804 * t) /
|
|
3622
|
+
const i = Ft((0.2225045 * r + 0.7168786 * e + 0.0606169 * t) / Ln);
|
|
3623
|
+
r === e && e === t ? a = o = i : (a = Ft((0.4360747 * r + 0.3850649 * e + 0.1430804 * t) / kn), o = Ft((0.0139322 * r + 0.0971045 * e + 0.7141733 * t) / Cn));
|
|
3624
3624
|
const s = 116 * i - 16;
|
|
3625
3625
|
return [s < 0 ? 0 : s, 500 * (a - i), 200 * (i - o), n];
|
|
3626
3626
|
}
|
|
@@ -3628,11 +3628,11 @@ function Nt(r) {
|
|
|
3628
3628
|
return r <= 0.04045 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4);
|
|
3629
3629
|
}
|
|
3630
3630
|
function Ft(r) {
|
|
3631
|
-
return r >
|
|
3631
|
+
return r > yi ? Math.pow(r, 1 / 3) : r / Tn + An;
|
|
3632
3632
|
}
|
|
3633
|
-
function
|
|
3633
|
+
function Mn([r, e, t, n]) {
|
|
3634
3634
|
let a = (r + 16) / 116, o = isNaN(e) ? a : a + e / 500, i = isNaN(t) ? a : a - t / 200;
|
|
3635
|
-
return a =
|
|
3635
|
+
return a = Ln * Dt(a), o = kn * Dt(o), i = Cn * Dt(i), [
|
|
3636
3636
|
Ot(3.1338561 * o - 1.6168667 * a - 0.4906146 * i),
|
|
3637
3637
|
// D50 -> sRGB
|
|
3638
3638
|
Ot(-0.9787684 * o + 1.9161415 * a + 0.033454 * i),
|
|
@@ -3644,16 +3644,16 @@ function Ot(r) {
|
|
|
3644
3644
|
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;
|
|
3645
3645
|
}
|
|
3646
3646
|
function Dt(r) {
|
|
3647
|
-
return r > $e ? r * r * r :
|
|
3647
|
+
return r > $e ? r * r * r : Tn * (r - An);
|
|
3648
3648
|
}
|
|
3649
|
-
function
|
|
3649
|
+
function gi(r) {
|
|
3650
3650
|
const [e, t, n, a] = En(r), o = Math.sqrt(t * t + n * n);
|
|
3651
|
-
return [Math.round(o * 1e4) ? In(Math.atan2(n, t) *
|
|
3651
|
+
return [Math.round(o * 1e4) ? In(Math.atan2(n, t) * hi) : NaN, o, e, a];
|
|
3652
3652
|
}
|
|
3653
|
-
function
|
|
3654
|
-
return r = isNaN(r) ? 0 : r *
|
|
3653
|
+
function vi([r, e, t, n]) {
|
|
3654
|
+
return r = isNaN(r) ? 0 : r * mi, Mn([t, Math.cos(r) * e, Math.sin(r) * e, n]);
|
|
3655
3655
|
}
|
|
3656
|
-
function
|
|
3656
|
+
function bi([r, e, t, n]) {
|
|
3657
3657
|
r = In(r), e /= 100, t /= 100;
|
|
3658
3658
|
function a(o) {
|
|
3659
3659
|
const i = (o + r / 30) % 12, s = e * Math.min(t, 1 - t);
|
|
@@ -3661,10 +3661,10 @@ function Si([r, e, t, n]) {
|
|
|
3661
3661
|
}
|
|
3662
3662
|
return [a(0), a(8), a(4), n];
|
|
3663
3663
|
}
|
|
3664
|
-
function
|
|
3664
|
+
function wi(r) {
|
|
3665
3665
|
if (r = r.toLowerCase().trim(), r === "transparent")
|
|
3666
3666
|
return [0, 0, 0, 0];
|
|
3667
|
-
const e =
|
|
3667
|
+
const e = Si[r];
|
|
3668
3668
|
if (e) {
|
|
3669
3669
|
const [a, o, i] = e;
|
|
3670
3670
|
return [a / 255, o / 255, i / 255, 1];
|
|
@@ -3754,7 +3754,7 @@ function xi(r) {
|
|
|
3754
3754
|
p ? Dr(+p, m) : 1
|
|
3755
3755
|
];
|
|
3756
3756
|
if (qr(d))
|
|
3757
|
-
return
|
|
3757
|
+
return bi(d);
|
|
3758
3758
|
}
|
|
3759
3759
|
}
|
|
3760
3760
|
}
|
|
@@ -3770,7 +3770,7 @@ function _e(r, e, t) {
|
|
|
3770
3770
|
function qr(r) {
|
|
3771
3771
|
return !r.some(Number.isNaN);
|
|
3772
3772
|
}
|
|
3773
|
-
const
|
|
3773
|
+
const Si = {
|
|
3774
3774
|
aliceblue: [240, 248, 255],
|
|
3775
3775
|
antiquewhite: [250, 235, 215],
|
|
3776
3776
|
aqua: [0, 255, 255],
|
|
@@ -3955,7 +3955,7 @@ class $ {
|
|
|
3955
3955
|
return e;
|
|
3956
3956
|
if (typeof e != "string")
|
|
3957
3957
|
return;
|
|
3958
|
-
const t =
|
|
3958
|
+
const t = wi(e);
|
|
3959
3959
|
if (t)
|
|
3960
3960
|
return new $(...t, !1);
|
|
3961
3961
|
}
|
|
@@ -3974,7 +3974,7 @@ class $ {
|
|
|
3974
3974
|
* @returns Gien color, with reversed alpha blending, in HCL color space.
|
|
3975
3975
|
*/
|
|
3976
3976
|
get hcl() {
|
|
3977
|
-
return this.overwriteGetter("hcl",
|
|
3977
|
+
return this.overwriteGetter("hcl", gi(this.rgb));
|
|
3978
3978
|
}
|
|
3979
3979
|
/**
|
|
3980
3980
|
* Used in color interpolation.
|
|
@@ -4035,7 +4035,7 @@ class $ {
|
|
|
4035
4035
|
let T = u - o;
|
|
4036
4036
|
u > o && T > 180 ? T -= 360 : u < o && o - u > 180 && (T += 360), f = o + n * T;
|
|
4037
4037
|
} else isNaN(o) ? isNaN(u) ? f = NaN : (f = u, (s === 1 || s === 0) && (d = c)) : (f = o, (p === 1 || p === 0) && (d = i));
|
|
4038
|
-
const [y, v, w, b] =
|
|
4038
|
+
const [y, v, w, b] = vi([
|
|
4039
4039
|
f,
|
|
4040
4040
|
d ?? ve(i, c, n),
|
|
4041
4041
|
ve(s, p, n),
|
|
@@ -4044,7 +4044,7 @@ class $ {
|
|
|
4044
4044
|
return new $(y, v, w, b, !1);
|
|
4045
4045
|
}
|
|
4046
4046
|
case "lab": {
|
|
4047
|
-
const [o, i, s, l] =
|
|
4047
|
+
const [o, i, s, l] = Mn(Ge(e.lab, t.lab, n));
|
|
4048
4048
|
return new $(o, i, s, l, !1);
|
|
4049
4049
|
}
|
|
4050
4050
|
}
|
|
@@ -4134,7 +4134,7 @@ class D {
|
|
|
4134
4134
|
return this.message;
|
|
4135
4135
|
}
|
|
4136
4136
|
}
|
|
4137
|
-
const
|
|
4137
|
+
const xi = /* @__PURE__ */ new Set(["center", "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right"]);
|
|
4138
4138
|
class ne {
|
|
4139
4139
|
constructor(e) {
|
|
4140
4140
|
this.values = e.slice();
|
|
@@ -4145,7 +4145,7 @@ class ne {
|
|
|
4145
4145
|
if (!(!Array.isArray(e) || e.length < 1 || e.length % 2 !== 0)) {
|
|
4146
4146
|
for (let t = 0; t < e.length; t += 2) {
|
|
4147
4147
|
const n = e[t], a = e[t + 1];
|
|
4148
|
-
if (typeof n != "string" || !
|
|
4148
|
+
if (typeof n != "string" || !xi.has(n) || !Array.isArray(a) || a.length !== 2 || typeof a[0] != "number" || typeof a[1] != "number")
|
|
4149
4149
|
return;
|
|
4150
4150
|
}
|
|
4151
4151
|
return new ne(e);
|
|
@@ -4198,7 +4198,7 @@ class ee {
|
|
|
4198
4198
|
return new ee(e, e, 1);
|
|
4199
4199
|
}
|
|
4200
4200
|
}
|
|
4201
|
-
function
|
|
4201
|
+
function zn(r, e, t, n) {
|
|
4202
4202
|
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.`;
|
|
4203
4203
|
}
|
|
4204
4204
|
function He(r) {
|
|
@@ -4221,7 +4221,7 @@ function q(r) {
|
|
|
4221
4221
|
if (r === null)
|
|
4222
4222
|
return gt;
|
|
4223
4223
|
if (typeof r == "string")
|
|
4224
|
-
return
|
|
4224
|
+
return I;
|
|
4225
4225
|
if (typeof r == "boolean")
|
|
4226
4226
|
return C;
|
|
4227
4227
|
if (typeof r == "number")
|
|
@@ -4258,7 +4258,7 @@ function q(r) {
|
|
|
4258
4258
|
} else
|
|
4259
4259
|
return Re;
|
|
4260
4260
|
}
|
|
4261
|
-
function
|
|
4261
|
+
function Be(r) {
|
|
4262
4262
|
const e = typeof r;
|
|
4263
4263
|
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);
|
|
4264
4264
|
}
|
|
@@ -4286,7 +4286,7 @@ class je {
|
|
|
4286
4286
|
}
|
|
4287
4287
|
}
|
|
4288
4288
|
const nt = {
|
|
4289
|
-
string:
|
|
4289
|
+
string: I,
|
|
4290
4290
|
number: g,
|
|
4291
4291
|
boolean: C,
|
|
4292
4292
|
object: Re
|
|
@@ -4347,11 +4347,11 @@ class te {
|
|
|
4347
4347
|
return this.args.every((e) => e.outputDefined());
|
|
4348
4348
|
}
|
|
4349
4349
|
}
|
|
4350
|
-
const
|
|
4350
|
+
const Br = {
|
|
4351
4351
|
"to-boolean": C,
|
|
4352
4352
|
"to-color": ie,
|
|
4353
4353
|
"to-number": g,
|
|
4354
|
-
"to-string":
|
|
4354
|
+
"to-string": I
|
|
4355
4355
|
};
|
|
4356
4356
|
class ge {
|
|
4357
4357
|
constructor(e, t) {
|
|
@@ -4361,11 +4361,11 @@ class ge {
|
|
|
4361
4361
|
if (e.length < 2)
|
|
4362
4362
|
return t.error("Expected at least one argument.");
|
|
4363
4363
|
const n = e[0];
|
|
4364
|
-
if (!
|
|
4364
|
+
if (!Br[n])
|
|
4365
4365
|
throw new Error(`Can't parse ${n} as it is not part of the known types`);
|
|
4366
4366
|
if ((n === "to-boolean" || n === "to-string") && e.length !== 2)
|
|
4367
4367
|
return t.error("Expected one argument.");
|
|
4368
|
-
const a =
|
|
4368
|
+
const a = Br[n], o = [];
|
|
4369
4369
|
for (let i = 1; i < e.length; i++) {
|
|
4370
4370
|
const s = t.parse(e[i], i, A);
|
|
4371
4371
|
if (!s)
|
|
@@ -4387,7 +4387,7 @@ class ge {
|
|
|
4387
4387
|
const o = e.parseColor(t);
|
|
4388
4388
|
if (o)
|
|
4389
4389
|
return o;
|
|
4390
|
-
} 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 =
|
|
4390
|
+
} 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 = zn(t[0], t[1], t[2], t[3]), !n))
|
|
4391
4391
|
return new $(t[0] / 255, t[1] / 255, t[2] / 255, t[3]);
|
|
4392
4392
|
}
|
|
4393
4393
|
throw new D(n || `Could not parse color from value '${typeof t == "string" ? t : JSON.stringify(t)}'`);
|
|
@@ -4424,13 +4424,13 @@ class ge {
|
|
|
4424
4424
|
throw new D(`Could not convert ${JSON.stringify(t)} to number.`);
|
|
4425
4425
|
}
|
|
4426
4426
|
case "formatted":
|
|
4427
|
-
return fe.fromString(
|
|
4427
|
+
return fe.fromString(Be(this.args[0].evaluate(e)));
|
|
4428
4428
|
case "resolvedImage":
|
|
4429
|
-
return be.fromString(
|
|
4429
|
+
return be.fromString(Be(this.args[0].evaluate(e)));
|
|
4430
4430
|
case "projectionDefinition":
|
|
4431
4431
|
return this.args[0].evaluate(e);
|
|
4432
4432
|
default:
|
|
4433
|
-
return
|
|
4433
|
+
return Be(this.args[0].evaluate(e));
|
|
4434
4434
|
}
|
|
4435
4435
|
}
|
|
4436
4436
|
eachChild(e) {
|
|
@@ -4440,61 +4440,16 @@ class ge {
|
|
|
4440
4440
|
return this.args.every((e) => e.outputDefined());
|
|
4441
4441
|
}
|
|
4442
4442
|
}
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
return [r];
|
|
4446
|
-
const n = [];
|
|
4447
|
-
let a, o;
|
|
4448
|
-
for (const i of r) {
|
|
4449
|
-
const s = Pn(i);
|
|
4450
|
-
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));
|
|
4451
|
-
}
|
|
4452
|
-
return a && n.push(a), n;
|
|
4453
|
-
}
|
|
4454
|
-
function Pn(r) {
|
|
4455
|
-
let e = 0;
|
|
4456
|
-
for (let t = 0, n = r.length, a = n - 1, o, i; t < n; a = t++)
|
|
4457
|
-
o = r[t], i = r[a], e += (i.x - o.x) * (o.y + i.y);
|
|
4458
|
-
return e;
|
|
4459
|
-
}
|
|
4460
|
-
function Ai(r) {
|
|
4461
|
-
const e = r.length;
|
|
4462
|
-
for (let t = 0, n; t < e; t++) {
|
|
4463
|
-
const a = Pn(r[t]);
|
|
4464
|
-
if (a !== 0) {
|
|
4465
|
-
if (n === void 0)
|
|
4466
|
-
n = a < 0;
|
|
4467
|
-
else if (n === a < 0)
|
|
4468
|
-
return !0;
|
|
4469
|
-
}
|
|
4470
|
-
}
|
|
4471
|
-
return !1;
|
|
4472
|
-
}
|
|
4473
|
-
const Br = ["Unknown", "Point", "LineString", "Polygon"], Ti = {
|
|
4474
|
-
Unknown: "Unknown",
|
|
4475
|
-
Point: "Point",
|
|
4476
|
-
MultiPoint: "Point",
|
|
4477
|
-
LineString: "LineString",
|
|
4478
|
-
MultiLineString: "LineString",
|
|
4479
|
-
Polygon: "Polygon",
|
|
4480
|
-
MultiPolygon: "Polygon"
|
|
4481
|
-
};
|
|
4482
|
-
class Rn {
|
|
4443
|
+
const ki = ["Unknown", "Point", "LineString", "Polygon"];
|
|
4444
|
+
class _n {
|
|
4483
4445
|
constructor() {
|
|
4484
4446
|
this.globals = null, this.feature = null, this.featureState = null, this.formattedSection = null, this._parseColorCache = {}, this.availableImages = null, this.canonical = null;
|
|
4485
4447
|
}
|
|
4486
4448
|
id() {
|
|
4487
4449
|
return this.feature && "id" in this.feature ? this.feature.id : null;
|
|
4488
4450
|
}
|
|
4489
|
-
geometryDollarType() {
|
|
4490
|
-
return this.feature ? typeof this.feature.type == "number" ? Br[this.feature.type] : Ti[this.feature.type] : null;
|
|
4491
|
-
}
|
|
4492
4451
|
geometryType() {
|
|
4493
|
-
|
|
4494
|
-
if (typeof e != "number" || (e = Br[this.feature.type], e === "Unknown"))
|
|
4495
|
-
return e;
|
|
4496
|
-
const t = this.geometry();
|
|
4497
|
-
return t.length === 1 ? e : e !== "Polygon" ? `Multi${e}` : Ai(t) ? "MultiPolygon" : "Polygon";
|
|
4452
|
+
return this.feature ? typeof this.feature.type == "number" ? ki[this.feature.type] : this.feature.type : null;
|
|
4498
4453
|
}
|
|
4499
4454
|
geometry() {
|
|
4500
4455
|
return this.feature && "geometry" in this.feature ? this.feature.geometry : null;
|
|
@@ -4556,7 +4511,7 @@ class kt {
|
|
|
4556
4511
|
return null;
|
|
4557
4512
|
}
|
|
4558
4513
|
if (!(i instanceof je) && i.type.kind !== "resolvedImage" && this._isConstant(i)) {
|
|
4559
|
-
const s = new
|
|
4514
|
+
const s = new _n();
|
|
4560
4515
|
try {
|
|
4561
4516
|
i = new je(i.type, i.evaluate(s));
|
|
4562
4517
|
} catch (l) {
|
|
@@ -4694,7 +4649,7 @@ class ur {
|
|
|
4694
4649
|
if (e.length !== 3)
|
|
4695
4650
|
return t.error(`Expected 2 arguments, but found ${e.length - 1} instead.`);
|
|
4696
4651
|
const n = t.parse(e[1], 1, A), a = t.parse(e[2], 2, A);
|
|
4697
|
-
return !n || !a ? null : ir(n.type, [C,
|
|
4652
|
+
return !n || !a ? null : ir(n.type, [C, I, g, gt, A]) ? new ur(n, a) : t.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(n.type)} instead`);
|
|
4698
4653
|
}
|
|
4699
4654
|
evaluate(e) {
|
|
4700
4655
|
const t = this.needle.evaluate(e), n = this.haystack.evaluate(e);
|
|
@@ -4723,7 +4678,7 @@ class ut {
|
|
|
4723
4678
|
const n = t.parse(e[1], 1, A), a = t.parse(e[2], 2, A);
|
|
4724
4679
|
if (!n || !a)
|
|
4725
4680
|
return null;
|
|
4726
|
-
if (!ir(n.type, [C,
|
|
4681
|
+
if (!ir(n.type, [C, I, g, gt, A]))
|
|
4727
4682
|
return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(n.type)} instead`);
|
|
4728
4683
|
if (e.length === 4) {
|
|
4729
4684
|
const o = t.parse(e[3], 3, g);
|
|
@@ -4861,7 +4816,7 @@ class ct {
|
|
|
4861
4816
|
const n = t.parse(e[1], 1, A), a = t.parse(e[2], 2, g);
|
|
4862
4817
|
if (!n || !a)
|
|
4863
4818
|
return null;
|
|
4864
|
-
if (!ir(n.type, [W(A),
|
|
4819
|
+
if (!ir(n.type, [W(A), I, A]))
|
|
4865
4820
|
return t.error(`Expected first argument to be of type array or string, but found ${N(n.type)} instead`);
|
|
4866
4821
|
if (e.length === 4) {
|
|
4867
4822
|
const o = t.parse(e[3], 3, g);
|
|
@@ -4885,7 +4840,7 @@ class ct {
|
|
|
4885
4840
|
return !1;
|
|
4886
4841
|
}
|
|
4887
4842
|
}
|
|
4888
|
-
function
|
|
4843
|
+
function Pn(r, e) {
|
|
4889
4844
|
const t = r.length - 1;
|
|
4890
4845
|
let n = 0, a = t, o = 0, i, s;
|
|
4891
4846
|
for (; n <= a; )
|
|
@@ -4939,7 +4894,7 @@ class At {
|
|
|
4939
4894
|
const o = t.length;
|
|
4940
4895
|
if (a >= t[o - 1])
|
|
4941
4896
|
return n[o - 1].evaluate(e);
|
|
4942
|
-
const i =
|
|
4897
|
+
const i = Pn(t, a);
|
|
4943
4898
|
return n[i].evaluate(e);
|
|
4944
4899
|
}
|
|
4945
4900
|
eachChild(e) {
|
|
@@ -4951,13 +4906,13 @@ class At {
|
|
|
4951
4906
|
return this.outputs.every((e) => e.outputDefined());
|
|
4952
4907
|
}
|
|
4953
4908
|
}
|
|
4954
|
-
function
|
|
4909
|
+
function Li(r) {
|
|
4955
4910
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
4956
4911
|
}
|
|
4957
|
-
var qt,
|
|
4958
|
-
function
|
|
4959
|
-
if (
|
|
4960
|
-
|
|
4912
|
+
var qt, Ur;
|
|
4913
|
+
function Ci() {
|
|
4914
|
+
if (Ur) return qt;
|
|
4915
|
+
Ur = 1, qt = r;
|
|
4961
4916
|
function r(e, t, n, a) {
|
|
4962
4917
|
this.cx = 3 * e, this.bx = 3 * (n - e) - this.cx, this.ax = 1 - this.cx - this.bx, this.cy = 3 * t, this.by = 3 * (a - t) - this.cy, this.ay = 1 - this.cy - this.by, this.p1x = e, this.p1y = t, this.p2x = n, this.p2y = a;
|
|
4963
4918
|
}
|
|
@@ -4991,7 +4946,7 @@ function Ii() {
|
|
|
4991
4946
|
}
|
|
4992
4947
|
}, qt;
|
|
4993
4948
|
}
|
|
4994
|
-
var
|
|
4949
|
+
var Ai = Ci(), Ti = /* @__PURE__ */ Li(Ai);
|
|
4995
4950
|
class se {
|
|
4996
4951
|
constructor(e, t, n, a, o) {
|
|
4997
4952
|
this.type = e, this.operator = t, this.interpolation = n, this.input = a, this.labels = [], this.outputs = [];
|
|
@@ -5001,12 +4956,12 @@ class se {
|
|
|
5001
4956
|
static interpolationFactor(e, t, n, a) {
|
|
5002
4957
|
let o = 0;
|
|
5003
4958
|
if (e.name === "exponential")
|
|
5004
|
-
o =
|
|
4959
|
+
o = Bt(t, e.base, n, a);
|
|
5005
4960
|
else if (e.name === "linear")
|
|
5006
|
-
o =
|
|
4961
|
+
o = Bt(t, 1, n, a);
|
|
5007
4962
|
else if (e.name === "cubic-bezier") {
|
|
5008
4963
|
const i = e.controlPoints;
|
|
5009
|
-
o = new
|
|
4964
|
+
o = new Ti(i[0], i[1], i[2], i[3]).solve(Bt(t, 1, n, a));
|
|
5010
4965
|
}
|
|
5011
4966
|
return o;
|
|
5012
4967
|
}
|
|
@@ -5066,7 +5021,7 @@ class se {
|
|
|
5066
5021
|
const o = t.length;
|
|
5067
5022
|
if (a >= t[o - 1])
|
|
5068
5023
|
return n[o - 1].evaluate(e);
|
|
5069
|
-
const i =
|
|
5024
|
+
const i = Pn(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);
|
|
5070
5025
|
switch (this.operator) {
|
|
5071
5026
|
case "interpolate":
|
|
5072
5027
|
switch (this.type.kind) {
|
|
@@ -5098,7 +5053,7 @@ class se {
|
|
|
5098
5053
|
return this.outputs.every((e) => e.outputDefined());
|
|
5099
5054
|
}
|
|
5100
5055
|
}
|
|
5101
|
-
function
|
|
5056
|
+
function Bt(r, e, t, n) {
|
|
5102
5057
|
const a = n - t, o = r - t;
|
|
5103
5058
|
return a === 0 ? 0 : e === 1 ? o / a : (Math.pow(e, o) - 1) / (Math.pow(e, a) - 1);
|
|
5104
5059
|
}
|
|
@@ -5138,48 +5093,48 @@ class Ke {
|
|
|
5138
5093
|
return this.args.every((e) => e.outputDefined());
|
|
5139
5094
|
}
|
|
5140
5095
|
}
|
|
5141
|
-
function
|
|
5096
|
+
function Vr(r, e) {
|
|
5142
5097
|
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";
|
|
5143
5098
|
}
|
|
5144
|
-
function
|
|
5099
|
+
function Ii(r, e, t) {
|
|
5145
5100
|
return e === t;
|
|
5146
5101
|
}
|
|
5147
|
-
function
|
|
5102
|
+
function Ei(r, e, t) {
|
|
5148
5103
|
return e !== t;
|
|
5149
5104
|
}
|
|
5150
|
-
function
|
|
5105
|
+
function Mi(r, e, t) {
|
|
5151
5106
|
return e < t;
|
|
5152
5107
|
}
|
|
5153
|
-
function
|
|
5108
|
+
function zi(r, e, t) {
|
|
5154
5109
|
return e > t;
|
|
5155
5110
|
}
|
|
5156
|
-
function
|
|
5111
|
+
function _i(r, e, t) {
|
|
5157
5112
|
return e <= t;
|
|
5158
5113
|
}
|
|
5159
|
-
function
|
|
5114
|
+
function Pi(r, e, t) {
|
|
5160
5115
|
return e >= t;
|
|
5161
5116
|
}
|
|
5162
|
-
function
|
|
5117
|
+
function Rn(r, e, t, n) {
|
|
5163
5118
|
return n.compare(e, t) === 0;
|
|
5164
5119
|
}
|
|
5165
|
-
function
|
|
5166
|
-
return !
|
|
5120
|
+
function Ri(r, e, t, n) {
|
|
5121
|
+
return !Rn(r, e, t, n);
|
|
5167
5122
|
}
|
|
5168
|
-
function
|
|
5123
|
+
function $i(r, e, t, n) {
|
|
5169
5124
|
return n.compare(e, t) < 0;
|
|
5170
5125
|
}
|
|
5171
|
-
function
|
|
5126
|
+
function ji(r, e, t, n) {
|
|
5172
5127
|
return n.compare(e, t) > 0;
|
|
5173
5128
|
}
|
|
5174
|
-
function
|
|
5129
|
+
function Ni(r, e, t, n) {
|
|
5175
5130
|
return n.compare(e, t) <= 0;
|
|
5176
5131
|
}
|
|
5177
|
-
function
|
|
5132
|
+
function Fi(r, e, t, n) {
|
|
5178
5133
|
return n.compare(e, t) >= 0;
|
|
5179
5134
|
}
|
|
5180
5135
|
function Fe(r, e, t) {
|
|
5181
5136
|
const n = r !== "==" && r !== "!=";
|
|
5182
|
-
return class
|
|
5137
|
+
return class $n {
|
|
5183
5138
|
constructor(o, i, s) {
|
|
5184
5139
|
this.type = C, this.lhs = o, this.rhs = i, this.collator = s, this.hasUntypedArgument = o.type.kind === "value" || i.type.kind === "value";
|
|
5185
5140
|
}
|
|
@@ -5190,12 +5145,12 @@ function Fe(r, e, t) {
|
|
|
5190
5145
|
let l = i.parse(o[1], 1, A);
|
|
5191
5146
|
if (!l)
|
|
5192
5147
|
return null;
|
|
5193
|
-
if (!
|
|
5148
|
+
if (!Vr(s, l.type))
|
|
5194
5149
|
return i.concat(1).error(`"${s}" comparisons are not supported for type '${N(l.type)}'.`);
|
|
5195
5150
|
let u = i.parse(o[2], 2, A);
|
|
5196
5151
|
if (!u)
|
|
5197
5152
|
return null;
|
|
5198
|
-
if (!
|
|
5153
|
+
if (!Vr(s, u.type))
|
|
5199
5154
|
return i.concat(2).error(`"${s}" comparisons are not supported for type '${N(u.type)}'.`);
|
|
5200
5155
|
if (l.type.kind !== u.type.kind && l.type.kind !== "value" && u.type.kind !== "value")
|
|
5201
5156
|
return i.error(`Cannot compare types '${N(l.type)}' and '${N(u.type)}'.`);
|
|
@@ -5207,7 +5162,7 @@ function Fe(r, e, t) {
|
|
|
5207
5162
|
if (c = i.parse(o[3], 3, bt), !c)
|
|
5208
5163
|
return null;
|
|
5209
5164
|
}
|
|
5210
|
-
return new
|
|
5165
|
+
return new $n(l, u, c);
|
|
5211
5166
|
}
|
|
5212
5167
|
evaluate(o) {
|
|
5213
5168
|
const i = this.lhs.evaluate(o), s = this.rhs.evaluate(o);
|
|
@@ -5231,7 +5186,7 @@ function Fe(r, e, t) {
|
|
|
5231
5186
|
}
|
|
5232
5187
|
};
|
|
5233
5188
|
}
|
|
5234
|
-
const
|
|
5189
|
+
const Oi = Fe("==", Ii, Rn), Di = Fe("!=", Ei, Ri), qi = Fe("<", Mi, $i), Bi = Fe(">", zi, ji), Ui = Fe("<=", _i, Ni), Vi = Fe(">=", Pi, Fi);
|
|
5235
5190
|
class Tt {
|
|
5236
5191
|
constructor(e, t, n) {
|
|
5237
5192
|
this.type = bt, this.locale = n, this.caseSensitive = e, this.diacriticSensitive = t;
|
|
@@ -5249,7 +5204,7 @@ class Tt {
|
|
|
5249
5204
|
if (!o)
|
|
5250
5205
|
return null;
|
|
5251
5206
|
let i = null;
|
|
5252
|
-
return n.locale && (i = t.parse(n.locale, 1,
|
|
5207
|
+
return n.locale && (i = t.parse(n.locale, 1, I), !i) ? null : new Tt(a, o, i);
|
|
5253
5208
|
}
|
|
5254
5209
|
evaluate(e) {
|
|
5255
5210
|
return new sr(this.caseSensitive.evaluate(e), this.diacriticSensitive.evaluate(e), this.locale ? this.locale.evaluate(e) : null);
|
|
@@ -5263,7 +5218,7 @@ class Tt {
|
|
|
5263
5218
|
}
|
|
5264
5219
|
class fr {
|
|
5265
5220
|
constructor(e, t, n, a, o) {
|
|
5266
|
-
this.type =
|
|
5221
|
+
this.type = I, this.number = e, this.locale = t, this.currency = n, this.minFractionDigits = a, this.maxFractionDigits = o;
|
|
5267
5222
|
}
|
|
5268
5223
|
static parse(e, t) {
|
|
5269
5224
|
if (e.length !== 3)
|
|
@@ -5275,10 +5230,10 @@ class fr {
|
|
|
5275
5230
|
if (typeof a != "object" || Array.isArray(a))
|
|
5276
5231
|
return t.error("NumberFormat options argument must be an object.");
|
|
5277
5232
|
let o = null;
|
|
5278
|
-
if (a.locale && (o = t.parse(a.locale, 1,
|
|
5233
|
+
if (a.locale && (o = t.parse(a.locale, 1, I), !o))
|
|
5279
5234
|
return null;
|
|
5280
5235
|
let i = null;
|
|
5281
|
-
if (a.currency && (i = t.parse(a.currency, 1,
|
|
5236
|
+
if (a.currency && (i = t.parse(a.currency, 1, I), !i))
|
|
5282
5237
|
return null;
|
|
5283
5238
|
let s = null;
|
|
5284
5239
|
if (a["min-fraction-digits"] && (s = t.parse(a["min-fraction-digits"], 1, g), !s))
|
|
@@ -5321,7 +5276,7 @@ class dr {
|
|
|
5321
5276
|
if (s["font-scale"] && (l = t.parse(s["font-scale"], 1, g), !l))
|
|
5322
5277
|
return null;
|
|
5323
5278
|
let u = null;
|
|
5324
|
-
if (s["text-font"] && (u = t.parse(s["text-font"], 1, W(
|
|
5279
|
+
if (s["text-font"] && (u = t.parse(s["text-font"], 1, W(I)), !u))
|
|
5325
5280
|
return null;
|
|
5326
5281
|
let c = null;
|
|
5327
5282
|
if (s["text-color"] && (c = t.parse(s["text-color"], 1, ie), !c))
|
|
@@ -5343,7 +5298,7 @@ class dr {
|
|
|
5343
5298
|
evaluate(e) {
|
|
5344
5299
|
const t = (n) => {
|
|
5345
5300
|
const a = n.content.evaluate(e);
|
|
5346
|
-
return q(a) === Xe ? new Zt("", a, null, null, null) : new Zt(
|
|
5301
|
+
return q(a) === Xe ? new Zt("", a, null, null, null) : new Zt(Be(a), null, n.scale ? n.scale.evaluate(e) : null, n.font ? n.font.evaluate(e).join(",") : null, n.textColor ? n.textColor.evaluate(e) : null);
|
|
5347
5302
|
};
|
|
5348
5303
|
return new fe(this.sections.map(t));
|
|
5349
5304
|
}
|
|
@@ -5362,7 +5317,7 @@ class yr {
|
|
|
5362
5317
|
static parse(e, t) {
|
|
5363
5318
|
if (e.length !== 2)
|
|
5364
5319
|
return t.error("Expected two arguments.");
|
|
5365
|
-
const n = t.parse(e[1], 1,
|
|
5320
|
+
const n = t.parse(e[1], 1, I);
|
|
5366
5321
|
return n ? new yr(n) : t.error("No image name provided.");
|
|
5367
5322
|
}
|
|
5368
5323
|
evaluate(e) {
|
|
@@ -5402,24 +5357,24 @@ class mr {
|
|
|
5402
5357
|
}
|
|
5403
5358
|
}
|
|
5404
5359
|
const le = 8192;
|
|
5405
|
-
function
|
|
5406
|
-
const t =
|
|
5360
|
+
function Gi(r, e) {
|
|
5361
|
+
const t = Hi(r[0]), n = Wi(r[1]), a = Math.pow(2, e.z);
|
|
5407
5362
|
return [Math.round(t * a * le), Math.round(n * a * le)];
|
|
5408
5363
|
}
|
|
5409
5364
|
function hr(r, e) {
|
|
5410
5365
|
const t = Math.pow(2, e.z), n = (r[0] / le + e.x) / t, a = (r[1] / le + e.y) / t;
|
|
5411
|
-
return [
|
|
5366
|
+
return [Ki(n), Zi(a)];
|
|
5412
5367
|
}
|
|
5413
|
-
function
|
|
5368
|
+
function Hi(r) {
|
|
5414
5369
|
return (180 + r) / 360;
|
|
5415
5370
|
}
|
|
5416
|
-
function
|
|
5371
|
+
function Ki(r) {
|
|
5417
5372
|
return r * 360 - 180;
|
|
5418
5373
|
}
|
|
5419
|
-
function
|
|
5374
|
+
function Wi(r) {
|
|
5420
5375
|
return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + r * Math.PI / 360))) / 360;
|
|
5421
5376
|
}
|
|
5422
|
-
function
|
|
5377
|
+
function Zi(r) {
|
|
5423
5378
|
return 360 / Math.PI * Math.atan(Math.exp((180 - r * 360) * Math.PI / 180)) - 90;
|
|
5424
5379
|
}
|
|
5425
5380
|
function Qe(r, e) {
|
|
@@ -5428,21 +5383,21 @@ function Qe(r, e) {
|
|
|
5428
5383
|
function We(r, e) {
|
|
5429
5384
|
return !(r[0] <= e[0] || r[2] >= e[2] || r[1] <= e[1] || r[3] >= e[3]);
|
|
5430
5385
|
}
|
|
5431
|
-
function
|
|
5386
|
+
function Ji(r, e, t) {
|
|
5432
5387
|
return e[1] > r[1] != t[1] > r[1] && r[0] < (t[0] - e[0]) * (r[1] - e[1]) / (t[1] - e[1]) + e[0];
|
|
5433
5388
|
}
|
|
5434
|
-
function
|
|
5389
|
+
function Yi(r, e, t) {
|
|
5435
5390
|
const n = r[0] - e[0], a = r[1] - e[1], o = r[0] - t[0], i = r[1] - t[1];
|
|
5436
5391
|
return n * i - o * a === 0 && n * o <= 0 && a * i <= 0;
|
|
5437
5392
|
}
|
|
5438
|
-
function
|
|
5393
|
+
function It(r, e, t, n) {
|
|
5439
5394
|
const a = [e[0] - r[0], e[1] - r[1]], o = [n[0] - t[0], n[1] - t[1]];
|
|
5440
|
-
return
|
|
5395
|
+
return ts(o, a) === 0 ? !1 : !!(Gr(r, e, t, n) && Gr(t, n, r, e));
|
|
5441
5396
|
}
|
|
5442
|
-
function
|
|
5397
|
+
function Xi(r, e, t) {
|
|
5443
5398
|
for (const n of t)
|
|
5444
5399
|
for (let a = 0; a < n.length - 1; ++a)
|
|
5445
|
-
if (
|
|
5400
|
+
if (It(r, e, n[a], n[a + 1]))
|
|
5446
5401
|
return !0;
|
|
5447
5402
|
return !1;
|
|
5448
5403
|
}
|
|
@@ -5450,37 +5405,37 @@ function Oe(r, e, t = !1) {
|
|
|
5450
5405
|
let n = !1;
|
|
5451
5406
|
for (const a of e)
|
|
5452
5407
|
for (let o = 0; o < a.length - 1; o++) {
|
|
5453
|
-
if (
|
|
5408
|
+
if (Yi(r, a[o], a[o + 1]))
|
|
5454
5409
|
return t;
|
|
5455
|
-
|
|
5410
|
+
Ji(r, a[o], a[o + 1]) && (n = !n);
|
|
5456
5411
|
}
|
|
5457
5412
|
return n;
|
|
5458
5413
|
}
|
|
5459
|
-
function
|
|
5414
|
+
function Qi(r, e) {
|
|
5460
5415
|
for (const t of e)
|
|
5461
5416
|
if (Oe(r, t))
|
|
5462
5417
|
return !0;
|
|
5463
5418
|
return !1;
|
|
5464
5419
|
}
|
|
5465
|
-
function
|
|
5420
|
+
function jn(r, e) {
|
|
5466
5421
|
for (const t of r)
|
|
5467
5422
|
if (!Oe(t, e))
|
|
5468
5423
|
return !1;
|
|
5469
5424
|
for (let t = 0; t < r.length - 1; ++t)
|
|
5470
|
-
if (
|
|
5425
|
+
if (Xi(r[t], r[t + 1], e))
|
|
5471
5426
|
return !1;
|
|
5472
5427
|
return !0;
|
|
5473
5428
|
}
|
|
5474
|
-
function
|
|
5429
|
+
function es(r, e) {
|
|
5475
5430
|
for (const t of e)
|
|
5476
|
-
if (
|
|
5431
|
+
if (jn(r, t))
|
|
5477
5432
|
return !0;
|
|
5478
5433
|
return !1;
|
|
5479
5434
|
}
|
|
5480
|
-
function
|
|
5435
|
+
function ts(r, e) {
|
|
5481
5436
|
return r[0] * e[1] - r[1] * e[0];
|
|
5482
5437
|
}
|
|
5483
|
-
function
|
|
5438
|
+
function Gr(r, e, t, n) {
|
|
5484
5439
|
const a = r[0] - t[0], o = r[1] - t[1], i = e[0] - t[0], s = e[1] - t[1], l = n[0] - t[0], u = n[1] - t[1], c = a * u - l * o, p = i * u - l * s;
|
|
5485
5440
|
return c > 0 && p < 0 || c < 0 && p > 0;
|
|
5486
5441
|
}
|
|
@@ -5489,14 +5444,14 @@ function gr(r, e, t) {
|
|
|
5489
5444
|
for (let a = 0; a < r.length; a++) {
|
|
5490
5445
|
const o = [];
|
|
5491
5446
|
for (let i = 0; i < r[a].length; i++) {
|
|
5492
|
-
const s =
|
|
5447
|
+
const s = Gi(r[a][i], t);
|
|
5493
5448
|
Qe(e, s), o.push(s);
|
|
5494
5449
|
}
|
|
5495
5450
|
n.push(o);
|
|
5496
5451
|
}
|
|
5497
5452
|
return n;
|
|
5498
5453
|
}
|
|
5499
|
-
function
|
|
5454
|
+
function Nn(r, e, t) {
|
|
5500
5455
|
const n = [];
|
|
5501
5456
|
for (let a = 0; a < r.length; a++) {
|
|
5502
5457
|
const o = gr(r[a], e, t);
|
|
@@ -5504,7 +5459,7 @@ function On(r, e, t) {
|
|
|
5504
5459
|
}
|
|
5505
5460
|
return n;
|
|
5506
5461
|
}
|
|
5507
|
-
function
|
|
5462
|
+
function Fn(r, e, t, n) {
|
|
5508
5463
|
if (r[0] < t[0] || r[0] > t[2]) {
|
|
5509
5464
|
const a = n * 0.5;
|
|
5510
5465
|
let o = r[0] - t[0] > a ? -n : t[0] - r[0] > a ? n : 0;
|
|
@@ -5512,19 +5467,19 @@ function Dn(r, e, t, n) {
|
|
|
5512
5467
|
}
|
|
5513
5468
|
Qe(e, r);
|
|
5514
5469
|
}
|
|
5515
|
-
function
|
|
5470
|
+
function rs(r) {
|
|
5516
5471
|
r[0] = r[1] = 1 / 0, r[2] = r[3] = -1 / 0;
|
|
5517
5472
|
}
|
|
5518
|
-
function
|
|
5473
|
+
function Hr(r, e, t, n) {
|
|
5519
5474
|
const a = Math.pow(2, n.z) * le, o = [n.x * le, n.y * le], i = [];
|
|
5520
5475
|
for (const s of r)
|
|
5521
5476
|
for (const l of s) {
|
|
5522
5477
|
const u = [l.x + o[0], l.y + o[1]];
|
|
5523
|
-
|
|
5478
|
+
Fn(u, e, t, a), i.push(u);
|
|
5524
5479
|
}
|
|
5525
5480
|
return i;
|
|
5526
5481
|
}
|
|
5527
|
-
function
|
|
5482
|
+
function Kr(r, e, t, n) {
|
|
5528
5483
|
const a = Math.pow(2, n.z) * le, o = [n.x * le, n.y * le], i = [];
|
|
5529
5484
|
for (const s of r) {
|
|
5530
5485
|
const l = [];
|
|
@@ -5535,17 +5490,17 @@ function Wr(r, e, t, n) {
|
|
|
5535
5490
|
i.push(l);
|
|
5536
5491
|
}
|
|
5537
5492
|
if (e[2] - e[0] <= a / 2) {
|
|
5538
|
-
|
|
5493
|
+
rs(e);
|
|
5539
5494
|
for (const s of i)
|
|
5540
5495
|
for (const l of s)
|
|
5541
|
-
|
|
5496
|
+
Fn(l, e, t, a);
|
|
5542
5497
|
}
|
|
5543
5498
|
return i;
|
|
5544
5499
|
}
|
|
5545
|
-
function
|
|
5500
|
+
function ns(r, e) {
|
|
5546
5501
|
const t = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n = [1 / 0, 1 / 0, -1 / 0, -1 / 0], a = r.canonicalID();
|
|
5547
5502
|
if (e.type === "Polygon") {
|
|
5548
|
-
const o = gr(e.coordinates, n, a), i =
|
|
5503
|
+
const o = gr(e.coordinates, n, a), i = Hr(r.geometry(), t, n, a);
|
|
5549
5504
|
if (!We(t, n))
|
|
5550
5505
|
return !1;
|
|
5551
5506
|
for (const s of i)
|
|
@@ -5553,31 +5508,31 @@ function ss(r, e) {
|
|
|
5553
5508
|
return !1;
|
|
5554
5509
|
}
|
|
5555
5510
|
if (e.type === "MultiPolygon") {
|
|
5556
|
-
const o =
|
|
5511
|
+
const o = Nn(e.coordinates, n, a), i = Hr(r.geometry(), t, n, a);
|
|
5557
5512
|
if (!We(t, n))
|
|
5558
5513
|
return !1;
|
|
5559
5514
|
for (const s of i)
|
|
5560
|
-
if (!
|
|
5515
|
+
if (!Qi(s, o))
|
|
5561
5516
|
return !1;
|
|
5562
5517
|
}
|
|
5563
5518
|
return !0;
|
|
5564
5519
|
}
|
|
5565
|
-
function
|
|
5520
|
+
function as(r, e) {
|
|
5566
5521
|
const t = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n = [1 / 0, 1 / 0, -1 / 0, -1 / 0], a = r.canonicalID();
|
|
5567
5522
|
if (e.type === "Polygon") {
|
|
5568
|
-
const o = gr(e.coordinates, n, a), i =
|
|
5523
|
+
const o = gr(e.coordinates, n, a), i = Kr(r.geometry(), t, n, a);
|
|
5569
5524
|
if (!We(t, n))
|
|
5570
5525
|
return !1;
|
|
5571
5526
|
for (const s of i)
|
|
5572
|
-
if (!
|
|
5527
|
+
if (!jn(s, o))
|
|
5573
5528
|
return !1;
|
|
5574
5529
|
}
|
|
5575
5530
|
if (e.type === "MultiPolygon") {
|
|
5576
|
-
const o =
|
|
5531
|
+
const o = Nn(e.coordinates, n, a), i = Kr(r.geometry(), t, n, a);
|
|
5577
5532
|
if (!We(t, n))
|
|
5578
5533
|
return !1;
|
|
5579
5534
|
for (const s of i)
|
|
5580
|
-
if (!
|
|
5535
|
+
if (!es(s, o))
|
|
5581
5536
|
return !1;
|
|
5582
5537
|
}
|
|
5583
5538
|
return !0;
|
|
@@ -5615,10 +5570,10 @@ class Ce {
|
|
|
5615
5570
|
}
|
|
5616
5571
|
evaluate(e) {
|
|
5617
5572
|
if (e.geometry() != null && e.canonicalID() != null) {
|
|
5618
|
-
if (e.
|
|
5619
|
-
return
|
|
5620
|
-
if (e.
|
|
5621
|
-
return
|
|
5573
|
+
if (e.geometryType() === "Point")
|
|
5574
|
+
return ns(e, this.geometries);
|
|
5575
|
+
if (e.geometryType() === "LineString")
|
|
5576
|
+
return as(e, this.geometries);
|
|
5622
5577
|
}
|
|
5623
5578
|
return !1;
|
|
5624
5579
|
}
|
|
@@ -5628,7 +5583,7 @@ class Ce {
|
|
|
5628
5583
|
return !0;
|
|
5629
5584
|
}
|
|
5630
5585
|
}
|
|
5631
|
-
class
|
|
5586
|
+
class On {
|
|
5632
5587
|
constructor(e = [], t = (n, a) => n < a ? -1 : n > a ? 1 : 0) {
|
|
5633
5588
|
if (this.data = e, this.length = this.data.length, this.compare = t, this.length > 0)
|
|
5634
5589
|
for (let n = (this.length >> 1) - 1; n >= 0; n--) this._down(n);
|
|
@@ -5664,11 +5619,28 @@ class qn {
|
|
|
5664
5619
|
t[e] = o;
|
|
5665
5620
|
}
|
|
5666
5621
|
}
|
|
5667
|
-
|
|
5622
|
+
function os(r, e) {
|
|
5623
|
+
if (r.length <= 1)
|
|
5624
|
+
return [r];
|
|
5625
|
+
const n = [];
|
|
5626
|
+
let a, o;
|
|
5627
|
+
for (const i of r) {
|
|
5628
|
+
const s = is(i);
|
|
5629
|
+
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));
|
|
5630
|
+
}
|
|
5631
|
+
return a && n.push(a), n;
|
|
5632
|
+
}
|
|
5633
|
+
function is(r) {
|
|
5634
|
+
let e = 0;
|
|
5635
|
+
for (let t = 0, n = r.length, a = n - 1, o, i; t < n; a = t++)
|
|
5636
|
+
o = r[t], i = r[a], e += (i.x - o.x) * (o.y + i.y);
|
|
5637
|
+
return e;
|
|
5638
|
+
}
|
|
5639
|
+
const ss = 6378.137, Wr = 1 / 298.257223563, Zr = Wr * (2 - Wr), Jr = Math.PI / 180;
|
|
5668
5640
|
class vr {
|
|
5669
5641
|
constructor(e) {
|
|
5670
|
-
const t =
|
|
5671
|
-
this.kx = t * o * n, this.ky = t * o * a * (1 -
|
|
5642
|
+
const t = Jr * ss * 1e3, n = Math.cos(e * Jr), a = 1 / (1 - Zr * (1 - n * n)), o = Math.sqrt(a);
|
|
5643
|
+
this.kx = t * o * n, this.ky = t * o * a * (1 - Zr);
|
|
5672
5644
|
}
|
|
5673
5645
|
/**
|
|
5674
5646
|
* Given two points of the form [longitude, latitude], returns the distance.
|
|
@@ -5719,7 +5691,7 @@ class vr {
|
|
|
5719
5691
|
}
|
|
5720
5692
|
}
|
|
5721
5693
|
const Jt = 100, Yt = 50;
|
|
5722
|
-
function
|
|
5694
|
+
function Dn(r, e) {
|
|
5723
5695
|
return e[0] - r[0];
|
|
5724
5696
|
}
|
|
5725
5697
|
function pt(r) {
|
|
@@ -5764,11 +5736,11 @@ function er(r) {
|
|
|
5764
5736
|
Qe(e, n);
|
|
5765
5737
|
return e;
|
|
5766
5738
|
}
|
|
5767
|
-
function
|
|
5739
|
+
function Yr(r) {
|
|
5768
5740
|
return r[0] !== -1 / 0 && r[1] !== -1 / 0 && r[2] !== 1 / 0 && r[3] !== 1 / 0;
|
|
5769
5741
|
}
|
|
5770
5742
|
function br(r, e, t) {
|
|
5771
|
-
if (!
|
|
5743
|
+
if (!Yr(r) || !Yr(e))
|
|
5772
5744
|
return NaN;
|
|
5773
5745
|
let n = 0, a = 0;
|
|
5774
5746
|
return r[2] < e[0] && (n = e[0] - r[2]), r[0] > e[2] && (n = r[0] - e[2]), r[1] > e[3] && (a = r[1] - e[3]), r[3] < e[1] && (a = e[1] - r[3]), t.distance([0, 0], [n, a]);
|
|
@@ -5781,7 +5753,7 @@ function wr(r, e, t, n, a) {
|
|
|
5781
5753
|
const o = Math.min(ke(r, [t, n], a), ke(e, [t, n], a)), i = Math.min(ke(t, [r, e], a), ke(n, [r, e], a));
|
|
5782
5754
|
return Math.min(o, i);
|
|
5783
5755
|
}
|
|
5784
|
-
function
|
|
5756
|
+
function ls(r, e, t, n, a) {
|
|
5785
5757
|
if (!(de(e, r.length) && de(n, t.length)))
|
|
5786
5758
|
return 1 / 0;
|
|
5787
5759
|
let i = 1 / 0;
|
|
@@ -5789,14 +5761,14 @@ function cs(r, e, t, n, a) {
|
|
|
5789
5761
|
const l = r[s], u = r[s + 1];
|
|
5790
5762
|
for (let c = n[0]; c < n[1]; ++c) {
|
|
5791
5763
|
const p = t[c], m = t[c + 1];
|
|
5792
|
-
if (
|
|
5764
|
+
if (It(l, u, p, m))
|
|
5793
5765
|
return 0;
|
|
5794
5766
|
i = Math.min(i, wr(l, u, p, m, a));
|
|
5795
5767
|
}
|
|
5796
5768
|
}
|
|
5797
5769
|
return i;
|
|
5798
5770
|
}
|
|
5799
|
-
function
|
|
5771
|
+
function us(r, e, t, n, a) {
|
|
5800
5772
|
if (!(de(e, r.length) && de(n, t.length)))
|
|
5801
5773
|
return NaN;
|
|
5802
5774
|
let i = 1 / 0;
|
|
@@ -5806,7 +5778,7 @@ function ps(r, e, t, n, a) {
|
|
|
5806
5778
|
return i;
|
|
5807
5779
|
return i;
|
|
5808
5780
|
}
|
|
5809
|
-
function
|
|
5781
|
+
function cs(r, e, t) {
|
|
5810
5782
|
if (Oe(r, e, !0))
|
|
5811
5783
|
return 0;
|
|
5812
5784
|
let n = 1 / 0;
|
|
@@ -5820,7 +5792,7 @@ function fs(r, e, t) {
|
|
|
5820
5792
|
}
|
|
5821
5793
|
return n;
|
|
5822
5794
|
}
|
|
5823
|
-
function
|
|
5795
|
+
function ps(r, e, t, n) {
|
|
5824
5796
|
if (!de(e, r.length))
|
|
5825
5797
|
return NaN;
|
|
5826
5798
|
for (let o = e[0]; o <= e[1]; ++o)
|
|
@@ -5832,28 +5804,28 @@ function ds(r, e, t, n) {
|
|
|
5832
5804
|
for (const l of t)
|
|
5833
5805
|
for (let u = 0, c = l.length, p = c - 1; u < c; p = u++) {
|
|
5834
5806
|
const m = l[p], f = l[u];
|
|
5835
|
-
if (
|
|
5807
|
+
if (It(i, s, m, f))
|
|
5836
5808
|
return 0;
|
|
5837
5809
|
a = Math.min(a, wr(i, s, m, f, n));
|
|
5838
5810
|
}
|
|
5839
5811
|
}
|
|
5840
5812
|
return a;
|
|
5841
5813
|
}
|
|
5842
|
-
function
|
|
5814
|
+
function Xr(r, e) {
|
|
5843
5815
|
for (const t of r)
|
|
5844
5816
|
for (const n of t)
|
|
5845
5817
|
if (Oe(n, e, !0))
|
|
5846
5818
|
return !0;
|
|
5847
5819
|
return !1;
|
|
5848
5820
|
}
|
|
5849
|
-
function
|
|
5821
|
+
function fs(r, e, t, n = 1 / 0) {
|
|
5850
5822
|
const a = er(r), o = er(e);
|
|
5851
5823
|
if (n !== 1 / 0 && br(a, o, t) >= n)
|
|
5852
5824
|
return n;
|
|
5853
5825
|
if (We(a, o)) {
|
|
5854
|
-
if (
|
|
5826
|
+
if (Xr(r, e))
|
|
5855
5827
|
return 0;
|
|
5856
|
-
} else if (
|
|
5828
|
+
} else if (Xr(e, r))
|
|
5857
5829
|
return 0;
|
|
5858
5830
|
let i = 1 / 0;
|
|
5859
5831
|
for (const s of r)
|
|
@@ -5862,14 +5834,14 @@ function ys(r, e, t, n = 1 / 0) {
|
|
|
5862
5834
|
for (const f of e)
|
|
5863
5835
|
for (let d = 0, y = f.length, v = y - 1; d < y; v = d++) {
|
|
5864
5836
|
const w = f[v], b = f[d];
|
|
5865
|
-
if (
|
|
5837
|
+
if (It(p, m, w, b))
|
|
5866
5838
|
return 0;
|
|
5867
5839
|
i = Math.min(i, wr(p, m, w, b, t));
|
|
5868
5840
|
}
|
|
5869
5841
|
}
|
|
5870
5842
|
return i;
|
|
5871
5843
|
}
|
|
5872
|
-
function
|
|
5844
|
+
function Qr(r, e, t, n, a, o) {
|
|
5873
5845
|
if (!o)
|
|
5874
5846
|
return;
|
|
5875
5847
|
const i = br(Qt(n, o), a, t);
|
|
@@ -5885,7 +5857,7 @@ function ft(r, e, t, n, a = 1 / 0) {
|
|
|
5885
5857
|
let o = Math.min(n.distance(r[0], t[0][0]), a);
|
|
5886
5858
|
if (o === 0)
|
|
5887
5859
|
return o;
|
|
5888
|
-
const i = new
|
|
5860
|
+
const i = new On([[0, [0, r.length - 1], [0, 0]]], Dn), s = er(t);
|
|
5889
5861
|
for (; i.length > 0; ) {
|
|
5890
5862
|
const l = i.pop();
|
|
5891
5863
|
if (l[0] >= o)
|
|
@@ -5895,19 +5867,19 @@ function ft(r, e, t, n, a = 1 / 0) {
|
|
|
5895
5867
|
if (!de(u, r.length))
|
|
5896
5868
|
return NaN;
|
|
5897
5869
|
if (e) {
|
|
5898
|
-
const p =
|
|
5870
|
+
const p = ps(r, u, t, n);
|
|
5899
5871
|
if (isNaN(p) || p === 0)
|
|
5900
5872
|
return p;
|
|
5901
5873
|
o = Math.min(o, p);
|
|
5902
5874
|
} else
|
|
5903
5875
|
for (let p = u[0]; p <= u[1]; ++p) {
|
|
5904
|
-
const m =
|
|
5876
|
+
const m = cs(r[p], t, n);
|
|
5905
5877
|
if (o = Math.min(o, m), o === 0)
|
|
5906
5878
|
return 0;
|
|
5907
5879
|
}
|
|
5908
5880
|
} else {
|
|
5909
5881
|
const p = Xt(u, e);
|
|
5910
|
-
|
|
5882
|
+
Qr(i, o, n, r, s, p[0]), Qr(i, o, n, r, s, p[1]);
|
|
5911
5883
|
}
|
|
5912
5884
|
}
|
|
5913
5885
|
return o;
|
|
@@ -5916,7 +5888,7 @@ function dt(r, e, t, n, a, o = 1 / 0) {
|
|
|
5916
5888
|
let i = Math.min(o, a.distance(r[0], t[0]));
|
|
5917
5889
|
if (i === 0)
|
|
5918
5890
|
return i;
|
|
5919
|
-
const s = new
|
|
5891
|
+
const s = new On([[0, [0, r.length - 1], [0, t.length - 1]]], Dn);
|
|
5920
5892
|
for (; s.length > 0; ) {
|
|
5921
5893
|
const l = s.pop();
|
|
5922
5894
|
if (l[0] >= i)
|
|
@@ -5927,7 +5899,7 @@ function dt(r, e, t, n, a, o = 1 / 0) {
|
|
|
5927
5899
|
return NaN;
|
|
5928
5900
|
let f;
|
|
5929
5901
|
if (e && n)
|
|
5930
|
-
f =
|
|
5902
|
+
f = ls(r, u, t, c, a), i = Math.min(i, f);
|
|
5931
5903
|
else if (e && !n) {
|
|
5932
5904
|
const d = r.slice(u[0], u[1] + 1);
|
|
5933
5905
|
for (let y = c[0]; y <= c[1]; ++y)
|
|
@@ -5939,7 +5911,7 @@ function dt(r, e, t, n, a, o = 1 / 0) {
|
|
|
5939
5911
|
if (f = ke(r[y], d, a), i = Math.min(i, f), i === 0)
|
|
5940
5912
|
return i;
|
|
5941
5913
|
} else
|
|
5942
|
-
f =
|
|
5914
|
+
f = us(r, u, t, c, a), i = Math.min(i, f);
|
|
5943
5915
|
} else {
|
|
5944
5916
|
const f = Xt(u, e), d = Xt(c, n);
|
|
5945
5917
|
at(s, i, a, r, t, f[0], d[0]), at(s, i, a, r, t, f[0], d[1]), at(s, i, a, r, t, f[1], d[0]), at(s, i, a, r, t, f[1], d[1]);
|
|
@@ -5947,7 +5919,7 @@ function dt(r, e, t, n, a, o = 1 / 0) {
|
|
|
5947
5919
|
}
|
|
5948
5920
|
return i;
|
|
5949
5921
|
}
|
|
5950
|
-
function
|
|
5922
|
+
function ds(r, e) {
|
|
5951
5923
|
const t = r.geometry(), n = t.flat().map((i) => hr([i.x, i.y], r.canonical));
|
|
5952
5924
|
if (t.length === 0)
|
|
5953
5925
|
return NaN;
|
|
@@ -5970,7 +5942,7 @@ function ms(r, e) {
|
|
|
5970
5942
|
}
|
|
5971
5943
|
return o;
|
|
5972
5944
|
}
|
|
5973
|
-
function
|
|
5945
|
+
function ys(r, e) {
|
|
5974
5946
|
const t = r.geometry(), n = t.flat().map((i) => hr([i.x, i.y], r.canonical));
|
|
5975
5947
|
if (t.length === 0)
|
|
5976
5948
|
return NaN;
|
|
@@ -5993,11 +5965,11 @@ function hs(r, e) {
|
|
|
5993
5965
|
}
|
|
5994
5966
|
return o;
|
|
5995
5967
|
}
|
|
5996
|
-
function
|
|
5968
|
+
function ms(r, e) {
|
|
5997
5969
|
const t = r.geometry();
|
|
5998
5970
|
if (t.length === 0 || t[0].length === 0)
|
|
5999
5971
|
return NaN;
|
|
6000
|
-
const n =
|
|
5972
|
+
const n = os(t).map((i) => i.map((s) => s.map((l) => hr([l.x, l.y], r.canonical)))), a = new vr(n[0][0][0][1]);
|
|
6001
5973
|
let o = 1 / 0;
|
|
6002
5974
|
for (const i of e)
|
|
6003
5975
|
for (const s of n) {
|
|
@@ -6009,7 +5981,7 @@ function gs(r, e) {
|
|
|
6009
5981
|
o = Math.min(o, ft(i.coordinates, !0, s, a, o));
|
|
6010
5982
|
break;
|
|
6011
5983
|
case "Polygon":
|
|
6012
|
-
o = Math.min(o,
|
|
5984
|
+
o = Math.min(o, fs(s, i.coordinates, a, o));
|
|
6013
5985
|
break;
|
|
6014
5986
|
}
|
|
6015
5987
|
if (o === 0)
|
|
@@ -6017,7 +5989,7 @@ function gs(r, e) {
|
|
|
6017
5989
|
}
|
|
6018
5990
|
return o;
|
|
6019
5991
|
}
|
|
6020
|
-
function
|
|
5992
|
+
function Ut(r) {
|
|
6021
5993
|
return r.type === "MultiPolygon" ? r.coordinates.map((e) => ({
|
|
6022
5994
|
type: "Polygon",
|
|
6023
5995
|
coordinates: e
|
|
@@ -6039,22 +6011,22 @@ class Ae {
|
|
|
6039
6011
|
if (He(e[1])) {
|
|
6040
6012
|
const n = e[1];
|
|
6041
6013
|
if (n.type === "FeatureCollection")
|
|
6042
|
-
return new Ae(n, n.features.map((a) =>
|
|
6014
|
+
return new Ae(n, n.features.map((a) => Ut(a.geometry)).flat());
|
|
6043
6015
|
if (n.type === "Feature")
|
|
6044
|
-
return new Ae(n,
|
|
6016
|
+
return new Ae(n, Ut(n.geometry));
|
|
6045
6017
|
if ("type" in n && "coordinates" in n)
|
|
6046
|
-
return new Ae(n,
|
|
6018
|
+
return new Ae(n, Ut(n));
|
|
6047
6019
|
}
|
|
6048
6020
|
return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.");
|
|
6049
6021
|
}
|
|
6050
6022
|
evaluate(e) {
|
|
6051
6023
|
if (e.geometry() != null && e.canonicalID() != null) {
|
|
6052
6024
|
if (e.geometryType() === "Point")
|
|
6053
|
-
return
|
|
6025
|
+
return ds(e, this.geometries);
|
|
6054
6026
|
if (e.geometryType() === "LineString")
|
|
6055
|
-
return
|
|
6027
|
+
return ys(e, this.geometries);
|
|
6056
6028
|
if (e.geometryType() === "Polygon")
|
|
6057
|
-
return
|
|
6029
|
+
return ms(e, this.geometries);
|
|
6058
6030
|
}
|
|
6059
6031
|
return NaN;
|
|
6060
6032
|
}
|
|
@@ -6066,12 +6038,12 @@ class Ae {
|
|
|
6066
6038
|
}
|
|
6067
6039
|
const Sr = {
|
|
6068
6040
|
// special forms
|
|
6069
|
-
"==":
|
|
6070
|
-
"!=":
|
|
6071
|
-
">":
|
|
6072
|
-
"<":
|
|
6073
|
-
">=":
|
|
6074
|
-
"<=":
|
|
6041
|
+
"==": Oi,
|
|
6042
|
+
"!=": Di,
|
|
6043
|
+
">": Bi,
|
|
6044
|
+
"<": qi,
|
|
6045
|
+
">=": Vi,
|
|
6046
|
+
"<=": Ui,
|
|
6075
6047
|
array: te,
|
|
6076
6048
|
at: lr,
|
|
6077
6049
|
boolean: te,
|
|
@@ -6151,7 +6123,7 @@ class re {
|
|
|
6151
6123
|
if (s.length === 1)
|
|
6152
6124
|
t.errors.push(...l.errors);
|
|
6153
6125
|
else {
|
|
6154
|
-
const c = (s.length ? s : i).map(([m]) =>
|
|
6126
|
+
const c = (s.length ? s : i).map(([m]) => gs(m)).join(" | "), p = [];
|
|
6155
6127
|
for (let m = 1; m < e.length; m++) {
|
|
6156
6128
|
const f = t.parse(e[m], 1 + p.length);
|
|
6157
6129
|
if (!f)
|
|
@@ -6168,21 +6140,21 @@ class re {
|
|
|
6168
6140
|
e[n] = re;
|
|
6169
6141
|
}
|
|
6170
6142
|
}
|
|
6171
|
-
function
|
|
6143
|
+
function en(r, [e, t, n, a]) {
|
|
6172
6144
|
e = e.evaluate(r), t = t.evaluate(r), n = n.evaluate(r);
|
|
6173
|
-
const o = a ? a.evaluate(r) : 1, i =
|
|
6145
|
+
const o = a ? a.evaluate(r) : 1, i = zn(e, t, n, o);
|
|
6174
6146
|
if (i)
|
|
6175
6147
|
throw new D(i);
|
|
6176
6148
|
return new $(e / 255, t / 255, n / 255, o, !1);
|
|
6177
6149
|
}
|
|
6178
|
-
function
|
|
6150
|
+
function tn(r, e) {
|
|
6179
6151
|
return r in e;
|
|
6180
6152
|
}
|
|
6181
6153
|
function Vt(r, e) {
|
|
6182
6154
|
const t = e[r];
|
|
6183
6155
|
return typeof t > "u" ? null : t;
|
|
6184
6156
|
}
|
|
6185
|
-
function
|
|
6157
|
+
function hs(r, e, t, n) {
|
|
6186
6158
|
for (; t <= n; ) {
|
|
6187
6159
|
const a = t + n >> 1;
|
|
6188
6160
|
if (e[a] === r)
|
|
@@ -6196,14 +6168,14 @@ function xe(r) {
|
|
|
6196
6168
|
}
|
|
6197
6169
|
re.register(Sr, {
|
|
6198
6170
|
error: [
|
|
6199
|
-
|
|
6200
|
-
[
|
|
6171
|
+
fi,
|
|
6172
|
+
[I],
|
|
6201
6173
|
(r, [e]) => {
|
|
6202
6174
|
throw new D(e.evaluate(r));
|
|
6203
6175
|
}
|
|
6204
6176
|
],
|
|
6205
6177
|
typeof: [
|
|
6206
|
-
|
|
6178
|
+
I,
|
|
6207
6179
|
[A],
|
|
6208
6180
|
(r, [e]) => N(q(e.evaluate(r)))
|
|
6209
6181
|
],
|
|
@@ -6218,23 +6190,23 @@ re.register(Sr, {
|
|
|
6218
6190
|
rgb: [
|
|
6219
6191
|
ie,
|
|
6220
6192
|
[g, g, g],
|
|
6221
|
-
|
|
6193
|
+
en
|
|
6222
6194
|
],
|
|
6223
6195
|
rgba: [
|
|
6224
6196
|
ie,
|
|
6225
6197
|
[g, g, g, g],
|
|
6226
|
-
|
|
6198
|
+
en
|
|
6227
6199
|
],
|
|
6228
6200
|
has: {
|
|
6229
6201
|
type: C,
|
|
6230
6202
|
overloads: [
|
|
6231
6203
|
[
|
|
6232
|
-
[
|
|
6233
|
-
(r, [e]) =>
|
|
6204
|
+
[I],
|
|
6205
|
+
(r, [e]) => tn(e.evaluate(r), r.properties())
|
|
6234
6206
|
],
|
|
6235
6207
|
[
|
|
6236
|
-
[
|
|
6237
|
-
(r, [e, t]) =>
|
|
6208
|
+
[I, Re],
|
|
6209
|
+
(r, [e, t]) => tn(e.evaluate(r), t.evaluate(r))
|
|
6238
6210
|
]
|
|
6239
6211
|
]
|
|
6240
6212
|
},
|
|
@@ -6242,18 +6214,18 @@ re.register(Sr, {
|
|
|
6242
6214
|
type: A,
|
|
6243
6215
|
overloads: [
|
|
6244
6216
|
[
|
|
6245
|
-
[
|
|
6217
|
+
[I],
|
|
6246
6218
|
(r, [e]) => Vt(e.evaluate(r), r.properties())
|
|
6247
6219
|
],
|
|
6248
6220
|
[
|
|
6249
|
-
[
|
|
6221
|
+
[I, Re],
|
|
6250
6222
|
(r, [e, t]) => Vt(e.evaluate(r), t.evaluate(r))
|
|
6251
6223
|
]
|
|
6252
6224
|
]
|
|
6253
6225
|
},
|
|
6254
6226
|
"feature-state": [
|
|
6255
6227
|
A,
|
|
6256
|
-
[
|
|
6228
|
+
[I],
|
|
6257
6229
|
(r, [e]) => Vt(e.evaluate(r), r.featureState || {})
|
|
6258
6230
|
],
|
|
6259
6231
|
properties: [
|
|
@@ -6262,7 +6234,7 @@ re.register(Sr, {
|
|
|
6262
6234
|
(r) => r.properties()
|
|
6263
6235
|
],
|
|
6264
6236
|
"geometry-type": [
|
|
6265
|
-
|
|
6237
|
+
I,
|
|
6266
6238
|
[],
|
|
6267
6239
|
(r) => r.geometryType()
|
|
6268
6240
|
],
|
|
@@ -6439,7 +6411,7 @@ re.register(Sr, {
|
|
|
6439
6411
|
],
|
|
6440
6412
|
"filter-==": [
|
|
6441
6413
|
C,
|
|
6442
|
-
[
|
|
6414
|
+
[I, A],
|
|
6443
6415
|
(r, [e, t]) => r.properties()[e.value] === t.value
|
|
6444
6416
|
],
|
|
6445
6417
|
"filter-id-==": [
|
|
@@ -6449,12 +6421,12 @@ re.register(Sr, {
|
|
|
6449
6421
|
],
|
|
6450
6422
|
"filter-type-==": [
|
|
6451
6423
|
C,
|
|
6452
|
-
[
|
|
6453
|
-
(r, [e]) => r.
|
|
6424
|
+
[I],
|
|
6425
|
+
(r, [e]) => r.geometryType() === e.value
|
|
6454
6426
|
],
|
|
6455
6427
|
"filter-<": [
|
|
6456
6428
|
C,
|
|
6457
|
-
[
|
|
6429
|
+
[I, A],
|
|
6458
6430
|
(r, [e, t]) => {
|
|
6459
6431
|
const n = r.properties()[e.value], a = t.value;
|
|
6460
6432
|
return typeof n == typeof a && n < a;
|
|
@@ -6470,7 +6442,7 @@ re.register(Sr, {
|
|
|
6470
6442
|
],
|
|
6471
6443
|
"filter->": [
|
|
6472
6444
|
C,
|
|
6473
|
-
[
|
|
6445
|
+
[I, A],
|
|
6474
6446
|
(r, [e, t]) => {
|
|
6475
6447
|
const n = r.properties()[e.value], a = t.value;
|
|
6476
6448
|
return typeof n == typeof a && n > a;
|
|
@@ -6486,7 +6458,7 @@ re.register(Sr, {
|
|
|
6486
6458
|
],
|
|
6487
6459
|
"filter-<=": [
|
|
6488
6460
|
C,
|
|
6489
|
-
[
|
|
6461
|
+
[I, A],
|
|
6490
6462
|
(r, [e, t]) => {
|
|
6491
6463
|
const n = r.properties()[e.value], a = t.value;
|
|
6492
6464
|
return typeof n == typeof a && n <= a;
|
|
@@ -6502,7 +6474,7 @@ re.register(Sr, {
|
|
|
6502
6474
|
],
|
|
6503
6475
|
"filter->=": [
|
|
6504
6476
|
C,
|
|
6505
|
-
[
|
|
6477
|
+
[I, A],
|
|
6506
6478
|
(r, [e, t]) => {
|
|
6507
6479
|
const n = r.properties()[e.value], a = t.value;
|
|
6508
6480
|
return typeof n == typeof a && n >= a;
|
|
@@ -6528,8 +6500,8 @@ re.register(Sr, {
|
|
|
6528
6500
|
],
|
|
6529
6501
|
"filter-type-in": [
|
|
6530
6502
|
C,
|
|
6531
|
-
[W(
|
|
6532
|
-
(r, [e]) => e.value.indexOf(r.
|
|
6503
|
+
[W(I)],
|
|
6504
|
+
(r, [e]) => e.value.indexOf(r.geometryType()) >= 0
|
|
6533
6505
|
],
|
|
6534
6506
|
"filter-id-in": [
|
|
6535
6507
|
C,
|
|
@@ -6538,15 +6510,15 @@ re.register(Sr, {
|
|
|
6538
6510
|
],
|
|
6539
6511
|
"filter-in-small": [
|
|
6540
6512
|
C,
|
|
6541
|
-
[
|
|
6513
|
+
[I, W(A)],
|
|
6542
6514
|
// assumes v is an array literal
|
|
6543
6515
|
(r, [e, t]) => t.value.indexOf(r.properties()[e.value]) >= 0
|
|
6544
6516
|
],
|
|
6545
6517
|
"filter-in-large": [
|
|
6546
6518
|
C,
|
|
6547
|
-
[
|
|
6519
|
+
[I, W(A)],
|
|
6548
6520
|
// assumes v is a array literal with values sorted in ascending order and of a single type
|
|
6549
|
-
(r, [e, t]) =>
|
|
6521
|
+
(r, [e, t]) => hs(r.properties()[e.value], t.value, 0, t.value.length - 1)
|
|
6550
6522
|
],
|
|
6551
6523
|
all: {
|
|
6552
6524
|
type: C,
|
|
@@ -6591,7 +6563,7 @@ re.register(Sr, {
|
|
|
6591
6563
|
],
|
|
6592
6564
|
"is-supported-script": [
|
|
6593
6565
|
C,
|
|
6594
|
-
[
|
|
6566
|
+
[I],
|
|
6595
6567
|
// At parse time this will always return true, so we need to exclude this expression with isGlobalPropertyConstant
|
|
6596
6568
|
(r, [e]) => {
|
|
6597
6569
|
const t = r.globals && r.globals.isSupportedScript;
|
|
@@ -6599,27 +6571,27 @@ re.register(Sr, {
|
|
|
6599
6571
|
}
|
|
6600
6572
|
],
|
|
6601
6573
|
upcase: [
|
|
6602
|
-
|
|
6603
|
-
[
|
|
6574
|
+
I,
|
|
6575
|
+
[I],
|
|
6604
6576
|
(r, [e]) => e.evaluate(r).toUpperCase()
|
|
6605
6577
|
],
|
|
6606
6578
|
downcase: [
|
|
6607
|
-
|
|
6608
|
-
[
|
|
6579
|
+
I,
|
|
6580
|
+
[I],
|
|
6609
6581
|
(r, [e]) => e.evaluate(r).toLowerCase()
|
|
6610
6582
|
],
|
|
6611
6583
|
concat: [
|
|
6612
|
-
|
|
6584
|
+
I,
|
|
6613
6585
|
xe(A),
|
|
6614
|
-
(r, e) => e.map((t) =>
|
|
6586
|
+
(r, e) => e.map((t) => Be(t.evaluate(r))).join("")
|
|
6615
6587
|
],
|
|
6616
6588
|
"resolved-locale": [
|
|
6617
|
-
|
|
6589
|
+
I,
|
|
6618
6590
|
[bt],
|
|
6619
6591
|
(r, [e]) => e.evaluate(r).resolvedLocale()
|
|
6620
6592
|
]
|
|
6621
6593
|
});
|
|
6622
|
-
function
|
|
6594
|
+
function gs(r) {
|
|
6623
6595
|
return Array.isArray(r) ? `(${r.map(N).join(", ")})` : `(${N(r.type)}...)`;
|
|
6624
6596
|
}
|
|
6625
6597
|
function yt(r) {
|
|
@@ -6637,9 +6609,9 @@ function yt(r) {
|
|
|
6637
6609
|
let t = !0;
|
|
6638
6610
|
return r.eachChild((n) => {
|
|
6639
6611
|
e ? t = t && yt(n) : t = t && n instanceof je;
|
|
6640
|
-
}), t ?
|
|
6612
|
+
}), t ? Et(r) && Mt(r, ["zoom", "heatmap-density", "line-progress", "accumulated", "is-supported-script"]) : !1;
|
|
6641
6613
|
}
|
|
6642
|
-
function
|
|
6614
|
+
function Et(r) {
|
|
6643
6615
|
if (r instanceof re) {
|
|
6644
6616
|
if (r.name === "get" && r.args.length === 1)
|
|
6645
6617
|
return !1;
|
|
@@ -6656,7 +6628,7 @@ function It(r) {
|
|
|
6656
6628
|
return !1;
|
|
6657
6629
|
let e = !0;
|
|
6658
6630
|
return r.eachChild((t) => {
|
|
6659
|
-
e && !
|
|
6631
|
+
e && !Et(t) && (e = !1);
|
|
6660
6632
|
}), e;
|
|
6661
6633
|
}
|
|
6662
6634
|
function Ze(r) {
|
|
@@ -6667,12 +6639,12 @@ function Ze(r) {
|
|
|
6667
6639
|
e && !Ze(t) && (e = !1);
|
|
6668
6640
|
}), e;
|
|
6669
6641
|
}
|
|
6670
|
-
function
|
|
6642
|
+
function Mt(r, e) {
|
|
6671
6643
|
if (r instanceof re && e.indexOf(r.name) >= 0)
|
|
6672
6644
|
return !1;
|
|
6673
6645
|
let t = !0;
|
|
6674
6646
|
return r.eachChild((n) => {
|
|
6675
|
-
t && !
|
|
6647
|
+
t && !Mt(n, e) && (t = !1);
|
|
6676
6648
|
}), t;
|
|
6677
6649
|
}
|
|
6678
6650
|
function tr(r) {
|
|
@@ -6684,10 +6656,10 @@ function Pe(r) {
|
|
|
6684
6656
|
function mt(r) {
|
|
6685
6657
|
return r["property-type"] === "data-driven" || r["property-type"] === "cross-faded-data-driven";
|
|
6686
6658
|
}
|
|
6687
|
-
function
|
|
6659
|
+
function qn(r) {
|
|
6688
6660
|
return !!r.expression && r.expression.parameters.indexOf("zoom") > -1;
|
|
6689
6661
|
}
|
|
6690
|
-
function
|
|
6662
|
+
function Bn(r) {
|
|
6691
6663
|
return !!r.expression && r.expression.interpolated;
|
|
6692
6664
|
}
|
|
6693
6665
|
function z(r) {
|
|
@@ -6696,9 +6668,9 @@ function z(r) {
|
|
|
6696
6668
|
function xr(r) {
|
|
6697
6669
|
return typeof r == "object" && r !== null && !Array.isArray(r);
|
|
6698
6670
|
}
|
|
6699
|
-
class
|
|
6671
|
+
class vs {
|
|
6700
6672
|
constructor(e, t) {
|
|
6701
|
-
this.expression = e, this._warningHistory = {}, this._evaluator = new
|
|
6673
|
+
this.expression = e, this._warningHistory = {}, this._evaluator = new _n(), this._defaultValue = t ? Ss(t) : null, this._enumValues = t && t.type === "enum" ? t.values : null;
|
|
6702
6674
|
}
|
|
6703
6675
|
evaluateWithoutErrorHandling(e, t, n, a, o, i) {
|
|
6704
6676
|
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);
|
|
@@ -6717,14 +6689,14 @@ class ws {
|
|
|
6717
6689
|
}
|
|
6718
6690
|
}
|
|
6719
6691
|
}
|
|
6720
|
-
function
|
|
6692
|
+
function Un(r) {
|
|
6721
6693
|
return Array.isArray(r) && r.length > 0 && typeof r[0] == "string" && r[0] in Sr;
|
|
6722
6694
|
}
|
|
6723
|
-
function
|
|
6724
|
-
const t = new kt(Sr, yt, [], e ?
|
|
6725
|
-
return n ? tr(new
|
|
6695
|
+
function Vn(r, e) {
|
|
6696
|
+
const t = new kt(Sr, yt, [], e ? ws(e) : void 0), n = t.parse(r, void 0, void 0, void 0, e && e.type === "string" ? { typeAnnotation: "coerce" } : void 0);
|
|
6697
|
+
return n ? tr(new vs(n, e)) : Pe(t.errors);
|
|
6726
6698
|
}
|
|
6727
|
-
class
|
|
6699
|
+
class rn {
|
|
6728
6700
|
constructor(e, t) {
|
|
6729
6701
|
this.kind = e, this._styleExpression = t, this.isStateDependent = e !== "constant" && !Ze(t.expression);
|
|
6730
6702
|
}
|
|
@@ -6735,7 +6707,7 @@ class nn {
|
|
|
6735
6707
|
return this._styleExpression.evaluate(e, t, n, a, o, i);
|
|
6736
6708
|
}
|
|
6737
6709
|
}
|
|
6738
|
-
class
|
|
6710
|
+
class nn {
|
|
6739
6711
|
constructor(e, t, n, a) {
|
|
6740
6712
|
this.kind = e, this.zoomStops = n, this._styleExpression = t, this.isStateDependent = e !== "camera" && !Ze(t.expression), this.interpolationType = a;
|
|
6741
6713
|
}
|
|
@@ -6749,27 +6721,27 @@ class an {
|
|
|
6749
6721
|
return this.interpolationType ? se.interpolationFactor(this.interpolationType, e, t, n) : 0;
|
|
6750
6722
|
}
|
|
6751
6723
|
}
|
|
6752
|
-
function
|
|
6753
|
-
const t =
|
|
6724
|
+
function bs(r, e) {
|
|
6725
|
+
const t = Vn(r, e);
|
|
6754
6726
|
if (t.result === "error")
|
|
6755
6727
|
return t;
|
|
6756
|
-
const n = t.value.expression, a =
|
|
6728
|
+
const n = t.value.expression, a = Et(n);
|
|
6757
6729
|
if (!a && !mt(e))
|
|
6758
6730
|
return Pe([new oe("", "data expressions not supported")]);
|
|
6759
|
-
const o =
|
|
6760
|
-
if (!o && !
|
|
6731
|
+
const o = Mt(n, ["zoom"]);
|
|
6732
|
+
if (!o && !qn(e))
|
|
6761
6733
|
return Pe([new oe("", "zoom expressions not supported")]);
|
|
6762
6734
|
const i = it(n);
|
|
6763
6735
|
if (!i && !o)
|
|
6764
6736
|
return Pe([new oe("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);
|
|
6765
6737
|
if (i instanceof oe)
|
|
6766
6738
|
return Pe([i]);
|
|
6767
|
-
if (i instanceof se && !
|
|
6739
|
+
if (i instanceof se && !Bn(e))
|
|
6768
6740
|
return Pe([new oe("", '"interpolate" expressions cannot be used with this property')]);
|
|
6769
6741
|
if (!i)
|
|
6770
|
-
return tr(a ? new
|
|
6742
|
+
return tr(a ? new rn("constant", t.value) : new rn("source", t.value));
|
|
6771
6743
|
const s = i instanceof se ? i.interpolation : void 0;
|
|
6772
|
-
return tr(a ? new
|
|
6744
|
+
return tr(a ? new nn("camera", t.value, i.labels, s) : new nn("composite", t.value, i.labels, s));
|
|
6773
6745
|
}
|
|
6774
6746
|
function it(r) {
|
|
6775
6747
|
let e = null;
|
|
@@ -6785,12 +6757,12 @@ function it(r) {
|
|
|
6785
6757
|
n instanceof oe ? e = n : !e && n ? e = new oe("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.') : e && n && e !== n && (e = new oe("", 'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'));
|
|
6786
6758
|
}), e;
|
|
6787
6759
|
}
|
|
6788
|
-
function
|
|
6760
|
+
function ws(r) {
|
|
6789
6761
|
const e = {
|
|
6790
6762
|
color: ie,
|
|
6791
|
-
string:
|
|
6763
|
+
string: I,
|
|
6792
6764
|
number: g,
|
|
6793
|
-
enum:
|
|
6765
|
+
enum: I,
|
|
6794
6766
|
boolean: C,
|
|
6795
6767
|
formatted: wt,
|
|
6796
6768
|
padding: St,
|
|
@@ -6800,10 +6772,10 @@ function xs(r) {
|
|
|
6800
6772
|
};
|
|
6801
6773
|
return r.type === "array" ? W(e[r.value] || A, r.length) : e[r.type];
|
|
6802
6774
|
}
|
|
6803
|
-
function
|
|
6775
|
+
function Ss(r) {
|
|
6804
6776
|
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;
|
|
6805
6777
|
}
|
|
6806
|
-
function
|
|
6778
|
+
function Gn(r) {
|
|
6807
6779
|
if (r === !0 || r === !1)
|
|
6808
6780
|
return !0;
|
|
6809
6781
|
if (!Array.isArray(r) || r.length === 0)
|
|
@@ -6827,27 +6799,27 @@ function Kn(r) {
|
|
|
6827
6799
|
case "any":
|
|
6828
6800
|
case "all":
|
|
6829
6801
|
for (const e of r.slice(1))
|
|
6830
|
-
if (!
|
|
6802
|
+
if (!Gn(e) && typeof e != "boolean")
|
|
6831
6803
|
return !1;
|
|
6832
6804
|
return !0;
|
|
6833
6805
|
default:
|
|
6834
6806
|
return !0;
|
|
6835
6807
|
}
|
|
6836
6808
|
}
|
|
6837
|
-
function
|
|
6809
|
+
function Hn(r) {
|
|
6838
6810
|
const e = r.key, t = r.value;
|
|
6839
6811
|
return t ? [new h(e, t, "constants have been deprecated as of v8")] : [];
|
|
6840
6812
|
}
|
|
6841
6813
|
function O(r) {
|
|
6842
6814
|
return r instanceof Number || r instanceof String || r instanceof Boolean ? r.valueOf() : r;
|
|
6843
6815
|
}
|
|
6844
|
-
function
|
|
6816
|
+
function Ee(r) {
|
|
6845
6817
|
if (Array.isArray(r))
|
|
6846
|
-
return r.map(
|
|
6818
|
+
return r.map(Ee);
|
|
6847
6819
|
if (r instanceof Object && !(r instanceof Number || r instanceof String || r instanceof Boolean)) {
|
|
6848
6820
|
const e = {};
|
|
6849
6821
|
for (const t in r)
|
|
6850
|
-
e[t] =
|
|
6822
|
+
e[t] = Ee(r[t]);
|
|
6851
6823
|
return e;
|
|
6852
6824
|
}
|
|
6853
6825
|
return O(r);
|
|
@@ -6920,7 +6892,7 @@ function Lr(r) {
|
|
|
6920
6892
|
let a = z(t);
|
|
6921
6893
|
return a === "number" && t !== t && (a = "NaN"), a !== "number" ? [new h(e, t, `number expected, ${a} found`)] : "minimum" in n && t < n.minimum ? [new h(e, t, `${t} is less than the minimum value ${n.minimum}`)] : "maximum" in n && t > n.maximum ? [new h(e, t, `${t} is greater than the maximum value ${n.maximum}`)] : [];
|
|
6922
6894
|
}
|
|
6923
|
-
function
|
|
6895
|
+
function Kn(r) {
|
|
6924
6896
|
const e = r.valueSpec, t = O(r.value.type);
|
|
6925
6897
|
let n, a = {}, o, i;
|
|
6926
6898
|
const s = t !== "categorical" && r.value.property === void 0, l = !s, u = z(r.value.stops) === "array" && z(r.value.stops[0]) === "array" && z(r.value.stops[0][0]) === "object", c = Y({
|
|
@@ -6935,7 +6907,7 @@ function Zn(r) {
|
|
|
6935
6907
|
default: d
|
|
6936
6908
|
}
|
|
6937
6909
|
});
|
|
6938
|
-
return t === "identity" && s && c.push(new h(r.key, r.value, 'missing required property "property"')), t !== "identity" && !r.value.stops && c.push(new h(r.key, r.value, 'missing required property "stops"')), t === "exponential" && r.valueSpec.expression && !
|
|
6910
|
+
return t === "identity" && s && c.push(new h(r.key, r.value, 'missing required property "property"')), t !== "identity" && !r.value.stops && c.push(new h(r.key, r.value, 'missing required property "stops"')), t === "exponential" && r.valueSpec.expression && !Bn(r.valueSpec) && c.push(new h(r.key, r.value, "exponential functions not supported")), r.styleSpec.$version >= 8 && (l && !mt(r.valueSpec) ? c.push(new h(r.key, r.value, "property functions not supported")) : s && !qn(r.valueSpec) && c.push(new h(r.key, r.value, "zoom functions not supported"))), (t === "categorical" || u) && r.value.property === void 0 && c.push(new h(r.key, r.value, '"property" property is required')), c;
|
|
6939
6911
|
function p(y) {
|
|
6940
6912
|
if (t === "identity")
|
|
6941
6913
|
return [new h(y.key, y.value, 'identity function may not have a "stops" property')];
|
|
@@ -6985,7 +6957,7 @@ function Zn(r) {
|
|
|
6985
6957
|
style: y.style,
|
|
6986
6958
|
styleSpec: y.styleSpec
|
|
6987
6959
|
}, w));
|
|
6988
|
-
return
|
|
6960
|
+
return Un(Ee(w[1])) ? v.concat([new h(`${b}[1]`, w[1], "expressions are not allowed in function stops.")]) : v.concat(y.validateSpec({
|
|
6989
6961
|
key: `${b}[1]`,
|
|
6990
6962
|
value: w[1],
|
|
6991
6963
|
valueSpec: e,
|
|
@@ -7020,7 +6992,7 @@ function Zn(r) {
|
|
|
7020
6992
|
}
|
|
7021
6993
|
}
|
|
7022
6994
|
function Ne(r) {
|
|
7023
|
-
const e = (r.expressionContext === "property" ?
|
|
6995
|
+
const e = (r.expressionContext === "property" ? bs : Vn)(Ee(r.value), r.valueSpec);
|
|
7024
6996
|
if (e.result === "error")
|
|
7025
6997
|
return e.value.map((n) => new h(`${r.key}${n.key}`, r.value, n.message));
|
|
7026
6998
|
const t = e.value.expression || e.value._styleExpression.expression;
|
|
@@ -7031,18 +7003,18 @@ function Ne(r) {
|
|
|
7031
7003
|
if (r.expressionContext === "filter" && !Ze(t))
|
|
7032
7004
|
return [new h(r.key, r.value, '"feature-state" data expressions are not supported with filters.')];
|
|
7033
7005
|
if (r.expressionContext && r.expressionContext.indexOf("cluster") === 0) {
|
|
7034
|
-
if (!
|
|
7006
|
+
if (!Mt(t, ["zoom", "feature-state"]))
|
|
7035
7007
|
return [new h(r.key, r.value, '"zoom" and "feature-state" expressions are not supported with cluster properties.')];
|
|
7036
|
-
if (r.expressionContext === "cluster-initial" && !
|
|
7008
|
+
if (r.expressionContext === "cluster-initial" && !Et(t))
|
|
7037
7009
|
return [new h(r.key, r.value, "Feature data expressions are not supported with initial expression part of cluster properties.")];
|
|
7038
7010
|
}
|
|
7039
7011
|
return [];
|
|
7040
7012
|
}
|
|
7041
|
-
function
|
|
7013
|
+
function xs(r) {
|
|
7042
7014
|
const e = r.value, t = r.key, n = z(e);
|
|
7043
7015
|
return n !== "boolean" ? [new h(t, e, `boolean expected, ${n} found`)] : [];
|
|
7044
7016
|
}
|
|
7045
|
-
function
|
|
7017
|
+
function ks(r) {
|
|
7046
7018
|
const e = r.key, t = r.value, n = z(t);
|
|
7047
7019
|
return n !== "string" ? [new h(e, t, `color expected, ${n} found`)] : $.parse(String(t)) ? [] : [new h(e, t, `color expected, "${t}" found`)];
|
|
7048
7020
|
}
|
|
@@ -7051,12 +7023,12 @@ function Je(r) {
|
|
|
7051
7023
|
return Array.isArray(n.values) ? n.values.indexOf(O(t)) === -1 && a.push(new h(e, t, `expected one of [${n.values.join(", ")}], ${JSON.stringify(t)} found`)) : Object.keys(n.values).indexOf(O(t)) === -1 && a.push(new h(e, t, `expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(t)} found`)), a;
|
|
7052
7024
|
}
|
|
7053
7025
|
function Cr(r) {
|
|
7054
|
-
return
|
|
7026
|
+
return Gn(Ee(r.value)) ? Ne(lt({}, r, {
|
|
7055
7027
|
expressionContext: "filter",
|
|
7056
7028
|
valueSpec: { value: "boolean" }
|
|
7057
|
-
})) :
|
|
7029
|
+
})) : Wn(r);
|
|
7058
7030
|
}
|
|
7059
|
-
function
|
|
7031
|
+
function Wn(r) {
|
|
7060
7032
|
const e = r.value, t = r.key;
|
|
7061
7033
|
if (z(e) !== "array")
|
|
7062
7034
|
return [new h(t, e, `array expected, ${z(e)} found`)];
|
|
@@ -7097,7 +7069,7 @@ function Jn(r) {
|
|
|
7097
7069
|
case "all":
|
|
7098
7070
|
case "none":
|
|
7099
7071
|
for (let i = 1; i < e.length; i++)
|
|
7100
|
-
o = o.concat(
|
|
7072
|
+
o = o.concat(Wn({
|
|
7101
7073
|
key: `${t}[${i}]`,
|
|
7102
7074
|
value: e[i],
|
|
7103
7075
|
style: r.style,
|
|
@@ -7111,7 +7083,7 @@ function Jn(r) {
|
|
|
7111
7083
|
}
|
|
7112
7084
|
return o;
|
|
7113
7085
|
}
|
|
7114
|
-
function
|
|
7086
|
+
function Zn(r, e) {
|
|
7115
7087
|
const t = r.key, n = r.validateSpec, a = r.style, o = r.styleSpec, i = r.value, s = r.objectKey, l = o[`${e}_${r.layerType}`];
|
|
7116
7088
|
if (!l)
|
|
7117
7089
|
return [];
|
|
@@ -7132,7 +7104,7 @@ function Yn(r, e) {
|
|
|
7132
7104
|
return [new h(t, i, `"${s}" does not support interpolation syntax
|
|
7133
7105
|
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(p[1])} }\`.`)];
|
|
7134
7106
|
const m = [];
|
|
7135
|
-
return r.layerType === "symbol" && (s === "text-field" && a && !a.glyphs && m.push(new h(t, i, 'use of "text-field" requires a style "glyphs" property')), s === "text-font" && xr(
|
|
7107
|
+
return r.layerType === "symbol" && (s === "text-field" && a && !a.glyphs && m.push(new h(t, i, 'use of "text-field" requires a style "glyphs" property')), s === "text-font" && xr(Ee(i)) && O(i.type) === "identity" && m.push(new h(t, i, '"text-font" does not support identity functions'))), m.concat(n({
|
|
7136
7108
|
key: r.key,
|
|
7137
7109
|
value: i,
|
|
7138
7110
|
valueSpec: c,
|
|
@@ -7143,13 +7115,13 @@ Use an identity property function instead: \`{ "type": "identity", "property": $
|
|
|
7143
7115
|
propertyKey: s
|
|
7144
7116
|
}));
|
|
7145
7117
|
}
|
|
7146
|
-
function
|
|
7147
|
-
return
|
|
7118
|
+
function Jn(r) {
|
|
7119
|
+
return Zn(r, "paint");
|
|
7148
7120
|
}
|
|
7149
|
-
function
|
|
7150
|
-
return
|
|
7121
|
+
function Yn(r) {
|
|
7122
|
+
return Zn(r, "layout");
|
|
7151
7123
|
}
|
|
7152
|
-
function
|
|
7124
|
+
function Xn(r) {
|
|
7153
7125
|
let e = [];
|
|
7154
7126
|
const t = r.value, n = r.key, a = r.style, o = r.styleSpec;
|
|
7155
7127
|
!t.type && !t.ref && e.push(new h(n, t, 'either "type" or "ref" is required'));
|
|
@@ -7213,7 +7185,7 @@ function ea(r) {
|
|
|
7213
7185
|
validateSpec: l.validateSpec,
|
|
7214
7186
|
objectElementValidators: {
|
|
7215
7187
|
"*"(u) {
|
|
7216
|
-
return
|
|
7188
|
+
return Yn(lt({ layerType: i }, u));
|
|
7217
7189
|
}
|
|
7218
7190
|
}
|
|
7219
7191
|
});
|
|
@@ -7228,7 +7200,7 @@ function ea(r) {
|
|
|
7228
7200
|
validateSpec: l.validateSpec,
|
|
7229
7201
|
objectElementValidators: {
|
|
7230
7202
|
"*"(u) {
|
|
7231
|
-
return
|
|
7203
|
+
return Jn(lt({ layerType: i }, u));
|
|
7232
7204
|
}
|
|
7233
7205
|
}
|
|
7234
7206
|
});
|
|
@@ -7236,11 +7208,11 @@ function ea(r) {
|
|
|
7236
7208
|
}
|
|
7237
7209
|
})), e;
|
|
7238
7210
|
}
|
|
7239
|
-
function
|
|
7211
|
+
function Me(r) {
|
|
7240
7212
|
const e = r.value, t = r.key, n = z(e);
|
|
7241
7213
|
return n !== "string" ? [new h(t, e, `string expected, ${n} found`)] : [];
|
|
7242
7214
|
}
|
|
7243
|
-
function
|
|
7215
|
+
function Ls(r) {
|
|
7244
7216
|
var e;
|
|
7245
7217
|
const t = (e = r.sourceName) !== null && e !== void 0 ? e : "", n = r.value, a = r.styleSpec, o = a.source_raster_dem, i = r.style;
|
|
7246
7218
|
let s = [];
|
|
@@ -7261,10 +7233,10 @@ function As(r) {
|
|
|
7261
7233
|
})) : s.push(new h(f, n[f], `unknown property "${f}"`));
|
|
7262
7234
|
return s;
|
|
7263
7235
|
}
|
|
7264
|
-
const
|
|
7265
|
-
promoteId:
|
|
7236
|
+
const an = {
|
|
7237
|
+
promoteId: Cs
|
|
7266
7238
|
};
|
|
7267
|
-
function
|
|
7239
|
+
function Qn(r) {
|
|
7268
7240
|
const e = r.value, t = r.key, n = r.styleSpec, a = r.style, o = r.validateSpec;
|
|
7269
7241
|
if (!e.type)
|
|
7270
7242
|
return [new h(t, e, '"type" is required')];
|
|
@@ -7279,11 +7251,11 @@ function ta(r) {
|
|
|
7279
7251
|
valueSpec: n[`source_${i.replace("-", "_")}`],
|
|
7280
7252
|
style: r.style,
|
|
7281
7253
|
styleSpec: n,
|
|
7282
|
-
objectElementValidators:
|
|
7254
|
+
objectElementValidators: an,
|
|
7283
7255
|
validateSpec: o
|
|
7284
7256
|
}), s;
|
|
7285
7257
|
case "raster-dem":
|
|
7286
|
-
return s =
|
|
7258
|
+
return s = Ls({
|
|
7287
7259
|
sourceName: t,
|
|
7288
7260
|
value: e,
|
|
7289
7261
|
style: r.style,
|
|
@@ -7298,7 +7270,7 @@ function ta(r) {
|
|
|
7298
7270
|
style: a,
|
|
7299
7271
|
styleSpec: n,
|
|
7300
7272
|
validateSpec: o,
|
|
7301
|
-
objectElementValidators:
|
|
7273
|
+
objectElementValidators: an
|
|
7302
7274
|
}), e.cluster)
|
|
7303
7275
|
for (const l in e.clusterProperties) {
|
|
7304
7276
|
const [u, c] = e.clusterProperties[l], p = typeof u == "string" ? [u, ["accumulated"], ["get", l]] : u;
|
|
@@ -7346,17 +7318,17 @@ function ta(r) {
|
|
|
7346
7318
|
});
|
|
7347
7319
|
}
|
|
7348
7320
|
}
|
|
7349
|
-
function
|
|
7321
|
+
function Cs({ key: r, value: e }) {
|
|
7350
7322
|
if (z(e) === "string")
|
|
7351
|
-
return
|
|
7323
|
+
return Me({ key: r, value: e });
|
|
7352
7324
|
{
|
|
7353
7325
|
const t = [];
|
|
7354
7326
|
for (const n in e)
|
|
7355
|
-
t.push(...
|
|
7327
|
+
t.push(...Me({ key: `${r}.${n}`, value: e[n] }));
|
|
7356
7328
|
return t;
|
|
7357
7329
|
}
|
|
7358
7330
|
}
|
|
7359
|
-
function
|
|
7331
|
+
function ea(r) {
|
|
7360
7332
|
const e = r.value, t = r.styleSpec, n = t.light, a = r.style;
|
|
7361
7333
|
let o = [];
|
|
7362
7334
|
const i = z(e);
|
|
@@ -7384,7 +7356,7 @@ function ra(r) {
|
|
|
7384
7356
|
}
|
|
7385
7357
|
return o;
|
|
7386
7358
|
}
|
|
7387
|
-
function
|
|
7359
|
+
function ta(r) {
|
|
7388
7360
|
const e = r.value, t = r.styleSpec, n = t.sky, a = r.style, o = z(e);
|
|
7389
7361
|
if (e === void 0)
|
|
7390
7362
|
return [];
|
|
@@ -7401,7 +7373,7 @@ function na(r) {
|
|
|
7401
7373
|
})) : i = i.concat([new h(s, e[s], `unknown property "${s}"`)]);
|
|
7402
7374
|
return i;
|
|
7403
7375
|
}
|
|
7404
|
-
function
|
|
7376
|
+
function ra(r) {
|
|
7405
7377
|
const e = r.value, t = r.styleSpec, n = t.terrain, a = r.style;
|
|
7406
7378
|
let o = [];
|
|
7407
7379
|
const i = z(e);
|
|
@@ -7420,13 +7392,13 @@ function aa(r) {
|
|
|
7420
7392
|
})) : o = o.concat([new h(s, e[s], `unknown property "${s}"`)]);
|
|
7421
7393
|
return o;
|
|
7422
7394
|
}
|
|
7423
|
-
function
|
|
7424
|
-
return
|
|
7395
|
+
function As(r) {
|
|
7396
|
+
return Me(r).length === 0 ? [] : Ne(r);
|
|
7425
7397
|
}
|
|
7426
|
-
function
|
|
7427
|
-
return
|
|
7398
|
+
function Ts(r) {
|
|
7399
|
+
return Me(r).length === 0 ? [] : Ne(r);
|
|
7428
7400
|
}
|
|
7429
|
-
function
|
|
7401
|
+
function Is(r) {
|
|
7430
7402
|
const e = r.key, t = r.value;
|
|
7431
7403
|
if (z(t) === "array") {
|
|
7432
7404
|
if (t.length < 1 || t.length > 4)
|
|
@@ -7450,7 +7422,7 @@ function Es(r) {
|
|
|
7450
7422
|
valueSpec: {}
|
|
7451
7423
|
});
|
|
7452
7424
|
}
|
|
7453
|
-
function
|
|
7425
|
+
function Es(r) {
|
|
7454
7426
|
const e = r.key, t = r.value, n = z(t), a = r.styleSpec;
|
|
7455
7427
|
if (n !== "array" || t.length < 1 || t.length % 2 !== 0)
|
|
7456
7428
|
return [new h(e, t, "variableAnchorOffsetCollection requires a non-empty array of even length")];
|
|
@@ -7473,7 +7445,7 @@ function zs(r) {
|
|
|
7473
7445
|
}));
|
|
7474
7446
|
return o;
|
|
7475
7447
|
}
|
|
7476
|
-
function
|
|
7448
|
+
function na(r) {
|
|
7477
7449
|
let e = [];
|
|
7478
7450
|
const t = r.value, n = r.key;
|
|
7479
7451
|
if (Array.isArray(t)) {
|
|
@@ -7499,12 +7471,12 @@ function oa(r) {
|
|
|
7499
7471
|
}
|
|
7500
7472
|
return e;
|
|
7501
7473
|
} else
|
|
7502
|
-
return
|
|
7474
|
+
return Me({
|
|
7503
7475
|
key: n,
|
|
7504
7476
|
value: t
|
|
7505
7477
|
});
|
|
7506
7478
|
}
|
|
7507
|
-
function
|
|
7479
|
+
function Ms(r) {
|
|
7508
7480
|
const e = r.value, t = r.styleSpec, n = t.projection, a = r.style, o = z(e);
|
|
7509
7481
|
if (e === void 0)
|
|
7510
7482
|
return [];
|
|
@@ -7521,106 +7493,106 @@ function _s(r) {
|
|
|
7521
7493
|
})) : i = i.concat([new h(s, e[s], `unknown property "${s}"`)]);
|
|
7522
7494
|
return i;
|
|
7523
7495
|
}
|
|
7524
|
-
function
|
|
7496
|
+
function zs(r) {
|
|
7525
7497
|
const e = r.key;
|
|
7526
7498
|
let t = r.value;
|
|
7527
7499
|
t = t instanceof String ? t.valueOf() : t;
|
|
7528
7500
|
const n = z(t);
|
|
7529
|
-
return n === "array" &&
|
|
7501
|
+
return n === "array" && !Ps(t) && !_s(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`)];
|
|
7530
7502
|
}
|
|
7531
|
-
function
|
|
7503
|
+
function _s(r) {
|
|
7532
7504
|
return !!["interpolate", "step", "literal"].includes(r[0]);
|
|
7533
7505
|
}
|
|
7534
|
-
function
|
|
7506
|
+
function Ps(r) {
|
|
7535
7507
|
return Array.isArray(r) && r.length === 3 && typeof r[0] == "string" && typeof r[1] == "string" && typeof r[2] == "number";
|
|
7536
7508
|
}
|
|
7537
|
-
const
|
|
7509
|
+
const on = {
|
|
7538
7510
|
"*"() {
|
|
7539
7511
|
return [];
|
|
7540
7512
|
},
|
|
7541
7513
|
array: kr,
|
|
7542
|
-
boolean:
|
|
7514
|
+
boolean: xs,
|
|
7543
7515
|
number: Lr,
|
|
7544
|
-
color:
|
|
7545
|
-
constants:
|
|
7516
|
+
color: ks,
|
|
7517
|
+
constants: Hn,
|
|
7546
7518
|
enum: Je,
|
|
7547
7519
|
filter: Cr,
|
|
7548
|
-
function:
|
|
7549
|
-
layer:
|
|
7520
|
+
function: Kn,
|
|
7521
|
+
layer: Xn,
|
|
7550
7522
|
object: Y,
|
|
7551
|
-
source:
|
|
7552
|
-
light:
|
|
7553
|
-
sky:
|
|
7554
|
-
terrain:
|
|
7555
|
-
projection:
|
|
7556
|
-
projectionDefinition:
|
|
7557
|
-
string:
|
|
7558
|
-
formatted:
|
|
7559
|
-
resolvedImage:
|
|
7560
|
-
padding:
|
|
7561
|
-
variableAnchorOffsetCollection:
|
|
7562
|
-
sprite:
|
|
7523
|
+
source: Qn,
|
|
7524
|
+
light: ea,
|
|
7525
|
+
sky: ta,
|
|
7526
|
+
terrain: ra,
|
|
7527
|
+
projection: Ms,
|
|
7528
|
+
projectionDefinition: zs,
|
|
7529
|
+
string: Me,
|
|
7530
|
+
formatted: As,
|
|
7531
|
+
resolvedImage: Ts,
|
|
7532
|
+
padding: Is,
|
|
7533
|
+
variableAnchorOffsetCollection: Es,
|
|
7534
|
+
sprite: na
|
|
7563
7535
|
};
|
|
7564
|
-
function
|
|
7536
|
+
function Ue(r) {
|
|
7565
7537
|
const e = r.value, t = r.valueSpec, n = r.styleSpec;
|
|
7566
|
-
return r.validateSpec =
|
|
7538
|
+
return r.validateSpec = Ue, t.expression && xr(O(e)) ? Kn(r) : t.expression && Un(Ee(e)) ? Ne(r) : t.type && on[t.type] ? on[t.type](r) : Y(lt({}, r, {
|
|
7567
7539
|
valueSpec: t.type ? n[t.type] : t
|
|
7568
7540
|
}));
|
|
7569
7541
|
}
|
|
7570
|
-
function
|
|
7571
|
-
const e = r.value, t = r.key, n =
|
|
7542
|
+
function aa(r) {
|
|
7543
|
+
const e = r.value, t = r.key, n = Me(r);
|
|
7572
7544
|
return n.length || (e.indexOf("{fontstack}") === -1 && n.push(new h(t, e, '"glyphs" url must include a "{fontstack}" token')), e.indexOf("{range}") === -1 && n.push(new h(t, e, '"glyphs" url must include a "{range}" token'))), n;
|
|
7573
7545
|
}
|
|
7574
|
-
function X(r, e =
|
|
7546
|
+
function X(r, e = pi) {
|
|
7575
7547
|
let t = [];
|
|
7576
|
-
return t = t.concat(
|
|
7548
|
+
return t = t.concat(Ue({
|
|
7577
7549
|
key: "",
|
|
7578
7550
|
value: r,
|
|
7579
7551
|
valueSpec: e.$root,
|
|
7580
7552
|
styleSpec: e,
|
|
7581
7553
|
style: r,
|
|
7582
|
-
validateSpec:
|
|
7554
|
+
validateSpec: Ue,
|
|
7583
7555
|
objectElementValidators: {
|
|
7584
|
-
glyphs:
|
|
7556
|
+
glyphs: aa,
|
|
7585
7557
|
"*"() {
|
|
7586
7558
|
return [];
|
|
7587
7559
|
}
|
|
7588
7560
|
}
|
|
7589
|
-
})), r.constants && (t = t.concat(
|
|
7561
|
+
})), r.constants && (t = t.concat(Hn({
|
|
7590
7562
|
key: "constants",
|
|
7591
7563
|
value: r.constants,
|
|
7592
7564
|
style: r,
|
|
7593
7565
|
styleSpec: e,
|
|
7594
|
-
validateSpec:
|
|
7595
|
-
}))),
|
|
7596
|
-
}
|
|
7597
|
-
X.source = ce(ue(
|
|
7598
|
-
X.sprite = ce(ue(
|
|
7599
|
-
X.glyphs = ce(ue(
|
|
7600
|
-
X.light = ce(ue(
|
|
7601
|
-
X.sky = ce(ue(
|
|
7602
|
-
X.terrain = ce(ue(
|
|
7603
|
-
X.layer = ce(ue(
|
|
7566
|
+
validateSpec: Ue
|
|
7567
|
+
}))), oa(t);
|
|
7568
|
+
}
|
|
7569
|
+
X.source = ce(ue(Qn));
|
|
7570
|
+
X.sprite = ce(ue(na));
|
|
7571
|
+
X.glyphs = ce(ue(aa));
|
|
7572
|
+
X.light = ce(ue(ea));
|
|
7573
|
+
X.sky = ce(ue(ta));
|
|
7574
|
+
X.terrain = ce(ue(ra));
|
|
7575
|
+
X.layer = ce(ue(Xn));
|
|
7604
7576
|
X.filter = ce(ue(Cr));
|
|
7605
|
-
X.paintProperty = ce(ue(
|
|
7606
|
-
X.layoutProperty = ce(ue(
|
|
7577
|
+
X.paintProperty = ce(ue(Jn));
|
|
7578
|
+
X.layoutProperty = ce(ue(Yn));
|
|
7607
7579
|
function ue(r) {
|
|
7608
7580
|
return function(e) {
|
|
7609
7581
|
return r({
|
|
7610
7582
|
...e,
|
|
7611
|
-
validateSpec:
|
|
7583
|
+
validateSpec: Ue
|
|
7612
7584
|
});
|
|
7613
7585
|
};
|
|
7614
7586
|
}
|
|
7615
|
-
function
|
|
7587
|
+
function oa(r) {
|
|
7616
7588
|
return [].concat(r).sort((e, t) => e.line - t.line);
|
|
7617
7589
|
}
|
|
7618
7590
|
function ce(r) {
|
|
7619
7591
|
return function(...e) {
|
|
7620
|
-
return
|
|
7592
|
+
return oa(r.apply(this, e));
|
|
7621
7593
|
};
|
|
7622
7594
|
}
|
|
7623
|
-
function
|
|
7595
|
+
function sn(r) {
|
|
7624
7596
|
if (!r)
|
|
7625
7597
|
return {
|
|
7626
7598
|
style: qe[$t[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL(),
|
|
@@ -7629,7 +7601,7 @@ function ln(r) {
|
|
|
7629
7601
|
isFallback: !0
|
|
7630
7602
|
};
|
|
7631
7603
|
if (typeof r == "string") {
|
|
7632
|
-
const t =
|
|
7604
|
+
const t = $s(r);
|
|
7633
7605
|
return t.isValidStyle ? {
|
|
7634
7606
|
style: t.styleObject,
|
|
7635
7607
|
requiresUrlMonitoring: !1,
|
|
@@ -7639,9 +7611,9 @@ function ln(r) {
|
|
|
7639
7611
|
requiresUrlMonitoring: !1,
|
|
7640
7612
|
// default styles don't require URL monitoring
|
|
7641
7613
|
isFallback: !0
|
|
7642
|
-
} : r.startsWith("http") ? { style: r, requiresUrlMonitoring: !0, isFallback: !1 } : r.toLowerCase().includes(".json") ? { style:
|
|
7614
|
+
} : r.startsWith("http") ? { style: r, requiresUrlMonitoring: !0, isFallback: !1 } : r.toLowerCase().includes(".json") ? { style: Rs(r), requiresUrlMonitoring: !0, isFallback: !1 } : { style: Ma(r), requiresUrlMonitoring: !0, isFallback: !1 };
|
|
7643
7615
|
}
|
|
7644
|
-
return r instanceof
|
|
7616
|
+
return r instanceof za ? { style: r.getExpandedStyleURL(), requiresUrlMonitoring: !1, isFallback: !1 } : r instanceof _a ? {
|
|
7645
7617
|
style: r.getDefaultVariant().getExpandedStyleURL(),
|
|
7646
7618
|
requiresUrlMonitoring: !1,
|
|
7647
7619
|
isFallback: !1
|
|
@@ -7656,14 +7628,14 @@ function ln(r) {
|
|
|
7656
7628
|
isFallback: !0
|
|
7657
7629
|
};
|
|
7658
7630
|
}
|
|
7659
|
-
function
|
|
7631
|
+
function Rs(r) {
|
|
7660
7632
|
try {
|
|
7661
7633
|
return new URL(r).href;
|
|
7662
7634
|
} catch {
|
|
7663
7635
|
}
|
|
7664
7636
|
return new URL(r, location.origin).href;
|
|
7665
7637
|
}
|
|
7666
|
-
function
|
|
7638
|
+
function $s(r) {
|
|
7667
7639
|
try {
|
|
7668
7640
|
const e = JSON.parse(r), t = X(e);
|
|
7669
7641
|
return {
|
|
@@ -7679,12 +7651,12 @@ function Ns(r) {
|
|
|
7679
7651
|
};
|
|
7680
7652
|
}
|
|
7681
7653
|
}
|
|
7682
|
-
class
|
|
7654
|
+
class js {
|
|
7683
7655
|
constructor() {
|
|
7684
7656
|
L(this, "_map");
|
|
7685
7657
|
L(this, "_container");
|
|
7686
7658
|
L(this, "_terrainButton");
|
|
7687
|
-
|
|
7659
|
+
so(["_toggleTerrain", "_updateTerrainIcon"], this);
|
|
7688
7660
|
}
|
|
7689
7661
|
onAdd(e) {
|
|
7690
7662
|
return this._map = e, this._container = pe("div", "maplibregl-ctrl maplibregl-ctrl-group"), this._terrainButton = pe("button", "maplibregl-ctrl-terrain", this._container), pe("span", "maplibregl-ctrl-icon", this._terrainButton).setAttribute("aria-hidden", "true"), this._terrainButton.type = "button", this._terrainButton.addEventListener("click", this._toggleTerrain), this._updateTerrainIcon(), this._map.on("terrain", this._updateTerrainIcon), this._container;
|
|
@@ -7699,7 +7671,7 @@ class Fs {
|
|
|
7699
7671
|
this._terrainButton.classList.remove("maplibregl-ctrl-terrain"), this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"), this._map.hasTerrain() ? (this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"), this._terrainButton.title = this._map._getUIString("TerrainControl.Disable")) : (this._terrainButton.classList.add("maplibregl-ctrl-terrain"), this._terrainButton.title = this._map._getUIString("TerrainControl.Enable"));
|
|
7700
7672
|
}
|
|
7701
7673
|
}
|
|
7702
|
-
class
|
|
7674
|
+
class Ns extends wo {
|
|
7703
7675
|
constructor(t = {}) {
|
|
7704
7676
|
super({
|
|
7705
7677
|
showCompass: t.showCompass ?? !0,
|
|
@@ -7728,11 +7700,11 @@ class Os extends xo {
|
|
|
7728
7700
|
return a.clickFunction = n, a;
|
|
7729
7701
|
}
|
|
7730
7702
|
}
|
|
7731
|
-
const
|
|
7732
|
-
class
|
|
7703
|
+
const ln = S.Marker, un = S.LngLat, Fs = S.LngLatBounds;
|
|
7704
|
+
class Os extends So {
|
|
7733
7705
|
constructor() {
|
|
7734
7706
|
super(...arguments);
|
|
7735
|
-
L(this, "lastUpdatedCenter", new
|
|
7707
|
+
L(this, "lastUpdatedCenter", new un(0, 0));
|
|
7736
7708
|
/**
|
|
7737
7709
|
* Update the camera location to center on the current position
|
|
7738
7710
|
*
|
|
@@ -7741,12 +7713,12 @@ class qs extends ko {
|
|
|
7741
7713
|
*/
|
|
7742
7714
|
L(this, "_updateCamera", (t) => {
|
|
7743
7715
|
var c, p;
|
|
7744
|
-
const n = new
|
|
7716
|
+
const n = new un(t.coords.longitude, t.coords.latitude), a = t.coords.accuracy, i = {
|
|
7745
7717
|
bearing: this._map.getBearing(),
|
|
7746
7718
|
...this.options.fitBoundsOptions,
|
|
7747
7719
|
linear: !0
|
|
7748
7720
|
}, s = this._map.getZoom();
|
|
7749
|
-
s > (((p = (c = this.options) == null ? void 0 : c.fitBoundsOptions) == null ? void 0 : p.maxZoom) ?? 30) && (i.zoom = s), this._map.fitBounds(
|
|
7721
|
+
s > (((p = (c = this.options) == null ? void 0 : c.fitBoundsOptions) == null ? void 0 : p.maxZoom) ?? 30) && (i.zoom = s), this._map.fitBounds(Fs.fromLngLat(n, a), i, {
|
|
7750
7722
|
geolocateSource: !0
|
|
7751
7723
|
// tag this camera change so it won't cause the control to change to background state
|
|
7752
7724
|
});
|
|
@@ -7767,7 +7739,7 @@ class qs extends ko {
|
|
|
7767
7739
|
const n = this._map._getUIString("GeolocateControl.FindMyLocation");
|
|
7768
7740
|
this._geolocateButton.disabled = !1, this._geolocateButton.title = n, this._geolocateButton.setAttribute("aria-label", n);
|
|
7769
7741
|
}
|
|
7770
|
-
this.options.trackUserLocation && (this._geolocateButton.setAttribute("aria-pressed", "false"), this._watchState = "OFF"), this.options.showUserLocation && (this._dotElement = pe("div", "maplibregl-user-location-dot"), this._userLocationDotMarker = new
|
|
7742
|
+
this.options.trackUserLocation && (this._geolocateButton.setAttribute("aria-pressed", "false"), this._watchState = "OFF"), this.options.showUserLocation && (this._dotElement = pe("div", "maplibregl-user-location-dot"), this._userLocationDotMarker = new ln({ element: this._dotElement }), this._circleElement = pe("div", "maplibregl-user-location-accuracy-circle"), this._accuracyCircleMarker = new ln({
|
|
7771
7743
|
element: this._circleElement,
|
|
7772
7744
|
pitchAlignment: "map"
|
|
7773
7745
|
}), this.options.trackUserLocation && (this._watchState = "OFF"), this._map.on("move", this._onZoom)), this._geolocateButton.addEventListener("click", this.trigger.bind(this)), this._setup = !0, this.options.trackUserLocation && this._map.on("moveend", (n) => {
|
|
@@ -7812,10 +7784,10 @@ class qs extends ko {
|
|
|
7812
7784
|
}
|
|
7813
7785
|
}
|
|
7814
7786
|
}
|
|
7815
|
-
var H, Q, me, he, K, Ye,
|
|
7787
|
+
var H, Q, me, he, K, Ye, B, ia, Z, sa;
|
|
7816
7788
|
class Gt {
|
|
7817
7789
|
constructor(e, t) {
|
|
7818
|
-
ye(this,
|
|
7790
|
+
ye(this, B);
|
|
7819
7791
|
ye(this, H);
|
|
7820
7792
|
L(this, "map");
|
|
7821
7793
|
ye(this, Q);
|
|
@@ -7846,51 +7818,51 @@ class Gt {
|
|
|
7846
7818
|
height: "300px",
|
|
7847
7819
|
...e.containerStyle ?? {}
|
|
7848
7820
|
}
|
|
7849
|
-
}), e.lockZoom !== void 0 && (
|
|
7821
|
+
}), e.lockZoom !== void 0 && (E(this, H).minZoom = e.lockZoom, E(this, H).maxZoom = e.lockZoom);
|
|
7850
7822
|
}
|
|
7851
7823
|
setStyle(e, t) {
|
|
7852
|
-
|
|
7824
|
+
E(this, K) || this.map.setStyle(e, t), G(this, B, Z).call(this);
|
|
7853
7825
|
}
|
|
7854
7826
|
addLayer(e, t) {
|
|
7855
|
-
return
|
|
7827
|
+
return E(this, K) || this.map.addLayer(e, t), G(this, B, Z).call(this), this.map;
|
|
7856
7828
|
}
|
|
7857
7829
|
moveLayer(e, t) {
|
|
7858
|
-
return
|
|
7830
|
+
return E(this, K) || this.map.moveLayer(e, t), G(this, B, Z).call(this), this.map;
|
|
7859
7831
|
}
|
|
7860
7832
|
removeLayer(e) {
|
|
7861
|
-
return
|
|
7833
|
+
return E(this, K) || this.map.removeLayer(e), G(this, B, Z).call(this), this;
|
|
7862
7834
|
}
|
|
7863
7835
|
setLayerZoomRange(e, t, n) {
|
|
7864
|
-
return
|
|
7836
|
+
return E(this, K) || this.map.setLayerZoomRange(e, t, n), G(this, B, Z).call(this), this;
|
|
7865
7837
|
}
|
|
7866
7838
|
setFilter(e, t, n) {
|
|
7867
|
-
return
|
|
7839
|
+
return E(this, K) || this.map.setFilter(e, t, n), G(this, B, Z).call(this), this;
|
|
7868
7840
|
}
|
|
7869
7841
|
setPaintProperty(e, t, n, a) {
|
|
7870
|
-
return
|
|
7842
|
+
return E(this, K) || this.map.setPaintProperty(e, t, n, a), G(this, B, Z).call(this), this;
|
|
7871
7843
|
}
|
|
7872
7844
|
setLayoutProperty(e, t, n, a) {
|
|
7873
|
-
return
|
|
7845
|
+
return E(this, K) || this.map.setLayoutProperty(e, t, n, a), G(this, B, Z).call(this), this;
|
|
7874
7846
|
}
|
|
7875
7847
|
setGlyphs(e, t) {
|
|
7876
|
-
return
|
|
7848
|
+
return E(this, K) || this.map.setGlyphs(e, t), G(this, B, Z).call(this), this;
|
|
7877
7849
|
}
|
|
7878
7850
|
onAdd(e) {
|
|
7879
7851
|
Se(this, Q, e), Se(this, me, pe("div", "maplibregl-ctrl maplibregl-ctrl-group"));
|
|
7880
|
-
for (const [t, n] of Object.entries(
|
|
7881
|
-
|
|
7882
|
-
return
|
|
7852
|
+
for (const [t, n] of Object.entries(E(this, H).containerStyle))
|
|
7853
|
+
E(this, me).style.setProperty(t, n);
|
|
7854
|
+
return E(this, H).container = E(this, me), E(this, H).zoom = e.getZoom() + E(this, H).zoomAdjust, this.map = new Us(E(this, H)), this.map.once("style.load", () => {
|
|
7883
7855
|
this.map.resize();
|
|
7884
7856
|
}), this.map.once("load", () => {
|
|
7885
|
-
G(this,
|
|
7886
|
-
}),
|
|
7857
|
+
G(this, B, ia).call(this, E(this, H).parentRect), Se(this, Ye, G(this, B, sa).call(this));
|
|
7858
|
+
}), E(this, me);
|
|
7887
7859
|
}
|
|
7888
7860
|
onRemove() {
|
|
7889
7861
|
var e;
|
|
7890
|
-
(e =
|
|
7862
|
+
(e = E(this, Ye)) == null || e.call(this), ar(E(this, me));
|
|
7891
7863
|
}
|
|
7892
7864
|
}
|
|
7893
|
-
H = new WeakMap(), Q = new WeakMap(), me = new WeakMap(), he = new WeakMap(), K = new WeakMap(), Ye = new WeakMap(),
|
|
7865
|
+
H = new WeakMap(), Q = new WeakMap(), me = new WeakMap(), he = new WeakMap(), K = new WeakMap(), Ye = new WeakMap(), B = new WeakSet(), ia = function(e) {
|
|
7894
7866
|
e === void 0 || e.linePaint === void 0 && e.fillPaint === void 0 || (Se(this, he, {
|
|
7895
7867
|
type: "Feature",
|
|
7896
7868
|
properties: {
|
|
@@ -7902,7 +7874,7 @@ H = new WeakMap(), Q = new WeakMap(), me = new WeakMap(), he = new WeakMap(), K
|
|
|
7902
7874
|
}
|
|
7903
7875
|
}), this.map.addSource("parentRect", {
|
|
7904
7876
|
type: "geojson",
|
|
7905
|
-
data:
|
|
7877
|
+
data: E(this, he)
|
|
7906
7878
|
}), (e.lineLayout !== void 0 || e.linePaint !== void 0) && this.map.addLayer({
|
|
7907
7879
|
id: "parentRectOutline",
|
|
7908
7880
|
type: "line",
|
|
@@ -7926,37 +7898,37 @@ H = new WeakMap(), Q = new WeakMap(), me = new WeakMap(), he = new WeakMap(), K
|
|
|
7926
7898
|
"fill-opacity": 0.135,
|
|
7927
7899
|
...e.fillPaint
|
|
7928
7900
|
}
|
|
7929
|
-
}), G(this,
|
|
7901
|
+
}), G(this, B, Z).call(this));
|
|
7930
7902
|
}, Z = function() {
|
|
7931
|
-
if (
|
|
7932
|
-
const { devicePixelRatio: e } = window, t =
|
|
7933
|
-
|
|
7903
|
+
if (E(this, he) === void 0) return;
|
|
7904
|
+
const { devicePixelRatio: e } = window, t = E(this, Q).getCanvas(), n = t.width / e, a = t.height / e, o = E(this, Q).unproject.bind(E(this, Q)), i = o([0, 0]), s = o([n, 0]), l = o([0, a]), u = o([n, a]);
|
|
7905
|
+
E(this, he).geometry.coordinates = [
|
|
7934
7906
|
[l.toArray(), u.toArray(), s.toArray(), i.toArray(), l.toArray()]
|
|
7935
|
-
], this.map.getSource("parentRect").setData(
|
|
7936
|
-
},
|
|
7937
|
-
const { pitchAdjust: e } =
|
|
7907
|
+
], this.map.getSource("parentRect").setData(E(this, he));
|
|
7908
|
+
}, sa = function() {
|
|
7909
|
+
const { pitchAdjust: e } = E(this, H), t = () => {
|
|
7938
7910
|
i("parent");
|
|
7939
7911
|
}, n = () => {
|
|
7940
7912
|
i("minimap");
|
|
7941
7913
|
}, a = () => {
|
|
7942
|
-
|
|
7914
|
+
E(this, Q).on("move", t), this.map.on("move", n);
|
|
7943
7915
|
}, o = () => {
|
|
7944
|
-
|
|
7916
|
+
E(this, Q).off("move", t), this.map.off("move", n);
|
|
7945
7917
|
}, i = (s) => {
|
|
7946
7918
|
o();
|
|
7947
|
-
const l = s === "parent" ?
|
|
7919
|
+
const l = s === "parent" ? E(this, Q) : this.map, u = s === "parent" ? this.map : E(this, Q), c = l.getCenter(), p = l.getZoom() + E(this, H).zoomAdjust * (s === "parent" ? 1 : -1), m = l.getBearing(), f = l.getPitch();
|
|
7948
7920
|
u.jumpTo({
|
|
7949
7921
|
center: c,
|
|
7950
7922
|
zoom: p,
|
|
7951
7923
|
bearing: m,
|
|
7952
7924
|
pitch: e ? f : 0
|
|
7953
|
-
}), G(this,
|
|
7925
|
+
}), G(this, B, Z).call(this), a();
|
|
7954
7926
|
};
|
|
7955
7927
|
return a(), () => {
|
|
7956
7928
|
o();
|
|
7957
7929
|
};
|
|
7958
7930
|
};
|
|
7959
|
-
class
|
|
7931
|
+
class Ds {
|
|
7960
7932
|
constructor() {
|
|
7961
7933
|
L(this, "map");
|
|
7962
7934
|
L(this, "container");
|
|
@@ -7975,7 +7947,7 @@ class Us {
|
|
|
7975
7947
|
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");
|
|
7976
7948
|
}
|
|
7977
7949
|
}
|
|
7978
|
-
class
|
|
7950
|
+
class qs {
|
|
7979
7951
|
/**
|
|
7980
7952
|
*
|
|
7981
7953
|
* @param map : a Map instance
|
|
@@ -8008,17 +7980,17 @@ class Bs {
|
|
|
8008
7980
|
}
|
|
8009
7981
|
preparePayload() {
|
|
8010
7982
|
const e = new URL(V.telemetryURL);
|
|
8011
|
-
return e.searchParams.append("sdk",
|
|
7983
|
+
return e.searchParams.append("sdk", wn.version), e.searchParams.append("key", F.apiKey), e.searchParams.append("mtsid", nr), e.searchParams.append("session", F.session ? "1" : "0"), e.searchParams.append("caching", F.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;
|
|
8012
7984
|
}
|
|
8013
7985
|
}
|
|
8014
|
-
const
|
|
7986
|
+
const Bs = {
|
|
8015
7987
|
POINT: "POINT",
|
|
8016
7988
|
COUNTRY: "COUNTRY"
|
|
8017
7989
|
};
|
|
8018
|
-
class
|
|
7990
|
+
class Us extends S.Map {
|
|
8019
7991
|
constructor(t) {
|
|
8020
|
-
|
|
8021
|
-
const { style: n, requiresUrlMonitoring: a, isFallback: o } =
|
|
7992
|
+
co(t.container), t.apiKey && (F.apiKey = t.apiKey);
|
|
7993
|
+
const { style: n, requiresUrlMonitoring: a, isFallback: o } = sn(t.style);
|
|
8022
7994
|
o && console.warn(
|
|
8023
7995
|
"Invalid style. A style must be a valid URL to a style.json, a JSON string representing a valid StyleSpecification or a valid StyleSpecification object. Fallback to default MapTiler style."
|
|
8024
7996
|
), F.apiKey || console.warn("MapTiler Cloud API key is not set. Visit https://maptiler.com and try Cloud for free!");
|
|
@@ -8075,19 +8047,19 @@ class Gs extends S.Map {
|
|
|
8075
8047
|
return u();
|
|
8076
8048
|
}), F.caching && !Wt && console.warn(
|
|
8077
8049
|
"The cache API is only available in secure contexts. More info at https://developer.mozilla.org/en-US/docs/Web/API/Cache"
|
|
8078
|
-
), F.caching && Wt &&
|
|
8050
|
+
), F.caching && Wt && oo(), typeof t.language > "u")
|
|
8079
8051
|
this.primaryLanguage = F.primaryLanguage;
|
|
8080
8052
|
else {
|
|
8081
|
-
const d = zr(t.language,
|
|
8053
|
+
const d = zr(t.language, M);
|
|
8082
8054
|
this.primaryLanguage = d ?? F.primaryLanguage;
|
|
8083
8055
|
}
|
|
8084
|
-
this.forceLanguageUpdate = !(this.primaryLanguage ===
|
|
8056
|
+
this.forceLanguageUpdate = !(this.primaryLanguage === M.STYLE || this.primaryLanguage === M.STYLE_LOCK), this.languageAlwaysBeenStyle = this.primaryLanguage === M.STYLE, this.terrainExaggeration = t.terrainExaggeration ?? this.terrainExaggeration, this.curentProjection = t.projection, this.on("styledata", () => {
|
|
8085
8057
|
this.curentProjection === "mercator" ? this.setProjection({ type: "mercator" }) : this.curentProjection === "globe" && this.setProjection({ type: "globe" });
|
|
8086
8058
|
}), this.once("styledata", async () => {
|
|
8087
8059
|
if (!t.geolocate || t.center || t.hash && i)
|
|
8088
8060
|
return;
|
|
8089
8061
|
try {
|
|
8090
|
-
if (t.geolocate ===
|
|
8062
|
+
if (t.geolocate === Bs.COUNTRY) {
|
|
8091
8063
|
await this.fitToIpBounds();
|
|
8092
8064
|
return;
|
|
8093
8065
|
}
|
|
@@ -8147,20 +8119,20 @@ class Gs extends S.Map {
|
|
|
8147
8119
|
this.addControl(new Or({ logoURL: y }), t.logoPosition);
|
|
8148
8120
|
} else t.maptilerLogo && this.addControl(new Or(), t.logoPosition);
|
|
8149
8121
|
if (t.scaleControl) {
|
|
8150
|
-
const y = t.scaleControl === !0 || t.scaleControl === void 0 ? "bottom-right" : t.scaleControl, v = new
|
|
8122
|
+
const y = t.scaleControl === !0 || t.scaleControl === void 0 ? "bottom-right" : t.scaleControl, v = new ko({ unit: F.unit });
|
|
8151
8123
|
this.addControl(v, y), F.on("unit", (w) => {
|
|
8152
8124
|
v.setUnit(w);
|
|
8153
8125
|
});
|
|
8154
8126
|
}
|
|
8155
8127
|
if (t.navigationControl !== !1) {
|
|
8156
8128
|
const y = t.navigationControl === !0 || t.navigationControl === void 0 ? "top-right" : t.navigationControl;
|
|
8157
|
-
this.addControl(new
|
|
8129
|
+
this.addControl(new Ns(), y);
|
|
8158
8130
|
}
|
|
8159
8131
|
if (t.geolocateControl !== !1) {
|
|
8160
8132
|
const y = t.geolocateControl === !0 || t.geolocateControl === void 0 ? "top-right" : t.geolocateControl;
|
|
8161
8133
|
this.addControl(
|
|
8162
8134
|
// new maplibregl.GeolocateControl({
|
|
8163
|
-
new
|
|
8135
|
+
new Os({
|
|
8164
8136
|
positionOptions: {
|
|
8165
8137
|
enableHighAccuracy: !0,
|
|
8166
8138
|
maximumAge: 0,
|
|
@@ -8178,15 +8150,15 @@ class Gs extends S.Map {
|
|
|
8178
8150
|
}
|
|
8179
8151
|
if (t.terrainControl) {
|
|
8180
8152
|
const y = t.terrainControl === !0 || t.terrainControl === void 0 ? "top-right" : t.terrainControl;
|
|
8181
|
-
this.addControl(new
|
|
8153
|
+
this.addControl(new js(), y);
|
|
8182
8154
|
}
|
|
8183
8155
|
if (t.projectionControl) {
|
|
8184
8156
|
const y = t.projectionControl === !0 || t.projectionControl === void 0 ? "top-right" : t.projectionControl;
|
|
8185
|
-
this.addControl(new
|
|
8157
|
+
this.addControl(new Ds(), y);
|
|
8186
8158
|
}
|
|
8187
8159
|
if (t.fullscreenControl) {
|
|
8188
8160
|
const y = t.fullscreenControl === !0 || t.fullscreenControl === void 0 ? "top-right" : t.fullscreenControl;
|
|
8189
|
-
this.addControl(new
|
|
8161
|
+
this.addControl(new Lo({}), y);
|
|
8190
8162
|
}
|
|
8191
8163
|
this.isReady = !0, this.fire("ready", { target: this });
|
|
8192
8164
|
});
|
|
@@ -8209,15 +8181,15 @@ class Gs extends S.Map {
|
|
|
8209
8181
|
scrollZoom: De,
|
|
8210
8182
|
minZoom: et,
|
|
8211
8183
|
maxZoom: tt,
|
|
8212
|
-
boxZoom:
|
|
8213
|
-
locale:
|
|
8214
|
-
fadeDuration:
|
|
8215
|
-
crossSourceCollisions:
|
|
8216
|
-
clickTolerance:
|
|
8217
|
-
bounds:
|
|
8218
|
-
fitBoundsOptions:
|
|
8219
|
-
pixelRatio:
|
|
8220
|
-
validateStyle:
|
|
8184
|
+
boxZoom: va,
|
|
8185
|
+
locale: ba,
|
|
8186
|
+
fadeDuration: wa,
|
|
8187
|
+
crossSourceCollisions: Sa,
|
|
8188
|
+
clickTolerance: xa,
|
|
8189
|
+
bounds: ka,
|
|
8190
|
+
fitBoundsOptions: La,
|
|
8191
|
+
pixelRatio: Ca,
|
|
8192
|
+
validateStyle: Aa
|
|
8221
8193
|
} = t;
|
|
8222
8194
|
this.minimap = new Gt(d, {
|
|
8223
8195
|
zoom: y,
|
|
@@ -8233,15 +8205,15 @@ class Gs extends S.Map {
|
|
|
8233
8205
|
scrollZoom: De,
|
|
8234
8206
|
minZoom: et,
|
|
8235
8207
|
maxZoom: tt,
|
|
8236
|
-
boxZoom:
|
|
8237
|
-
locale:
|
|
8238
|
-
fadeDuration:
|
|
8239
|
-
crossSourceCollisions:
|
|
8240
|
-
clickTolerance:
|
|
8241
|
-
bounds:
|
|
8242
|
-
fitBoundsOptions:
|
|
8243
|
-
pixelRatio:
|
|
8244
|
-
validateStyle:
|
|
8208
|
+
boxZoom: va,
|
|
8209
|
+
locale: ba,
|
|
8210
|
+
fadeDuration: wa,
|
|
8211
|
+
crossSourceCollisions: Sa,
|
|
8212
|
+
clickTolerance: xa,
|
|
8213
|
+
bounds: ka,
|
|
8214
|
+
fitBoundsOptions: La,
|
|
8215
|
+
pixelRatio: Ca,
|
|
8216
|
+
validateStyle: Aa
|
|
8245
8217
|
}), this.addControl(this.minimap, d.position ?? "bottom-left");
|
|
8246
8218
|
} else d === !0 ? (this.minimap = new Gt({}, t), this.addControl(this.minimap, "bottom-left")) : d !== void 0 && d !== !1 && (this.minimap = new Gt({}, t), this.addControl(this.minimap, d));
|
|
8247
8219
|
});
|
|
@@ -8254,9 +8226,9 @@ class Gs extends S.Map {
|
|
|
8254
8226
|
};
|
|
8255
8227
|
this.on("terrain", f), t.terrain && this.enableTerrain(t.terrainExaggeration ?? this.terrainExaggeration), this.once("load", () => {
|
|
8256
8228
|
this.getCanvas().addEventListener("webglcontextlost", (d) => {
|
|
8257
|
-
console.warn(d),
|
|
8229
|
+
console.warn(d), po(t.container), this.fire("webglContextLost", { error: d });
|
|
8258
8230
|
});
|
|
8259
|
-
}), this.telemetry = new
|
|
8231
|
+
}), this.telemetry = new qs(this);
|
|
8260
8232
|
}
|
|
8261
8233
|
/**
|
|
8262
8234
|
* Set the duration (millisec) of the terrain animation for growing or flattening.
|
|
@@ -8330,7 +8302,7 @@ class Gs extends S.Map {
|
|
|
8330
8302
|
this.originalLabelStyle.clear(), (o = this.minimap) == null || o.setStyle(t), this.forceLanguageUpdate = !0, this.once("idle", () => {
|
|
8331
8303
|
this.forceLanguageUpdate = !1;
|
|
8332
8304
|
});
|
|
8333
|
-
const a =
|
|
8305
|
+
const a = sn(t);
|
|
8334
8306
|
if (a.requiresUrlMonitoring && this.monitorStyleUrl(a.style), a.isFallback) {
|
|
8335
8307
|
if (this.getStyle())
|
|
8336
8308
|
return console.warn(
|
|
@@ -8481,7 +8453,7 @@ class Gs extends S.Map {
|
|
|
8481
8453
|
return (a = this.minimap) == null || a.setGlyphs(t, n), super.setGlyphs(t, n);
|
|
8482
8454
|
}
|
|
8483
8455
|
getStyleLanguage() {
|
|
8484
|
-
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" ?
|
|
8456
|
+
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" ? Pa(this.style.stylesheet.metadata["maptiler:language"]) : null;
|
|
8485
8457
|
}
|
|
8486
8458
|
/**
|
|
8487
8459
|
* Define the primary language of the map. Note that not all the languages shorthands provided are available.
|
|
@@ -8496,14 +8468,14 @@ class Gs extends S.Map {
|
|
|
8496
8468
|
* Define the primary language of the map. Note that not all the languages shorthands provided are available.
|
|
8497
8469
|
*/
|
|
8498
8470
|
setPrimaryLanguage(t) {
|
|
8499
|
-
const n = this.getStyleLanguage(), a = zr(t,
|
|
8471
|
+
const n = this.getStyleLanguage(), a = zr(t, M);
|
|
8500
8472
|
if (!a) {
|
|
8501
8473
|
console.warn(`The language "${a}" is not supported.`);
|
|
8502
8474
|
return;
|
|
8503
8475
|
}
|
|
8504
|
-
if (!(a.flag ===
|
|
8476
|
+
if (!(a.flag === M.STYLE.flag && n && (n.flag === M.AUTO.flag || n.flag === M.VISITOR.flag)) && (a.flag !== M.STYLE.flag && (this.languageAlwaysBeenStyle = !1), this.languageAlwaysBeenStyle || this.primaryLanguage === a && !this.forceLanguageUpdate))
|
|
8505
8477
|
return;
|
|
8506
|
-
if (this.primaryLanguage.flag ===
|
|
8478
|
+
if (this.primaryLanguage.flag === M.STYLE_LOCK.flag) {
|
|
8507
8479
|
console.warn(
|
|
8508
8480
|
"The language cannot be changed because this map has been instantiated with the STYLE_LOCK language flag."
|
|
8509
8481
|
);
|
|
@@ -8511,54 +8483,54 @@ class Gs extends S.Map {
|
|
|
8511
8483
|
}
|
|
8512
8484
|
this.primaryLanguage = a;
|
|
8513
8485
|
let o = a;
|
|
8514
|
-
if (a.flag ===
|
|
8486
|
+
if (a.flag === M.STYLE.flag) {
|
|
8515
8487
|
if (!n) {
|
|
8516
8488
|
console.warn("The style has no default languages or has an invalid one.");
|
|
8517
8489
|
return;
|
|
8518
8490
|
}
|
|
8519
8491
|
o = n;
|
|
8520
8492
|
}
|
|
8521
|
-
let i =
|
|
8522
|
-
o.flag ===
|
|
8493
|
+
let i = M.LOCAL.flag, s = ["get", i];
|
|
8494
|
+
o.flag === M.VISITOR.flag ? (i = Pr().flag, s = [
|
|
8523
8495
|
"case",
|
|
8524
|
-
["all", ["has", i], ["has",
|
|
8496
|
+
["all", ["has", i], ["has", M.LOCAL.flag]],
|
|
8525
8497
|
[
|
|
8526
8498
|
"case",
|
|
8527
|
-
["==", ["get", i], ["get",
|
|
8528
|
-
["get",
|
|
8499
|
+
["==", ["get", i], ["get", M.LOCAL.flag]],
|
|
8500
|
+
["get", M.LOCAL.flag],
|
|
8529
8501
|
[
|
|
8530
8502
|
"format",
|
|
8531
8503
|
["get", i],
|
|
8532
8504
|
{ "font-scale": 0.8 },
|
|
8533
8505
|
`
|
|
8534
8506
|
`,
|
|
8535
|
-
["get",
|
|
8507
|
+
["get", M.LOCAL.flag],
|
|
8536
8508
|
{ "font-scale": 1.1 }
|
|
8537
8509
|
]
|
|
8538
8510
|
],
|
|
8539
|
-
["get",
|
|
8540
|
-
]) : o.flag ===
|
|
8511
|
+
["get", M.LOCAL.flag]
|
|
8512
|
+
]) : o.flag === M.VISITOR_ENGLISH.flag ? (i = M.ENGLISH.flag, s = [
|
|
8541
8513
|
"case",
|
|
8542
|
-
["all", ["has", i], ["has",
|
|
8514
|
+
["all", ["has", i], ["has", M.LOCAL.flag]],
|
|
8543
8515
|
[
|
|
8544
8516
|
"case",
|
|
8545
|
-
["==", ["get", i], ["get",
|
|
8546
|
-
["get",
|
|
8517
|
+
["==", ["get", i], ["get", M.LOCAL.flag]],
|
|
8518
|
+
["get", M.LOCAL.flag],
|
|
8547
8519
|
[
|
|
8548
8520
|
"format",
|
|
8549
8521
|
["get", i],
|
|
8550
8522
|
{ "font-scale": 0.8 },
|
|
8551
8523
|
`
|
|
8552
8524
|
`,
|
|
8553
|
-
["get",
|
|
8525
|
+
["get", M.LOCAL.flag],
|
|
8554
8526
|
{ "font-scale": 1.1 }
|
|
8555
8527
|
]
|
|
8556
8528
|
],
|
|
8557
|
-
["get",
|
|
8558
|
-
]) : o.flag ===
|
|
8529
|
+
["get", M.LOCAL.flag]
|
|
8530
|
+
]) : o.flag === M.AUTO.flag ? (i = Pr().flag, s = ["coalesce", ["get", i], ["get", M.LOCAL.flag]]) : o === M.LOCAL ? (i = M.LOCAL.flag, s = ["get", i]) : (i = o.flag, s = ["coalesce", ["get", i], ["get", M.LOCAL.flag]]);
|
|
8559
8531
|
const { layers: l } = this.getStyle(), u = this.originalLabelStyle.size === 0;
|
|
8560
8532
|
if (u) {
|
|
8561
|
-
const c =
|
|
8533
|
+
const c = bo(l, this);
|
|
8562
8534
|
this.isStyleLocalized = Object.keys(c.localized).length > 0;
|
|
8563
8535
|
}
|
|
8564
8536
|
for (const c of l) {
|
|
@@ -8572,16 +8544,16 @@ class Gs extends S.Map {
|
|
|
8572
8544
|
continue;
|
|
8573
8545
|
let v;
|
|
8574
8546
|
if (u ? (v = this.getLayoutProperty(d, "text-field"), this.originalLabelStyle.set(d, v)) : v = this.originalLabelStyle.get(d), typeof v == "string") {
|
|
8575
|
-
const { contains: w, exactMatch: b } =
|
|
8547
|
+
const { contains: w, exactMatch: b } = yo(v, this.isStyleLocalized);
|
|
8576
8548
|
if (!w) continue;
|
|
8577
8549
|
if (b)
|
|
8578
8550
|
this.setLayoutProperty(d, "text-field", s);
|
|
8579
8551
|
else {
|
|
8580
|
-
const T =
|
|
8552
|
+
const T = mo(v, s, this.isStyleLocalized);
|
|
8581
8553
|
this.setLayoutProperty(d, "text-field", T);
|
|
8582
8554
|
}
|
|
8583
8555
|
} else {
|
|
8584
|
-
const w =
|
|
8556
|
+
const w = fo(v, s, this.isStyleLocalized);
|
|
8585
8557
|
this.setLayoutProperty(d, "text-field", w);
|
|
8586
8558
|
}
|
|
8587
8559
|
}
|
|
@@ -8706,7 +8678,7 @@ class Gs extends S.Map {
|
|
|
8706
8678
|
}
|
|
8707
8679
|
getCameraHash() {
|
|
8708
8680
|
const t = new Float32Array(5), n = this.getCenter();
|
|
8709
|
-
return t[0] = n.lng, t[1] = n.lat, t[2] = this.getZoom(), t[3] = this.getPitch(), t[4] = this.getBearing(),
|
|
8681
|
+
return t[0] = n.lng, t[1] = n.lat, t[2] = this.getZoom(), t[3] = this.getPitch(), t[4] = this.getBearing(), ja.fromUint8Array(new Uint8Array(t.buffer));
|
|
8710
8682
|
}
|
|
8711
8683
|
/**
|
|
8712
8684
|
* Get the SDK config object.
|
|
@@ -8776,7 +8748,7 @@ function Ar(r) {
|
|
|
8776
8748
|
}
|
|
8777
8749
|
throw new Error("No XML parser found");
|
|
8778
8750
|
}
|
|
8779
|
-
function
|
|
8751
|
+
function la(r, e) {
|
|
8780
8752
|
if (!r.hasChildNodes())
|
|
8781
8753
|
return !1;
|
|
8782
8754
|
for (const t of Array.from(r.childNodes)) {
|
|
@@ -8786,71 +8758,71 @@ function ca(r, e) {
|
|
|
8786
8758
|
}
|
|
8787
8759
|
return !1;
|
|
8788
8760
|
}
|
|
8789
|
-
function
|
|
8761
|
+
function cn(r) {
|
|
8790
8762
|
if (typeof XMLSerializer < "u")
|
|
8791
8763
|
return new XMLSerializer().serializeToString(r);
|
|
8792
8764
|
throw new Error("No XML serializer found");
|
|
8793
8765
|
}
|
|
8794
|
-
function
|
|
8766
|
+
function ua(r) {
|
|
8795
8767
|
const e = typeof r == "string" ? Ar(r) : r;
|
|
8796
|
-
if (!
|
|
8768
|
+
if (!la(e, "gpx"))
|
|
8797
8769
|
throw new Error("The XML document is not valid GPX");
|
|
8798
|
-
const t =
|
|
8770
|
+
const t = U(e, "trk"), n = U(e, "rte"), a = U(e, "wpt"), o = {
|
|
8799
8771
|
type: "FeatureCollection",
|
|
8800
8772
|
features: []
|
|
8801
8773
|
};
|
|
8802
8774
|
for (const i of Array.from(t)) {
|
|
8803
|
-
const s =
|
|
8775
|
+
const s = Ks(i);
|
|
8804
8776
|
s && o.features.push(s);
|
|
8805
8777
|
}
|
|
8806
8778
|
for (const i of Array.from(n)) {
|
|
8807
|
-
const s =
|
|
8779
|
+
const s = Ws(i);
|
|
8808
8780
|
s && o.features.push(s);
|
|
8809
8781
|
}
|
|
8810
8782
|
for (const i of Array.from(a))
|
|
8811
|
-
o.features.push(
|
|
8783
|
+
o.features.push(Zs(i));
|
|
8812
8784
|
return o;
|
|
8813
8785
|
}
|
|
8814
|
-
function
|
|
8786
|
+
function ca(r, e) {
|
|
8815
8787
|
let t = r;
|
|
8816
|
-
if (typeof t == "string" && (t = Ar(t)), !
|
|
8788
|
+
if (typeof t == "string" && (t = Ar(t)), !la(t, "kml"))
|
|
8817
8789
|
throw new Error("The XML document is not valid KML");
|
|
8818
8790
|
const n = {
|
|
8819
8791
|
type: "FeatureCollection",
|
|
8820
8792
|
features: []
|
|
8821
|
-
}, a = {}, o = {}, i = {}, s =
|
|
8793
|
+
}, a = {}, o = {}, i = {}, s = U(t, "Placemark"), l = U(t, "Style"), u = U(t, "StyleMap");
|
|
8822
8794
|
for (const c of Array.from(l)) {
|
|
8823
|
-
const p =
|
|
8795
|
+
const p = fn(e !== void 0 ? e(c) : cn(c)).toString(16);
|
|
8824
8796
|
a[`#${Te(c, "id")}`] = p, o[p] = c;
|
|
8825
8797
|
}
|
|
8826
8798
|
for (const c of Array.from(u)) {
|
|
8827
|
-
a[`#${Te(c, "id")}`] =
|
|
8828
|
-
e !== void 0 ? e(c) :
|
|
8799
|
+
a[`#${Te(c, "id")}`] = fn(
|
|
8800
|
+
e !== void 0 ? e(c) : cn(c)
|
|
8829
8801
|
).toString(16);
|
|
8830
|
-
const p =
|
|
8802
|
+
const p = U(c, "Pair"), m = {};
|
|
8831
8803
|
for (const f of Array.from(p))
|
|
8832
8804
|
m[_(k(f, "key")) ?? ""] = _(k(f, "styleUrl"));
|
|
8833
8805
|
i[`#${Te(c, "id")}`] = m;
|
|
8834
8806
|
}
|
|
8835
8807
|
for (const c of Array.from(s))
|
|
8836
|
-
n.features = n.features.concat(
|
|
8808
|
+
n.features = n.features.concat(Hs(c, a, o, i));
|
|
8837
8809
|
return n;
|
|
8838
8810
|
}
|
|
8839
|
-
function
|
|
8811
|
+
function pn(r) {
|
|
8840
8812
|
if (r === null) return ["#000000", 1];
|
|
8841
8813
|
let e = "", t = 1, n = r;
|
|
8842
8814
|
return n.substring(0, 1) === "#" && (n = n.substring(1)), (n.length === 6 || n.length === 3) && (e = n), n.length === 8 && (t = Number.parseInt(n.substring(0, 2), 16) / 255, e = `#${n.substring(6, 8)}${n.substring(4, 6)}${n.substring(2, 4)}`), [e ?? "#000000", t ?? 1];
|
|
8843
8815
|
}
|
|
8844
|
-
function
|
|
8845
|
-
return
|
|
8816
|
+
function Vs(r) {
|
|
8817
|
+
return da(r.split(" "));
|
|
8846
8818
|
}
|
|
8847
|
-
function
|
|
8848
|
-
let e =
|
|
8819
|
+
function Gs(r) {
|
|
8820
|
+
let e = U(r, "coord");
|
|
8849
8821
|
const t = [], n = [];
|
|
8850
|
-
e.length === 0 && (e =
|
|
8822
|
+
e.length === 0 && (e = U(r, "gx:coord"));
|
|
8851
8823
|
for (const o of Array.from(e))
|
|
8852
|
-
t.push(
|
|
8853
|
-
const a =
|
|
8824
|
+
t.push(Vs(_(o) ?? ""));
|
|
8825
|
+
const a = U(r, "when");
|
|
8854
8826
|
for (const o of Array.from(a)) n.push(_(o));
|
|
8855
8827
|
return {
|
|
8856
8828
|
coords: t,
|
|
@@ -8868,28 +8840,28 @@ function st(r) {
|
|
|
8868
8840
|
if (k(r, "gx:MultiTrack") !== null)
|
|
8869
8841
|
return st(k(r, "gx:MultiTrack"));
|
|
8870
8842
|
for (a = 0; a < e.length; a++)
|
|
8871
|
-
if (n =
|
|
8843
|
+
if (n = U(r, e[a]), n) {
|
|
8872
8844
|
for (o = 0; o < n.length; o++)
|
|
8873
8845
|
if (t = n[o], e[a] === "Point")
|
|
8874
8846
|
s.push({
|
|
8875
8847
|
type: "Point",
|
|
8876
|
-
coordinates:
|
|
8848
|
+
coordinates: ya(_(k(t, "coordinates")) ?? "")
|
|
8877
8849
|
});
|
|
8878
8850
|
else if (e[a] === "LineString")
|
|
8879
8851
|
s.push({
|
|
8880
8852
|
type: "LineString",
|
|
8881
|
-
coordinates:
|
|
8853
|
+
coordinates: yn(_(k(t, "coordinates")) ?? "")
|
|
8882
8854
|
});
|
|
8883
8855
|
else if (e[a] === "Polygon") {
|
|
8884
|
-
const u =
|
|
8856
|
+
const u = U(t, "LinearRing"), c = [];
|
|
8885
8857
|
for (i = 0; i < u.length; i++)
|
|
8886
|
-
c.push(
|
|
8858
|
+
c.push(yn(_(k(u[i], "coordinates")) ?? ""));
|
|
8887
8859
|
s.push({
|
|
8888
8860
|
type: "Polygon",
|
|
8889
8861
|
coordinates: c
|
|
8890
8862
|
});
|
|
8891
8863
|
} else if (e[a] === "Track" || e[a] === "gx:Track") {
|
|
8892
|
-
const u =
|
|
8864
|
+
const u = Gs(t);
|
|
8893
8865
|
s.push({
|
|
8894
8866
|
type: "LineString",
|
|
8895
8867
|
coordinates: u.coords
|
|
@@ -8898,7 +8870,7 @@ function st(r) {
|
|
|
8898
8870
|
}
|
|
8899
8871
|
return { geoms: s, coordTimes: l };
|
|
8900
8872
|
}
|
|
8901
|
-
function
|
|
8873
|
+
function Hs(r, e, t, n) {
|
|
8902
8874
|
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");
|
|
8903
8875
|
let f, d = _(k(r, "styleUrl")), y = k(r, "LineStyle"), v = k(r, "PolyStyle");
|
|
8904
8876
|
if (!a.geoms.length) return [];
|
|
@@ -8922,15 +8894,15 @@ function Ws(r, e, t, n) {
|
|
|
8922
8894
|
b && T && (o.timespan = { begin: b, end: T });
|
|
8923
8895
|
}
|
|
8924
8896
|
if (c !== null && (o.timestamp = _(k(c, "when")) ?? (/* @__PURE__ */ new Date()).toISOString()), y !== null) {
|
|
8925
|
-
const b =
|
|
8897
|
+
const b = pn(_(k(y, "color"))), T = b[0], j = b[1], R = Number.parseFloat(_(k(y, "width")) ?? "");
|
|
8926
8898
|
T && (o.stroke = T), Number.isNaN(j) || (o["stroke-opacity"] = j), Number.isNaN(R) || (o["stroke-width"] = R);
|
|
8927
8899
|
}
|
|
8928
8900
|
if (v) {
|
|
8929
|
-
const b =
|
|
8901
|
+
const b = pn(_(k(v, "color"))), T = b[0], j = b[1], R = _(k(v, "fill")), ae = _(k(v, "outline"));
|
|
8930
8902
|
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);
|
|
8931
8903
|
}
|
|
8932
8904
|
if (p) {
|
|
8933
|
-
const b =
|
|
8905
|
+
const b = U(p, "Data"), T = U(p, "SimpleData");
|
|
8934
8906
|
for (f = 0; f < b.length; f++)
|
|
8935
8907
|
o[b[f].getAttribute("name") ?? ""] = _(k(b[f], "value")) ?? "";
|
|
8936
8908
|
for (f = 0; f < T.length; f++)
|
|
@@ -8947,13 +8919,13 @@ function Ws(r, e, t, n) {
|
|
|
8947
8919
|
};
|
|
8948
8920
|
return Te(r, "id") && (w.id = Te(r, "id") ?? void 0), [w];
|
|
8949
8921
|
}
|
|
8950
|
-
function
|
|
8951
|
-
const t =
|
|
8922
|
+
function pa(r, e) {
|
|
8923
|
+
const t = U(r, e), n = [], a = [];
|
|
8952
8924
|
let o = [];
|
|
8953
8925
|
const i = t.length;
|
|
8954
8926
|
if (!(i < 2)) {
|
|
8955
8927
|
for (let s = 0; s < i; s++) {
|
|
8956
|
-
const l =
|
|
8928
|
+
const l = ma(t[s]);
|
|
8957
8929
|
n.push(l.coordinates), l.time && a.push(l.time), (l.heartRate || o.length) && (o.length === 0 && (o = new Array(s).fill(null)), o.push(l.heartRate));
|
|
8958
8930
|
}
|
|
8959
8931
|
return {
|
|
@@ -8963,11 +8935,11 @@ function da(r, e) {
|
|
|
8963
8935
|
};
|
|
8964
8936
|
}
|
|
8965
8937
|
}
|
|
8966
|
-
function
|
|
8967
|
-
const e =
|
|
8938
|
+
function Ks(r) {
|
|
8939
|
+
const e = U(r, "trkseg"), t = [], n = [], a = [];
|
|
8968
8940
|
let o;
|
|
8969
8941
|
for (let s = 0; s < e.length; s++)
|
|
8970
|
-
if (o =
|
|
8942
|
+
if (o = pa(e[s], "trkpt"), o !== void 0 && (o.line && t.push(o.line), o.times && o.times.length && n.push(o.times), a.length || o.heartRates && o.heartRates.length)) {
|
|
8971
8943
|
if (!a.length)
|
|
8972
8944
|
for (let l = 0; l < s; l++)
|
|
8973
8945
|
a.push(new Array(t[l].length).fill(null));
|
|
@@ -8976,7 +8948,7 @@ function Zs(r) {
|
|
|
8976
8948
|
if (t.length === 0) return;
|
|
8977
8949
|
const i = {
|
|
8978
8950
|
...Tr(r),
|
|
8979
|
-
...
|
|
8951
|
+
...fa(k(r, "extensions"))
|
|
8980
8952
|
};
|
|
8981
8953
|
return n.length !== 0 && (i.coordTimes = t.length === 1 ? n[0] : n), a.length !== 0 && (i.heartRates = t.length === 1 ? a[0] : a), t.length === 1 ? {
|
|
8982
8954
|
type: "Feature",
|
|
@@ -8994,13 +8966,13 @@ function Zs(r) {
|
|
|
8994
8966
|
}
|
|
8995
8967
|
};
|
|
8996
8968
|
}
|
|
8997
|
-
function
|
|
8998
|
-
const e =
|
|
8969
|
+
function Ws(r) {
|
|
8970
|
+
const e = pa(r, "rtept");
|
|
8999
8971
|
return e === void 0 ? void 0 : {
|
|
9000
8972
|
type: "Feature",
|
|
9001
8973
|
properties: {
|
|
9002
8974
|
...Tr(r),
|
|
9003
|
-
...
|
|
8975
|
+
...fa(k(r, "extensions"))
|
|
9004
8976
|
},
|
|
9005
8977
|
geometry: {
|
|
9006
8978
|
type: "LineString",
|
|
@@ -9008,17 +8980,17 @@ function Js(r) {
|
|
|
9008
8980
|
}
|
|
9009
8981
|
};
|
|
9010
8982
|
}
|
|
9011
|
-
function
|
|
8983
|
+
function Zs(r) {
|
|
9012
8984
|
return {
|
|
9013
8985
|
type: "Feature",
|
|
9014
8986
|
properties: { ...Tr(r), ...rr(r, ["sym"]) },
|
|
9015
8987
|
geometry: {
|
|
9016
8988
|
type: "Point",
|
|
9017
|
-
coordinates:
|
|
8989
|
+
coordinates: ma(r).coordinates
|
|
9018
8990
|
}
|
|
9019
8991
|
};
|
|
9020
8992
|
}
|
|
9021
|
-
function
|
|
8993
|
+
function fa(r) {
|
|
9022
8994
|
const e = {};
|
|
9023
8995
|
if (r) {
|
|
9024
8996
|
const t = k(r, "line");
|
|
@@ -9037,7 +9009,7 @@ function Tr(r) {
|
|
|
9037
9009
|
"type",
|
|
9038
9010
|
"time",
|
|
9039
9011
|
"keywords"
|
|
9040
|
-
]), t =
|
|
9012
|
+
]), t = U(r, "link");
|
|
9041
9013
|
if (t.length !== 0) {
|
|
9042
9014
|
e.links = [];
|
|
9043
9015
|
for (const n of Array.from(t)) {
|
|
@@ -9050,34 +9022,34 @@ function Tr(r) {
|
|
|
9050
9022
|
}
|
|
9051
9023
|
return e;
|
|
9052
9024
|
}
|
|
9053
|
-
function
|
|
9025
|
+
function fn(r) {
|
|
9054
9026
|
let e = 0;
|
|
9055
9027
|
if (!r || !r.length) return e;
|
|
9056
9028
|
for (let t = 0; t < r.length; t++)
|
|
9057
9029
|
e = (e << 5) - e + r.charCodeAt(t) | 0;
|
|
9058
9030
|
return e;
|
|
9059
9031
|
}
|
|
9060
|
-
function
|
|
9032
|
+
function U(r, e) {
|
|
9061
9033
|
return r.getElementsByTagName(e);
|
|
9062
9034
|
}
|
|
9063
9035
|
function Te(r, e) {
|
|
9064
9036
|
return r.getAttribute(e);
|
|
9065
9037
|
}
|
|
9066
|
-
function
|
|
9038
|
+
function dn(r, e) {
|
|
9067
9039
|
return Number.parseFloat(Te(r, e) ?? "0");
|
|
9068
9040
|
}
|
|
9069
9041
|
function k(r, e) {
|
|
9070
|
-
const t =
|
|
9042
|
+
const t = U(r, e);
|
|
9071
9043
|
return t.length ? t[0] : null;
|
|
9072
9044
|
}
|
|
9073
|
-
function
|
|
9045
|
+
function Js(r) {
|
|
9074
9046
|
return r.normalize && r.normalize(), r;
|
|
9075
9047
|
}
|
|
9076
|
-
function
|
|
9048
|
+
function da(r) {
|
|
9077
9049
|
return r.map(Number.parseFloat).map((e) => Number.isNaN(e) ? null : e);
|
|
9078
9050
|
}
|
|
9079
9051
|
function _(r) {
|
|
9080
|
-
return r &&
|
|
9052
|
+
return r && Js(r), r && r.textContent;
|
|
9081
9053
|
}
|
|
9082
9054
|
function rr(r, e) {
|
|
9083
9055
|
const t = {};
|
|
@@ -9086,16 +9058,16 @@ function rr(r, e) {
|
|
|
9086
9058
|
n = k(r, e[a]), n && (t[e[a]] = _(n) ?? "");
|
|
9087
9059
|
return t;
|
|
9088
9060
|
}
|
|
9089
|
-
function
|
|
9090
|
-
return
|
|
9061
|
+
function ya(r) {
|
|
9062
|
+
return da(r.replace(/\s*/g, "").split(","));
|
|
9091
9063
|
}
|
|
9092
|
-
function
|
|
9064
|
+
function yn(r) {
|
|
9093
9065
|
const e = r.replace(/^\s*|\s*$/g, "").split(/\s+/), t = [];
|
|
9094
|
-
for (const n of e) t.push(
|
|
9066
|
+
for (const n of e) t.push(ya(n));
|
|
9095
9067
|
return t;
|
|
9096
9068
|
}
|
|
9097
|
-
function
|
|
9098
|
-
const e = [
|
|
9069
|
+
function ma(r) {
|
|
9070
|
+
const e = [dn(r, "lon"), dn(r, "lat")], t = k(r, "ele"), n = k(r, "gpxtpx:hr") || k(r, "hr"), a = k(r, "time");
|
|
9099
9071
|
let o;
|
|
9100
9072
|
return t && (o = Number.parseFloat(_(t) ?? "0"), Number.isNaN(o) || e.push(o)), {
|
|
9101
9073
|
coordinates: e,
|
|
@@ -9103,7 +9075,7 @@ function ga(r) {
|
|
|
9103
9075
|
heartRate: n !== null ? Number.parseFloat(_(n) ?? "0") : null
|
|
9104
9076
|
};
|
|
9105
9077
|
}
|
|
9106
|
-
function
|
|
9078
|
+
function Ys(r) {
|
|
9107
9079
|
let e = r;
|
|
9108
9080
|
try {
|
|
9109
9081
|
typeof e == "string" && (e = Ar(e));
|
|
@@ -9111,11 +9083,11 @@ function Qs(r) {
|
|
|
9111
9083
|
return null;
|
|
9112
9084
|
}
|
|
9113
9085
|
try {
|
|
9114
|
-
return
|
|
9086
|
+
return ua(e);
|
|
9115
9087
|
} catch {
|
|
9116
9088
|
}
|
|
9117
9089
|
try {
|
|
9118
|
-
return
|
|
9090
|
+
return ca(e);
|
|
9119
9091
|
} catch {
|
|
9120
9092
|
}
|
|
9121
9093
|
return null;
|
|
@@ -9124,7 +9096,7 @@ function ot(r) {
|
|
|
9124
9096
|
const e = r.toString(16);
|
|
9125
9097
|
return e.length === 1 ? `0${e}` : e;
|
|
9126
9098
|
}
|
|
9127
|
-
function
|
|
9099
|
+
function Xs(r) {
|
|
9128
9100
|
return `#${ot(r[0])}${ot(r[1])}${ot(r[2])}${r.length === 4 ? ot(r[3]) : ""}`;
|
|
9129
9101
|
}
|
|
9130
9102
|
class x extends Array {
|
|
@@ -9220,7 +9192,7 @@ class x extends Array {
|
|
|
9220
9192
|
smooth: !0,
|
|
9221
9193
|
withAlpha: !1
|
|
9222
9194
|
}) {
|
|
9223
|
-
return
|
|
9195
|
+
return Xs(this.getColor(t, n));
|
|
9224
9196
|
}
|
|
9225
9197
|
/**
|
|
9226
9198
|
* Get the color of the color ramp at a relative position in [0, 1]
|
|
@@ -9307,7 +9279,7 @@ class x extends Array {
|
|
|
9307
9279
|
return this[0].color.length === 4 && this[0].color[3] === 0;
|
|
9308
9280
|
}
|
|
9309
9281
|
}
|
|
9310
|
-
const
|
|
9282
|
+
const ha = {
|
|
9311
9283
|
/**
|
|
9312
9284
|
* A fully transparent [0, 0, 0, 0] colorramp to hide data.
|
|
9313
9285
|
* Defined in interval [0, 1], without unit.
|
|
@@ -10063,8 +10035,8 @@ const va = {
|
|
|
10063
10035
|
]
|
|
10064
10036
|
})
|
|
10065
10037
|
};
|
|
10066
|
-
async function
|
|
10067
|
-
const t = e.download ?? !1, n = await
|
|
10038
|
+
async function Qs(r, e = {}) {
|
|
10039
|
+
const t = e.download ?? !1, n = await el(r);
|
|
10068
10040
|
if (t) {
|
|
10069
10041
|
const a = e.filename ?? "maptiler_screenshot.png", o = document.createElement("a");
|
|
10070
10042
|
o.style.display = "none", document.body.appendChild(o), o.href = URL.createObjectURL(n), o.download = a, o.click(), setTimeout(() => {
|
|
@@ -10073,7 +10045,7 @@ async function tl(r, e = {}) {
|
|
|
10073
10045
|
}
|
|
10074
10046
|
return n;
|
|
10075
10047
|
}
|
|
10076
|
-
function
|
|
10048
|
+
function el(r) {
|
|
10077
10049
|
return new Promise((e, t) => {
|
|
10078
10050
|
r.redraw(), r.once("idle", () => {
|
|
10079
10051
|
r.getCanvas().toBlob((n) => {
|
|
@@ -10084,7 +10056,7 @@ function rl(r) {
|
|
|
10084
10056
|
});
|
|
10085
10057
|
});
|
|
10086
10058
|
}
|
|
10087
|
-
const
|
|
10059
|
+
const mn = [
|
|
10088
10060
|
// https://colorhunt.co/palette/1d5b79468b97ef6262f3aa60
|
|
10089
10061
|
["#1D5B79", "#468B97", "#EF6262", "#F3AA60"],
|
|
10090
10062
|
// https://colorhunt.co/palette/614bc333bbc585e6c5c8ffe0
|
|
@@ -10104,16 +10076,16 @@ const hn = [
|
|
|
10104
10076
|
// https://colorhunt.co/palette/10a19d540375ff7000ffbf00
|
|
10105
10077
|
["#10A19D", "#540375", "#FF7000", "#FFBF00"]
|
|
10106
10078
|
];
|
|
10107
|
-
function
|
|
10108
|
-
return
|
|
10079
|
+
function Ir() {
|
|
10080
|
+
return mn[~~(Math.random() * mn.length)][~~(Math.random() * 4)];
|
|
10109
10081
|
}
|
|
10110
10082
|
function zt() {
|
|
10111
|
-
return `maptiler_source_${
|
|
10083
|
+
return `maptiler_source_${xn()}`;
|
|
10112
10084
|
}
|
|
10113
10085
|
function _t() {
|
|
10114
|
-
return `maptiler_layer_${
|
|
10086
|
+
return `maptiler_layer_${xn()}`;
|
|
10115
10087
|
}
|
|
10116
|
-
function
|
|
10088
|
+
function hn(r, e) {
|
|
10117
10089
|
if (e <= r[0].zoom)
|
|
10118
10090
|
return r[0].value;
|
|
10119
10091
|
if (e >= r[r.length - 1].zoom)
|
|
@@ -10125,13 +10097,13 @@ function gn(r, e) {
|
|
|
10125
10097
|
}
|
|
10126
10098
|
return 0;
|
|
10127
10099
|
}
|
|
10128
|
-
function
|
|
10100
|
+
function Ie(r) {
|
|
10129
10101
|
return ["interpolate", ["linear"], ["zoom"], ...r.flatMap((e) => [e.zoom, e.value])];
|
|
10130
10102
|
}
|
|
10131
10103
|
function P(r) {
|
|
10132
10104
|
return ["interpolate", ["linear"], ["zoom"], ...r.flatMap((e) => [e.zoom, e.value])];
|
|
10133
10105
|
}
|
|
10134
|
-
function
|
|
10106
|
+
function tl(r, e) {
|
|
10135
10107
|
if (typeof e == "number" && typeof r == "number")
|
|
10136
10108
|
return 2 * e + r;
|
|
10137
10109
|
if (typeof e == "number" && Array.isArray(r))
|
|
@@ -10146,15 +10118,15 @@ function nl(r, e) {
|
|
|
10146
10118
|
"interpolate",
|
|
10147
10119
|
["linear"],
|
|
10148
10120
|
["zoom"],
|
|
10149
|
-
...t.flatMap((n) => [n, 2 *
|
|
10121
|
+
...t.flatMap((n) => [n, 2 * hn(e, n) + hn(r, n)])
|
|
10150
10122
|
];
|
|
10151
10123
|
}
|
|
10152
10124
|
return 0;
|
|
10153
10125
|
}
|
|
10154
|
-
function
|
|
10126
|
+
function rl(r, e) {
|
|
10155
10127
|
return ["interpolate", ["linear"], ["get", e], ...r.flatMap((t) => [t.propertyValue, t.value])];
|
|
10156
10128
|
}
|
|
10157
|
-
function
|
|
10129
|
+
function ga(r) {
|
|
10158
10130
|
const e = r.trimStart(), t = `${e}${" ".repeat(r.length - e.length)}`, n = Array.from(t);
|
|
10159
10131
|
if (!n.every((s) => s === " " || s === "_"))
|
|
10160
10132
|
throw new Error("A dash pattern must be composed only of whitespace and underscore characters.");
|
|
@@ -10167,10 +10139,10 @@ function ba(r) {
|
|
|
10167
10139
|
}
|
|
10168
10140
|
return i;
|
|
10169
10141
|
}
|
|
10170
|
-
function
|
|
10142
|
+
function gn(r, e) {
|
|
10171
10143
|
return ["interpolate", ["linear"], ["get", e], ...r.flatMap((t) => [t.value, t.color])];
|
|
10172
10144
|
}
|
|
10173
|
-
function
|
|
10145
|
+
function vn(r, e, t = !0) {
|
|
10174
10146
|
return t ? [
|
|
10175
10147
|
"interpolate",
|
|
10176
10148
|
["linear"],
|
|
@@ -10187,7 +10159,7 @@ function bn(r, e, t = !0) {
|
|
|
10187
10159
|
["interpolate", ["linear"], ["get", e], ...r.flatMap((n) => [n.value, n.pointRadius])]
|
|
10188
10160
|
] : ["interpolate", ["linear"], ["get", e], ...r.flatMap((n) => [n.value, n.pointRadius])];
|
|
10189
10161
|
}
|
|
10190
|
-
function
|
|
10162
|
+
function nl(r, e, t = !0) {
|
|
10191
10163
|
return t ? [
|
|
10192
10164
|
"interpolate",
|
|
10193
10165
|
["linear"],
|
|
@@ -10204,7 +10176,7 @@ function ol(r, e, t = !0) {
|
|
|
10204
10176
|
["interpolate", ["linear"], ["get", e], ...r.flatMap((n) => [n.propertyValue, n.value])]
|
|
10205
10177
|
] : ["interpolate", ["linear"], ["get", e], ...r.flatMap((n) => [n.propertyValue, n.value])];
|
|
10206
10178
|
}
|
|
10207
|
-
function
|
|
10179
|
+
function bn(r, e) {
|
|
10208
10180
|
return r.every((t) => t.color[3] === r[0].color[3]) ? r[0].color[3] ? r[0].color[3] / 255 : 1 : [
|
|
10209
10181
|
"interpolate",
|
|
10210
10182
|
["linear"],
|
|
@@ -10215,7 +10187,7 @@ function wn(r, e) {
|
|
|
10215
10187
|
})
|
|
10216
10188
|
];
|
|
10217
10189
|
}
|
|
10218
|
-
function
|
|
10190
|
+
function al(r, e = 10) {
|
|
10219
10191
|
return [
|
|
10220
10192
|
"interpolate",
|
|
10221
10193
|
["linear"],
|
|
@@ -10226,7 +10198,7 @@ function il(r, e = 10) {
|
|
|
10226
10198
|
}).flat()
|
|
10227
10199
|
];
|
|
10228
10200
|
}
|
|
10229
|
-
async function
|
|
10201
|
+
async function ol(r, e, t = {}) {
|
|
10230
10202
|
var a, o;
|
|
10231
10203
|
if (!e.sourceId && !e.data)
|
|
10232
10204
|
throw new Error("Creating a polyline layer requires an existing .sourceId or a valid .data property");
|
|
@@ -10236,23 +10208,23 @@ async function sl(r, e, t = {}) {
|
|
|
10236
10208
|
n = `https://api.maptiler.com/data/${e.data}/features.json?key=${F.apiKey}`;
|
|
10237
10209
|
else if (((a = n.split(".").pop()) == null ? void 0 : a.toLowerCase().trim()) === "gpx") {
|
|
10238
10210
|
const s = await (await fetch(n, t)).text();
|
|
10239
|
-
n =
|
|
10211
|
+
n = ua(s);
|
|
10240
10212
|
} else if (((o = n.split(".").pop()) == null ? void 0 : o.toLowerCase().trim()) === "kml") {
|
|
10241
10213
|
const s = await (await fetch(n, t)).text();
|
|
10242
|
-
n =
|
|
10214
|
+
n = ca(s);
|
|
10243
10215
|
} else {
|
|
10244
|
-
const i =
|
|
10216
|
+
const i = lo(n) ?? Ys(n);
|
|
10245
10217
|
i && (n = i);
|
|
10246
10218
|
}
|
|
10247
10219
|
if (!n)
|
|
10248
10220
|
throw new Error("Polyline data was provided as string but is incompatible with valid formats.");
|
|
10249
10221
|
}
|
|
10250
|
-
return
|
|
10222
|
+
return il(r, {
|
|
10251
10223
|
...e,
|
|
10252
10224
|
data: n
|
|
10253
10225
|
});
|
|
10254
10226
|
}
|
|
10255
|
-
function
|
|
10227
|
+
function il(r, e) {
|
|
10256
10228
|
if (e.layerId && r.getLayer(e.layerId))
|
|
10257
10229
|
throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
|
|
10258
10230
|
const t = e.sourceId ?? zt(), n = e.layerId ?? _t(), a = {
|
|
@@ -10264,10 +10236,10 @@ function ll(r, e) {
|
|
|
10264
10236
|
type: "geojson",
|
|
10265
10237
|
data: e.data
|
|
10266
10238
|
});
|
|
10267
|
-
const o = e.lineWidth ?? 3, i = e.lineColor ??
|
|
10239
|
+
const o = e.lineWidth ?? 3, i = e.lineColor ?? Ir(), s = e.lineOpacity ?? 1, l = e.lineBlur ?? 0, u = e.lineGapWidth ?? 0;
|
|
10268
10240
|
let c = e.lineDashArray ?? null;
|
|
10269
10241
|
const p = e.outlineWidth ?? 1, m = e.outlineColor ?? "#FFFFFF", f = e.outlineOpacity ?? 1, d = e.outlineBlur ?? 0;
|
|
10270
|
-
if (typeof c == "string" && (c =
|
|
10242
|
+
if (typeof c == "string" && (c = ga(c)), e.outline === !0) {
|
|
10271
10243
|
const y = `${n}_outline`;
|
|
10272
10244
|
a.polylineOutlineLayerId = y, r.addLayer(
|
|
10273
10245
|
{
|
|
@@ -10282,8 +10254,8 @@ function ll(r, e) {
|
|
|
10282
10254
|
maxzoom: e.maxzoom ?? 23,
|
|
10283
10255
|
paint: {
|
|
10284
10256
|
"line-opacity": typeof f == "number" ? f : P(f),
|
|
10285
|
-
"line-color": typeof m == "string" ? m :
|
|
10286
|
-
"line-width":
|
|
10257
|
+
"line-color": typeof m == "string" ? m : Ie(m),
|
|
10258
|
+
"line-width": tl(o, p),
|
|
10287
10259
|
"line-blur": typeof d == "number" ? d : P(d)
|
|
10288
10260
|
}
|
|
10289
10261
|
},
|
|
@@ -10303,7 +10275,7 @@ function ll(r, e) {
|
|
|
10303
10275
|
maxzoom: e.maxzoom ?? 23,
|
|
10304
10276
|
paint: {
|
|
10305
10277
|
"line-opacity": typeof s == "number" ? s : P(s),
|
|
10306
|
-
"line-color": typeof i == "string" ? i :
|
|
10278
|
+
"line-color": typeof i == "string" ? i : Ie(i),
|
|
10307
10279
|
"line-width": typeof o == "number" ? o : P(o),
|
|
10308
10280
|
"line-blur": typeof l == "number" ? l : P(l),
|
|
10309
10281
|
"line-gap-width": typeof u == "number" ? u : P(u),
|
|
@@ -10318,7 +10290,7 @@ function ll(r, e) {
|
|
|
10318
10290
|
e.beforeId
|
|
10319
10291
|
), a;
|
|
10320
10292
|
}
|
|
10321
|
-
function
|
|
10293
|
+
function sl(r, e) {
|
|
10322
10294
|
if (e.layerId && r.getLayer(e.layerId))
|
|
10323
10295
|
throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
|
|
10324
10296
|
const t = e.sourceId ?? zt(), n = e.layerId ?? _t(), a = {
|
|
@@ -10334,8 +10306,8 @@ function ul(r, e) {
|
|
|
10334
10306
|
});
|
|
10335
10307
|
}
|
|
10336
10308
|
let o = e.outlineDashArray ?? null;
|
|
10337
|
-
const i = e.outlineWidth ?? 1, s = e.outlineColor ?? "#FFFFFF", l = e.outlineOpacity ?? 1, u = e.outlineBlur ?? 0, c = e.fillColor ??
|
|
10338
|
-
typeof o == "string" && (o =
|
|
10309
|
+
const i = e.outlineWidth ?? 1, s = e.outlineColor ?? "#FFFFFF", l = e.outlineOpacity ?? 1, u = e.outlineBlur ?? 0, c = e.fillColor ?? Ir(), p = e.fillOpacity ?? 1, m = e.outlinePosition ?? "center", f = e.pattern ?? null;
|
|
10310
|
+
typeof o == "string" && (o = ga(o));
|
|
10339
10311
|
const d = (y = null) => {
|
|
10340
10312
|
if (r.addLayer(
|
|
10341
10313
|
{
|
|
@@ -10345,7 +10317,7 @@ function ul(r, e) {
|
|
|
10345
10317
|
minzoom: e.minzoom ?? 0,
|
|
10346
10318
|
maxzoom: e.maxzoom ?? 23,
|
|
10347
10319
|
paint: {
|
|
10348
|
-
"fill-color": typeof c == "string" ? c :
|
|
10320
|
+
"fill-color": typeof c == "string" ? c : Ie(c),
|
|
10349
10321
|
"fill-opacity": typeof p == "number" ? p : P(p),
|
|
10350
10322
|
// Adding a pattern if provided
|
|
10351
10323
|
...y && { "fill-pattern": y }
|
|
@@ -10377,7 +10349,7 @@ function ul(r, e) {
|
|
|
10377
10349
|
maxzoom: e.maxzoom ?? 23,
|
|
10378
10350
|
paint: {
|
|
10379
10351
|
"line-opacity": typeof l == "number" ? l : P(l),
|
|
10380
|
-
"line-color": typeof s == "string" ? s :
|
|
10352
|
+
"line-color": typeof s == "string" ? s : Ie(s),
|
|
10381
10353
|
"line-width": typeof i == "number" ? i : P(i),
|
|
10382
10354
|
"line-blur": typeof u == "number" ? u : P(u),
|
|
10383
10355
|
"line-offset": v,
|
|
@@ -10399,13 +10371,13 @@ function ul(r, e) {
|
|
|
10399
10371
|
r.addImage(f, y.data), d(f);
|
|
10400
10372
|
}).catch((y) => (console.error("Could not load the pattern image.", y.message), d())) : d(), a;
|
|
10401
10373
|
}
|
|
10402
|
-
function
|
|
10374
|
+
function ll(r, e) {
|
|
10403
10375
|
if (e.layerId && r.getLayer(e.layerId))
|
|
10404
10376
|
throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
|
|
10405
|
-
const t = e.minPointRadius ?? 10, n = e.maxPointRadius ?? 50, a = e.cluster ?? !1, o = 20, i = Array.isArray(e.pointColor) ? e.pointColor :
|
|
10377
|
+
const t = e.minPointRadius ?? 10, n = e.maxPointRadius ?? 50, a = e.cluster ?? !1, o = 20, i = Array.isArray(e.pointColor) ? e.pointColor : ha.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";
|
|
10406
10378
|
let v;
|
|
10407
10379
|
const w = e.zoomCompensation ?? !0, b = e.minzoom ?? 0, T = e.maxzoom ?? 23;
|
|
10408
|
-
typeof e.pointOpacity == "number" ? v = e.pointOpacity : Array.isArray(e.pointOpacity) ? v = P(e.pointOpacity) : e.cluster ? v =
|
|
10380
|
+
typeof e.pointOpacity == "number" ? v = e.pointOpacity : Array.isArray(e.pointOpacity) ? v = P(e.pointOpacity) : e.cluster ? v = bn(i, "point_count") : e.property ? v = bn(i, e.property) : v = P([
|
|
10409
10381
|
{ zoom: b, value: 0 },
|
|
10410
10382
|
{ zoom: b + 0.25, value: 1 },
|
|
10411
10383
|
{ zoom: T - 0.25, value: 1 },
|
|
@@ -10443,8 +10415,8 @@ function cl(r, e) {
|
|
|
10443
10415
|
filter: ["has", "point_count"],
|
|
10444
10416
|
paint: {
|
|
10445
10417
|
// 'circle-color': options.pointColor ?? colorDrivenByProperty(clusterStyle, "point_count"),
|
|
10446
|
-
"circle-color": typeof e.pointColor == "string" ? e.pointColor :
|
|
10447
|
-
"circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ? P(e.pointRadius) :
|
|
10418
|
+
"circle-color": typeof e.pointColor == "string" ? e.pointColor : gn(R, "point_count"),
|
|
10419
|
+
"circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ? P(e.pointRadius) : vn(R, "point_count", !1),
|
|
10448
10420
|
"circle-pitch-alignment": p ? "viewport" : "map",
|
|
10449
10421
|
"circle-pitch-scale": "map",
|
|
10450
10422
|
// scale with camera distance regardless of viewport/biewport alignement
|
|
@@ -10452,7 +10424,7 @@ function cl(r, e) {
|
|
|
10452
10424
|
...m && {
|
|
10453
10425
|
"circle-stroke-opacity": typeof f == "number" ? f : P(f),
|
|
10454
10426
|
"circle-stroke-width": typeof d == "number" ? d : P(d),
|
|
10455
|
-
"circle-stroke-color": typeof y == "string" ? y :
|
|
10427
|
+
"circle-stroke-color": typeof y == "string" ? y : Ie(y)
|
|
10456
10428
|
}
|
|
10457
10429
|
},
|
|
10458
10430
|
minzoom: b,
|
|
@@ -10476,7 +10448,7 @@ function cl(r, e) {
|
|
|
10476
10448
|
...m && {
|
|
10477
10449
|
"circle-stroke-opacity": typeof f == "number" ? f : P(f),
|
|
10478
10450
|
"circle-stroke-width": typeof d == "number" ? d : P(d),
|
|
10479
|
-
"circle-stroke-color": typeof y == "string" ? y :
|
|
10451
|
+
"circle-stroke-color": typeof y == "string" ? y : Ie(y)
|
|
10480
10452
|
}
|
|
10481
10453
|
},
|
|
10482
10454
|
minzoom: b,
|
|
@@ -10485,7 +10457,7 @@ function cl(r, e) {
|
|
|
10485
10457
|
e.beforeId
|
|
10486
10458
|
);
|
|
10487
10459
|
} else {
|
|
10488
|
-
let R = typeof e.pointColor == "string" ? e.pointColor : Array.isArray(e.pointColor) ? e.pointColor.getColorHex(e.pointColor.getBounds().min) :
|
|
10460
|
+
let R = typeof e.pointColor == "string" ? e.pointColor : Array.isArray(e.pointColor) ? e.pointColor.getColorHex(e.pointColor.getBounds().min) : Ir(), ae = typeof e.pointRadius == "number" ? w ? P([
|
|
10489
10461
|
{ zoom: 0, value: e.pointRadius * 0.025 },
|
|
10490
10462
|
{ zoom: 2, value: e.pointRadius * 0.05 },
|
|
10491
10463
|
{ zoom: 4, value: e.pointRadius * 0.1 },
|
|
@@ -10507,7 +10479,7 @@ function cl(r, e) {
|
|
|
10507
10479
|
color: typeof e.pointColor == "string" ? e.pointColor : i.getColorHex(tt)
|
|
10508
10480
|
};
|
|
10509
10481
|
});
|
|
10510
|
-
R =
|
|
10482
|
+
R = gn(we, e.property), ae = vn(we, e.property, w);
|
|
10511
10483
|
}
|
|
10512
10484
|
r.addLayer(
|
|
10513
10485
|
{
|
|
@@ -10528,7 +10500,7 @@ function cl(r, e) {
|
|
|
10528
10500
|
...m && {
|
|
10529
10501
|
"circle-stroke-opacity": typeof f == "number" ? f : P(f),
|
|
10530
10502
|
"circle-stroke-width": typeof d == "number" ? d : P(d),
|
|
10531
|
-
"circle-stroke-color": typeof y == "string" ? y :
|
|
10503
|
+
"circle-stroke-color": typeof y == "string" ? y : Ie(y)
|
|
10532
10504
|
}
|
|
10533
10505
|
},
|
|
10534
10506
|
minzoom: b,
|
|
@@ -10566,7 +10538,7 @@ function cl(r, e) {
|
|
|
10566
10538
|
}
|
|
10567
10539
|
return j;
|
|
10568
10540
|
}
|
|
10569
|
-
function
|
|
10541
|
+
function ul(r, e) {
|
|
10570
10542
|
if (e.layerId && r.getLayer(e.layerId))
|
|
10571
10543
|
throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
|
|
10572
10544
|
const t = e.sourceId ?? zt(), n = e.layerId ?? _t(), a = e.minzoom ?? 0, o = e.maxzoom ?? 23, i = e.zoomCompensation ?? !0, s = e.opacity ?? [
|
|
@@ -10575,7 +10547,7 @@ function pl(r, e) {
|
|
|
10575
10547
|
{ zoom: o - 0.25, value: 1 },
|
|
10576
10548
|
{ zoom: o, value: 0 }
|
|
10577
10549
|
];
|
|
10578
|
-
let l = Array.isArray(e.colorRamp) ? e.colorRamp :
|
|
10550
|
+
let l = Array.isArray(e.colorRamp) ? e.colorRamp : ha.TURBO.transparentStart();
|
|
10579
10551
|
const u = l.getBounds();
|
|
10580
10552
|
(u.min !== 0 || u.max !== 1) && (l = l.scale(0, 1)), l.hasTransparentStart() || (l = l.transparentStart());
|
|
10581
10553
|
const c = e.intensity ?? [
|
|
@@ -10586,7 +10558,7 @@ function pl(r, e) {
|
|
|
10586
10558
|
let f = 1;
|
|
10587
10559
|
p ? typeof m == "number" ? (f = m, typeof e.weight == "number" && console.warn(
|
|
10588
10560
|
"The option `.property` is ignored when `.propertyValueWeights` is not of type `PropertyValueWeights`"
|
|
10589
|
-
)) : Array.isArray(m) ? f =
|
|
10561
|
+
)) : Array.isArray(m) ? f = rl(m, p) : console.warn(
|
|
10590
10562
|
"The option `.property` is ignored when `.propertyValueWeights` is not of type `PropertyValueWeights`"
|
|
10591
10563
|
) : typeof m == "number" ? f = m : Array.isArray(m) && console.warn("The options `.propertyValueWeights` can only be used when `.property` is provided.");
|
|
10592
10564
|
const d = [
|
|
@@ -10597,7 +10569,7 @@ function pl(r, e) {
|
|
|
10597
10569
|
{ zoom: 16, value: 50 }
|
|
10598
10570
|
], y = e.radius ?? (i ? d : 10);
|
|
10599
10571
|
let v = 1;
|
|
10600
|
-
typeof y == "number" ? v = y : Array.isArray(y) && "zoom" in y[0] ? v = P(y) : p && Array.isArray(y) && "propertyValue" in y[0] ? v =
|
|
10572
|
+
typeof y == "number" ? v = y : Array.isArray(y) && "zoom" in y[0] ? v = P(y) : p && Array.isArray(y) && "propertyValue" in y[0] ? v = nl(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);
|
|
10601
10573
|
const w = {
|
|
10602
10574
|
heatmapLayerId: n,
|
|
10603
10575
|
heatmapSourceId: t
|
|
@@ -10619,7 +10591,7 @@ function pl(r, e) {
|
|
|
10619
10591
|
paint: {
|
|
10620
10592
|
"heatmap-weight": f,
|
|
10621
10593
|
"heatmap-intensity": typeof c == "number" ? c : P(c),
|
|
10622
|
-
"heatmap-color":
|
|
10594
|
+
"heatmap-color": al(l),
|
|
10623
10595
|
"heatmap-radius": v,
|
|
10624
10596
|
"heatmap-opacity": typeof s == "number" ? s : P(s)
|
|
10625
10597
|
}
|
|
@@ -10627,176 +10599,176 @@ function pl(r, e) {
|
|
|
10627
10599
|
e.beforeId
|
|
10628
10600
|
), w;
|
|
10629
10601
|
}
|
|
10630
|
-
const
|
|
10631
|
-
addPolyline:
|
|
10632
|
-
addPolygon:
|
|
10633
|
-
addPoint:
|
|
10634
|
-
addHeatmap:
|
|
10635
|
-
takeScreenshot:
|
|
10602
|
+
const Nl = {
|
|
10603
|
+
addPolyline: ol,
|
|
10604
|
+
addPolygon: sl,
|
|
10605
|
+
addPoint: ll,
|
|
10606
|
+
addHeatmap: ul,
|
|
10607
|
+
takeScreenshot: Qs
|
|
10636
10608
|
};
|
|
10637
|
-
|
|
10638
|
-
function
|
|
10639
|
-
return
|
|
10640
|
-
}
|
|
10641
|
-
const
|
|
10642
|
-
setRTLTextPlugin:
|
|
10643
|
-
getRTLTextPluginStatus:
|
|
10644
|
-
LngLat:
|
|
10645
|
-
LngLatBounds:
|
|
10646
|
-
MercatorCoordinate:
|
|
10647
|
-
Evented:
|
|
10648
|
-
AJAXError:
|
|
10649
|
-
prewarm:
|
|
10650
|
-
clearPrewarmedResources:
|
|
10651
|
-
Hash:
|
|
10652
|
-
Point:
|
|
10653
|
-
EdgeInsets:
|
|
10654
|
-
DragRotateHandler:
|
|
10655
|
-
DragPanHandler:
|
|
10656
|
-
TwoFingersTouchZoomRotateHandler:
|
|
10657
|
-
DoubleClickZoomHandler:
|
|
10658
|
-
TwoFingersTouchZoomHandler:
|
|
10659
|
-
TwoFingersTouchRotateHandler:
|
|
10660
|
-
getWorkerCount:
|
|
10661
|
-
setWorkerCount:
|
|
10662
|
-
getMaxParallelImageRequests:
|
|
10663
|
-
setMaxParallelImageRequests:
|
|
10664
|
-
getWorkerUrl:
|
|
10665
|
-
setWorkerUrl:
|
|
10666
|
-
addSourceType:
|
|
10667
|
-
importScriptInWorkers:
|
|
10668
|
-
addProtocol:
|
|
10669
|
-
removeProtocol:
|
|
10609
|
+
io();
|
|
10610
|
+
function Fl() {
|
|
10611
|
+
return wn.version;
|
|
10612
|
+
}
|
|
10613
|
+
const Ol = S.Map, Dl = S.Marker, ql = S.Popup, Bl = S.Style, Ul = S.CanvasSource, Vl = S.GeoJSONSource, Gl = S.ImageSource, Hl = S.RasterTileSource, Kl = S.RasterDEMTileSource, Wl = S.VectorTileSource, Zl = S.VideoSource, Jl = S.NavigationControl, Yl = S.GeolocateControl, Xl = S.AttributionControl, Ql = S.LogoControl, eu = S.ScaleControl, tu = S.FullscreenControl, ru = S.TerrainControl, nu = S.BoxZoomHandler, au = S.ScrollZoomHandler, ou = S.CooperativeGesturesHandler, iu = S.KeyboardHandler, su = S.TwoFingersTouchPitchHandler, lu = S.MapWheelEvent, uu = S.MapTouchEvent, cu = S.MapMouseEvent, pu = S.config, fu = S.getVersion, {
|
|
10614
|
+
setRTLTextPlugin: du,
|
|
10615
|
+
getRTLTextPluginStatus: yu,
|
|
10616
|
+
LngLat: mu,
|
|
10617
|
+
LngLatBounds: hu,
|
|
10618
|
+
MercatorCoordinate: gu,
|
|
10619
|
+
Evented: vu,
|
|
10620
|
+
AJAXError: bu,
|
|
10621
|
+
prewarm: wu,
|
|
10622
|
+
clearPrewarmedResources: Su,
|
|
10623
|
+
Hash: xu,
|
|
10624
|
+
Point: ku,
|
|
10625
|
+
EdgeInsets: Lu,
|
|
10626
|
+
DragRotateHandler: Cu,
|
|
10627
|
+
DragPanHandler: Au,
|
|
10628
|
+
TwoFingersTouchZoomRotateHandler: Tu,
|
|
10629
|
+
DoubleClickZoomHandler: Iu,
|
|
10630
|
+
TwoFingersTouchZoomHandler: Eu,
|
|
10631
|
+
TwoFingersTouchRotateHandler: Mu,
|
|
10632
|
+
getWorkerCount: zu,
|
|
10633
|
+
setWorkerCount: _u,
|
|
10634
|
+
getMaxParallelImageRequests: Pu,
|
|
10635
|
+
setMaxParallelImageRequests: Ru,
|
|
10636
|
+
getWorkerUrl: $u,
|
|
10637
|
+
setWorkerUrl: ju,
|
|
10638
|
+
addSourceType: Nu,
|
|
10639
|
+
importScriptInWorkers: Fu,
|
|
10640
|
+
addProtocol: Ou,
|
|
10641
|
+
removeProtocol: Du
|
|
10670
10642
|
} = S;
|
|
10671
10643
|
export {
|
|
10672
|
-
|
|
10673
|
-
|
|
10674
|
-
|
|
10675
|
-
|
|
10676
|
-
|
|
10677
|
-
|
|
10678
|
-
|
|
10644
|
+
bu as AJAXError,
|
|
10645
|
+
Tl as AttributionControl,
|
|
10646
|
+
Xl as AttributionControlMLGL,
|
|
10647
|
+
El as BoxZoomHandler,
|
|
10648
|
+
nu as BoxZoomHandlerMLGL,
|
|
10649
|
+
wl as CanvasSource,
|
|
10650
|
+
Ul as CanvasSourceMLGL,
|
|
10679
10651
|
x as ColorRamp,
|
|
10680
|
-
|
|
10681
|
-
|
|
10682
|
-
|
|
10683
|
-
|
|
10684
|
-
|
|
10685
|
-
|
|
10686
|
-
|
|
10687
|
-
|
|
10688
|
-
|
|
10689
|
-
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
|
|
10700
|
-
|
|
10701
|
-
|
|
10702
|
-
|
|
10703
|
-
|
|
10704
|
-
|
|
10705
|
-
|
|
10706
|
-
|
|
10707
|
-
|
|
10708
|
-
|
|
10709
|
-
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10652
|
+
ha as ColorRampCollection,
|
|
10653
|
+
zl as CooperativeGesturesHandler,
|
|
10654
|
+
ou as CooperativeGesturesHandlerMLGL,
|
|
10655
|
+
Iu as DoubleClickZoomHandler,
|
|
10656
|
+
Au as DragPanHandler,
|
|
10657
|
+
Cu as DragRotateHandler,
|
|
10658
|
+
Lu as EdgeInsets,
|
|
10659
|
+
vu as Evented,
|
|
10660
|
+
Lo as FullscreenControl,
|
|
10661
|
+
tu as FullscreenControlMLGL,
|
|
10662
|
+
Sl as GeoJSONSource,
|
|
10663
|
+
Vl as GeoJSONSourceMLGL,
|
|
10664
|
+
So as GeolocateControl,
|
|
10665
|
+
Yl as GeolocateControlMLGL,
|
|
10666
|
+
Bs as GeolocationType,
|
|
10667
|
+
xu as Hash,
|
|
10668
|
+
xl as ImageSource,
|
|
10669
|
+
Gl as ImageSourceMLGL,
|
|
10670
|
+
_l as KeyboardHandler,
|
|
10671
|
+
iu as KeyboardHandlerMLGL,
|
|
10672
|
+
M as Language,
|
|
10673
|
+
mu as LngLat,
|
|
10674
|
+
hu as LngLatBounds,
|
|
10675
|
+
xo as LogoControl,
|
|
10676
|
+
Ql as LogoControlMLGL,
|
|
10677
|
+
Us as Map,
|
|
10678
|
+
Ol as MapMLGL,
|
|
10679
|
+
jl as MapMouseEvent,
|
|
10680
|
+
cu as MapMouseEventMLGL,
|
|
10681
|
+
Uu as MapStyle,
|
|
10682
|
+
Vu as MapStyleVariant,
|
|
10683
|
+
$l as MapTouchEvent,
|
|
10684
|
+
uu as MapTouchEventMLGL,
|
|
10685
|
+
Rl as MapWheelEvent,
|
|
10686
|
+
lu as MapWheelEventMLGL,
|
|
10687
|
+
Os as MaptilerGeolocateControl,
|
|
10716
10688
|
Or as MaptilerLogoControl,
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
10724
|
-
|
|
10725
|
-
|
|
10726
|
-
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
|
|
10730
|
-
|
|
10731
|
-
|
|
10732
|
-
|
|
10733
|
-
|
|
10734
|
-
|
|
10735
|
-
|
|
10736
|
-
|
|
10737
|
-
|
|
10738
|
-
|
|
10739
|
-
|
|
10740
|
-
|
|
10741
|
-
|
|
10742
|
-
|
|
10743
|
-
|
|
10744
|
-
|
|
10745
|
-
|
|
10746
|
-
|
|
10747
|
-
|
|
10748
|
-
|
|
10749
|
-
|
|
10750
|
-
|
|
10751
|
-
|
|
10752
|
-
|
|
10753
|
-
|
|
10754
|
-
|
|
10755
|
-
|
|
10756
|
-
|
|
10757
|
-
|
|
10689
|
+
Ns as MaptilerNavigationControl,
|
|
10690
|
+
Ds as MaptilerProjectionControl,
|
|
10691
|
+
js as MaptilerTerrainControl,
|
|
10692
|
+
hl as Marker,
|
|
10693
|
+
Dl as MarkerMLGL,
|
|
10694
|
+
gu as MercatorCoordinate,
|
|
10695
|
+
Jl as NavigationControMLGL,
|
|
10696
|
+
wo as NavigationControl,
|
|
10697
|
+
ku as Point,
|
|
10698
|
+
vl as Popup,
|
|
10699
|
+
ql as PopupMLGL,
|
|
10700
|
+
Ll as RasterDEMTileSource,
|
|
10701
|
+
Kl as RasterDEMTileSourceMLGL,
|
|
10702
|
+
kl as RasterTileSource,
|
|
10703
|
+
Hl as RasterTileSourceMLGL,
|
|
10704
|
+
Gu as ReferenceMapStyle,
|
|
10705
|
+
ko as ScaleControl,
|
|
10706
|
+
eu as ScaleControlMLGL,
|
|
10707
|
+
Ml as ScrollZoomHandler,
|
|
10708
|
+
au as ScrollZoomHandlerMLGL,
|
|
10709
|
+
Qa as SdkConfig,
|
|
10710
|
+
Hu as ServiceError,
|
|
10711
|
+
bl as Style,
|
|
10712
|
+
Bl as StyleMLGL,
|
|
10713
|
+
ru as TerrainControMLGL,
|
|
10714
|
+
Il as TerrainControl,
|
|
10715
|
+
Pl as TwoFingersTouchPitchHandler,
|
|
10716
|
+
su as TwoFingersTouchPitchHandlerMLGL,
|
|
10717
|
+
Mu as TwoFingersTouchRotateHandler,
|
|
10718
|
+
Eu as TwoFingersTouchZoomHandler,
|
|
10719
|
+
Tu as TwoFingersTouchZoomRotateHandler,
|
|
10720
|
+
Cl as VectorTileSource,
|
|
10721
|
+
Wl as VectorTileSourceMLGL,
|
|
10722
|
+
Al as VideoSource,
|
|
10723
|
+
Zl as VideoSourceMLGL,
|
|
10724
|
+
Ou as addProtocol,
|
|
10725
|
+
Nu as addSourceType,
|
|
10726
|
+
Ku as areSameLanguages,
|
|
10727
|
+
Wu as bufferToPixelDataBrowser,
|
|
10728
|
+
Zu as circumferenceAtLatitude,
|
|
10729
|
+
Su as clearPrewarmedResources,
|
|
10758
10730
|
F as config,
|
|
10759
|
-
|
|
10760
|
-
|
|
10761
|
-
|
|
10762
|
-
|
|
10763
|
-
|
|
10764
|
-
|
|
10765
|
-
|
|
10766
|
-
|
|
10731
|
+
pu as configMLGL,
|
|
10732
|
+
Ju as coordinates,
|
|
10733
|
+
Yu as data,
|
|
10734
|
+
Xu as elevation,
|
|
10735
|
+
Qu as expandMapStyle,
|
|
10736
|
+
ec as geocoding,
|
|
10737
|
+
tc as geolocation,
|
|
10738
|
+
rc as getAutoLanguage,
|
|
10767
10739
|
Pr as getBrowserLanguage,
|
|
10768
|
-
|
|
10769
|
-
|
|
10770
|
-
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
|
|
10774
|
-
|
|
10775
|
-
|
|
10776
|
-
|
|
10777
|
-
|
|
10778
|
-
|
|
10779
|
-
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
|
|
10740
|
+
nc as getBufferToPixelDataParser,
|
|
10741
|
+
ac as getLanguageInfoFromCode,
|
|
10742
|
+
oc as getLanguageInfoFromFlag,
|
|
10743
|
+
ic as getLanguageInfoFromKey,
|
|
10744
|
+
fu as getMapLibreVersion,
|
|
10745
|
+
Pu as getMaxParallelImageRequests,
|
|
10746
|
+
yu as getRTLTextPluginStatus,
|
|
10747
|
+
sc as getTileCache,
|
|
10748
|
+
Fl as getVersion,
|
|
10749
|
+
uo as getWebGLSupportError,
|
|
10750
|
+
zu as getWorkerCount,
|
|
10751
|
+
$u as getWorkerUrl,
|
|
10752
|
+
ua as gpx,
|
|
10753
|
+
Ys as gpxOrKml,
|
|
10754
|
+
la as hasChildNodeWithName,
|
|
10755
|
+
Nl as helpers,
|
|
10756
|
+
Fu as importScriptInWorkers,
|
|
10757
|
+
lc as isLanguageInfo,
|
|
10758
|
+
ca as kml,
|
|
10759
|
+
uc as mapStylePresetList,
|
|
10760
|
+
cc as math,
|
|
10761
|
+
pc as misc,
|
|
10762
|
+
wu as prewarm,
|
|
10763
|
+
Du as removeProtocol,
|
|
10764
|
+
Ru as setMaxParallelImageRequests,
|
|
10765
|
+
du as setRTLTextPlugin,
|
|
10766
|
+
_u as setWorkerCount,
|
|
10767
|
+
ju as setWorkerUrl,
|
|
10768
|
+
fc as staticMaps,
|
|
10797
10769
|
Ar as str2xml,
|
|
10798
|
-
|
|
10799
|
-
|
|
10800
|
-
|
|
10770
|
+
dc as styleToStyle,
|
|
10771
|
+
yc as toLanguageInfo,
|
|
10772
|
+
cn as xml2str
|
|
10801
10773
|
};
|
|
10802
10774
|
//# sourceMappingURL=maptiler-sdk.mjs.map
|