@maptiler/sdk 3.8.0-rc7 → 3.8.0-rc8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/maptiler-sdk.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Go = Object.defineProperty;
|
|
2
2
|
var bn = (r) => {
|
|
3
3
|
throw TypeError(r);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var Ho = (r, e, t) => e in r ? Go(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
6
|
+
var b = (r, e, t) => Ho(r, typeof e != "symbol" ? e + "" : e, t), or = (r, e, t) => e.has(r) || bn("Cannot " + t);
|
|
7
7
|
var P = (r, e, t) => (or(r, e, "read from private field"), t ? t.call(r) : e.get(r)), Se = (r, e, t) => e.has(r) ? bn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), Re = (r, e, t, n) => (or(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), Z = (r, e, t) => (or(r, e, "access private method"), t);
|
|
8
8
|
import k from "maplibre-gl";
|
|
9
|
-
import { Language as
|
|
10
|
-
import { MapStyle as
|
|
11
|
-
import
|
|
12
|
-
import { v4 as
|
|
13
|
-
import { Base64 as
|
|
9
|
+
import { Language as Zo, getLanguageInfoFromCode as wn, config as ir, MapStyle as ot, mapStylePresetList as sr, expandMapStyle as Xo, MapStyleVariant as Ko, ReferenceMapStyle as Yo, toLanguageInfo as xn, getLanguageInfoFromFlag as Wo, geolocation as Sn } from "@maptiler/client";
|
|
10
|
+
import { MapStyle as lf, MapStyleVariant as uf, ReferenceMapStyle as cf, ServiceError as pf, areSameLanguages as ff, bufferToPixelDataBrowser as df, canParsePixelData as hf, circumferenceAtLatitude as mf, coordinates as yf, data as gf, elevation as vf, expandMapStyle as bf, geocoding as wf, geolocation as xf, getAutoLanguage as Sf, getBufferToPixelDataParser as kf, getLanguageInfoFromCode as Lf, getLanguageInfoFromFlag as Cf, getLanguageInfoFromKey as Ef, getTileCache as Tf, isLanguageInfo as Af, mapStylePresetList as _f, math as If, misc as Mf, staticMaps as Pf, styleToStyle as Rf, toLanguageInfo as zf } from "@maptiler/client";
|
|
11
|
+
import Jo from "events";
|
|
12
|
+
import { v4 as Qo } from "uuid";
|
|
13
|
+
import { Base64 as ei } from "js-base64";
|
|
14
14
|
const R = {
|
|
15
15
|
/**
|
|
16
16
|
* Language mode to display labels in both the local language and the language of the visitor's device, concatenated.
|
|
@@ -58,7 +58,7 @@ const R = {
|
|
|
58
58
|
isMode: !0,
|
|
59
59
|
geocoding: !1
|
|
60
60
|
},
|
|
61
|
-
...
|
|
61
|
+
...Zo
|
|
62
62
|
};
|
|
63
63
|
function kn() {
|
|
64
64
|
if (typeof navigator > "u") {
|
|
@@ -79,19 +79,19 @@ const H = {
|
|
|
79
79
|
terrainSourceId: "maptiler-terrain"
|
|
80
80
|
};
|
|
81
81
|
Object.freeze(H);
|
|
82
|
-
const Gr =
|
|
83
|
-
class
|
|
82
|
+
const Gr = Qo();
|
|
83
|
+
class ti extends Jo {
|
|
84
84
|
constructor() {
|
|
85
85
|
super(...arguments);
|
|
86
86
|
/**
|
|
87
87
|
* The primary language. By default, the language of the web browser is used.
|
|
88
88
|
*/
|
|
89
|
-
|
|
89
|
+
b(this, "primaryLanguage", H.primaryLanguage);
|
|
90
90
|
/**
|
|
91
91
|
* The secondary language, to overwrite the default language defined in the map style.
|
|
92
92
|
* This settings is highly dependant on the style compatibility and may not work in most cases.
|
|
93
93
|
*/
|
|
94
|
-
|
|
94
|
+
b(this, "secondaryLanguage");
|
|
95
95
|
/**
|
|
96
96
|
* Setting on whether of not the SDK runs with a session logic.
|
|
97
97
|
* A "session" is started at the initialization of the SDK and finished when the browser
|
|
@@ -99,13 +99,13 @@ class ei extends Wo {
|
|
|
99
99
|
* When `session` is enabled (default: true), the extra URL param `mtsid` is added to queries
|
|
100
100
|
* on the MapTiler Cloud API. This allows MapTiler to enable "session based billing".
|
|
101
101
|
*/
|
|
102
|
-
|
|
102
|
+
b(this, "session", !0);
|
|
103
103
|
/**
|
|
104
104
|
* Enables client-side caching of requests for tiles and fonts.
|
|
105
105
|
* The cached requests persist multiple browser sessions and will be reused when possible.
|
|
106
106
|
* Works only for requests to the MapTiler Cloud API when sessions are enabled.
|
|
107
107
|
*/
|
|
108
|
-
|
|
108
|
+
b(this, "caching", !0);
|
|
109
109
|
/**
|
|
110
110
|
* Telemetry is enabled by default but can be opted-out by setting this value to `false`.
|
|
111
111
|
* The telemetry is very valuable to the team at MapTiler because it shares information
|
|
@@ -123,15 +123,15 @@ class ei extends Wo {
|
|
|
123
123
|
*
|
|
124
124
|
* In addition, each official module will be added to a list, alongside its version number.
|
|
125
125
|
*/
|
|
126
|
-
|
|
126
|
+
b(this, "telemetry", !0);
|
|
127
127
|
/**
|
|
128
128
|
* Unit to be used
|
|
129
129
|
*/
|
|
130
|
-
|
|
130
|
+
b(this, "_unit", "metric");
|
|
131
131
|
/**
|
|
132
132
|
* MapTiler Cloud API key
|
|
133
133
|
*/
|
|
134
|
-
|
|
134
|
+
b(this, "_apiKey", "");
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
137
137
|
* Set the unit system
|
|
@@ -170,32 +170,32 @@ class ei extends Wo {
|
|
|
170
170
|
return ir.fetch;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
const N = new
|
|
174
|
-
function
|
|
173
|
+
const N = new ti(), Cr = "localcache_source", Er = "localcache", ri = "maptiler_sdk", ni = 1e3, ai = 100, Tr = typeof caches < "u", { addProtocol: Ln } = k;
|
|
174
|
+
function oi(r, e) {
|
|
175
175
|
if (Tr && N.caching && N.session && r.host === H.maptilerApiHost) {
|
|
176
176
|
if (e === "Source" && r.href.includes("tiles.json"))
|
|
177
|
-
return r.href.replace("https://", `${Er}://`);
|
|
178
|
-
if (e === "Tile" || e === "Glyphs")
|
|
179
177
|
return r.href.replace("https://", `${Cr}://`);
|
|
178
|
+
if (e === "Tile" || e === "Glyphs")
|
|
179
|
+
return r.href.replace("https://", `${Er}://`);
|
|
180
180
|
}
|
|
181
181
|
return r.href;
|
|
182
182
|
}
|
|
183
183
|
let lr;
|
|
184
184
|
async function ba() {
|
|
185
|
-
return lr || (lr = await caches.open(
|
|
185
|
+
return lr || (lr = await caches.open(ri)), lr;
|
|
186
186
|
}
|
|
187
|
-
let
|
|
188
|
-
async function
|
|
189
|
-
const r = await ba(), e = await r.keys(), t = e.slice(0, Math.max(e.length -
|
|
187
|
+
let Cn = 0;
|
|
188
|
+
async function ii() {
|
|
189
|
+
const r = await ba(), e = await r.keys(), t = e.slice(0, Math.max(e.length - ni, 0));
|
|
190
190
|
for (const n of t)
|
|
191
191
|
r.delete(n);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function si() {
|
|
194
194
|
Ln(
|
|
195
|
-
|
|
195
|
+
Cr,
|
|
196
196
|
async (r, e) => {
|
|
197
197
|
if (!r.url) throw new Error("");
|
|
198
|
-
r.url = r.url.replace(`${
|
|
198
|
+
r.url = r.url.replace(`${Cr}://`, "https://");
|
|
199
199
|
const t = r;
|
|
200
200
|
t.signal = e.signal;
|
|
201
201
|
const n = await fetch(r.url, t), a = await n.json();
|
|
@@ -205,9 +205,9 @@ function ii() {
|
|
|
205
205
|
expires: n.headers.get("Expires")
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
|
-
), Ln(
|
|
208
|
+
), Ln(Er, async (r, e) => {
|
|
209
209
|
if (!r.url) throw new Error("");
|
|
210
|
-
r.url = r.url.replace(`${
|
|
210
|
+
r.url = r.url.replace(`${Er}://`, "https://");
|
|
211
211
|
const t = new URL(r.url), n = new URL(t);
|
|
212
212
|
n.searchParams.delete("mtsid"), n.searchParams.delete("key");
|
|
213
213
|
const a = n.toString(), o = new URL(t);
|
|
@@ -223,10 +223,10 @@ function ii() {
|
|
|
223
223
|
c.signal = e.signal;
|
|
224
224
|
const p = await fetch(i, c);
|
|
225
225
|
return p.status >= 200 && p.status < 300 && (l.put(a, p.clone()).catch(() => {
|
|
226
|
-
}), ++
|
|
226
|
+
}), ++Cn > ai && (ii(), Cn = 0)), s(p);
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function li() {
|
|
230
230
|
if (typeof window > "u") return;
|
|
231
231
|
const r = k.getRTLTextPluginStatus();
|
|
232
232
|
if (r === "unavailable" || r === "requested")
|
|
@@ -235,11 +235,11 @@ function si() {
|
|
|
235
235
|
} catch {
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function ui(r, e) {
|
|
239
239
|
for (const t of r)
|
|
240
240
|
typeof e[t] == "function" && (e[t] = e[t].bind(e));
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function En(r, e) {
|
|
243
243
|
let t = null;
|
|
244
244
|
try {
|
|
245
245
|
t = new URL(r);
|
|
@@ -249,19 +249,19 @@ function Cn(r, e) {
|
|
|
249
249
|
};
|
|
250
250
|
}
|
|
251
251
|
return t.host === H.maptilerApiHost && (t.searchParams.has("key") || t.searchParams.append("key", N.apiKey), N.session && t.searchParams.append("mtsid", Gr)), {
|
|
252
|
-
url:
|
|
252
|
+
url: oi(t, e)
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
255
|
function Tn(r) {
|
|
256
256
|
return (e, t) => {
|
|
257
257
|
if (r != null) {
|
|
258
|
-
const n = r(e, t), a =
|
|
258
|
+
const n = r(e, t), a = En((n == null ? void 0 : n.url) ?? "", t);
|
|
259
259
|
return {
|
|
260
260
|
...n,
|
|
261
261
|
...a
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
|
-
return
|
|
264
|
+
return En(e, t);
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
267
|
function wa() {
|
|
@@ -270,18 +270,18 @@ function wa() {
|
|
|
270
270
|
function Ut(r) {
|
|
271
271
|
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);
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function ci(r) {
|
|
274
274
|
try {
|
|
275
275
|
return JSON.parse(r);
|
|
276
276
|
} catch {
|
|
277
277
|
}
|
|
278
278
|
return null;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function pi() {
|
|
281
281
|
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.";
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
const e =
|
|
283
|
+
function fi(r) {
|
|
284
|
+
const e = pi();
|
|
285
285
|
if (!e) return;
|
|
286
286
|
let t = null;
|
|
287
287
|
if (typeof r == "string" ? t = document.getElementById(r) : r instanceof HTMLElement && (t = r), !t)
|
|
@@ -289,14 +289,14 @@ function pi(r) {
|
|
|
289
289
|
const n = document.createElement("div");
|
|
290
290
|
throw n.innerHTML = e, n.classList.add("webgl-warning-div"), t.appendChild(n), new Error(e);
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function Fc(r) {
|
|
293
293
|
const e = "The WebGL context was lost.", t = r.getContainer(), n = document.createElement("div");
|
|
294
294
|
n.innerHTML = e, n.classList.add("webgl-warning-div"), t.appendChild(n);
|
|
295
295
|
}
|
|
296
296
|
function An(r, e) {
|
|
297
297
|
return !(!Array.isArray(r) || r.length !== 2 || r[0] !== "get" || typeof r[1] != "string" || e && !r[1].startsWith("name:") || !e && r[1] !== "name");
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function di(r, e, t) {
|
|
300
300
|
const n = structuredClone(r), a = (o) => {
|
|
301
301
|
if (typeof o != "string")
|
|
302
302
|
for (let i = 0; i < o.length; i += 1)
|
|
@@ -304,18 +304,18 @@ function fi(r, e, t) {
|
|
|
304
304
|
};
|
|
305
305
|
return An(n, t) ? e : (a(n), n);
|
|
306
306
|
}
|
|
307
|
-
function
|
|
307
|
+
function hi(r, e) {
|
|
308
308
|
const t = e ? /\{name:\S+\}/ : /\{name\}/;
|
|
309
309
|
return {
|
|
310
310
|
contains: t.test(r),
|
|
311
311
|
exactMatch: new RegExp(`^${t.source}$`).test(r)
|
|
312
312
|
};
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function mi(r, e, t) {
|
|
315
315
|
const n = t ? /\{name:\S+\}/ : /\{name\}/, a = r.split(n);
|
|
316
316
|
return ["concat", ...a.flatMap((s, l) => l === a.length - 1 ? [s] : [s, e])];
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function yi(r) {
|
|
319
319
|
var n;
|
|
320
320
|
const e = /\{name(?::(?<language>\S+))?\}/g, t = [];
|
|
321
321
|
for (; ; ) {
|
|
@@ -326,7 +326,7 @@ function mi(r) {
|
|
|
326
326
|
}
|
|
327
327
|
return t;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function gi(r) {
|
|
330
330
|
return !Array.isArray(r) || r.length !== 2 || r[0] !== "get" || typeof r[1] != "string" ? null : r[1].trim() === "name" ? {
|
|
331
331
|
isLanguage: !0,
|
|
332
332
|
localization: null
|
|
@@ -335,17 +335,17 @@ function yi(r) {
|
|
|
335
335
|
localization: r[1].trim().split(":").pop()
|
|
336
336
|
} : null;
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function vi(r) {
|
|
339
339
|
const e = [], t = structuredClone(r), n = (a) => {
|
|
340
340
|
if (typeof a != "string")
|
|
341
341
|
for (let o = 0; o < a.length; o += 1) {
|
|
342
|
-
const i =
|
|
342
|
+
const i = gi(a[o]);
|
|
343
343
|
i ? e.push(i.localization) : n(a[o]);
|
|
344
344
|
}
|
|
345
345
|
};
|
|
346
346
|
return n([t]), e;
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function bi(r, e) {
|
|
349
349
|
const t = [];
|
|
350
350
|
for (const o of r) {
|
|
351
351
|
if (o.type !== "symbol")
|
|
@@ -356,10 +356,10 @@ function vi(r, e) {
|
|
|
356
356
|
const u = e.getLayoutProperty(s, "text-field");
|
|
357
357
|
if (u)
|
|
358
358
|
if (typeof u == "string") {
|
|
359
|
-
const c =
|
|
359
|
+
const c = yi(u);
|
|
360
360
|
t.push(c);
|
|
361
361
|
} else {
|
|
362
|
-
const c =
|
|
362
|
+
const c = vi(u);
|
|
363
363
|
t.push(c);
|
|
364
364
|
}
|
|
365
365
|
}
|
|
@@ -376,52 +376,52 @@ let $c = class extends k.Marker {
|
|
|
376
376
|
return super.addTo(e);
|
|
377
377
|
}
|
|
378
378
|
};
|
|
379
|
-
class
|
|
379
|
+
class Nc extends k.Popup {
|
|
380
380
|
addTo(e) {
|
|
381
381
|
return super.addTo(e);
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
|
-
class
|
|
384
|
+
class jc extends k.Style {
|
|
385
385
|
constructor(e, t = {}) {
|
|
386
386
|
super(e, t);
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
-
class
|
|
389
|
+
class Dc extends k.CanvasSource {
|
|
390
390
|
onAdd(e) {
|
|
391
391
|
super.onAdd(e);
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
class
|
|
394
|
+
class Uc extends k.GeoJSONSource {
|
|
395
395
|
onAdd(e) {
|
|
396
396
|
super.onAdd(e);
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
|
-
class
|
|
399
|
+
class Bc extends k.ImageSource {
|
|
400
400
|
onAdd(e) {
|
|
401
401
|
super.onAdd(e);
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
-
class
|
|
404
|
+
class qc extends k.RasterTileSource {
|
|
405
405
|
onAdd(e) {
|
|
406
406
|
super.onAdd(e);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
|
-
class
|
|
409
|
+
class Vc extends k.RasterDEMTileSource {
|
|
410
410
|
onAdd(e) {
|
|
411
411
|
super.onAdd(e);
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
class
|
|
414
|
+
class Gc extends k.VectorTileSource {
|
|
415
415
|
onAdd(e) {
|
|
416
416
|
super.onAdd(e);
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
class
|
|
419
|
+
class Hc extends k.VideoSource {
|
|
420
420
|
onAdd(e) {
|
|
421
421
|
super.onAdd(e);
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
class
|
|
424
|
+
class xa extends k.NavigationControl {
|
|
425
425
|
onAdd(e) {
|
|
426
426
|
return super.onAdd(e);
|
|
427
427
|
}
|
|
@@ -431,7 +431,7 @@ class wi extends k.GeolocateControl {
|
|
|
431
431
|
return super.onAdd(e);
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
class
|
|
434
|
+
class Zc extends k.AttributionControl {
|
|
435
435
|
onAdd(e) {
|
|
436
436
|
return super.onAdd(e);
|
|
437
437
|
}
|
|
@@ -451,47 +451,47 @@ class ki extends k.FullscreenControl {
|
|
|
451
451
|
return super.onAdd(e);
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
|
-
class
|
|
454
|
+
class Xc extends k.TerrainControl {
|
|
455
455
|
onAdd(e) {
|
|
456
456
|
return super.onAdd(e);
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
|
-
class
|
|
459
|
+
class Kc extends k.BoxZoomHandler {
|
|
460
460
|
constructor(e, t) {
|
|
461
461
|
super(e, t);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
class
|
|
464
|
+
class Yc extends k.ScrollZoomHandler {
|
|
465
465
|
constructor(e, t) {
|
|
466
466
|
super(e, t);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
class
|
|
469
|
+
class Wc extends k.CooperativeGesturesHandler {
|
|
470
470
|
constructor(e, t) {
|
|
471
471
|
super(e, t);
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
class
|
|
474
|
+
class Jc extends k.KeyboardHandler {
|
|
475
475
|
constructor(e) {
|
|
476
476
|
super(e);
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
-
class
|
|
479
|
+
class Qc extends k.TwoFingersTouchPitchHandler {
|
|
480
480
|
constructor(e) {
|
|
481
481
|
super(e);
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
|
-
class
|
|
484
|
+
class ep extends k.MapWheelEvent {
|
|
485
485
|
constructor(e, t, n) {
|
|
486
486
|
super(e, t, n);
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
|
-
class
|
|
489
|
+
class tp extends k.MapTouchEvent {
|
|
490
490
|
constructor(e, t, n) {
|
|
491
491
|
super(e, t, n);
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
-
class
|
|
494
|
+
class rp extends k.MapMouseEvent {
|
|
495
495
|
constructor(e, t, n, a = {}) {
|
|
496
496
|
super(e, t, n, a);
|
|
497
497
|
}
|
|
@@ -499,8 +499,8 @@ class tp extends k.MapMouseEvent {
|
|
|
499
499
|
class _n extends xi {
|
|
500
500
|
constructor(t = {}) {
|
|
501
501
|
super(t);
|
|
502
|
-
|
|
503
|
-
|
|
502
|
+
b(this, "logoURL", "");
|
|
503
|
+
b(this, "linkURL", "");
|
|
504
504
|
this.logoURL = t.logoURL ?? H.maptilerLogoURL, this.linkURL = t.linkURL ?? H.maptilerURL;
|
|
505
505
|
}
|
|
506
506
|
onAdd(t) {
|
|
@@ -509,7 +509,7 @@ class _n extends xi {
|
|
|
509
509
|
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;
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
var Li = 8,
|
|
512
|
+
var Li = 8, Ci = {
|
|
513
513
|
version: {
|
|
514
514
|
required: !0,
|
|
515
515
|
type: "enum",
|
|
@@ -583,7 +583,7 @@ var Li = 8, Ei = {
|
|
|
583
583
|
type: "array",
|
|
584
584
|
value: "layer"
|
|
585
585
|
}
|
|
586
|
-
},
|
|
586
|
+
}, Ei = {
|
|
587
587
|
"*": {
|
|
588
588
|
type: "source"
|
|
589
589
|
}
|
|
@@ -706,7 +706,7 @@ var Li = 8, Ei = {
|
|
|
706
706
|
"*": {
|
|
707
707
|
type: "*"
|
|
708
708
|
}
|
|
709
|
-
},
|
|
709
|
+
}, Ii = {
|
|
710
710
|
type: {
|
|
711
711
|
required: !0,
|
|
712
712
|
type: "enum",
|
|
@@ -780,7 +780,7 @@ var Li = 8, Ei = {
|
|
|
780
780
|
"*": {
|
|
781
781
|
type: "*"
|
|
782
782
|
}
|
|
783
|
-
},
|
|
783
|
+
}, Mi = {
|
|
784
784
|
type: {
|
|
785
785
|
required: !0,
|
|
786
786
|
type: "enum",
|
|
@@ -935,7 +935,7 @@ var Li = 8, Ei = {
|
|
|
935
935
|
paint: {
|
|
936
936
|
type: "paint"
|
|
937
937
|
}
|
|
938
|
-
},
|
|
938
|
+
}, Fi = [
|
|
939
939
|
"layout_fill",
|
|
940
940
|
"layout_line",
|
|
941
941
|
"layout_circle",
|
|
@@ -946,7 +946,7 @@ var Li = 8, Ei = {
|
|
|
946
946
|
"layout_hillshade",
|
|
947
947
|
"layout_color-relief",
|
|
948
948
|
"layout_background"
|
|
949
|
-
],
|
|
949
|
+
], $i = {
|
|
950
950
|
visibility: {
|
|
951
951
|
type: "enum",
|
|
952
952
|
values: {
|
|
@@ -3292,18 +3292,18 @@ var Li = 8, Ei = {
|
|
|
3292
3292
|
}
|
|
3293
3293
|
}, cs = {
|
|
3294
3294
|
$version: Li,
|
|
3295
|
-
$root:
|
|
3296
|
-
sources:
|
|
3295
|
+
$root: Ci,
|
|
3296
|
+
sources: Ei,
|
|
3297
3297
|
source: Ti,
|
|
3298
3298
|
source_vector: Ai,
|
|
3299
3299
|
source_raster: _i,
|
|
3300
|
-
source_raster_dem:
|
|
3301
|
-
source_geojson:
|
|
3300
|
+
source_raster_dem: Ii,
|
|
3301
|
+
source_geojson: Mi,
|
|
3302
3302
|
source_video: Pi,
|
|
3303
3303
|
source_image: Ri,
|
|
3304
3304
|
layer: zi,
|
|
3305
|
-
layout:
|
|
3306
|
-
layout_background:
|
|
3305
|
+
layout: Fi,
|
|
3306
|
+
layout_background: $i,
|
|
3307
3307
|
layout_fill: Oi,
|
|
3308
3308
|
layout_circle: Ni,
|
|
3309
3309
|
layout_heatmap: ji,
|
|
@@ -3608,7 +3608,7 @@ class Hr {
|
|
|
3608
3608
|
return this.bindings[e] ? !0 : this.parent ? this.parent.has(e) : !1;
|
|
3609
3609
|
}
|
|
3610
3610
|
}
|
|
3611
|
-
const Bt = { kind: "null" }, x = { kind: "number" },
|
|
3611
|
+
const Bt = { kind: "null" }, x = { kind: "number" }, I = { kind: "string" }, _ = { kind: "boolean" }, me = { kind: "color" }, qt = { kind: "projectionDefinition" }, Oe = { kind: "object" }, A = { kind: "value" }, ps = { kind: "error" }, Vt = { kind: "collator" }, Gt = { kind: "formatted" }, Ht = { kind: "padding" }, ut = { kind: "colorArray" }, Zt = { kind: "numberArray" }, vt = { kind: "resolvedImage" }, Xt = { kind: "variableAnchorOffsetCollection" };
|
|
3612
3612
|
function W(r, e) {
|
|
3613
3613
|
return {
|
|
3614
3614
|
kind: "array",
|
|
@@ -3626,7 +3626,7 @@ function j(r) {
|
|
|
3626
3626
|
const fs = [
|
|
3627
3627
|
Bt,
|
|
3628
3628
|
x,
|
|
3629
|
-
|
|
3629
|
+
I,
|
|
3630
3630
|
_,
|
|
3631
3631
|
me,
|
|
3632
3632
|
qt,
|
|
@@ -3665,15 +3665,15 @@ function Ne(r, e) {
|
|
|
3665
3665
|
function ke(r, e) {
|
|
3666
3666
|
return r.kind === "array" && e.kind === "array" ? r.itemType.kind === e.itemType.kind && typeof r.N == "number" : r.kind === e.kind;
|
|
3667
3667
|
}
|
|
3668
|
-
const
|
|
3669
|
-
function
|
|
3668
|
+
const Sa = 0.96422, ka = 1, La = 0.82521, Ca = 4 / 29, Ye = 6 / 29, Ea = 3 * Ye * Ye, ds = Ye * Ye * Ye, hs = Math.PI / 180, ms = 180 / Math.PI;
|
|
3669
|
+
function Ta(r) {
|
|
3670
3670
|
return r = r % 360, r < 0 && (r += 360), r;
|
|
3671
3671
|
}
|
|
3672
|
-
function
|
|
3672
|
+
function Aa([r, e, t, n]) {
|
|
3673
3673
|
r = ur(r), e = ur(e), t = ur(t);
|
|
3674
3674
|
let a, o;
|
|
3675
|
-
const i = cr((0.2225045 * r + 0.7168786 * e + 0.0606169 * t) /
|
|
3676
|
-
r === e && e === t ? a = o = i : (a = cr((0.4360747 * r + 0.3850649 * e + 0.1430804 * t) /
|
|
3675
|
+
const i = cr((0.2225045 * r + 0.7168786 * e + 0.0606169 * t) / ka);
|
|
3676
|
+
r === e && e === t ? a = o = i : (a = cr((0.4360747 * r + 0.3850649 * e + 0.1430804 * t) / Sa), o = cr((0.0139322 * r + 0.0971045 * e + 0.7141733 * t) / La));
|
|
3677
3677
|
const s = 116 * i - 16;
|
|
3678
3678
|
return [s < 0 ? 0 : s, 500 * (a - i), 200 * (i - o), n];
|
|
3679
3679
|
}
|
|
@@ -3681,11 +3681,11 @@ function ur(r) {
|
|
|
3681
3681
|
return r <= 0.04045 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4);
|
|
3682
3682
|
}
|
|
3683
3683
|
function cr(r) {
|
|
3684
|
-
return r > ds ? Math.pow(r, 1 / 3) : r / Ea +
|
|
3684
|
+
return r > ds ? Math.pow(r, 1 / 3) : r / Ea + Ca;
|
|
3685
3685
|
}
|
|
3686
|
-
function
|
|
3686
|
+
function _a([r, e, t, n]) {
|
|
3687
3687
|
let a = (r + 16) / 116, o = isNaN(e) ? a : a + e / 500, i = isNaN(t) ? a : a - t / 200;
|
|
3688
|
-
return a =
|
|
3688
|
+
return a = ka * fr(a), o = Sa * fr(o), i = La * fr(i), [
|
|
3689
3689
|
pr(3.1338561 * o - 1.6168667 * a - 0.4906146 * i),
|
|
3690
3690
|
// D50 -> sRGB
|
|
3691
3691
|
pr(-0.9787684 * o + 1.9161415 * a + 0.033454 * i),
|
|
@@ -3697,17 +3697,17 @@ function pr(r) {
|
|
|
3697
3697
|
return r = r <= 304e-5 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - 0.055, r < 0 ? 0 : r > 1 ? 1 : r;
|
|
3698
3698
|
}
|
|
3699
3699
|
function fr(r) {
|
|
3700
|
-
return r > Ye ? r * r * r : Ea * (r -
|
|
3700
|
+
return r > Ye ? r * r * r : Ea * (r - Ca);
|
|
3701
3701
|
}
|
|
3702
3702
|
function ys(r) {
|
|
3703
|
-
const [e, t, n, a] =
|
|
3704
|
-
return [Math.round(o * 1e4) ?
|
|
3703
|
+
const [e, t, n, a] = Aa(r), o = Math.sqrt(t * t + n * n);
|
|
3704
|
+
return [Math.round(o * 1e4) ? Ta(Math.atan2(n, t) * ms) : NaN, o, e, a];
|
|
3705
3705
|
}
|
|
3706
3706
|
function gs([r, e, t, n]) {
|
|
3707
|
-
return r = isNaN(r) ? 0 : r * hs,
|
|
3707
|
+
return r = isNaN(r) ? 0 : r * hs, _a([t, Math.cos(r) * e, Math.sin(r) * e, n]);
|
|
3708
3708
|
}
|
|
3709
3709
|
function vs([r, e, t, n]) {
|
|
3710
|
-
r =
|
|
3710
|
+
r = Ta(r), e /= 100, t /= 100;
|
|
3711
3711
|
function a(o) {
|
|
3712
3712
|
const i = (o + r / 30) % 12, s = e * Math.min(t, 1 - t);
|
|
3713
3713
|
return t - s * Math.max(-1, Math.min(i - 3, 9 - i, 1));
|
|
@@ -3764,20 +3764,20 @@ function ws(r) {
|
|
|
3764
3764
|
// ,|/ (optional)
|
|
3765
3765
|
y,
|
|
3766
3766
|
// <numeric> (optional)
|
|
3767
|
-
|
|
3767
|
+
w
|
|
3768
3768
|
// % (optional)
|
|
3769
3769
|
] = o, g = [u || " ", d || " ", m].join("");
|
|
3770
3770
|
if (g === " " || g === " /" || g === ",," || g === ",,,") {
|
|
3771
|
-
const S = [l, p, h].join(""),
|
|
3772
|
-
if (
|
|
3773
|
-
const
|
|
3774
|
-
Xe(+s /
|
|
3775
|
-
Xe(+c /
|
|
3776
|
-
Xe(+f /
|
|
3777
|
-
y ?
|
|
3771
|
+
const S = [l, p, h].join(""), E = S === "%%%" ? 100 : S === "" ? 255 : 0;
|
|
3772
|
+
if (E) {
|
|
3773
|
+
const C = [
|
|
3774
|
+
Xe(+s / E, 0, 1),
|
|
3775
|
+
Xe(+c / E, 0, 1),
|
|
3776
|
+
Xe(+f / E, 0, 1),
|
|
3777
|
+
y ? In(+y, w) : 1
|
|
3778
3778
|
];
|
|
3779
|
-
if (
|
|
3780
|
-
return
|
|
3779
|
+
if (Mn(C))
|
|
3780
|
+
return C;
|
|
3781
3781
|
}
|
|
3782
3782
|
}
|
|
3783
3783
|
return;
|
|
@@ -3810,9 +3810,9 @@ function ws(r) {
|
|
|
3810
3810
|
+o,
|
|
3811
3811
|
Xe(+s, 0, 100),
|
|
3812
3812
|
Xe(+u, 0, 100),
|
|
3813
|
-
p ?
|
|
3813
|
+
p ? In(+p, d) : 1
|
|
3814
3814
|
];
|
|
3815
|
-
if (
|
|
3815
|
+
if (Mn(h))
|
|
3816
3816
|
return vs(h);
|
|
3817
3817
|
}
|
|
3818
3818
|
}
|
|
@@ -3820,13 +3820,13 @@ function ws(r) {
|
|
|
3820
3820
|
function kt(r) {
|
|
3821
3821
|
return parseInt(r.padEnd(2, r), 16) / 255;
|
|
3822
3822
|
}
|
|
3823
|
-
function
|
|
3823
|
+
function In(r, e) {
|
|
3824
3824
|
return Xe(e ? r / 100 : r, 0, 1);
|
|
3825
3825
|
}
|
|
3826
3826
|
function Xe(r, e, t) {
|
|
3827
3827
|
return Math.min(Math.max(e, r), t);
|
|
3828
3828
|
}
|
|
3829
|
-
function
|
|
3829
|
+
function Mn(r) {
|
|
3830
3830
|
return !r.some(Number.isNaN);
|
|
3831
3831
|
}
|
|
3832
3832
|
const xs = {
|
|
@@ -3985,7 +3985,7 @@ function Ae(r, e, t) {
|
|
|
3985
3985
|
function We(r, e, t) {
|
|
3986
3986
|
return r.map((n, a) => Ae(n, e[a], t));
|
|
3987
3987
|
}
|
|
3988
|
-
class
|
|
3988
|
+
class $ {
|
|
3989
3989
|
/**
|
|
3990
3990
|
* @param r Red component premultiplied by `alpha` 0..1
|
|
3991
3991
|
* @param g Green component premultiplied by `alpha` 0..1
|
|
@@ -4010,13 +4010,13 @@ class F {
|
|
|
4010
4010
|
* @returns A `Color` instance, or `undefined` if the input is not a valid color string.
|
|
4011
4011
|
*/
|
|
4012
4012
|
static parse(e) {
|
|
4013
|
-
if (e instanceof
|
|
4013
|
+
if (e instanceof $)
|
|
4014
4014
|
return e;
|
|
4015
4015
|
if (typeof e != "string")
|
|
4016
4016
|
return;
|
|
4017
4017
|
const t = ws(e);
|
|
4018
4018
|
if (t)
|
|
4019
|
-
return new
|
|
4019
|
+
return new $(...t, !1);
|
|
4020
4020
|
}
|
|
4021
4021
|
/**
|
|
4022
4022
|
* Used in color interpolation and by 'to-rgba' expression.
|
|
@@ -4041,7 +4041,7 @@ class F {
|
|
|
4041
4041
|
* @returns Gien color, with reversed alpha blending, in LAB color space.
|
|
4042
4042
|
*/
|
|
4043
4043
|
get lab() {
|
|
4044
|
-
return this.overwriteGetter("lab",
|
|
4044
|
+
return this.overwriteGetter("lab", Aa(this.rgb));
|
|
4045
4045
|
}
|
|
4046
4046
|
/**
|
|
4047
4047
|
* Lazy getter pattern. When getter is called for the first time lazy value
|
|
@@ -4085,7 +4085,7 @@ class F {
|
|
|
4085
4085
|
switch (a) {
|
|
4086
4086
|
case "rgb": {
|
|
4087
4087
|
const [o, i, s, l] = We(e.rgb, t.rgb, n);
|
|
4088
|
-
return new
|
|
4088
|
+
return new $(o, i, s, l, !1);
|
|
4089
4089
|
}
|
|
4090
4090
|
case "hcl": {
|
|
4091
4091
|
const [o, i, s, l] = e.hcl, [u, c, p, d] = t.hcl;
|
|
@@ -4094,25 +4094,25 @@ class F {
|
|
|
4094
4094
|
let S = u - o;
|
|
4095
4095
|
u > o && S > 180 ? S -= 360 : u < o && o - u > 180 && (S += 360), f = o + n * S;
|
|
4096
4096
|
} else isNaN(o) ? isNaN(u) ? f = NaN : (f = u, (s === 1 || s === 0) && (h = c)) : (f = o, (p === 1 || p === 0) && (h = i));
|
|
4097
|
-
const [m, y,
|
|
4097
|
+
const [m, y, w, g] = gs([
|
|
4098
4098
|
f,
|
|
4099
4099
|
h ?? Ae(i, c, n),
|
|
4100
4100
|
Ae(s, p, n),
|
|
4101
4101
|
Ae(l, d, n)
|
|
4102
4102
|
]);
|
|
4103
|
-
return new
|
|
4103
|
+
return new $(m, y, w, g, !1);
|
|
4104
4104
|
}
|
|
4105
4105
|
case "lab": {
|
|
4106
|
-
const [o, i, s, l] =
|
|
4107
|
-
return new
|
|
4106
|
+
const [o, i, s, l] = _a(We(e.lab, t.lab, n));
|
|
4107
|
+
return new $(o, i, s, l, !1);
|
|
4108
4108
|
}
|
|
4109
4109
|
}
|
|
4110
4110
|
}
|
|
4111
4111
|
}
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4112
|
+
$.black = new $(0, 0, 0, 1);
|
|
4113
|
+
$.white = new $(1, 1, 1, 1);
|
|
4114
|
+
$.transparent = new $(0, 0, 0, 0);
|
|
4115
|
+
$.red = new $(1, 0, 0, 1);
|
|
4116
4116
|
class Xr {
|
|
4117
4117
|
constructor(e, t, n) {
|
|
4118
4118
|
e ? this.sensitivity = t ? "variant" : "case" : this.sensitivity = t ? "accent" : "base", this.locale = n, this.collator = new Intl.Collator(this.locale ? this.locale : [], { sensitivity: this.sensitivity, usage: "search" });
|
|
@@ -4227,7 +4227,7 @@ class K {
|
|
|
4227
4227
|
if (e instanceof K)
|
|
4228
4228
|
return e;
|
|
4229
4229
|
if (typeof e == "string") {
|
|
4230
|
-
const n =
|
|
4230
|
+
const n = $.parse(e);
|
|
4231
4231
|
return n ? new K([n]) : void 0;
|
|
4232
4232
|
}
|
|
4233
4233
|
if (!Array.isArray(e))
|
|
@@ -4236,7 +4236,7 @@ class K {
|
|
|
4236
4236
|
for (const n of e) {
|
|
4237
4237
|
if (typeof n != "string")
|
|
4238
4238
|
return;
|
|
4239
|
-
const a =
|
|
4239
|
+
const a = $.parse(n);
|
|
4240
4240
|
if (!a)
|
|
4241
4241
|
return;
|
|
4242
4242
|
t.push(a);
|
|
@@ -4251,7 +4251,7 @@ class K {
|
|
|
4251
4251
|
if (e.values.length != t.values.length)
|
|
4252
4252
|
throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${t.values.length}), cannot interpolate.`);
|
|
4253
4253
|
for (let i = 0; i < e.values.length; i++)
|
|
4254
|
-
o.push(
|
|
4254
|
+
o.push($.interpolate(e.values[i], t.values[i], n, a));
|
|
4255
4255
|
return new K(o);
|
|
4256
4256
|
}
|
|
4257
4257
|
}
|
|
@@ -4298,7 +4298,7 @@ class pe {
|
|
|
4298
4298
|
return new pe(i);
|
|
4299
4299
|
}
|
|
4300
4300
|
}
|
|
4301
|
-
class
|
|
4301
|
+
class Ie {
|
|
4302
4302
|
constructor(e) {
|
|
4303
4303
|
this.name = e.name, this.available = e.available;
|
|
4304
4304
|
}
|
|
@@ -4306,7 +4306,7 @@ class Me {
|
|
|
4306
4306
|
return this.name;
|
|
4307
4307
|
}
|
|
4308
4308
|
static fromString(e) {
|
|
4309
|
-
return e ? new
|
|
4309
|
+
return e ? new Ie({ name: e, available: !1 }) : null;
|
|
4310
4310
|
}
|
|
4311
4311
|
}
|
|
4312
4312
|
class le {
|
|
@@ -4327,11 +4327,11 @@ class le {
|
|
|
4327
4327
|
return new le(e, e, 1);
|
|
4328
4328
|
}
|
|
4329
4329
|
}
|
|
4330
|
-
function
|
|
4330
|
+
function Ia(r, e, t, n) {
|
|
4331
4331
|
return typeof r == "number" && r >= 0 && r <= 255 && typeof e == "number" && e >= 0 && e <= 255 && typeof t == "number" && t >= 0 && t <= 255 ? typeof n > "u" || typeof n == "number" && n >= 0 && n <= 1 ? null : `Invalid rgba value [${[r, e, t, n].join(", ")}]: 'a' must be between 0 and 1.` : `Invalid rgba value [${(typeof n == "number" ? [r, e, t, n] : [r, e, t]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`;
|
|
4332
4332
|
}
|
|
4333
4333
|
function pt(r) {
|
|
4334
|
-
if (r === null || typeof r == "string" || typeof r == "boolean" || typeof r == "number" || r instanceof le || r instanceof
|
|
4334
|
+
if (r === null || typeof r == "string" || typeof r == "boolean" || typeof r == "number" || r instanceof le || r instanceof $ || r instanceof Xr || r instanceof be || r instanceof te || r instanceof re || r instanceof K || r instanceof pe || r instanceof Ie)
|
|
4335
4335
|
return !0;
|
|
4336
4336
|
if (Array.isArray(r)) {
|
|
4337
4337
|
for (const e of r)
|
|
@@ -4350,12 +4350,12 @@ function B(r) {
|
|
|
4350
4350
|
if (r === null)
|
|
4351
4351
|
return Bt;
|
|
4352
4352
|
if (typeof r == "string")
|
|
4353
|
-
return
|
|
4353
|
+
return I;
|
|
4354
4354
|
if (typeof r == "boolean")
|
|
4355
4355
|
return _;
|
|
4356
4356
|
if (typeof r == "number")
|
|
4357
4357
|
return x;
|
|
4358
|
-
if (r instanceof
|
|
4358
|
+
if (r instanceof $)
|
|
4359
4359
|
return me;
|
|
4360
4360
|
if (r instanceof le)
|
|
4361
4361
|
return qt;
|
|
@@ -4371,7 +4371,7 @@ function B(r) {
|
|
|
4371
4371
|
return ut;
|
|
4372
4372
|
if (r instanceof pe)
|
|
4373
4373
|
return Xt;
|
|
4374
|
-
if (r instanceof
|
|
4374
|
+
if (r instanceof Ie)
|
|
4375
4375
|
return vt;
|
|
4376
4376
|
if (Array.isArray(r)) {
|
|
4377
4377
|
const e = r.length;
|
|
@@ -4393,7 +4393,7 @@ function B(r) {
|
|
|
4393
4393
|
}
|
|
4394
4394
|
function st(r) {
|
|
4395
4395
|
const e = typeof r;
|
|
4396
|
-
return r === null ? "" : e === "string" || e === "number" || e === "boolean" ? String(r) : r instanceof
|
|
4396
|
+
return r === null ? "" : e === "string" || e === "number" || e === "boolean" ? String(r) : r instanceof $ || r instanceof le || r instanceof be || r instanceof te || r instanceof re || r instanceof K || r instanceof pe || r instanceof Ie ? r.toString() : JSON.stringify(r);
|
|
4397
4397
|
}
|
|
4398
4398
|
class Je {
|
|
4399
4399
|
constructor(e, t) {
|
|
@@ -4419,7 +4419,7 @@ class Je {
|
|
|
4419
4419
|
}
|
|
4420
4420
|
}
|
|
4421
4421
|
const Lt = {
|
|
4422
|
-
string:
|
|
4422
|
+
string: I,
|
|
4423
4423
|
number: x,
|
|
4424
4424
|
boolean: _,
|
|
4425
4425
|
object: Oe
|
|
@@ -4484,9 +4484,9 @@ const Pn = {
|
|
|
4484
4484
|
"to-boolean": _,
|
|
4485
4485
|
"to-color": me,
|
|
4486
4486
|
"to-number": x,
|
|
4487
|
-
"to-string":
|
|
4487
|
+
"to-string": I
|
|
4488
4488
|
};
|
|
4489
|
-
class
|
|
4489
|
+
class Ee {
|
|
4490
4490
|
constructor(e, t) {
|
|
4491
4491
|
this.type = e, this.args = t;
|
|
4492
4492
|
}
|
|
@@ -4505,7 +4505,7 @@ class Ce {
|
|
|
4505
4505
|
return null;
|
|
4506
4506
|
o.push(s);
|
|
4507
4507
|
}
|
|
4508
|
-
return new
|
|
4508
|
+
return new Ee(a, o);
|
|
4509
4509
|
}
|
|
4510
4510
|
evaluate(e) {
|
|
4511
4511
|
switch (this.type.kind) {
|
|
@@ -4514,14 +4514,14 @@ class Ce {
|
|
|
4514
4514
|
case "color": {
|
|
4515
4515
|
let t, n;
|
|
4516
4516
|
for (const a of this.args) {
|
|
4517
|
-
if (t = a.evaluate(e), n = null, t instanceof
|
|
4517
|
+
if (t = a.evaluate(e), n = null, t instanceof $)
|
|
4518
4518
|
return t;
|
|
4519
4519
|
if (typeof t == "string") {
|
|
4520
4520
|
const o = e.parseColor(t);
|
|
4521
4521
|
if (o)
|
|
4522
4522
|
return o;
|
|
4523
|
-
} 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 =
|
|
4524
|
-
return new
|
|
4523
|
+
} else if (Array.isArray(t) && (t.length < 3 || t.length > 4 ? n = `Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.` : n = Ia(t[0], t[1], t[2], t[3]), !n))
|
|
4524
|
+
return new $(t[0] / 255, t[1] / 255, t[2] / 255, t[3]);
|
|
4525
4525
|
}
|
|
4526
4526
|
throw new D(n || `Could not parse color from value '${typeof t == "string" ? t : JSON.stringify(t)}'`);
|
|
4527
4527
|
}
|
|
@@ -4579,7 +4579,7 @@ class Ce {
|
|
|
4579
4579
|
case "formatted":
|
|
4580
4580
|
return be.fromString(st(this.args[0].evaluate(e)));
|
|
4581
4581
|
case "resolvedImage":
|
|
4582
|
-
return
|
|
4582
|
+
return Ie.fromString(st(this.args[0].evaluate(e)));
|
|
4583
4583
|
case "projectionDefinition":
|
|
4584
4584
|
return this.args[0].evaluate(e);
|
|
4585
4585
|
default:
|
|
@@ -4615,7 +4615,7 @@ class Ma {
|
|
|
4615
4615
|
}
|
|
4616
4616
|
parseColor(e) {
|
|
4617
4617
|
let t = this._parseColorCache.get(e);
|
|
4618
|
-
return t || (t =
|
|
4618
|
+
return t || (t = $.parse(e), this._parseColorCache.set(e, t)), t;
|
|
4619
4619
|
}
|
|
4620
4620
|
}
|
|
4621
4621
|
class Kt {
|
|
@@ -4635,7 +4635,7 @@ class Kt {
|
|
|
4635
4635
|
_parse(e, t) {
|
|
4636
4636
|
(e === null || typeof e == "string" || typeof e == "boolean" || typeof e == "number") && (e = ["literal", e]);
|
|
4637
4637
|
function n(a, o, i) {
|
|
4638
|
-
return i === "assert" ? new ue(o, [a]) : i === "coerce" ? new
|
|
4638
|
+
return i === "assert" ? new ue(o, [a]) : i === "coerce" ? new Ee(o, [a]) : a;
|
|
4639
4639
|
}
|
|
4640
4640
|
if (Array.isArray(e)) {
|
|
4641
4641
|
if (e.length === 0)
|
|
@@ -4796,7 +4796,7 @@ class Yr {
|
|
|
4796
4796
|
if (e.length !== 3)
|
|
4797
4797
|
return t.error(`Expected 2 arguments, but found ${e.length - 1} instead.`);
|
|
4798
4798
|
const n = t.parse(e[1], 1, A), a = t.parse(e[2], 2, A);
|
|
4799
|
-
return !n || !a ? null : Zr(n.type, [_,
|
|
4799
|
+
return !n || !a ? null : Zr(n.type, [_, I, x, Bt, A]) ? new Yr(n, a) : t.error(`Expected first argument to be of type boolean, string, number or null, but found ${j(n.type)} instead`);
|
|
4800
4800
|
}
|
|
4801
4801
|
evaluate(e) {
|
|
4802
4802
|
const t = this.needle.evaluate(e), n = this.haystack.evaluate(e);
|
|
@@ -4825,7 +4825,7 @@ class Rt {
|
|
|
4825
4825
|
const n = t.parse(e[1], 1, A), a = t.parse(e[2], 2, A);
|
|
4826
4826
|
if (!n || !a)
|
|
4827
4827
|
return null;
|
|
4828
|
-
if (!Zr(n.type, [_,
|
|
4828
|
+
if (!Zr(n.type, [_, I, x, Bt, A]))
|
|
4829
4829
|
return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${j(n.type)} instead`);
|
|
4830
4830
|
if (e.length === 4) {
|
|
4831
4831
|
const o = t.parse(e[3], 3, x);
|
|
@@ -4963,7 +4963,7 @@ class zt {
|
|
|
4963
4963
|
const n = t.parse(e[1], 1, A), a = t.parse(e[2], 2, x);
|
|
4964
4964
|
if (!n || !a)
|
|
4965
4965
|
return null;
|
|
4966
|
-
if (!Zr(n.type, [W(A),
|
|
4966
|
+
if (!Zr(n.type, [W(A), I, A]))
|
|
4967
4967
|
return t.error(`Expected first argument to be of type array or string, but found ${j(n.type)} instead`);
|
|
4968
4968
|
if (e.length === 4) {
|
|
4969
4969
|
const o = t.parse(e[3], 3, x);
|
|
@@ -4987,7 +4987,7 @@ class zt {
|
|
|
4987
4987
|
return !1;
|
|
4988
4988
|
}
|
|
4989
4989
|
}
|
|
4990
|
-
function
|
|
4990
|
+
function Pa(r, e) {
|
|
4991
4991
|
const t = r.length - 1;
|
|
4992
4992
|
let n = 0, a = t, o = 0, i, s;
|
|
4993
4993
|
for (; n <= a; )
|
|
@@ -5041,7 +5041,7 @@ class Jt {
|
|
|
5041
5041
|
const o = t.length;
|
|
5042
5042
|
if (a >= t[o - 1])
|
|
5043
5043
|
return n[o - 1].evaluate(e);
|
|
5044
|
-
const i =
|
|
5044
|
+
const i = Pa(t, a);
|
|
5045
5045
|
return n[i].evaluate(e);
|
|
5046
5046
|
}
|
|
5047
5047
|
eachChild(e) {
|
|
@@ -5053,11 +5053,11 @@ class Jt {
|
|
|
5053
5053
|
return this.outputs.every((e) => e.outputDefined());
|
|
5054
5054
|
}
|
|
5055
5055
|
}
|
|
5056
|
-
function
|
|
5056
|
+
function Cs(r) {
|
|
5057
5057
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
5058
5058
|
}
|
|
5059
5059
|
var dr, Rn;
|
|
5060
|
-
function
|
|
5060
|
+
function Es() {
|
|
5061
5061
|
if (Rn) return dr;
|
|
5062
5062
|
Rn = 1, dr = r;
|
|
5063
5063
|
function r(e, t, n, a) {
|
|
@@ -5093,7 +5093,7 @@ function Cs() {
|
|
|
5093
5093
|
}
|
|
5094
5094
|
}, dr;
|
|
5095
5095
|
}
|
|
5096
|
-
var Ts =
|
|
5096
|
+
var Ts = Es(), As = /* @__PURE__ */ Cs(Ts);
|
|
5097
5097
|
class ye {
|
|
5098
5098
|
constructor(e, t, n, a, o) {
|
|
5099
5099
|
this.type = e, this.operator = t, this.interpolation = n, this.input = a, this.labels = [], this.outputs = [];
|
|
@@ -5168,14 +5168,14 @@ class ye {
|
|
|
5168
5168
|
const o = t.length;
|
|
5169
5169
|
if (a >= t[o - 1])
|
|
5170
5170
|
return n[o - 1].evaluate(e);
|
|
5171
|
-
const i =
|
|
5171
|
+
const i = Pa(t, a), s = t[i], l = t[i + 1], u = ye.interpolationFactor(this.interpolation, a, s, l), c = n[i].evaluate(e), p = n[i + 1].evaluate(e);
|
|
5172
5172
|
switch (this.operator) {
|
|
5173
5173
|
case "interpolate":
|
|
5174
5174
|
switch (this.type.kind) {
|
|
5175
5175
|
case "number":
|
|
5176
5176
|
return Ae(c, p, u);
|
|
5177
5177
|
case "color":
|
|
5178
|
-
return
|
|
5178
|
+
return $.interpolate(c, p, u);
|
|
5179
5179
|
case "padding":
|
|
5180
5180
|
return te.interpolate(c, p, u);
|
|
5181
5181
|
case "colorArray":
|
|
@@ -5192,14 +5192,14 @@ class ye {
|
|
|
5192
5192
|
case "interpolate-hcl":
|
|
5193
5193
|
switch (this.type.kind) {
|
|
5194
5194
|
case "color":
|
|
5195
|
-
return
|
|
5195
|
+
return $.interpolate(c, p, u, "hcl");
|
|
5196
5196
|
case "colorArray":
|
|
5197
5197
|
return K.interpolate(c, p, u, "hcl");
|
|
5198
5198
|
}
|
|
5199
5199
|
case "interpolate-lab":
|
|
5200
5200
|
switch (this.type.kind) {
|
|
5201
5201
|
case "color":
|
|
5202
|
-
return
|
|
5202
|
+
return $.interpolate(c, p, u, "lab");
|
|
5203
5203
|
case "colorArray":
|
|
5204
5204
|
return K.interpolate(c, p, u, "lab");
|
|
5205
5205
|
}
|
|
@@ -5218,7 +5218,7 @@ function hr(r, e, t, n) {
|
|
|
5218
5218
|
const a = n - t, o = r - t;
|
|
5219
5219
|
return a === 0 ? 0 : e === 1 ? o / a : (Math.pow(e, o) - 1) / (Math.pow(e, a) - 1);
|
|
5220
5220
|
}
|
|
5221
|
-
|
|
5221
|
+
$.interpolate, te.interpolate, re.interpolate, K.interpolate, pe.interpolate;
|
|
5222
5222
|
class ft {
|
|
5223
5223
|
constructor(e, t) {
|
|
5224
5224
|
this.type = e, this.args = t;
|
|
@@ -5243,7 +5243,7 @@ class ft {
|
|
|
5243
5243
|
evaluate(e) {
|
|
5244
5244
|
let t = null, n = 0, a;
|
|
5245
5245
|
for (const o of this.args)
|
|
5246
|
-
if (n++, t = o.evaluate(e), t && t instanceof
|
|
5246
|
+
if (n++, t = o.evaluate(e), t && t instanceof Ie && !t.available && (a || (a = t.name), t = null, n === this.args.length && (t = a)), t !== null)
|
|
5247
5247
|
break;
|
|
5248
5248
|
return t;
|
|
5249
5249
|
}
|
|
@@ -5260,10 +5260,10 @@ function zn(r, e) {
|
|
|
5260
5260
|
function _s(r, e, t) {
|
|
5261
5261
|
return e === t;
|
|
5262
5262
|
}
|
|
5263
|
-
function
|
|
5263
|
+
function Is(r, e, t) {
|
|
5264
5264
|
return e !== t;
|
|
5265
5265
|
}
|
|
5266
|
-
function
|
|
5266
|
+
function Ms(r, e, t) {
|
|
5267
5267
|
return e < t;
|
|
5268
5268
|
}
|
|
5269
5269
|
function Ps(r, e, t) {
|
|
@@ -5275,13 +5275,13 @@ function Rs(r, e, t) {
|
|
|
5275
5275
|
function zs(r, e, t) {
|
|
5276
5276
|
return e >= t;
|
|
5277
5277
|
}
|
|
5278
|
-
function
|
|
5278
|
+
function Ra(r, e, t, n) {
|
|
5279
5279
|
return n.compare(e, t) === 0;
|
|
5280
5280
|
}
|
|
5281
|
-
function $s(r, e, t, n) {
|
|
5282
|
-
return !Pa(r, e, t, n);
|
|
5283
|
-
}
|
|
5284
5281
|
function Fs(r, e, t, n) {
|
|
5282
|
+
return !Ra(r, e, t, n);
|
|
5283
|
+
}
|
|
5284
|
+
function $s(r, e, t, n) {
|
|
5285
5285
|
return n.compare(e, t) < 0;
|
|
5286
5286
|
}
|
|
5287
5287
|
function Os(r, e, t, n) {
|
|
@@ -5295,7 +5295,7 @@ function js(r, e, t, n) {
|
|
|
5295
5295
|
}
|
|
5296
5296
|
function et(r, e, t) {
|
|
5297
5297
|
const n = r !== "==" && r !== "!=";
|
|
5298
|
-
return class
|
|
5298
|
+
return class za {
|
|
5299
5299
|
constructor(o, i, s) {
|
|
5300
5300
|
this.type = _, this.lhs = o, this.rhs = i, this.collator = s, this.hasUntypedArgument = o.type.kind === "value" || i.type.kind === "value";
|
|
5301
5301
|
}
|
|
@@ -5323,7 +5323,7 @@ function et(r, e, t) {
|
|
|
5323
5323
|
if (c = i.parse(o[3], 3, Vt), !c)
|
|
5324
5324
|
return null;
|
|
5325
5325
|
}
|
|
5326
|
-
return new
|
|
5326
|
+
return new za(l, u, c);
|
|
5327
5327
|
}
|
|
5328
5328
|
evaluate(o) {
|
|
5329
5329
|
const i = this.lhs.evaluate(o), s = this.rhs.evaluate(o);
|
|
@@ -5347,7 +5347,7 @@ function et(r, e, t) {
|
|
|
5347
5347
|
}
|
|
5348
5348
|
};
|
|
5349
5349
|
}
|
|
5350
|
-
const Ds = et("==", _s,
|
|
5350
|
+
const Ds = et("==", _s, Ra), Us = et("!=", Is, Fs), Bs = et("<", Ms, $s), qs = et(">", Ps, Os), Vs = et("<=", Rs, Ns), Gs = et(">=", zs, js);
|
|
5351
5351
|
class Qt {
|
|
5352
5352
|
constructor(e, t, n) {
|
|
5353
5353
|
this.type = Vt, this.locale = n, this.caseSensitive = e, this.diacriticSensitive = t;
|
|
@@ -5365,7 +5365,7 @@ class Qt {
|
|
|
5365
5365
|
if (!o)
|
|
5366
5366
|
return null;
|
|
5367
5367
|
let i = null;
|
|
5368
|
-
return n.locale && (i = t.parse(n.locale, 1,
|
|
5368
|
+
return n.locale && (i = t.parse(n.locale, 1, I), !i) ? null : new Qt(a, o, i);
|
|
5369
5369
|
}
|
|
5370
5370
|
evaluate(e) {
|
|
5371
5371
|
return new Xr(this.caseSensitive.evaluate(e), this.diacriticSensitive.evaluate(e), this.locale ? this.locale.evaluate(e) : null);
|
|
@@ -5379,7 +5379,7 @@ class Qt {
|
|
|
5379
5379
|
}
|
|
5380
5380
|
class Qr {
|
|
5381
5381
|
constructor(e, t, n, a, o) {
|
|
5382
|
-
this.type =
|
|
5382
|
+
this.type = I, this.number = e, this.locale = t, this.currency = n, this.minFractionDigits = a, this.maxFractionDigits = o;
|
|
5383
5383
|
}
|
|
5384
5384
|
static parse(e, t) {
|
|
5385
5385
|
if (e.length !== 3)
|
|
@@ -5391,10 +5391,10 @@ class Qr {
|
|
|
5391
5391
|
if (typeof a != "object" || Array.isArray(a))
|
|
5392
5392
|
return t.error("NumberFormat options argument must be an object.");
|
|
5393
5393
|
let o = null;
|
|
5394
|
-
if (a.locale && (o = t.parse(a.locale, 1,
|
|
5394
|
+
if (a.locale && (o = t.parse(a.locale, 1, I), !o))
|
|
5395
5395
|
return null;
|
|
5396
5396
|
let i = null;
|
|
5397
|
-
if (a.currency && (i = t.parse(a.currency, 1,
|
|
5397
|
+
if (a.currency && (i = t.parse(a.currency, 1, I), !i))
|
|
5398
5398
|
return null;
|
|
5399
5399
|
let s = null;
|
|
5400
5400
|
if (a["min-fraction-digits"] && (s = t.parse(a["min-fraction-digits"], 1, x), !s))
|
|
@@ -5437,7 +5437,7 @@ class en {
|
|
|
5437
5437
|
if (s["font-scale"] && (l = t.parse(s["font-scale"], 1, x), !l))
|
|
5438
5438
|
return null;
|
|
5439
5439
|
let u = null;
|
|
5440
|
-
if (s["text-font"] && (u = t.parse(s["text-font"], 1, W(
|
|
5440
|
+
if (s["text-font"] && (u = t.parse(s["text-font"], 1, W(I)), !u))
|
|
5441
5441
|
return null;
|
|
5442
5442
|
let c = null;
|
|
5443
5443
|
if (s["text-color"] && (c = t.parse(s["text-color"], 1, me), !c))
|
|
@@ -5446,7 +5446,7 @@ class en {
|
|
|
5446
5446
|
if (s["vertical-align"]) {
|
|
5447
5447
|
if (typeof s["vertical-align"] == "string" && !Ss.includes(s["vertical-align"]))
|
|
5448
5448
|
return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${s["vertical-align"]}' instead.`);
|
|
5449
|
-
if (p = t.parse(s["vertical-align"], 1,
|
|
5449
|
+
if (p = t.parse(s["vertical-align"], 1, I), !p)
|
|
5450
5450
|
return null;
|
|
5451
5451
|
}
|
|
5452
5452
|
const d = a[a.length - 1];
|
|
@@ -5485,11 +5485,11 @@ class tn {
|
|
|
5485
5485
|
static parse(e, t) {
|
|
5486
5486
|
if (e.length !== 2)
|
|
5487
5487
|
return t.error("Expected two arguments.");
|
|
5488
|
-
const n = t.parse(e[1], 1,
|
|
5488
|
+
const n = t.parse(e[1], 1, I);
|
|
5489
5489
|
return n ? new tn(n) : t.error("No image name provided.");
|
|
5490
5490
|
}
|
|
5491
5491
|
evaluate(e) {
|
|
5492
|
-
const t = this.input.evaluate(e), n =
|
|
5492
|
+
const t = this.input.evaluate(e), n = Ie.fromString(t);
|
|
5493
5493
|
return n && e.availableImages && (n.available = e.availableImages.indexOf(t) > -1), n;
|
|
5494
5494
|
}
|
|
5495
5495
|
eachChild(e) {
|
|
@@ -5560,7 +5560,7 @@ function Js(r, e, t) {
|
|
|
5560
5560
|
}
|
|
5561
5561
|
function er(r, e, t, n) {
|
|
5562
5562
|
const a = [e[0] - r[0], e[1] - r[1]], o = [n[0] - t[0], n[1] - t[1]];
|
|
5563
|
-
return rl(o, a) === 0 ? !1 : !!(
|
|
5563
|
+
return rl(o, a) === 0 ? !1 : !!(Fn(r, e, t, n) && Fn(t, n, r, e));
|
|
5564
5564
|
}
|
|
5565
5565
|
function Qs(r, e, t) {
|
|
5566
5566
|
for (const n of t)
|
|
@@ -5585,7 +5585,7 @@ function el(r, e) {
|
|
|
5585
5585
|
return !0;
|
|
5586
5586
|
return !1;
|
|
5587
5587
|
}
|
|
5588
|
-
function
|
|
5588
|
+
function Fa(r, e) {
|
|
5589
5589
|
for (const t of r)
|
|
5590
5590
|
if (!tt(t, e))
|
|
5591
5591
|
return !1;
|
|
@@ -5596,14 +5596,14 @@ function za(r, e) {
|
|
|
5596
5596
|
}
|
|
5597
5597
|
function tl(r, e) {
|
|
5598
5598
|
for (const t of e)
|
|
5599
|
-
if (
|
|
5599
|
+
if (Fa(r, t))
|
|
5600
5600
|
return !0;
|
|
5601
5601
|
return !1;
|
|
5602
5602
|
}
|
|
5603
5603
|
function rl(r, e) {
|
|
5604
5604
|
return r[0] * e[1] - r[1] * e[0];
|
|
5605
5605
|
}
|
|
5606
|
-
function
|
|
5606
|
+
function Fn(r, e, t, n) {
|
|
5607
5607
|
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;
|
|
5608
5608
|
return c > 0 && p < 0 || c < 0 && p > 0;
|
|
5609
5609
|
}
|
|
@@ -5627,7 +5627,7 @@ function $a(r, e, t) {
|
|
|
5627
5627
|
}
|
|
5628
5628
|
return n;
|
|
5629
5629
|
}
|
|
5630
|
-
function
|
|
5630
|
+
function Oa(r, e, t, n) {
|
|
5631
5631
|
if (r[0] < t[0] || r[0] > t[2]) {
|
|
5632
5632
|
const a = n * 0.5;
|
|
5633
5633
|
let o = r[0] - t[0] > a ? -n : t[0] - r[0] > a ? n : 0;
|
|
@@ -5638,12 +5638,12 @@ function Fa(r, e, t, n) {
|
|
|
5638
5638
|
function nl(r) {
|
|
5639
5639
|
r[0] = r[1] = 1 / 0, r[2] = r[3] = -1 / 0;
|
|
5640
5640
|
}
|
|
5641
|
-
function
|
|
5641
|
+
function $n(r, e, t, n) {
|
|
5642
5642
|
const a = Math.pow(2, n.z) * ge, o = [n.x * ge, n.y * ge], i = [];
|
|
5643
5643
|
for (const s of r)
|
|
5644
5644
|
for (const l of s) {
|
|
5645
5645
|
const u = [l.x + o[0], l.y + o[1]];
|
|
5646
|
-
|
|
5646
|
+
Oa(u, e, t, a), i.push(u);
|
|
5647
5647
|
}
|
|
5648
5648
|
return i;
|
|
5649
5649
|
}
|
|
@@ -5661,14 +5661,14 @@ function On(r, e, t, n) {
|
|
|
5661
5661
|
nl(e);
|
|
5662
5662
|
for (const s of i)
|
|
5663
5663
|
for (const l of s)
|
|
5664
|
-
|
|
5664
|
+
Oa(l, e, t, a);
|
|
5665
5665
|
}
|
|
5666
5666
|
return i;
|
|
5667
5667
|
}
|
|
5668
5668
|
function al(r, e) {
|
|
5669
5669
|
const t = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n = [1 / 0, 1 / 0, -1 / 0, -1 / 0], a = r.canonicalID();
|
|
5670
5670
|
if (e.type === "Polygon") {
|
|
5671
|
-
const o = an(e.coordinates, n, a), i =
|
|
5671
|
+
const o = an(e.coordinates, n, a), i = $n(r.geometry(), t, n, a);
|
|
5672
5672
|
if (!dt(t, n))
|
|
5673
5673
|
return !1;
|
|
5674
5674
|
for (const s of i)
|
|
@@ -5676,7 +5676,7 @@ function al(r, e) {
|
|
|
5676
5676
|
return !1;
|
|
5677
5677
|
}
|
|
5678
5678
|
if (e.type === "MultiPolygon") {
|
|
5679
|
-
const o = $a(e.coordinates, n, a), i =
|
|
5679
|
+
const o = $a(e.coordinates, n, a), i = $n(r.geometry(), t, n, a);
|
|
5680
5680
|
if (!dt(t, n))
|
|
5681
5681
|
return !1;
|
|
5682
5682
|
for (const s of i)
|
|
@@ -5692,7 +5692,7 @@ function ol(r, e) {
|
|
|
5692
5692
|
if (!dt(t, n))
|
|
5693
5693
|
return !1;
|
|
5694
5694
|
for (const s of i)
|
|
5695
|
-
if (!
|
|
5695
|
+
if (!Fa(s, o))
|
|
5696
5696
|
return !1;
|
|
5697
5697
|
}
|
|
5698
5698
|
if (e.type === "MultiPolygon") {
|
|
@@ -5751,7 +5751,7 @@ class je {
|
|
|
5751
5751
|
return !0;
|
|
5752
5752
|
}
|
|
5753
5753
|
}
|
|
5754
|
-
class
|
|
5754
|
+
class Na {
|
|
5755
5755
|
constructor(e = [], t = (n, a) => n < a ? -1 : n > a ? 1 : 0) {
|
|
5756
5756
|
if (this.data = e, this.length = this.data.length, this.compare = t, this.length > 0)
|
|
5757
5757
|
for (let n = (this.length >> 1) - 1; n >= 0; n--) this._down(n);
|
|
@@ -5858,20 +5858,20 @@ class on {
|
|
|
5858
5858
|
return e;
|
|
5859
5859
|
}
|
|
5860
5860
|
}
|
|
5861
|
-
const _r = 100,
|
|
5862
|
-
function
|
|
5861
|
+
const _r = 100, Ir = 50;
|
|
5862
|
+
function ja(r, e) {
|
|
5863
5863
|
return e[0] - r[0];
|
|
5864
5864
|
}
|
|
5865
|
-
function
|
|
5865
|
+
function Ft(r) {
|
|
5866
5866
|
return r[1] - r[0] + 1;
|
|
5867
5867
|
}
|
|
5868
5868
|
function xe(r, e) {
|
|
5869
5869
|
return r[1] >= r[0] && r[1] < e;
|
|
5870
5870
|
}
|
|
5871
|
-
function
|
|
5871
|
+
function Mr(r, e) {
|
|
5872
5872
|
if (r[0] > r[1])
|
|
5873
5873
|
return [null, null];
|
|
5874
|
-
const t =
|
|
5874
|
+
const t = Ft(r);
|
|
5875
5875
|
if (e) {
|
|
5876
5876
|
if (t === 2)
|
|
5877
5877
|
return [r, null];
|
|
@@ -5913,12 +5913,12 @@ function sn(r, e, t) {
|
|
|
5913
5913
|
let n = 0, a = 0;
|
|
5914
5914
|
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]);
|
|
5915
5915
|
}
|
|
5916
|
-
function
|
|
5916
|
+
function $e(r, e, t) {
|
|
5917
5917
|
const n = t.pointOnLine(e, r);
|
|
5918
5918
|
return t.distance(r, n.point);
|
|
5919
5919
|
}
|
|
5920
5920
|
function ln(r, e, t, n, a) {
|
|
5921
|
-
const o = Math.min(
|
|
5921
|
+
const o = Math.min($e(r, [t, n], a), $e(e, [t, n], a)), i = Math.min($e(t, [r, e], a), $e(n, [r, e], a));
|
|
5922
5922
|
return Math.min(o, i);
|
|
5923
5923
|
}
|
|
5924
5924
|
function ul(r, e, t, n, a) {
|
|
@@ -5952,7 +5952,7 @@ function pl(r, e, t) {
|
|
|
5952
5952
|
let n = 1 / 0;
|
|
5953
5953
|
for (const a of e) {
|
|
5954
5954
|
const o = a[0], i = a[a.length - 1];
|
|
5955
|
-
if (o !== i && (n = Math.min(n,
|
|
5955
|
+
if (o !== i && (n = Math.min(n, $e(r, [i, o], t)), n === 0))
|
|
5956
5956
|
return n;
|
|
5957
5957
|
const s = t.pointOnLine(a, r);
|
|
5958
5958
|
if (n = Math.min(n, t.distance(r, s.point)), n === 0)
|
|
@@ -6001,10 +6001,10 @@ function dl(r, e, t, n = 1 / 0) {
|
|
|
6001
6001
|
const p = s[c], d = s[l];
|
|
6002
6002
|
for (const f of e)
|
|
6003
6003
|
for (let h = 0, m = f.length, y = m - 1; h < m; y = h++) {
|
|
6004
|
-
const
|
|
6005
|
-
if (er(p, d,
|
|
6004
|
+
const w = f[y], g = f[h];
|
|
6005
|
+
if (er(p, d, w, g))
|
|
6006
6006
|
return 0;
|
|
6007
|
-
i = Math.min(i, ln(p, d,
|
|
6007
|
+
i = Math.min(i, ln(p, d, w, g, t));
|
|
6008
6008
|
}
|
|
6009
6009
|
}
|
|
6010
6010
|
return i;
|
|
@@ -6015,23 +6015,23 @@ function qn(r, e, t, n, a, o) {
|
|
|
6015
6015
|
const i = sn(Pr(n, o), a, t);
|
|
6016
6016
|
i < e && r.push([i, o, [0, 0]]);
|
|
6017
6017
|
}
|
|
6018
|
-
function
|
|
6018
|
+
function Ct(r, e, t, n, a, o, i) {
|
|
6019
6019
|
if (!o || !i)
|
|
6020
6020
|
return;
|
|
6021
6021
|
const s = sn(Pr(n, o), Pr(a, i), t);
|
|
6022
6022
|
s < e && r.push([s, o, i]);
|
|
6023
6023
|
}
|
|
6024
|
-
function
|
|
6024
|
+
function $t(r, e, t, n, a = 1 / 0) {
|
|
6025
6025
|
let o = Math.min(n.distance(r[0], t[0][0]), a);
|
|
6026
6026
|
if (o === 0)
|
|
6027
6027
|
return o;
|
|
6028
|
-
const i = new
|
|
6028
|
+
const i = new Na([[0, [0, r.length - 1], [0, 0]]], ja), s = Rr(t);
|
|
6029
6029
|
for (; i.length > 0; ) {
|
|
6030
6030
|
const l = i.pop();
|
|
6031
6031
|
if (l[0] >= o)
|
|
6032
6032
|
continue;
|
|
6033
|
-
const u = l[1], c = e ?
|
|
6034
|
-
if (
|
|
6033
|
+
const u = l[1], c = e ? Ir : _r;
|
|
6034
|
+
if (Ft(u) <= c) {
|
|
6035
6035
|
if (!xe(u, r.length))
|
|
6036
6036
|
return NaN;
|
|
6037
6037
|
if (e) {
|
|
@@ -6046,7 +6046,7 @@ function Ft(r, e, t, n, a = 1 / 0) {
|
|
|
6046
6046
|
return 0;
|
|
6047
6047
|
}
|
|
6048
6048
|
} else {
|
|
6049
|
-
const p =
|
|
6049
|
+
const p = Mr(u, e);
|
|
6050
6050
|
qn(i, o, n, r, s, p[0]), qn(i, o, n, r, s, p[1]);
|
|
6051
6051
|
}
|
|
6052
6052
|
}
|
|
@@ -6056,13 +6056,13 @@ function Ot(r, e, t, n, a, o = 1 / 0) {
|
|
|
6056
6056
|
let i = Math.min(o, a.distance(r[0], t[0]));
|
|
6057
6057
|
if (i === 0)
|
|
6058
6058
|
return i;
|
|
6059
|
-
const s = new
|
|
6059
|
+
const s = new Na([[0, [0, r.length - 1], [0, t.length - 1]]], ja);
|
|
6060
6060
|
for (; s.length > 0; ) {
|
|
6061
6061
|
const l = s.pop();
|
|
6062
6062
|
if (l[0] >= i)
|
|
6063
6063
|
continue;
|
|
6064
|
-
const u = l[1], c = l[2], p = e ?
|
|
6065
|
-
if (
|
|
6064
|
+
const u = l[1], c = l[2], p = e ? Ir : _r, d = n ? Ir : _r;
|
|
6065
|
+
if (Ft(u) <= p && Ft(c) <= d) {
|
|
6066
6066
|
if (!xe(u, r.length) && xe(c, t.length))
|
|
6067
6067
|
return NaN;
|
|
6068
6068
|
let f;
|
|
@@ -6071,18 +6071,18 @@ function Ot(r, e, t, n, a, o = 1 / 0) {
|
|
|
6071
6071
|
else if (e && !n) {
|
|
6072
6072
|
const h = r.slice(u[0], u[1] + 1);
|
|
6073
6073
|
for (let m = c[0]; m <= c[1]; ++m)
|
|
6074
|
-
if (f =
|
|
6074
|
+
if (f = $e(t[m], h, a), i = Math.min(i, f), i === 0)
|
|
6075
6075
|
return i;
|
|
6076
6076
|
} else if (!e && n) {
|
|
6077
6077
|
const h = t.slice(c[0], c[1] + 1);
|
|
6078
6078
|
for (let m = u[0]; m <= u[1]; ++m)
|
|
6079
|
-
if (f =
|
|
6079
|
+
if (f = $e(r[m], h, a), i = Math.min(i, f), i === 0)
|
|
6080
6080
|
return i;
|
|
6081
6081
|
} else
|
|
6082
6082
|
f = cl(r, u, t, c, a), i = Math.min(i, f);
|
|
6083
6083
|
} else {
|
|
6084
|
-
const f =
|
|
6085
|
-
|
|
6084
|
+
const f = Mr(u, e), h = Mr(c, n);
|
|
6085
|
+
Ct(s, i, a, r, t, f[0], h[0]), Ct(s, i, a, r, t, f[0], h[1]), Ct(s, i, a, r, t, f[1], h[0]), Ct(s, i, a, r, t, f[1], h[1]);
|
|
6086
6086
|
}
|
|
6087
6087
|
}
|
|
6088
6088
|
return i;
|
|
@@ -6102,7 +6102,7 @@ function hl(r, e) {
|
|
|
6102
6102
|
o = Math.min(o, Ot(n, !1, i.coordinates, !0, a, o));
|
|
6103
6103
|
break;
|
|
6104
6104
|
case "Polygon":
|
|
6105
|
-
o = Math.min(o,
|
|
6105
|
+
o = Math.min(o, $t(n, !1, i.coordinates, a, o));
|
|
6106
6106
|
break;
|
|
6107
6107
|
}
|
|
6108
6108
|
if (o === 0)
|
|
@@ -6125,7 +6125,7 @@ function ml(r, e) {
|
|
|
6125
6125
|
o = Math.min(o, Ot(n, !0, i.coordinates, !0, a, o));
|
|
6126
6126
|
break;
|
|
6127
6127
|
case "Polygon":
|
|
6128
|
-
o = Math.min(o,
|
|
6128
|
+
o = Math.min(o, $t(n, !0, i.coordinates, a, o));
|
|
6129
6129
|
break;
|
|
6130
6130
|
}
|
|
6131
6131
|
if (o === 0)
|
|
@@ -6143,10 +6143,10 @@ function yl(r, e) {
|
|
|
6143
6143
|
for (const s of n) {
|
|
6144
6144
|
switch (i.type) {
|
|
6145
6145
|
case "Point":
|
|
6146
|
-
o = Math.min(o,
|
|
6146
|
+
o = Math.min(o, $t([i.coordinates], !1, s, a, o));
|
|
6147
6147
|
break;
|
|
6148
6148
|
case "LineString":
|
|
6149
|
-
o = Math.min(o,
|
|
6149
|
+
o = Math.min(o, $t(i.coordinates, !0, s, a, o));
|
|
6150
6150
|
break;
|
|
6151
6151
|
case "Polygon":
|
|
6152
6152
|
o = Math.min(o, dl(s, i.coordinates, a, o));
|
|
@@ -6256,10 +6256,10 @@ const un = {
|
|
|
6256
6256
|
slice: zt,
|
|
6257
6257
|
step: Jt,
|
|
6258
6258
|
string: ue,
|
|
6259
|
-
"to-boolean":
|
|
6260
|
-
"to-color":
|
|
6261
|
-
"to-number":
|
|
6262
|
-
"to-string":
|
|
6259
|
+
"to-boolean": Ee,
|
|
6260
|
+
"to-color": Ee,
|
|
6261
|
+
"to-number": Ee,
|
|
6262
|
+
"to-string": Ee,
|
|
6263
6263
|
var: Wt,
|
|
6264
6264
|
within: je,
|
|
6265
6265
|
distance: De,
|
|
@@ -6332,10 +6332,10 @@ class ce {
|
|
|
6332
6332
|
}
|
|
6333
6333
|
function Vn(r, [e, t, n, a]) {
|
|
6334
6334
|
e = e.evaluate(r), t = t.evaluate(r), n = n.evaluate(r);
|
|
6335
|
-
const o = a ? a.evaluate(r) : 1, i =
|
|
6335
|
+
const o = a ? a.evaluate(r) : 1, i = Ia(e, t, n, o);
|
|
6336
6336
|
if (i)
|
|
6337
6337
|
throw new D(i);
|
|
6338
|
-
return new
|
|
6338
|
+
return new $(e / 255, t / 255, n / 255, o, !1);
|
|
6339
6339
|
}
|
|
6340
6340
|
function Gn(r, e) {
|
|
6341
6341
|
return r in e;
|
|
@@ -6359,13 +6359,13 @@ function ze(r) {
|
|
|
6359
6359
|
ce.register(un, {
|
|
6360
6360
|
error: [
|
|
6361
6361
|
ps,
|
|
6362
|
-
[
|
|
6362
|
+
[I],
|
|
6363
6363
|
(r, [e]) => {
|
|
6364
6364
|
throw new D(e.evaluate(r));
|
|
6365
6365
|
}
|
|
6366
6366
|
],
|
|
6367
6367
|
typeof: [
|
|
6368
|
-
|
|
6368
|
+
I,
|
|
6369
6369
|
[A],
|
|
6370
6370
|
(r, [e]) => j(B(e.evaluate(r)))
|
|
6371
6371
|
],
|
|
@@ -6391,11 +6391,11 @@ ce.register(un, {
|
|
|
6391
6391
|
type: _,
|
|
6392
6392
|
overloads: [
|
|
6393
6393
|
[
|
|
6394
|
-
[
|
|
6394
|
+
[I],
|
|
6395
6395
|
(r, [e]) => Gn(e.evaluate(r), r.properties())
|
|
6396
6396
|
],
|
|
6397
6397
|
[
|
|
6398
|
-
[
|
|
6398
|
+
[I, Oe],
|
|
6399
6399
|
(r, [e, t]) => Gn(e.evaluate(r), t.evaluate(r))
|
|
6400
6400
|
]
|
|
6401
6401
|
]
|
|
@@ -6404,18 +6404,18 @@ ce.register(un, {
|
|
|
6404
6404
|
type: A,
|
|
6405
6405
|
overloads: [
|
|
6406
6406
|
[
|
|
6407
|
-
[
|
|
6407
|
+
[I],
|
|
6408
6408
|
(r, [e]) => yr(e.evaluate(r), r.properties())
|
|
6409
6409
|
],
|
|
6410
6410
|
[
|
|
6411
|
-
[
|
|
6411
|
+
[I, Oe],
|
|
6412
6412
|
(r, [e, t]) => yr(e.evaluate(r), t.evaluate(r))
|
|
6413
6413
|
]
|
|
6414
6414
|
]
|
|
6415
6415
|
},
|
|
6416
6416
|
"feature-state": [
|
|
6417
6417
|
A,
|
|
6418
|
-
[
|
|
6418
|
+
[I],
|
|
6419
6419
|
(r, [e]) => yr(e.evaluate(r), r.featureState || {})
|
|
6420
6420
|
],
|
|
6421
6421
|
properties: [
|
|
@@ -6424,7 +6424,7 @@ ce.register(un, {
|
|
|
6424
6424
|
(r) => r.properties()
|
|
6425
6425
|
],
|
|
6426
6426
|
"geometry-type": [
|
|
6427
|
-
|
|
6427
|
+
I,
|
|
6428
6428
|
[],
|
|
6429
6429
|
(r) => r.geometryType()
|
|
6430
6430
|
],
|
|
@@ -6606,7 +6606,7 @@ ce.register(un, {
|
|
|
6606
6606
|
],
|
|
6607
6607
|
"filter-==": [
|
|
6608
6608
|
_,
|
|
6609
|
-
[
|
|
6609
|
+
[I, A],
|
|
6610
6610
|
(r, [e, t]) => r.properties()[e.value] === t.value
|
|
6611
6611
|
],
|
|
6612
6612
|
"filter-id-==": [
|
|
@@ -6616,12 +6616,12 @@ ce.register(un, {
|
|
|
6616
6616
|
],
|
|
6617
6617
|
"filter-type-==": [
|
|
6618
6618
|
_,
|
|
6619
|
-
[
|
|
6619
|
+
[I],
|
|
6620
6620
|
(r, [e]) => r.geometryType() === e.value
|
|
6621
6621
|
],
|
|
6622
6622
|
"filter-<": [
|
|
6623
6623
|
_,
|
|
6624
|
-
[
|
|
6624
|
+
[I, A],
|
|
6625
6625
|
(r, [e, t]) => {
|
|
6626
6626
|
const n = r.properties()[e.value], a = t.value;
|
|
6627
6627
|
return typeof n == typeof a && n < a;
|
|
@@ -6637,7 +6637,7 @@ ce.register(un, {
|
|
|
6637
6637
|
],
|
|
6638
6638
|
"filter->": [
|
|
6639
6639
|
_,
|
|
6640
|
-
[
|
|
6640
|
+
[I, A],
|
|
6641
6641
|
(r, [e, t]) => {
|
|
6642
6642
|
const n = r.properties()[e.value], a = t.value;
|
|
6643
6643
|
return typeof n == typeof a && n > a;
|
|
@@ -6653,7 +6653,7 @@ ce.register(un, {
|
|
|
6653
6653
|
],
|
|
6654
6654
|
"filter-<=": [
|
|
6655
6655
|
_,
|
|
6656
|
-
[
|
|
6656
|
+
[I, A],
|
|
6657
6657
|
(r, [e, t]) => {
|
|
6658
6658
|
const n = r.properties()[e.value], a = t.value;
|
|
6659
6659
|
return typeof n == typeof a && n <= a;
|
|
@@ -6669,7 +6669,7 @@ ce.register(un, {
|
|
|
6669
6669
|
],
|
|
6670
6670
|
"filter->=": [
|
|
6671
6671
|
_,
|
|
6672
|
-
[
|
|
6672
|
+
[I, A],
|
|
6673
6673
|
(r, [e, t]) => {
|
|
6674
6674
|
const n = r.properties()[e.value], a = t.value;
|
|
6675
6675
|
return typeof n == typeof a && n >= a;
|
|
@@ -6695,7 +6695,7 @@ ce.register(un, {
|
|
|
6695
6695
|
],
|
|
6696
6696
|
"filter-type-in": [
|
|
6697
6697
|
_,
|
|
6698
|
-
[W(
|
|
6698
|
+
[W(I)],
|
|
6699
6699
|
(r, [e]) => e.value.indexOf(r.geometryType()) >= 0
|
|
6700
6700
|
],
|
|
6701
6701
|
"filter-id-in": [
|
|
@@ -6705,13 +6705,13 @@ ce.register(un, {
|
|
|
6705
6705
|
],
|
|
6706
6706
|
"filter-in-small": [
|
|
6707
6707
|
_,
|
|
6708
|
-
[
|
|
6708
|
+
[I, W(A)],
|
|
6709
6709
|
// assumes v is an array literal
|
|
6710
6710
|
(r, [e, t]) => t.value.indexOf(r.properties()[e.value]) >= 0
|
|
6711
6711
|
],
|
|
6712
6712
|
"filter-in-large": [
|
|
6713
6713
|
_,
|
|
6714
|
-
[
|
|
6714
|
+
[I, W(A)],
|
|
6715
6715
|
// assumes v is a array literal with values sorted in ascending order and of a single type
|
|
6716
6716
|
(r, [e, t]) => gl(r.properties()[e.value], t.value, 0, t.value.length - 1)
|
|
6717
6717
|
],
|
|
@@ -6758,7 +6758,7 @@ ce.register(un, {
|
|
|
6758
6758
|
],
|
|
6759
6759
|
"is-supported-script": [
|
|
6760
6760
|
_,
|
|
6761
|
-
[
|
|
6761
|
+
[I],
|
|
6762
6762
|
// At parse time this will always return true, so we need to exclude this expression with isGlobalPropertyConstant
|
|
6763
6763
|
(r, [e]) => {
|
|
6764
6764
|
const t = r.globals && r.globals.isSupportedScript;
|
|
@@ -6766,22 +6766,22 @@ ce.register(un, {
|
|
|
6766
6766
|
}
|
|
6767
6767
|
],
|
|
6768
6768
|
upcase: [
|
|
6769
|
-
|
|
6770
|
-
[
|
|
6769
|
+
I,
|
|
6770
|
+
[I],
|
|
6771
6771
|
(r, [e]) => e.evaluate(r).toUpperCase()
|
|
6772
6772
|
],
|
|
6773
6773
|
downcase: [
|
|
6774
|
-
|
|
6775
|
-
[
|
|
6774
|
+
I,
|
|
6775
|
+
[I],
|
|
6776
6776
|
(r, [e]) => e.evaluate(r).toLowerCase()
|
|
6777
6777
|
],
|
|
6778
6778
|
concat: [
|
|
6779
|
-
|
|
6779
|
+
I,
|
|
6780
6780
|
ze(A),
|
|
6781
6781
|
(r, e) => e.map((t) => st(t.evaluate(r))).join("")
|
|
6782
6782
|
],
|
|
6783
6783
|
"resolved-locale": [
|
|
6784
|
-
|
|
6784
|
+
I,
|
|
6785
6785
|
[Vt],
|
|
6786
6786
|
(r, [e]) => e.evaluate(r).resolvedLocale()
|
|
6787
6787
|
]
|
|
@@ -6802,7 +6802,7 @@ function Nt(r) {
|
|
|
6802
6802
|
return !1;
|
|
6803
6803
|
if (r instanceof wt)
|
|
6804
6804
|
return !1;
|
|
6805
|
-
const e = r instanceof
|
|
6805
|
+
const e = r instanceof Ee || r instanceof ue;
|
|
6806
6806
|
let t = !0;
|
|
6807
6807
|
return r.eachChild((n) => {
|
|
6808
6808
|
e ? t = t && Nt(n) : t = t && n instanceof Je;
|
|
@@ -6853,13 +6853,13 @@ function Ke(r) {
|
|
|
6853
6853
|
function jt(r) {
|
|
6854
6854
|
return r["property-type"] === "data-driven" || r["property-type"] === "cross-faded-data-driven";
|
|
6855
6855
|
}
|
|
6856
|
-
function
|
|
6856
|
+
function Da(r) {
|
|
6857
6857
|
return !!r.expression && r.expression.parameters.indexOf("zoom") > -1;
|
|
6858
6858
|
}
|
|
6859
|
-
function
|
|
6859
|
+
function Ua(r) {
|
|
6860
6860
|
return !!r.expression && r.expression.interpolated;
|
|
6861
6861
|
}
|
|
6862
|
-
function
|
|
6862
|
+
function M(r) {
|
|
6863
6863
|
return r instanceof Number ? "number" : r instanceof String ? "string" : r instanceof Boolean ? "boolean" : Array.isArray(r) ? "array" : r === null ? "null" : typeof r;
|
|
6864
6864
|
}
|
|
6865
6865
|
function cn(r) {
|
|
@@ -6886,10 +6886,10 @@ class bl {
|
|
|
6886
6886
|
}
|
|
6887
6887
|
}
|
|
6888
6888
|
}
|
|
6889
|
-
function
|
|
6889
|
+
function Ba(r) {
|
|
6890
6890
|
return Array.isArray(r) && r.length > 0 && typeof r[0] == "string" && r[0] in un;
|
|
6891
6891
|
}
|
|
6892
|
-
function
|
|
6892
|
+
function qa(r, e) {
|
|
6893
6893
|
const t = new Kt(un, Nt, [], e ? xl(e) : void 0), n = t.parse(r, void 0, void 0, void 0, e && e.type === "string" ? { typeAnnotation: "coerce" } : void 0);
|
|
6894
6894
|
return n ? zr(new bl(n, e)) : Ke(t.errors);
|
|
6895
6895
|
}
|
|
@@ -6919,21 +6919,21 @@ class Zn {
|
|
|
6919
6919
|
}
|
|
6920
6920
|
}
|
|
6921
6921
|
function wl(r, e) {
|
|
6922
|
-
const t =
|
|
6922
|
+
const t = qa(r, e);
|
|
6923
6923
|
if (t.result === "error")
|
|
6924
6924
|
return t;
|
|
6925
6925
|
const n = t.value.expression, a = tr(n);
|
|
6926
6926
|
if (!a && !jt(e))
|
|
6927
6927
|
return Ke([new he("", "data expressions not supported")]);
|
|
6928
6928
|
const o = rr(n, ["zoom"]);
|
|
6929
|
-
if (!o && !
|
|
6929
|
+
if (!o && !Da(e))
|
|
6930
6930
|
return Ke([new he("", "zoom expressions not supported")]);
|
|
6931
6931
|
const i = At(n);
|
|
6932
6932
|
if (!i && !o)
|
|
6933
6933
|
return Ke([new he("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);
|
|
6934
6934
|
if (i instanceof he)
|
|
6935
6935
|
return Ke([i]);
|
|
6936
|
-
if (i instanceof ye && !
|
|
6936
|
+
if (i instanceof ye && !Ua(e))
|
|
6937
6937
|
return Ke([new he("", '"interpolate" expressions cannot be used with this property')]);
|
|
6938
6938
|
if (!i)
|
|
6939
6939
|
return zr(a ? new Hn("constant", t.value) : new Hn("source", t.value));
|
|
@@ -6962,9 +6962,9 @@ function pn(r, e = /* @__PURE__ */ new Set()) {
|
|
|
6962
6962
|
function xl(r) {
|
|
6963
6963
|
const e = {
|
|
6964
6964
|
color: me,
|
|
6965
|
-
string:
|
|
6965
|
+
string: I,
|
|
6966
6966
|
number: x,
|
|
6967
|
-
enum:
|
|
6967
|
+
enum: I,
|
|
6968
6968
|
boolean: _,
|
|
6969
6969
|
formatted: Gt,
|
|
6970
6970
|
padding: Ht,
|
|
@@ -6978,10 +6978,10 @@ function xl(r) {
|
|
|
6978
6978
|
}
|
|
6979
6979
|
function Sl(r) {
|
|
6980
6980
|
if (r.type === "color" && cn(r.default))
|
|
6981
|
-
return new
|
|
6981
|
+
return new $(0, 0, 0, 0);
|
|
6982
6982
|
switch (r.type) {
|
|
6983
6983
|
case "color":
|
|
6984
|
-
return
|
|
6984
|
+
return $.parse(r.default) || null;
|
|
6985
6985
|
case "padding":
|
|
6986
6986
|
return te.parse(r.default) || null;
|
|
6987
6987
|
case "numberArray":
|
|
@@ -6996,7 +6996,7 @@ function Sl(r) {
|
|
|
6996
6996
|
return r.default === void 0 ? null : r.default;
|
|
6997
6997
|
}
|
|
6998
6998
|
}
|
|
6999
|
-
function
|
|
6999
|
+
function Va(r) {
|
|
7000
7000
|
if (r === !0 || r === !1)
|
|
7001
7001
|
return !0;
|
|
7002
7002
|
if (!Array.isArray(r) || r.length === 0)
|
|
@@ -7020,14 +7020,14 @@ function qa(r) {
|
|
|
7020
7020
|
case "any":
|
|
7021
7021
|
case "all":
|
|
7022
7022
|
for (const e of r.slice(1))
|
|
7023
|
-
if (!
|
|
7023
|
+
if (!Va(e) && typeof e != "boolean")
|
|
7024
7024
|
return !1;
|
|
7025
7025
|
return !0;
|
|
7026
7026
|
default:
|
|
7027
7027
|
return !0;
|
|
7028
7028
|
}
|
|
7029
7029
|
}
|
|
7030
|
-
function
|
|
7030
|
+
function Ga(r) {
|
|
7031
7031
|
const e = r.key, t = r.value;
|
|
7032
7032
|
return t ? [new v(e, t, "constants have been deprecated as of v8")] : [];
|
|
7033
7033
|
}
|
|
@@ -7048,7 +7048,7 @@ function qe(r) {
|
|
|
7048
7048
|
function ne(r) {
|
|
7049
7049
|
const e = r.key, t = r.value, n = r.valueSpec || {}, a = r.objectElementValidators || {}, o = r.style, i = r.styleSpec, s = r.validateSpec;
|
|
7050
7050
|
let l = [];
|
|
7051
|
-
const u =
|
|
7051
|
+
const u = M(t);
|
|
7052
7052
|
if (u !== "object")
|
|
7053
7053
|
return [new v(e, t, `object expected, ${u} found`)];
|
|
7054
7054
|
for (const c in t) {
|
|
@@ -7083,8 +7083,8 @@ function ne(r) {
|
|
|
7083
7083
|
}
|
|
7084
7084
|
function fn(r) {
|
|
7085
7085
|
const e = r.value, t = r.valueSpec, n = r.validateSpec, a = r.style, o = r.styleSpec, i = r.key, s = r.arrayElementValidator || n;
|
|
7086
|
-
if (
|
|
7087
|
-
return [new v(i, e, `array expected, ${
|
|
7086
|
+
if (M(e) !== "array")
|
|
7087
|
+
return [new v(i, e, `array expected, ${M(e)} found`)];
|
|
7088
7088
|
if (t.length && e.length !== t.length)
|
|
7089
7089
|
return [new v(i, e, `array length ${t.length} expected, length ${e.length} found`)];
|
|
7090
7090
|
if (t["min-length"] && e.length < t["min-length"])
|
|
@@ -7093,7 +7093,7 @@ function fn(r) {
|
|
|
7093
7093
|
type: t.value,
|
|
7094
7094
|
values: t.values
|
|
7095
7095
|
};
|
|
7096
|
-
o.$version < 7 && (l.function = t.function),
|
|
7096
|
+
o.$version < 7 && (l.function = t.function), M(t.value) === "object" && (l = t.value);
|
|
7097
7097
|
let u = [];
|
|
7098
7098
|
for (let c = 0; c < e.length; c++)
|
|
7099
7099
|
u = u.concat(s({
|
|
@@ -7110,13 +7110,13 @@ function fn(r) {
|
|
|
7110
7110
|
}
|
|
7111
7111
|
function nr(r) {
|
|
7112
7112
|
const e = r.key, t = r.value, n = r.valueSpec;
|
|
7113
|
-
let a =
|
|
7113
|
+
let a = M(t);
|
|
7114
7114
|
return a === "number" && t !== t && (a = "NaN"), a !== "number" ? [new v(e, t, `number expected, ${a} found`)] : "minimum" in n && t < n.minimum ? [new v(e, t, `${t} is less than the minimum value ${n.minimum}`)] : "maximum" in n && t > n.maximum ? [new v(e, t, `${t} is greater than the maximum value ${n.maximum}`)] : [];
|
|
7115
7115
|
}
|
|
7116
|
-
function
|
|
7116
|
+
function Ha(r) {
|
|
7117
7117
|
const e = r.valueSpec, t = U(r.value.type);
|
|
7118
7118
|
let n, a = {}, o, i;
|
|
7119
|
-
const s = t !== "categorical" && r.value.property === void 0, l = !s, u =
|
|
7119
|
+
const s = t !== "categorical" && r.value.property === void 0, l = !s, u = M(r.value.stops) === "array" && M(r.value.stops[0]) === "array" && M(r.value.stops[0][0]) === "object", c = ne({
|
|
7120
7120
|
key: r.key,
|
|
7121
7121
|
value: r.value,
|
|
7122
7122
|
valueSpec: r.styleSpec.function,
|
|
@@ -7128,41 +7128,41 @@ function Ga(r) {
|
|
|
7128
7128
|
default: h
|
|
7129
7129
|
}
|
|
7130
7130
|
});
|
|
7131
|
-
return t === "identity" && s && c.push(new v(r.key, r.value, 'missing required property "property"')), t !== "identity" && !r.value.stops && c.push(new v(r.key, r.value, 'missing required property "stops"')), t === "exponential" && r.valueSpec.expression && !
|
|
7131
|
+
return t === "identity" && s && c.push(new v(r.key, r.value, 'missing required property "property"')), t !== "identity" && !r.value.stops && c.push(new v(r.key, r.value, 'missing required property "stops"')), t === "exponential" && r.valueSpec.expression && !Ua(r.valueSpec) && c.push(new v(r.key, r.value, "exponential functions not supported")), r.styleSpec.$version >= 8 && (l && !jt(r.valueSpec) ? c.push(new v(r.key, r.value, "property functions not supported")) : s && !Da(r.valueSpec) && c.push(new v(r.key, r.value, "zoom functions not supported"))), (t === "categorical" || u) && r.value.property === void 0 && c.push(new v(r.key, r.value, '"property" property is required')), c;
|
|
7132
7132
|
function p(m) {
|
|
7133
7133
|
if (t === "identity")
|
|
7134
7134
|
return [new v(m.key, m.value, 'identity function may not have a "stops" property')];
|
|
7135
7135
|
let y = [];
|
|
7136
|
-
const
|
|
7136
|
+
const w = m.value;
|
|
7137
7137
|
return y = y.concat(fn({
|
|
7138
7138
|
key: m.key,
|
|
7139
|
-
value:
|
|
7139
|
+
value: w,
|
|
7140
7140
|
valueSpec: m.valueSpec,
|
|
7141
7141
|
validateSpec: m.validateSpec,
|
|
7142
7142
|
style: m.style,
|
|
7143
7143
|
styleSpec: m.styleSpec,
|
|
7144
7144
|
arrayElementValidator: d
|
|
7145
|
-
})),
|
|
7145
|
+
})), M(w) === "array" && w.length === 0 && y.push(new v(m.key, w, "array must have at least one stop")), y;
|
|
7146
7146
|
}
|
|
7147
7147
|
function d(m) {
|
|
7148
7148
|
let y = [];
|
|
7149
|
-
const
|
|
7150
|
-
if (
|
|
7151
|
-
return [new v(g,
|
|
7152
|
-
if (
|
|
7153
|
-
return [new v(g,
|
|
7149
|
+
const w = m.value, g = m.key;
|
|
7150
|
+
if (M(w) !== "array")
|
|
7151
|
+
return [new v(g, w, `array expected, ${M(w)} found`)];
|
|
7152
|
+
if (w.length !== 2)
|
|
7153
|
+
return [new v(g, w, `array length 2 expected, length ${w.length} found`)];
|
|
7154
7154
|
if (u) {
|
|
7155
|
-
if (
|
|
7156
|
-
return [new v(g,
|
|
7157
|
-
if (
|
|
7158
|
-
return [new v(g,
|
|
7159
|
-
if (
|
|
7160
|
-
return [new v(g,
|
|
7161
|
-
if (i && i > U(
|
|
7162
|
-
return [new v(g,
|
|
7163
|
-
U(
|
|
7155
|
+
if (M(w[0]) !== "object")
|
|
7156
|
+
return [new v(g, w, `object expected, ${M(w[0])} found`)];
|
|
7157
|
+
if (w[0].zoom === void 0)
|
|
7158
|
+
return [new v(g, w, "object stop key must have zoom")];
|
|
7159
|
+
if (w[0].value === void 0)
|
|
7160
|
+
return [new v(g, w, "object stop key must have value")];
|
|
7161
|
+
if (i && i > U(w[0].zoom))
|
|
7162
|
+
return [new v(g, w[0].zoom, "stop zoom values must appear in ascending order")];
|
|
7163
|
+
U(w[0].zoom) !== i && (i = U(w[0].zoom), o = void 0, a = {}), y = y.concat(ne({
|
|
7164
7164
|
key: `${g}[0]`,
|
|
7165
|
-
value:
|
|
7165
|
+
value: w[0],
|
|
7166
7166
|
valueSpec: { zoom: {} },
|
|
7167
7167
|
validateSpec: m.validateSpec,
|
|
7168
7168
|
style: m.style,
|
|
@@ -7172,14 +7172,14 @@ function Ga(r) {
|
|
|
7172
7172
|
} else
|
|
7173
7173
|
y = y.concat(f({
|
|
7174
7174
|
key: `${g}[0]`,
|
|
7175
|
-
value:
|
|
7175
|
+
value: w[0],
|
|
7176
7176
|
validateSpec: m.validateSpec,
|
|
7177
7177
|
style: m.style,
|
|
7178
7178
|
styleSpec: m.styleSpec
|
|
7179
|
-
},
|
|
7180
|
-
return
|
|
7179
|
+
}, w));
|
|
7180
|
+
return Ba(qe(w[1])) ? y.concat([new v(`${g}[1]`, w[1], "expressions are not allowed in function stops.")]) : y.concat(m.validateSpec({
|
|
7181
7181
|
key: `${g}[1]`,
|
|
7182
|
-
value:
|
|
7182
|
+
value: w[1],
|
|
7183
7183
|
valueSpec: e,
|
|
7184
7184
|
validateSpec: m.validateSpec,
|
|
7185
7185
|
style: m.style,
|
|
@@ -7187,18 +7187,18 @@ function Ga(r) {
|
|
|
7187
7187
|
}));
|
|
7188
7188
|
}
|
|
7189
7189
|
function f(m, y) {
|
|
7190
|
-
const
|
|
7190
|
+
const w = M(m.value), g = U(m.value), S = m.value !== null ? m.value : y;
|
|
7191
7191
|
if (!n)
|
|
7192
|
-
n =
|
|
7193
|
-
else if (
|
|
7194
|
-
return [new v(m.key, S, `${
|
|
7195
|
-
if (
|
|
7192
|
+
n = w;
|
|
7193
|
+
else if (w !== n)
|
|
7194
|
+
return [new v(m.key, S, `${w} stop domain type must match previous stop domain type ${n}`)];
|
|
7195
|
+
if (w !== "number" && w !== "string" && w !== "boolean")
|
|
7196
7196
|
return [new v(m.key, S, "stop domain value must be a number, string, or boolean")];
|
|
7197
|
-
if (
|
|
7198
|
-
let
|
|
7199
|
-
return jt(e) && t === void 0 && (
|
|
7197
|
+
if (w !== "number" && t !== "categorical") {
|
|
7198
|
+
let E = `number expected, ${w} found`;
|
|
7199
|
+
return jt(e) && t === void 0 && (E += '\nIf you intended to use a categorical function, specify `"type": "categorical"`.'), [new v(m.key, S, E)];
|
|
7200
7200
|
}
|
|
7201
|
-
return t === "categorical" &&
|
|
7201
|
+
return t === "categorical" && w === "number" && (!isFinite(g) || Math.floor(g) !== g) ? [new v(m.key, S, `integer expected, found ${g}`)] : t !== "categorical" && w === "number" && o !== void 0 && g < o ? [new v(m.key, S, "stop domain values must appear in ascending order")] : (o = g, t === "categorical" && g in a ? [new v(m.key, S, "stop domain values must be unique")] : (a[g] = !0, []));
|
|
7202
7202
|
}
|
|
7203
7203
|
function h(m) {
|
|
7204
7204
|
return m.validateSpec({
|
|
@@ -7212,7 +7212,7 @@ function Ga(r) {
|
|
|
7212
7212
|
}
|
|
7213
7213
|
}
|
|
7214
7214
|
function Qe(r) {
|
|
7215
|
-
const e = (r.expressionContext === "property" ? wl :
|
|
7215
|
+
const e = (r.expressionContext === "property" ? wl : qa)(qe(r.value), r.valueSpec);
|
|
7216
7216
|
if (e.result === "error")
|
|
7217
7217
|
return e.value.map((n) => new v(`${r.key}${n.key}`, r.value, n.message));
|
|
7218
7218
|
const t = e.value.expression || e.value._styleExpression.expression;
|
|
@@ -7231,27 +7231,27 @@ function Qe(r) {
|
|
|
7231
7231
|
return [];
|
|
7232
7232
|
}
|
|
7233
7233
|
function kl(r) {
|
|
7234
|
-
const e = r.value, t = r.key, n =
|
|
7234
|
+
const e = r.value, t = r.key, n = M(e);
|
|
7235
7235
|
return n !== "boolean" ? [new v(t, e, `boolean expected, ${n} found`)] : [];
|
|
7236
7236
|
}
|
|
7237
|
-
function
|
|
7238
|
-
const e = r.key, t = r.value, n =
|
|
7239
|
-
return n !== "string" ? [new v(e, t, `color expected, ${n} found`)] :
|
|
7237
|
+
function Fr(r) {
|
|
7238
|
+
const e = r.key, t = r.value, n = M(t);
|
|
7239
|
+
return n !== "string" ? [new v(e, t, `color expected, ${n} found`)] : $.parse(String(t)) ? [] : [new v(e, t, `color expected, "${t}" found`)];
|
|
7240
7240
|
}
|
|
7241
7241
|
function mt(r) {
|
|
7242
7242
|
const e = r.key, t = r.value, n = r.valueSpec, a = [];
|
|
7243
7243
|
return Array.isArray(n.values) ? n.values.indexOf(U(t)) === -1 && a.push(new v(e, t, `expected one of [${n.values.join(", ")}], ${JSON.stringify(t)} found`)) : Object.keys(n.values).indexOf(U(t)) === -1 && a.push(new v(e, t, `expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(t)} found`)), a;
|
|
7244
7244
|
}
|
|
7245
7245
|
function dn(r) {
|
|
7246
|
-
return
|
|
7246
|
+
return Va(qe(r.value)) ? Qe(Pt({}, r, {
|
|
7247
7247
|
expressionContext: "filter",
|
|
7248
7248
|
valueSpec: { value: "boolean" }
|
|
7249
|
-
})) :
|
|
7249
|
+
})) : Za(r);
|
|
7250
7250
|
}
|
|
7251
|
-
function
|
|
7251
|
+
function Za(r) {
|
|
7252
7252
|
const e = r.value, t = r.key;
|
|
7253
|
-
if (
|
|
7254
|
-
return [new v(t, e, `array expected, ${
|
|
7253
|
+
if (M(e) !== "array")
|
|
7254
|
+
return [new v(t, e, `array expected, ${M(e)} found`)];
|
|
7255
7255
|
const n = r.styleSpec;
|
|
7256
7256
|
let a, o = [];
|
|
7257
7257
|
if (e.length < 1)
|
|
@@ -7275,9 +7275,9 @@ function Ha(r) {
|
|
|
7275
7275
|
/* falls through */
|
|
7276
7276
|
case "in":
|
|
7277
7277
|
case "!in":
|
|
7278
|
-
e.length >= 2 && (a =
|
|
7278
|
+
e.length >= 2 && (a = M(e[1]), a !== "string" && o.push(new v(`${t}[1]`, e[1], `string expected, ${a} found`)));
|
|
7279
7279
|
for (let i = 2; i < e.length; i++)
|
|
7280
|
-
a =
|
|
7280
|
+
a = M(e[i]), U(e[1]) === "$type" ? o = o.concat(mt({
|
|
7281
7281
|
key: `${t}[${i}]`,
|
|
7282
7282
|
value: e[i],
|
|
7283
7283
|
valueSpec: n.geometry_type,
|
|
@@ -7289,7 +7289,7 @@ function Ha(r) {
|
|
|
7289
7289
|
case "all":
|
|
7290
7290
|
case "none":
|
|
7291
7291
|
for (let i = 1; i < e.length; i++)
|
|
7292
|
-
o = o.concat(
|
|
7292
|
+
o = o.concat(Za({
|
|
7293
7293
|
key: `${t}[${i}]`,
|
|
7294
7294
|
value: e[i],
|
|
7295
7295
|
style: r.style,
|
|
@@ -7298,12 +7298,12 @@ function Ha(r) {
|
|
|
7298
7298
|
break;
|
|
7299
7299
|
case "has":
|
|
7300
7300
|
case "!has":
|
|
7301
|
-
a =
|
|
7301
|
+
a = M(e[1]), e.length !== 2 ? o.push(new v(t, e, `filter array for "${e[0]}" operator must have 2 elements`)) : a !== "string" && o.push(new v(`${t}[1]`, e[1], `string expected, ${a} found`));
|
|
7302
7302
|
break;
|
|
7303
7303
|
}
|
|
7304
7304
|
return o;
|
|
7305
7305
|
}
|
|
7306
|
-
function
|
|
7306
|
+
function Xa(r, e) {
|
|
7307
7307
|
const t = r.key, n = r.validateSpec, a = r.style, o = r.styleSpec, i = r.value, s = r.objectKey, l = o[`${e}_${r.layerType}`];
|
|
7308
7308
|
if (!l)
|
|
7309
7309
|
return [];
|
|
@@ -7320,7 +7320,7 @@ function Za(r, e) {
|
|
|
7320
7320
|
if (!c)
|
|
7321
7321
|
return [new v(t, i, `unknown property "${s}"`)];
|
|
7322
7322
|
let p;
|
|
7323
|
-
if (
|
|
7323
|
+
if (M(i) === "string" && jt(c) && !c.tokens && (p = /^{([^}]+)}$/.exec(i)))
|
|
7324
7324
|
return [new v(t, i, `"${s}" does not support interpolation syntax
|
|
7325
7325
|
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(p[1])} }\`.`)];
|
|
7326
7326
|
const d = [];
|
|
@@ -7335,17 +7335,17 @@ Use an identity property function instead: \`{ "type": "identity", "property": $
|
|
|
7335
7335
|
propertyKey: s
|
|
7336
7336
|
}));
|
|
7337
7337
|
}
|
|
7338
|
-
function Xa(r) {
|
|
7339
|
-
return Za(r, "paint");
|
|
7340
|
-
}
|
|
7341
7338
|
function Ka(r) {
|
|
7342
|
-
return
|
|
7339
|
+
return Xa(r, "paint");
|
|
7343
7340
|
}
|
|
7344
7341
|
function Ya(r) {
|
|
7342
|
+
return Xa(r, "layout");
|
|
7343
|
+
}
|
|
7344
|
+
function Wa(r) {
|
|
7345
7345
|
let e = [];
|
|
7346
7346
|
const t = r.value, n = r.key, a = r.style, o = r.styleSpec;
|
|
7347
|
-
if (
|
|
7348
|
-
return [new v(n, t, `object expected, ${
|
|
7347
|
+
if (M(t) !== "object")
|
|
7348
|
+
return [new v(n, t, `object expected, ${M(t)} found`)];
|
|
7349
7349
|
!t.type && !t.ref && e.push(new v(n, t, 'either "type" or "ref" is required'));
|
|
7350
7350
|
let i = U(t.type);
|
|
7351
7351
|
const s = U(t.ref);
|
|
@@ -7407,7 +7407,7 @@ function Ya(r) {
|
|
|
7407
7407
|
validateSpec: l.validateSpec,
|
|
7408
7408
|
objectElementValidators: {
|
|
7409
7409
|
"*"(u) {
|
|
7410
|
-
return
|
|
7410
|
+
return Ya(Pt({ layerType: i }, u));
|
|
7411
7411
|
}
|
|
7412
7412
|
}
|
|
7413
7413
|
});
|
|
@@ -7422,7 +7422,7 @@ function Ya(r) {
|
|
|
7422
7422
|
validateSpec: l.validateSpec,
|
|
7423
7423
|
objectElementValidators: {
|
|
7424
7424
|
"*"(u) {
|
|
7425
|
-
return
|
|
7425
|
+
return Ka(Pt({ layerType: i }, u));
|
|
7426
7426
|
}
|
|
7427
7427
|
}
|
|
7428
7428
|
});
|
|
@@ -7431,14 +7431,14 @@ function Ya(r) {
|
|
|
7431
7431
|
})), e;
|
|
7432
7432
|
}
|
|
7433
7433
|
function Ve(r) {
|
|
7434
|
-
const e = r.value, t = r.key, n =
|
|
7434
|
+
const e = r.value, t = r.key, n = M(e);
|
|
7435
7435
|
return n !== "string" ? [new v(t, e, `string expected, ${n} found`)] : [];
|
|
7436
7436
|
}
|
|
7437
7437
|
function Ll(r) {
|
|
7438
7438
|
var e;
|
|
7439
7439
|
const t = (e = r.sourceName) !== null && e !== void 0 ? e : "", n = r.value, a = r.styleSpec, o = a.source_raster_dem, i = r.style;
|
|
7440
7440
|
let s = [];
|
|
7441
|
-
const l =
|
|
7441
|
+
const l = M(n);
|
|
7442
7442
|
if (n === void 0)
|
|
7443
7443
|
return s;
|
|
7444
7444
|
if (l !== "object")
|
|
@@ -7456,9 +7456,9 @@ function Ll(r) {
|
|
|
7456
7456
|
return s;
|
|
7457
7457
|
}
|
|
7458
7458
|
const Xn = {
|
|
7459
|
-
promoteId:
|
|
7459
|
+
promoteId: Cl
|
|
7460
7460
|
};
|
|
7461
|
-
function
|
|
7461
|
+
function Ja(r) {
|
|
7462
7462
|
const e = r.value, t = r.key, n = r.styleSpec, a = r.style, o = r.validateSpec;
|
|
7463
7463
|
if (!e.type)
|
|
7464
7464
|
return [new v(t, e, '"type" is required')];
|
|
@@ -7535,8 +7535,8 @@ function Wa(r) {
|
|
|
7535
7535
|
});
|
|
7536
7536
|
}
|
|
7537
7537
|
}
|
|
7538
|
-
function
|
|
7539
|
-
if (
|
|
7538
|
+
function Cl({ key: r, value: e }) {
|
|
7539
|
+
if (M(e) === "string")
|
|
7540
7540
|
return Ve({ key: r, value: e });
|
|
7541
7541
|
{
|
|
7542
7542
|
const t = [];
|
|
@@ -7545,10 +7545,10 @@ function El({ key: r, value: e }) {
|
|
|
7545
7545
|
return t;
|
|
7546
7546
|
}
|
|
7547
7547
|
}
|
|
7548
|
-
function
|
|
7548
|
+
function Qa(r) {
|
|
7549
7549
|
const e = r.value, t = r.styleSpec, n = t.light, a = r.style;
|
|
7550
7550
|
let o = [];
|
|
7551
|
-
const i =
|
|
7551
|
+
const i = M(e);
|
|
7552
7552
|
if (e === void 0)
|
|
7553
7553
|
return o;
|
|
7554
7554
|
if (i !== "object")
|
|
@@ -7573,8 +7573,8 @@ function Ja(r) {
|
|
|
7573
7573
|
}
|
|
7574
7574
|
return o;
|
|
7575
7575
|
}
|
|
7576
|
-
function
|
|
7577
|
-
const e = r.value, t = r.styleSpec, n = t.sky, a = r.style, o =
|
|
7576
|
+
function eo(r) {
|
|
7577
|
+
const e = r.value, t = r.styleSpec, n = t.sky, a = r.style, o = M(e);
|
|
7578
7578
|
if (e === void 0)
|
|
7579
7579
|
return [];
|
|
7580
7580
|
if (o !== "object")
|
|
@@ -7590,10 +7590,10 @@ function Qa(r) {
|
|
|
7590
7590
|
})) : i = i.concat([new v(s, e[s], `unknown property "${s}"`)]);
|
|
7591
7591
|
return i;
|
|
7592
7592
|
}
|
|
7593
|
-
function
|
|
7593
|
+
function to(r) {
|
|
7594
7594
|
const e = r.value, t = r.styleSpec, n = t.terrain, a = r.style;
|
|
7595
7595
|
let o = [];
|
|
7596
|
-
const i =
|
|
7596
|
+
const i = M(e);
|
|
7597
7597
|
if (e === void 0)
|
|
7598
7598
|
return o;
|
|
7599
7599
|
if (i !== "object")
|
|
@@ -7609,7 +7609,7 @@ function eo(r) {
|
|
|
7609
7609
|
})) : o = o.concat([new v(s, e[s], `unknown property "${s}"`)]);
|
|
7610
7610
|
return o;
|
|
7611
7611
|
}
|
|
7612
|
-
function
|
|
7612
|
+
function El(r) {
|
|
7613
7613
|
return Ve(r).length === 0 ? [] : Qe(r);
|
|
7614
7614
|
}
|
|
7615
7615
|
function Tl(r) {
|
|
@@ -7617,7 +7617,7 @@ function Tl(r) {
|
|
|
7617
7617
|
}
|
|
7618
7618
|
function Al(r) {
|
|
7619
7619
|
const e = r.key, t = r.value;
|
|
7620
|
-
if (
|
|
7620
|
+
if (M(t) === "array") {
|
|
7621
7621
|
if (t.length < 1 || t.length > 4)
|
|
7622
7622
|
return [new v(e, t, `padding requires 1 to 4 values; ${t.length} values found`)];
|
|
7623
7623
|
const a = {
|
|
@@ -7641,7 +7641,7 @@ function Al(r) {
|
|
|
7641
7641
|
}
|
|
7642
7642
|
function _l(r) {
|
|
7643
7643
|
const e = r.key, t = r.value;
|
|
7644
|
-
if (
|
|
7644
|
+
if (M(t) === "array") {
|
|
7645
7645
|
const a = {
|
|
7646
7646
|
type: "number"
|
|
7647
7647
|
};
|
|
@@ -7663,26 +7663,26 @@ function _l(r) {
|
|
|
7663
7663
|
valueSpec: {}
|
|
7664
7664
|
});
|
|
7665
7665
|
}
|
|
7666
|
-
function
|
|
7666
|
+
function Il(r) {
|
|
7667
7667
|
const e = r.key, t = r.value;
|
|
7668
|
-
if (
|
|
7668
|
+
if (M(t) === "array") {
|
|
7669
7669
|
if (t.length < 1)
|
|
7670
7670
|
return [new v(e, t, "array length at least 1 expected, length 0 found")];
|
|
7671
7671
|
let a = [];
|
|
7672
7672
|
for (let o = 0; o < t.length; o++)
|
|
7673
|
-
a = a.concat(
|
|
7673
|
+
a = a.concat(Fr({
|
|
7674
7674
|
key: `${e}[${o}]`,
|
|
7675
7675
|
value: t[o]
|
|
7676
7676
|
}));
|
|
7677
7677
|
return a;
|
|
7678
7678
|
} else
|
|
7679
|
-
return
|
|
7679
|
+
return Fr({
|
|
7680
7680
|
key: e,
|
|
7681
7681
|
value: t
|
|
7682
7682
|
});
|
|
7683
7683
|
}
|
|
7684
|
-
function
|
|
7685
|
-
const e = r.key, t = r.value, n =
|
|
7684
|
+
function Ml(r) {
|
|
7685
|
+
const e = r.key, t = r.value, n = M(t), a = r.styleSpec;
|
|
7686
7686
|
if (n !== "array" || t.length < 1 || t.length % 2 !== 0)
|
|
7687
7687
|
return [new v(e, t, "variableAnchorOffsetCollection requires a non-empty array of even length")];
|
|
7688
7688
|
let o = [];
|
|
@@ -7704,7 +7704,7 @@ function Il(r) {
|
|
|
7704
7704
|
}));
|
|
7705
7705
|
return o;
|
|
7706
7706
|
}
|
|
7707
|
-
function
|
|
7707
|
+
function ro(r) {
|
|
7708
7708
|
let e = [];
|
|
7709
7709
|
const t = r.value, n = r.key;
|
|
7710
7710
|
if (Array.isArray(t)) {
|
|
@@ -7736,7 +7736,7 @@ function to(r) {
|
|
|
7736
7736
|
});
|
|
7737
7737
|
}
|
|
7738
7738
|
function Pl(r) {
|
|
7739
|
-
const e = r.value, t = r.styleSpec, n = t.projection, a = r.style, o =
|
|
7739
|
+
const e = r.value, t = r.styleSpec, n = t.projection, a = r.style, o = M(e);
|
|
7740
7740
|
if (e === void 0)
|
|
7741
7741
|
return [];
|
|
7742
7742
|
if (o !== "object")
|
|
@@ -7756,21 +7756,21 @@ function Rl(r) {
|
|
|
7756
7756
|
const e = r.key;
|
|
7757
7757
|
let t = r.value;
|
|
7758
7758
|
t = t instanceof String ? t.valueOf() : t;
|
|
7759
|
-
const n =
|
|
7760
|
-
return n === "array" &&
|
|
7759
|
+
const n = M(t);
|
|
7760
|
+
return n === "array" && !Fl(t) && !zl(t) ? [new v(e, t, `projection expected, invalid array ${JSON.stringify(t)} found`)] : ["array", "string"].includes(n) ? [] : [new v(e, t, `projection expected, invalid type "${n}" found`)];
|
|
7761
7761
|
}
|
|
7762
7762
|
function zl(r) {
|
|
7763
7763
|
return !!["interpolate", "step", "literal"].includes(r[0]);
|
|
7764
7764
|
}
|
|
7765
|
-
function
|
|
7765
|
+
function Fl(r) {
|
|
7766
7766
|
return Array.isArray(r) && r.length === 3 && typeof r[0] == "string" && typeof r[1] == "string" && typeof r[2] == "number";
|
|
7767
7767
|
}
|
|
7768
|
-
function
|
|
7768
|
+
function $l(r) {
|
|
7769
7769
|
return !!r && r.constructor === Object;
|
|
7770
7770
|
}
|
|
7771
|
-
function
|
|
7772
|
-
return
|
|
7773
|
-
new v(r.key, r.value, `object expected, ${
|
|
7771
|
+
function no(r) {
|
|
7772
|
+
return $l(r.value) ? [] : [
|
|
7773
|
+
new v(r.key, r.value, `object expected, ${M(r.value)} found`)
|
|
7774
7774
|
];
|
|
7775
7775
|
}
|
|
7776
7776
|
const Kn = {
|
|
@@ -7780,36 +7780,36 @@ const Kn = {
|
|
|
7780
7780
|
array: fn,
|
|
7781
7781
|
boolean: kl,
|
|
7782
7782
|
number: nr,
|
|
7783
|
-
color:
|
|
7784
|
-
constants:
|
|
7783
|
+
color: Fr,
|
|
7784
|
+
constants: Ga,
|
|
7785
7785
|
enum: mt,
|
|
7786
7786
|
filter: dn,
|
|
7787
|
-
function:
|
|
7788
|
-
layer:
|
|
7787
|
+
function: Ha,
|
|
7788
|
+
layer: Wa,
|
|
7789
7789
|
object: ne,
|
|
7790
|
-
source:
|
|
7791
|
-
light:
|
|
7792
|
-
sky:
|
|
7793
|
-
terrain:
|
|
7790
|
+
source: Ja,
|
|
7791
|
+
light: Qa,
|
|
7792
|
+
sky: eo,
|
|
7793
|
+
terrain: to,
|
|
7794
7794
|
projection: Pl,
|
|
7795
7795
|
projectionDefinition: Rl,
|
|
7796
7796
|
string: Ve,
|
|
7797
|
-
formatted:
|
|
7797
|
+
formatted: El,
|
|
7798
7798
|
resolvedImage: Tl,
|
|
7799
7799
|
padding: Al,
|
|
7800
7800
|
numberArray: _l,
|
|
7801
|
-
colorArray:
|
|
7802
|
-
variableAnchorOffsetCollection:
|
|
7803
|
-
sprite:
|
|
7804
|
-
state:
|
|
7801
|
+
colorArray: Il,
|
|
7802
|
+
variableAnchorOffsetCollection: Ml,
|
|
7803
|
+
sprite: ro,
|
|
7804
|
+
state: no
|
|
7805
7805
|
};
|
|
7806
7806
|
function Dt(r) {
|
|
7807
7807
|
const e = r.value, t = r.valueSpec, n = r.styleSpec;
|
|
7808
|
-
return r.validateSpec = Dt, t.expression && cn(U(e)) ?
|
|
7808
|
+
return r.validateSpec = Dt, t.expression && cn(U(e)) ? Ha(r) : t.expression && Ba(qe(e)) ? Qe(r) : t.type && Kn[t.type] ? Kn[t.type](r) : ne(Pt({}, r, {
|
|
7809
7809
|
valueSpec: t.type ? n[t.type] : t
|
|
7810
7810
|
}));
|
|
7811
7811
|
}
|
|
7812
|
-
function
|
|
7812
|
+
function ao(r) {
|
|
7813
7813
|
const e = r.value, t = r.key, n = Ve(r);
|
|
7814
7814
|
return n.length || (e.indexOf("{fontstack}") === -1 && n.push(new v(t, e, '"glyphs" url must include a "{fontstack}" token')), e.indexOf("{range}") === -1 && n.push(new v(t, e, '"glyphs" url must include a "{range}" token'))), n;
|
|
7815
7815
|
}
|
|
@@ -7823,27 +7823,27 @@ function J(r, e = cs) {
|
|
|
7823
7823
|
style: r,
|
|
7824
7824
|
validateSpec: Dt,
|
|
7825
7825
|
objectElementValidators: {
|
|
7826
|
-
glyphs:
|
|
7826
|
+
glyphs: ao,
|
|
7827
7827
|
"*"() {
|
|
7828
7828
|
return [];
|
|
7829
7829
|
}
|
|
7830
7830
|
}
|
|
7831
|
-
})), r.constants && (t = t.concat(
|
|
7831
|
+
})), r.constants && (t = t.concat(Ga({
|
|
7832
7832
|
key: "constants",
|
|
7833
7833
|
value: r.constants
|
|
7834
|
-
}))),
|
|
7835
|
-
}
|
|
7836
|
-
J.source = de(fe(
|
|
7837
|
-
J.sprite = de(fe(
|
|
7838
|
-
J.glyphs = de(fe(
|
|
7839
|
-
J.light = de(fe(
|
|
7840
|
-
J.sky = de(fe(
|
|
7841
|
-
J.terrain = de(fe(
|
|
7842
|
-
J.state = de(fe(
|
|
7843
|
-
J.layer = de(fe(
|
|
7834
|
+
}))), oo(t);
|
|
7835
|
+
}
|
|
7836
|
+
J.source = de(fe(Ja));
|
|
7837
|
+
J.sprite = de(fe(ro));
|
|
7838
|
+
J.glyphs = de(fe(ao));
|
|
7839
|
+
J.light = de(fe(Qa));
|
|
7840
|
+
J.sky = de(fe(eo));
|
|
7841
|
+
J.terrain = de(fe(to));
|
|
7842
|
+
J.state = de(fe(no));
|
|
7843
|
+
J.layer = de(fe(Wa));
|
|
7844
7844
|
J.filter = de(fe(dn));
|
|
7845
|
-
J.paintProperty = de(fe(
|
|
7846
|
-
J.layoutProperty = de(fe(
|
|
7845
|
+
J.paintProperty = de(fe(Ka));
|
|
7846
|
+
J.layoutProperty = de(fe(Ya));
|
|
7847
7847
|
function fe(r) {
|
|
7848
7848
|
return function(e) {
|
|
7849
7849
|
return r({
|
|
@@ -7852,12 +7852,12 @@ function fe(r) {
|
|
|
7852
7852
|
});
|
|
7853
7853
|
};
|
|
7854
7854
|
}
|
|
7855
|
-
function
|
|
7855
|
+
function oo(r) {
|
|
7856
7856
|
return [].concat(r).sort((e, t) => e.line - t.line);
|
|
7857
7857
|
}
|
|
7858
7858
|
function de(r) {
|
|
7859
7859
|
return function(...e) {
|
|
7860
|
-
return
|
|
7860
|
+
return oo(r.apply(this, e));
|
|
7861
7861
|
};
|
|
7862
7862
|
}
|
|
7863
7863
|
function Yn(r) {
|
|
@@ -7884,16 +7884,16 @@ function Yn(r) {
|
|
|
7884
7884
|
requiresUrlMonitoring: !0,
|
|
7885
7885
|
isFallback: !1
|
|
7886
7886
|
} : {
|
|
7887
|
-
style:
|
|
7887
|
+
style: Xo(r),
|
|
7888
7888
|
requiresUrlMonitoring: !0,
|
|
7889
7889
|
isFallback: !1
|
|
7890
7890
|
};
|
|
7891
7891
|
}
|
|
7892
|
-
return r instanceof
|
|
7892
|
+
return r instanceof Ko ? {
|
|
7893
7893
|
style: r.getExpandedStyleURL(),
|
|
7894
7894
|
requiresUrlMonitoring: !1,
|
|
7895
7895
|
isFallback: !1
|
|
7896
|
-
} : r instanceof
|
|
7896
|
+
} : r instanceof Yo ? {
|
|
7897
7897
|
style: r.getDefaultVariant().getExpandedStyleURL(),
|
|
7898
7898
|
requiresUrlMonitoring: !1,
|
|
7899
7899
|
isFallback: !1
|
|
@@ -7940,10 +7940,10 @@ function hn(r) {
|
|
|
7940
7940
|
}
|
|
7941
7941
|
class jl {
|
|
7942
7942
|
constructor() {
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7943
|
+
b(this, "_map");
|
|
7944
|
+
b(this, "_container");
|
|
7945
|
+
b(this, "_terrainButton");
|
|
7946
|
+
ui(["_toggleTerrain", "_updateTerrainIcon"], this);
|
|
7947
7947
|
}
|
|
7948
7948
|
onAdd(e) {
|
|
7949
7949
|
return this._map = e, this._container = we("div", "maplibregl-ctrl maplibregl-ctrl-group"), this._terrainButton = we("button", "maplibregl-ctrl-terrain", this._container), we("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;
|
|
@@ -7958,7 +7958,7 @@ class jl {
|
|
|
7958
7958
|
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"));
|
|
7959
7959
|
}
|
|
7960
7960
|
}
|
|
7961
|
-
class Dl extends
|
|
7961
|
+
class Dl extends xa {
|
|
7962
7962
|
constructor(t = {}) {
|
|
7963
7963
|
super({
|
|
7964
7964
|
showCompass: t.showCompass ?? !0,
|
|
@@ -7968,7 +7968,7 @@ class Dl extends bi {
|
|
|
7968
7968
|
/**
|
|
7969
7969
|
* Overloading: Limit how flat the compass icon can get
|
|
7970
7970
|
*/
|
|
7971
|
-
|
|
7971
|
+
b(this, "_rotateCompassArrow", () => {
|
|
7972
7972
|
const t = this._map.getBearing(), n = this._map.getPitch(), a = this.options.visualizePitch ? `scale(${Math.min(1.5, 1 / Math.cos(n * (Math.PI / 180)) ** 0.5)}) rotateX(${Math.min(70, n)}deg) rotateZ(${-t}deg)` : `rotate(${-t}deg)`;
|
|
7973
7973
|
this._compassIcon.style.transform = a;
|
|
7974
7974
|
});
|
|
@@ -7988,14 +7988,14 @@ const Wn = k.Marker, Jn = k.LngLat, Ul = k.LngLatBounds;
|
|
|
7988
7988
|
class Bl extends wi {
|
|
7989
7989
|
constructor() {
|
|
7990
7990
|
super(...arguments);
|
|
7991
|
-
|
|
7991
|
+
b(this, "lastUpdatedCenter", new Jn(0, 0));
|
|
7992
7992
|
/**
|
|
7993
7993
|
* Update the camera location to center on the current position
|
|
7994
7994
|
*
|
|
7995
7995
|
* @param {Position} position the Geolocation API Position
|
|
7996
7996
|
* @private
|
|
7997
7997
|
*/
|
|
7998
|
-
|
|
7998
|
+
b(this, "_updateCamera", (t) => {
|
|
7999
7999
|
var c;
|
|
8000
8000
|
const n = new Jn(t.coords.longitude, t.coords.latitude), a = t.coords.accuracy, i = {
|
|
8001
8001
|
bearing: this._map.getBearing(),
|
|
@@ -8014,7 +8014,7 @@ class Bl extends wi {
|
|
|
8014
8014
|
this._map.off("click", u), this._map.off("dblclick", u), this._map.off("dragstart", u), this._map.off("mousedown", u), this._map.off("touchstart", u), this._map.off("wheel", u), !l && (this.lastUpdatedCenter = this._map.getCenter());
|
|
8015
8015
|
});
|
|
8016
8016
|
});
|
|
8017
|
-
|
|
8017
|
+
b(this, "_finishSetupUI", (t) => {
|
|
8018
8018
|
if (this._map) {
|
|
8019
8019
|
if (t === !1) {
|
|
8020
8020
|
const n = this._map._getUIString("GeolocateControl.LocationNotAvailable");
|
|
@@ -8032,7 +8032,7 @@ class Bl extends wi {
|
|
|
8032
8032
|
});
|
|
8033
8033
|
}
|
|
8034
8034
|
});
|
|
8035
|
-
|
|
8035
|
+
b(this, "_onZoom", () => {
|
|
8036
8036
|
this.options.showUserLocation && this.options.showAccuracyCircle && this._updateCircleRadius();
|
|
8037
8037
|
});
|
|
8038
8038
|
}
|
|
@@ -8065,15 +8065,15 @@ class Bl extends wi {
|
|
|
8065
8065
|
}
|
|
8066
8066
|
}
|
|
8067
8067
|
}
|
|
8068
|
-
var X, se, Le,
|
|
8068
|
+
var X, se, Le, Ce, Y, gt, q, io, Q, so;
|
|
8069
8069
|
class gr {
|
|
8070
8070
|
constructor(e, t) {
|
|
8071
8071
|
Se(this, q);
|
|
8072
8072
|
Se(this, X);
|
|
8073
|
-
|
|
8073
|
+
b(this, "map");
|
|
8074
8074
|
Se(this, se);
|
|
8075
8075
|
Se(this, Le);
|
|
8076
|
-
Se(this,
|
|
8076
|
+
Se(this, Ce);
|
|
8077
8077
|
Se(this, Y, !1);
|
|
8078
8078
|
Se(this, gt);
|
|
8079
8079
|
e.style !== void 0 && Re(this, Y, !0), Re(this, X, {
|
|
@@ -8132,10 +8132,10 @@ class gr {
|
|
|
8132
8132
|
Re(this, se, e), Re(this, Le, we("div", "maplibregl-ctrl maplibregl-ctrl-group"));
|
|
8133
8133
|
for (const [t, n] of Object.entries(P(this, X).containerStyle))
|
|
8134
8134
|
P(this, Le).style.setProperty(t, n);
|
|
8135
|
-
return P(this, X).container = P(this, Le), P(this, X).zoom = e.getZoom() + P(this, X).zoomAdjust, this.map = new
|
|
8135
|
+
return P(this, X).container = P(this, Le), P(this, X).zoom = e.getZoom() + P(this, X).zoomAdjust, this.map = new po(P(this, X)), this.map.once("style.load", () => {
|
|
8136
8136
|
this.map.resize();
|
|
8137
8137
|
}), this.map.once("load", () => {
|
|
8138
|
-
Z(this, q,
|
|
8138
|
+
Z(this, q, io).call(this, P(this, X).parentRect), Re(this, gt, Z(this, q, so).call(this));
|
|
8139
8139
|
}), P(this, Le);
|
|
8140
8140
|
}
|
|
8141
8141
|
onRemove() {
|
|
@@ -8143,8 +8143,8 @@ class gr {
|
|
|
8143
8143
|
(e = P(this, gt)) == null || e.call(this), hn(P(this, Le));
|
|
8144
8144
|
}
|
|
8145
8145
|
}
|
|
8146
|
-
X = new WeakMap(), se = new WeakMap(), Le = new WeakMap(),
|
|
8147
|
-
e === void 0 || e.linePaint === void 0 && e.fillPaint === void 0 || (Re(this,
|
|
8146
|
+
X = new WeakMap(), se = new WeakMap(), Le = new WeakMap(), Ce = new WeakMap(), Y = new WeakMap(), gt = new WeakMap(), q = new WeakSet(), io = function(e) {
|
|
8147
|
+
e === void 0 || e.linePaint === void 0 && e.fillPaint === void 0 || (Re(this, Ce, {
|
|
8148
8148
|
type: "Feature",
|
|
8149
8149
|
properties: {
|
|
8150
8150
|
name: "parentRect"
|
|
@@ -8155,7 +8155,7 @@ X = new WeakMap(), se = new WeakMap(), Le = new WeakMap(), Ee = new WeakMap(), Y
|
|
|
8155
8155
|
}
|
|
8156
8156
|
}), this.map.addSource("parentRect", {
|
|
8157
8157
|
type: "geojson",
|
|
8158
|
-
data: P(this,
|
|
8158
|
+
data: P(this, Ce)
|
|
8159
8159
|
}), (e.lineLayout !== void 0 || e.linePaint !== void 0) && this.map.addLayer({
|
|
8160
8160
|
id: "parentRectOutline",
|
|
8161
8161
|
type: "line",
|
|
@@ -8181,12 +8181,12 @@ X = new WeakMap(), se = new WeakMap(), Le = new WeakMap(), Ee = new WeakMap(), Y
|
|
|
8181
8181
|
}
|
|
8182
8182
|
}), Z(this, q, Q).call(this));
|
|
8183
8183
|
}, Q = function() {
|
|
8184
|
-
if (P(this,
|
|
8184
|
+
if (P(this, Ce) === void 0) return;
|
|
8185
8185
|
const { devicePixelRatio: e } = window, t = P(this, se).getCanvas(), n = t.width / e, a = t.height / e, o = P(this, se).unproject.bind(P(this, se)), i = o([0, 0]), s = o([n, 0]), l = o([0, a]), u = o([n, a]);
|
|
8186
|
-
P(this,
|
|
8186
|
+
P(this, Ce).geometry.coordinates = [[l.toArray(), u.toArray(), s.toArray(), i.toArray(), l.toArray()]];
|
|
8187
8187
|
const c = this.map.getSource("parentRect");
|
|
8188
|
-
c !== void 0 && c.setData(P(this,
|
|
8189
|
-
},
|
|
8188
|
+
c !== void 0 && c.setData(P(this, Ce));
|
|
8189
|
+
}, so = function() {
|
|
8190
8190
|
const { pitchAdjust: e } = P(this, X), t = () => {
|
|
8191
8191
|
i("parent");
|
|
8192
8192
|
}, n = () => {
|
|
@@ -8211,9 +8211,9 @@ X = new WeakMap(), se = new WeakMap(), Le = new WeakMap(), Ee = new WeakMap(), Y
|
|
|
8211
8211
|
};
|
|
8212
8212
|
class ql {
|
|
8213
8213
|
constructor() {
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8214
|
+
b(this, "map");
|
|
8215
|
+
b(this, "container");
|
|
8216
|
+
b(this, "projectionButton");
|
|
8217
8217
|
}
|
|
8218
8218
|
onAdd(e) {
|
|
8219
8219
|
return this.map = e, this.container = we("div", "maplibregl-ctrl maplibregl-ctrl-group"), this.projectionButton = we("button", "maplibregl-ctrl-projection", this.container), we("span", "maplibregl-ctrl-icon", this.projectionButton).setAttribute("aria-hidden", "true"), this.projectionButton.type = "button", this.projectionButton.addEventListener("click", this.toggleProjection.bind(this)), e.on("projectiontransition", this.updateProjectionIcon.bind(this)), this.updateProjectionIcon(), this.container;
|
|
@@ -8228,7 +8228,7 @@ class ql {
|
|
|
8228
8228
|
this.projectionButton.classList.remove("maplibregl-ctrl-projection-globe"), this.projectionButton.classList.remove("maplibregl-ctrl-projection-mercator"), this.map.isGlobeProjection() ? (this.projectionButton.classList.add("maplibregl-ctrl-projection-mercator"), this.projectionButton.title = "Enable Mercator projection") : (this.projectionButton.classList.add("maplibregl-ctrl-projection-globe"), this.projectionButton.title = "Enable Globe projection");
|
|
8229
8229
|
}
|
|
8230
8230
|
}
|
|
8231
|
-
const Vl = "@maptiler/sdk", Gl = "3.8.0-
|
|
8231
|
+
const Vl = "@maptiler/sdk", Gl = "3.8.0-rc8", Hl = "The Javascript & TypeScript map SDK tailored for MapTiler Cloud", Zl = "MapTiler", Xl = "dist/maptiler-sdk.mjs", Kl = "dist/maptiler-sdk.d.ts", Yl = "dist/maptiler-sdk.css", Wl = "module", Jl = "dist/maptiler-sdk.mjs", Ql = { ".": { 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" } }, eu = ["maptiler", "map", "sdk", "webmap", "cloud", "webGL", "maplibre"], tu = "https://docs.maptiler.com/sdk-js/", ru = "BSD-3-Clause", nu = { type: "git", url: "https://github.com/maptiler/maptiler-sdk-js.git" }, au = { prepare: "husky", doc: "rm -rf docs/* && typedoc --out docs && cp -r images docs/", ncu: "npx npm-check-updates", lint: "tsc --noEmit && eslint src", "lint:fix": "tsc --noEmit && eslint src --fix", "test:watch": "vitest watch -c vite.config-test.ts --dom", test: "vitest run -c vite.config-test.ts --dom", "install:clean": "rm -rf build/ dist/ node_modules/ && npm ci", dev: "npm run build-css && vite -c vite.config-dev.ts", "dev-umd": "npm run build-css && tsc && NODE_ENV=development vite build -w -c vite.config-umd.ts", "build-css": "mkdir -p dist build && node scripts/replace-path-with-content.js src/style/style_template.css dist/tmp_maptiler-sdk.css && cat node_modules/maplibre-gl/dist/maplibre-gl.css dist/tmp_maptiler-sdk.css > dist/maptiler-sdk.css && rm dist/tmp_maptiler-sdk.css && cp dist/maptiler-sdk.css build/maptiler-sdk.css", "build-umd": "tsc && NODE_ENV=production vite build -c vite.config-umd.ts", "build-es": "tsc && NODE_ENV=production vite build -c vite.config-es.ts", build: "npm run build-es; npm run build-umd; npm run build-css", make: "npm run install:clean && npm run build" }, ou = { "@canvas/image-data": "^1.0.0", "@eslint/js": "^9.21.0", "@types/color-convert": "^2.0.4", "@types/color-name": "^2.0.0", "@types/stats.js": "^0.17.4", "@types/uuid": "^10.0.0", "@types/xmldom": "^0.1.31", "@vitest/web-worker": "^3.0.9", "@xmldom/xmldom": "^0.8.10", concurrently: "^9.1.2", eslint: "^9.21.0", "eslint-config-prettier": "^10.0.2", "eslint-plugin-prettier": "^5.2.3", "happy-dom": "^17.4.4", husky: "^8.0.0", jiti: "^2.4.2", "lint-staged": "^15.4.3", prettier: "3.5.2", "stats.js": "^0.17.0", typedoc: "^0.27.6", typescript: "^5.7.3", "typescript-eslint": "^8.25.0", vite: "^6.0.7", "vite-plugin-dts": "^4.5.0", vitest: "^3.0.9" }, iu = { "@koa/cors": "^5.0.0", "@koa/router": "^13.1.1", "@maplibre/maplibre-gl-style-spec": "~23.3.0", "@maptiler/client": "~2.5.0", events: "^3.3.0", "gl-matrix": "^3.4.3", "js-base64": "^3.7.7", koa: "^3.0.0", "maplibre-gl": "~5.6.0", uuid: "^11.0.5" }, su = {
|
|
8232
8232
|
name: Vl,
|
|
8233
8233
|
version: Gl,
|
|
8234
8234
|
description: Hl,
|
|
@@ -8256,9 +8256,9 @@ class lu {
|
|
|
8256
8256
|
* @param delay : a delay in milliseconds after which the payload is sent to MapTiler cloud (cannot be less than 1000ms)
|
|
8257
8257
|
*/
|
|
8258
8258
|
constructor(e, t = 2e3) {
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8259
|
+
b(this, "map");
|
|
8260
|
+
b(this, "registeredModules", /* @__PURE__ */ new Set());
|
|
8261
|
+
b(this, "viewerType");
|
|
8262
8262
|
this.map = e, this.viewerType = "Map", setTimeout(
|
|
8263
8263
|
async () => {
|
|
8264
8264
|
if (!N.telemetry)
|
|
@@ -8303,8 +8303,8 @@ function uu(r, e, t, n, a, o, i, s, l, u, c, p, d, f, h, m, y) {
|
|
|
8303
8303
|
return r[0] = e, r[1] = t, r[2] = n, r[3] = a, r[4] = o, r[5] = i, r[6] = s, r[7] = l, r[8] = u, r[9] = c, r[10] = p, r[11] = d, r[12] = f, r[13] = h, r[14] = m, r[15] = y, r;
|
|
8304
8304
|
}
|
|
8305
8305
|
function cu(r, e, t) {
|
|
8306
|
-
var n = e[0], a = e[1], o = e[2], i = e[3], s = e[4], l = e[5], u = e[6], c = e[7], p = e[8], d = e[9], f = e[10], h = e[11], m = e[12], y = e[13],
|
|
8307
|
-
return r[0] = S * n +
|
|
8306
|
+
var n = e[0], a = e[1], o = e[2], i = e[3], s = e[4], l = e[5], u = e[6], c = e[7], p = e[8], d = e[9], f = e[10], h = e[11], m = e[12], y = e[13], w = e[14], g = e[15], S = t[0], E = t[1], C = t[2], z = t[3];
|
|
8307
|
+
return r[0] = S * n + E * s + C * p + z * m, r[1] = S * a + E * l + C * d + z * y, r[2] = S * o + E * u + C * f + z * w, r[3] = S * i + E * c + C * h + z * g, S = t[4], E = t[5], C = t[6], z = t[7], r[4] = S * n + E * s + C * p + z * m, r[5] = S * a + E * l + C * d + z * y, r[6] = S * o + E * u + C * f + z * w, r[7] = S * i + E * c + C * h + z * g, S = t[8], E = t[9], C = t[10], z = t[11], r[8] = S * n + E * s + C * p + z * m, r[9] = S * a + E * l + C * d + z * y, r[10] = S * o + E * u + C * f + z * w, r[11] = S * i + E * c + C * h + z * g, S = t[12], E = t[13], C = t[14], z = t[15], r[12] = S * n + E * s + C * p + z * m, r[13] = S * a + E * l + C * d + z * y, r[14] = S * o + E * u + C * f + z * w, r[15] = S * i + E * c + C * h + z * g, r;
|
|
8308
8308
|
}
|
|
8309
8309
|
function pu(r, e, t) {
|
|
8310
8310
|
var n = t[0], a = t[1], o = t[2];
|
|
@@ -8509,7 +8509,7 @@ function gu() {
|
|
|
8509
8509
|
}), br;
|
|
8510
8510
|
}
|
|
8511
8511
|
var wr, na;
|
|
8512
|
-
function
|
|
8512
|
+
function lo() {
|
|
8513
8513
|
if (na) return wr;
|
|
8514
8514
|
na = 1;
|
|
8515
8515
|
const r = gu(), e = {};
|
|
@@ -8815,7 +8815,7 @@ var xr, aa;
|
|
|
8815
8815
|
function vu() {
|
|
8816
8816
|
if (aa) return xr;
|
|
8817
8817
|
aa = 1;
|
|
8818
|
-
const r =
|
|
8818
|
+
const r = lo();
|
|
8819
8819
|
function e() {
|
|
8820
8820
|
const o = {}, i = Object.keys(r);
|
|
8821
8821
|
for (let s = i.length, l = 0; l < s; l++)
|
|
@@ -8863,7 +8863,7 @@ var Sr, oa;
|
|
|
8863
8863
|
function bu() {
|
|
8864
8864
|
if (oa) return Sr;
|
|
8865
8865
|
oa = 1;
|
|
8866
|
-
const r =
|
|
8866
|
+
const r = lo(), e = vu(), t = {}, n = Object.keys(r);
|
|
8867
8867
|
function a(i) {
|
|
8868
8868
|
const s = function(...l) {
|
|
8869
8869
|
const u = l[0];
|
|
@@ -8920,7 +8920,7 @@ function ku(r, e, t) {
|
|
|
8920
8920
|
throw new Error(`Cannot get uniform location for ${t}`);
|
|
8921
8921
|
return n;
|
|
8922
8922
|
}
|
|
8923
|
-
function
|
|
8923
|
+
function uo({
|
|
8924
8924
|
gl: r,
|
|
8925
8925
|
vertexShaderSource: e,
|
|
8926
8926
|
fragmentShaderSource: t,
|
|
@@ -8943,7 +8943,7 @@ function lo({
|
|
|
8943
8943
|
indexBufferLength: d
|
|
8944
8944
|
};
|
|
8945
8945
|
}
|
|
8946
|
-
function
|
|
8946
|
+
function It(r) {
|
|
8947
8947
|
if (!r)
|
|
8948
8948
|
return [1, 1, 1, 0];
|
|
8949
8949
|
if (r === "transparent")
|
|
@@ -8970,7 +8970,7 @@ let rt;
|
|
|
8970
8970
|
function Lu(r) {
|
|
8971
8971
|
return rt = rt ?? document.createElement("canvas").getContext("2d"), rt ? (rt.fillStyle = r, rt.fillStyle) : "#000000";
|
|
8972
8972
|
}
|
|
8973
|
-
const mn = 1, ae = mn / 2, oe = mn / 2, ie = mn / 2,
|
|
8973
|
+
const mn = 1, ae = mn / 2, oe = mn / 2, ie = mn / 2, Cu = [-0.5, -0.5, ie, ae, -0.5, ie, ae, oe, ie, -0.5, oe, ie], Eu = [-0.5, -0.5, -0.5, -0.5, oe, -0.5, ae, oe, -0.5, ae, -0.5, -0.5], Tu = [-0.5, oe, -0.5, -0.5, oe, ie, ae, oe, ie, ae, oe, -0.5], Au = [-0.5, -0.5, -0.5, ae, -0.5, -0.5, ae, -0.5, ie, -0.5, -0.5, ie], _u = [ae, -0.5, -0.5, ae, oe, -0.5, ae, oe, ie, ae, -0.5, ie], Iu = [-0.5, -0.5, -0.5, -0.5, -0.5, ie, -0.5, oe, ie, -0.5, oe, -0.5], Mu = [...Cu, ...Eu, ...Tu, ...Au, ..._u, ...Iu], Pu = [
|
|
8974
8974
|
// Front
|
|
8975
8975
|
0,
|
|
8976
8976
|
1,
|
|
@@ -9080,11 +9080,11 @@ const Ue = {
|
|
|
9080
9080
|
preset: "milkyway-colored"
|
|
9081
9081
|
}
|
|
9082
9082
|
};
|
|
9083
|
-
var
|
|
9084
|
-
let
|
|
9085
|
-
function
|
|
9086
|
-
|
|
9087
|
-
const a =
|
|
9083
|
+
var Fe = /* @__PURE__ */ ((r) => (r.POSITIVE_X = "pX", r.NEGATIVE_X = "nX", r.POSITIVE_Y = "pY", r.NEGATIVE_Y = "nY", r.POSITIVE_Z = "pZ", r.NEGATIVE_Z = "nZ", r))(Fe || {});
|
|
9084
|
+
let Et, la, ua;
|
|
9085
|
+
function Fu({ gl: r, faces: e, onReady: t, forceRefresh: n }) {
|
|
9086
|
+
Et && !n && ua === JSON.stringify(e) && t(Et, la), ua = JSON.stringify(e);
|
|
9087
|
+
const a = Et ?? r.createTexture();
|
|
9088
9088
|
if (r.bindTexture(r.TEXTURE_CUBE_MAP, a), !e) {
|
|
9089
9089
|
console.warn("[CubemapLayer][loadCubemapTexture]: Faces are null");
|
|
9090
9090
|
return;
|
|
@@ -9116,28 +9116,28 @@ function $u({ gl: r, faces: e, onReady: t, forceRefresh: n }) {
|
|
|
9116
9116
|
console.warn("[CubemapLayer][loadCubemapTexture]: Image or key is null");
|
|
9117
9117
|
continue;
|
|
9118
9118
|
}
|
|
9119
|
-
const y =
|
|
9119
|
+
const y = $u(r, m);
|
|
9120
9120
|
r.bindTexture(r.TEXTURE_CUBE_MAP, a), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MAG_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MIN_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_WRAP_S, r.CLAMP_TO_EDGE), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_WRAP_T, r.CLAMP_TO_EDGE), r.texImage2D(y, 0, p, d, f, h);
|
|
9121
9121
|
}
|
|
9122
9122
|
r.bindTexture(r.TEXTURE_CUBE_MAP, a), r.generateMipmap(r.TEXTURE_CUBE_MAP), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_LINEAR), r.texParameteri(r.TEXTURE_CUBE_MAP, r.TEXTURE_MAG_FILTER, r.LINEAR);
|
|
9123
9123
|
const l = s.map((u) => u.image);
|
|
9124
|
-
t(a, l), la = l,
|
|
9124
|
+
t(a, l), la = l, Et = a;
|
|
9125
9125
|
}).catch((s) => {
|
|
9126
9126
|
console.error("[CubemapLayer][loadCubemapTexture]: Error loading cubemap texture", s);
|
|
9127
9127
|
});
|
|
9128
9128
|
}
|
|
9129
|
-
function
|
|
9130
|
-
if (e ===
|
|
9129
|
+
function $u(r, e) {
|
|
9130
|
+
if (e === Fe.POSITIVE_X)
|
|
9131
9131
|
return r.TEXTURE_CUBE_MAP_POSITIVE_X;
|
|
9132
|
-
if (e ===
|
|
9132
|
+
if (e === Fe.NEGATIVE_X)
|
|
9133
9133
|
return r.TEXTURE_CUBE_MAP_NEGATIVE_X;
|
|
9134
|
-
if (e ===
|
|
9134
|
+
if (e === Fe.POSITIVE_Y)
|
|
9135
9135
|
return r.TEXTURE_CUBE_MAP_POSITIVE_Y;
|
|
9136
|
-
if (e ===
|
|
9136
|
+
if (e === Fe.NEGATIVE_Y)
|
|
9137
9137
|
return r.TEXTURE_CUBE_MAP_NEGATIVE_Y;
|
|
9138
|
-
if (e ===
|
|
9138
|
+
if (e === Fe.POSITIVE_Z)
|
|
9139
9139
|
return r.TEXTURE_CUBE_MAP_POSITIVE_Z;
|
|
9140
|
-
if (e ===
|
|
9140
|
+
if (e === Fe.NEGATIVE_Z)
|
|
9141
9141
|
return r.TEXTURE_CUBE_MAP_NEGATIVE_Z;
|
|
9142
9142
|
throw new Error(`[CubemapLayer][loadCubemapTexture]: Invalid key ${e}`);
|
|
9143
9143
|
}
|
|
@@ -9154,7 +9154,7 @@ function Te(r, e, t) {
|
|
|
9154
9154
|
}
|
|
9155
9155
|
const Ze = "https://api.maptiler.com/resources/space", Nu = ["vertexPosition"], ju = ["projectionMatrix", "modelViewMatrix", "cubeSampler", "bgColor", "fadeOpacity"], ca = "%USE_TEXTURE_MACRO_MARKER%", Du = "#define USE_TEXTURE", Uu = Ue.stars;
|
|
9156
9156
|
function Bu(r, e) {
|
|
9157
|
-
if (!
|
|
9157
|
+
if (!co(r))
|
|
9158
9158
|
return {
|
|
9159
9159
|
color: "transparent"
|
|
9160
9160
|
};
|
|
@@ -9188,15 +9188,15 @@ class kr {
|
|
|
9188
9188
|
* whether to use a cubemap texture based on the provided options.
|
|
9189
9189
|
*/
|
|
9190
9190
|
constructor(e) {
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9191
|
+
b(this, "id", "Cubemap Layer");
|
|
9192
|
+
b(this, "type", "custom");
|
|
9193
|
+
b(this, "renderingMode", "3d");
|
|
9194
9194
|
/**
|
|
9195
9195
|
* The map instance to which this layer is added.
|
|
9196
9196
|
* @type {MapSDK}
|
|
9197
9197
|
* @private
|
|
9198
9198
|
*/
|
|
9199
|
-
|
|
9199
|
+
b(this, "map");
|
|
9200
9200
|
/**
|
|
9201
9201
|
* The cubemap faces definition, which can be either a preset, path, or explicit face URLs.
|
|
9202
9202
|
* @type {CubemapFaces | null}
|
|
@@ -9204,99 +9204,99 @@ class kr {
|
|
|
9204
9204
|
* This property is set during the initialization of the layer and can be updated later.
|
|
9205
9205
|
* If no faces are defined, it will be `null`.
|
|
9206
9206
|
*/
|
|
9207
|
-
|
|
9207
|
+
b(this, "faces");
|
|
9208
9208
|
/**
|
|
9209
9209
|
* Indicates whether to use a cubemap texture for rendering.
|
|
9210
9210
|
* @type {boolean}
|
|
9211
9211
|
* @private
|
|
9212
9212
|
* @default true
|
|
9213
9213
|
*/
|
|
9214
|
-
|
|
9214
|
+
b(this, "useCubemapTexture", !0);
|
|
9215
9215
|
/**
|
|
9216
9216
|
* The current opacity of the fade effect applied to the cubemap image texture, used for fading in and out.
|
|
9217
9217
|
* @type {number}
|
|
9218
9218
|
* @private
|
|
9219
9219
|
* @default 0.0
|
|
9220
9220
|
*/
|
|
9221
|
-
|
|
9221
|
+
b(this, "currentFadeOpacity", 0);
|
|
9222
9222
|
/**
|
|
9223
9223
|
* Indicates whether the cubemap needs to be updated, typically when the faces or texture changes.
|
|
9224
9224
|
* @type {boolean}
|
|
9225
9225
|
* @private
|
|
9226
9226
|
* @default false
|
|
9227
9227
|
*/
|
|
9228
|
-
|
|
9228
|
+
b(this, "cubeMapNeedsUpdate", !1);
|
|
9229
9229
|
/**
|
|
9230
9230
|
* The background color of the cubemap layer, represented as a Vec4 (RGBA).
|
|
9231
9231
|
* @type {Vec4}
|
|
9232
9232
|
* @private
|
|
9233
9233
|
*/
|
|
9234
|
-
|
|
9234
|
+
b(this, "bgColor");
|
|
9235
9235
|
/**
|
|
9236
9236
|
* The previous background color used for transition animations.
|
|
9237
9237
|
* @type {Vec4}
|
|
9238
9238
|
* @private
|
|
9239
9239
|
*/
|
|
9240
|
-
|
|
9240
|
+
b(this, "previousBgColor", [0, 0, 0, 0]);
|
|
9241
9241
|
/**
|
|
9242
9242
|
* The target background color to which the layer will transition.
|
|
9243
9243
|
* @type {Vec4}
|
|
9244
9244
|
* @private
|
|
9245
9245
|
*/
|
|
9246
|
-
|
|
9246
|
+
b(this, "targetBgColor", [0, 0, 0, 0]);
|
|
9247
9247
|
/**
|
|
9248
9248
|
* The delta value used for transitioning the background color. 0 = start of transition, 1 = end of transition.
|
|
9249
9249
|
* This value is incremented over time to create a smooth transition effect.
|
|
9250
9250
|
* @type {number}
|
|
9251
9251
|
* @private
|
|
9252
9252
|
*/
|
|
9253
|
-
|
|
9253
|
+
b(this, "transitionDelta", 0);
|
|
9254
9254
|
/**
|
|
9255
9255
|
* The WebGL context used for rendering the cubemap layer.
|
|
9256
9256
|
* @type {WebGLContext}
|
|
9257
9257
|
* @private
|
|
9258
9258
|
*/
|
|
9259
|
-
|
|
9259
|
+
b(this, "gl");
|
|
9260
9260
|
/**
|
|
9261
9261
|
* The cubemap object that contains the shader program, buffers and uniform locations for rendering.
|
|
9262
9262
|
* @type {Object3D}
|
|
9263
9263
|
* @private
|
|
9264
9264
|
*/
|
|
9265
|
-
|
|
9265
|
+
b(this, "cubemap");
|
|
9266
9266
|
/**
|
|
9267
9267
|
* The WebGL texture used for the cubemap, which is created from the defined faces.
|
|
9268
9268
|
* This texture is used to render the cubemap in the scene.
|
|
9269
9269
|
* @type {WebGLTexture | undefined}
|
|
9270
9270
|
* @private
|
|
9271
9271
|
*/
|
|
9272
|
-
|
|
9272
|
+
b(this, "texture");
|
|
9273
9273
|
/**
|
|
9274
9274
|
* The key representing the current faces definition, used to diff / track changes in the cubemap faces.
|
|
9275
9275
|
* @type {string}
|
|
9276
9276
|
*/
|
|
9277
|
-
|
|
9277
|
+
b(this, "currentFacesDefinitionKey", "");
|
|
9278
9278
|
/**
|
|
9279
9279
|
* The configuration options for the cubemap layer.
|
|
9280
9280
|
* @type {CubemapLayerConstructorOptions}
|
|
9281
9281
|
* @private
|
|
9282
9282
|
*/
|
|
9283
|
-
|
|
9283
|
+
b(this, "options");
|
|
9284
9284
|
/**
|
|
9285
9285
|
* Animates the cubemap image fading in.
|
|
9286
9286
|
* This method gradually increases the opacity of the cubemap image to create a fade-in effect.
|
|
9287
9287
|
*
|
|
9288
9288
|
* @private
|
|
9289
9289
|
*/
|
|
9290
|
-
|
|
9290
|
+
b(this, "imageIsAnimating", !1);
|
|
9291
9291
|
/**
|
|
9292
9292
|
* The delta value used for the image fade-in animation.
|
|
9293
9293
|
* This value is incremented over time to create a smooth fade-in effect.
|
|
9294
9294
|
* @type {number}
|
|
9295
9295
|
* @private
|
|
9296
9296
|
*/
|
|
9297
|
-
|
|
9297
|
+
b(this, "imageFadeInDelta", 0);
|
|
9298
9298
|
const t = Bu(e, Uu);
|
|
9299
|
-
this.options = t, this.currentFacesDefinitionKey = JSON.stringify(t.faces ?? t.preset ?? t.path), this.bgColor = [0, 0, 0, 0], this.targetBgColor =
|
|
9299
|
+
this.options = t, this.currentFacesDefinitionKey = JSON.stringify(t.faces ?? t.preset ?? t.path), this.bgColor = [0, 0, 0, 0], this.targetBgColor = It(t.color), this.faces = pa(t), this.useCubemapTexture = this.faces !== null;
|
|
9300
9300
|
}
|
|
9301
9301
|
/**
|
|
9302
9302
|
* Updates the cubemap object with the current faces and shader configuration.
|
|
@@ -9309,14 +9309,14 @@ class kr {
|
|
|
9309
9309
|
updateCubemap({ facesNeedUpdate: e } = { facesNeedUpdate: !0 }) {
|
|
9310
9310
|
this.useCubemapTexture = this.faces !== null;
|
|
9311
9311
|
const t = ju.filter((n) => n === "cubeSampler" || n === "fadeOpacity" ? this.useCubemapTexture : !0);
|
|
9312
|
-
this.cubemap =
|
|
9312
|
+
this.cubemap = uo({
|
|
9313
9313
|
gl: this.gl,
|
|
9314
9314
|
vertexShaderSource: Ru,
|
|
9315
9315
|
// Because we only want to use the read the texture in gl if we're supposed to
|
|
9316
9316
|
fragmentShaderSource: this.useCubemapTexture ? sa.replace(ca, Du) : sa.replace(ca, ""),
|
|
9317
9317
|
attributesKeys: Nu,
|
|
9318
9318
|
uniformsKeys: t,
|
|
9319
|
-
vertices:
|
|
9319
|
+
vertices: Mu,
|
|
9320
9320
|
indices: Pu
|
|
9321
9321
|
}), this.cubeMapNeedsUpdate = e, this.useCubemapTexture && this.updateTexture(this.gl, this.faces), this.animateColorChange();
|
|
9322
9322
|
}
|
|
@@ -9351,7 +9351,7 @@ class kr {
|
|
|
9351
9351
|
if (this.cubeMapNeedsUpdate === !0 && !this.imageIsAnimating) {
|
|
9352
9352
|
if (this.cubeMapNeedsUpdate = !1, !this.useCubemapTexture)
|
|
9353
9353
|
return;
|
|
9354
|
-
|
|
9354
|
+
Fu({
|
|
9355
9355
|
gl: e,
|
|
9356
9356
|
faces: t,
|
|
9357
9357
|
onReady: (n) => {
|
|
@@ -9478,12 +9478,12 @@ class kr {
|
|
|
9478
9478
|
this.options = e;
|
|
9479
9479
|
const t = JSON.stringify(e.faces ?? e.preset ?? e.path), n = this.currentFacesDefinitionKey !== t;
|
|
9480
9480
|
n && (await this.setCubemapFaces(e), this.cubeMapNeedsUpdate = !0);
|
|
9481
|
-
const a =
|
|
9481
|
+
const a = It(e.color);
|
|
9482
9482
|
if (e.color && this.targetBgColor.toString() !== a.toString())
|
|
9483
9483
|
this.setBgColor(a);
|
|
9484
9484
|
else if (!e.color && e.preset && e.preset in Ue) {
|
|
9485
9485
|
const o = Ue[e.preset];
|
|
9486
|
-
this.setBgColor(
|
|
9486
|
+
this.setBgColor(It(o.color));
|
|
9487
9487
|
}
|
|
9488
9488
|
this.updateCubemap({ facesNeedUpdate: n });
|
|
9489
9489
|
}
|
|
@@ -9502,7 +9502,7 @@ class kr {
|
|
|
9502
9502
|
this.map.setLayoutProperty(this.id, "visibility", "none");
|
|
9503
9503
|
}
|
|
9504
9504
|
}
|
|
9505
|
-
function
|
|
9505
|
+
function co(r) {
|
|
9506
9506
|
return typeof r == "boolean" ? !0 : !(!r.path && !r.preset && !r.faces && !r.color || r.preset && !(r.preset in Ue) || r.faces && (!r.faces.pX || !r.faces.nX || !r.faces.pY || !r.faces.nY || !r.faces.pZ || !r.faces.nZ));
|
|
9507
9507
|
}
|
|
9508
9508
|
function pa(r) {
|
|
@@ -9628,37 +9628,37 @@ class Lr {
|
|
|
9628
9628
|
* If an `RadialGradientLayerConstructorOptions` is provided, it will be merged with default options.
|
|
9629
9629
|
*/
|
|
9630
9630
|
constructor(e) {
|
|
9631
|
-
|
|
9632
|
-
|
|
9633
|
-
|
|
9631
|
+
b(this, "id", "Halo Layer");
|
|
9632
|
+
b(this, "type", "custom");
|
|
9633
|
+
b(this, "renderingMode", "3d");
|
|
9634
9634
|
/**
|
|
9635
9635
|
* The gradient definition used by this layer.
|
|
9636
9636
|
* It contains the stops and scale for the radial gradient.
|
|
9637
9637
|
* @private
|
|
9638
9638
|
* @type {GradientDefinition}
|
|
9639
9639
|
*/
|
|
9640
|
-
|
|
9640
|
+
b(this, "gradient");
|
|
9641
9641
|
/**
|
|
9642
9642
|
* The scale of the radial gradient, which determines its size.
|
|
9643
9643
|
* This value is animated from 0 to the target scale during the layer's appearance.
|
|
9644
9644
|
* @private
|
|
9645
9645
|
* @type {number}
|
|
9646
9646
|
*/
|
|
9647
|
-
|
|
9647
|
+
b(this, "scale", 0);
|
|
9648
9648
|
/**
|
|
9649
9649
|
* The animation delta value used to control the progress of the gradient's appearance animation.
|
|
9650
9650
|
* It is incremented during each frame of the animation until it reaches 1.
|
|
9651
9651
|
* @private
|
|
9652
9652
|
* @type {number}
|
|
9653
9653
|
*/
|
|
9654
|
-
|
|
9654
|
+
b(this, "animationDelta", 0);
|
|
9655
9655
|
/**
|
|
9656
9656
|
* The MapSDK instance to which this layer is added.
|
|
9657
9657
|
* This is set when the layer is added to the map.
|
|
9658
9658
|
* @private
|
|
9659
9659
|
* @type {MapSDK}
|
|
9660
9660
|
*/
|
|
9661
|
-
|
|
9661
|
+
b(this, "map");
|
|
9662
9662
|
/**
|
|
9663
9663
|
* The 3D object representing the radial gradient plane.
|
|
9664
9664
|
* This object is created when the layer is added to the map and contains the shader program and buffers.
|
|
@@ -9666,7 +9666,7 @@ class Lr {
|
|
|
9666
9666
|
* @private
|
|
9667
9667
|
* @type {Object3D<(typeof ATTRIBUTES_KEYS)[number], (typeof UNIFORMS_KEYS)[number]>}
|
|
9668
9668
|
*/
|
|
9669
|
-
|
|
9669
|
+
b(this, "plane");
|
|
9670
9670
|
if (typeof e == "boolean") {
|
|
9671
9671
|
this.gradient = nt;
|
|
9672
9672
|
return;
|
|
@@ -9685,7 +9685,7 @@ class Lr {
|
|
|
9685
9685
|
* @returns void
|
|
9686
9686
|
*/
|
|
9687
9687
|
onAdd(e, t) {
|
|
9688
|
-
this.map = e, this.plane =
|
|
9688
|
+
this.map = e, this.plane = uo({
|
|
9689
9689
|
gl: t,
|
|
9690
9690
|
vertexShaderSource: qu,
|
|
9691
9691
|
fragmentShaderSource: Vu,
|
|
@@ -9778,14 +9778,14 @@ class Lr {
|
|
|
9778
9778
|
ta(f, c, d), vr(f, f), uu(l, d[0], d[1], d[2], 0, f[0], f[1], f[2], 0, c[0], c[1], c[2], 0, 0, 0, 0, 1);
|
|
9779
9779
|
const h = this.plane.programInfo.uniformsLocations.rotationMatrix;
|
|
9780
9780
|
e.uniformMatrix4fv(h, !1, l);
|
|
9781
|
-
const m = this.gradient.stops.length, y = [],
|
|
9781
|
+
const m = this.gradient.stops.length, y = [], w = [];
|
|
9782
9782
|
for (let g = 0; g <= m; g++)
|
|
9783
9783
|
if (g < m) {
|
|
9784
9784
|
y[g] = this.gradient.stops[g][0];
|
|
9785
|
-
const S =
|
|
9786
|
-
|
|
9785
|
+
const S = It(this.gradient.stops[g][1]);
|
|
9786
|
+
w.push(...S);
|
|
9787
9787
|
}
|
|
9788
|
-
e.uniform1i(this.plane.programInfo.uniformsLocations.stopsNumber, m), e.uniform1fv(this.plane.programInfo.uniformsLocations.stops, new Float32Array(y)), e.uniform4fv(this.plane.programInfo.uniformsLocations.colors, new Float32Array(
|
|
9788
|
+
e.uniform1i(this.plane.programInfo.uniformsLocations.stopsNumber, m), e.uniform1fv(this.plane.programInfo.uniformsLocations.stops, new Float32Array(y)), e.uniform4fv(this.plane.programInfo.uniformsLocations.colors, new Float32Array(w)), e.uniform1f(this.plane.programInfo.uniformsLocations.maxDistance, at), e.uniform1f(this.plane.programInfo.uniformsLocations.scale, o), e.drawArrays(e.TRIANGLE_STRIP, 0, 4);
|
|
9789
9789
|
}
|
|
9790
9790
|
/**
|
|
9791
9791
|
* Sets a new gradient for the radial gradient layer and animates the transition.
|
|
@@ -9820,9 +9820,9 @@ const Ku = {
|
|
|
9820
9820
|
POINT: "POINT",
|
|
9821
9821
|
COUNTRY: "COUNTRY"
|
|
9822
9822
|
};
|
|
9823
|
-
let
|
|
9823
|
+
let po = class fo extends k.Map {
|
|
9824
9824
|
constructor(t) {
|
|
9825
|
-
|
|
9825
|
+
fi(t.container), t.apiKey && (N.apiKey = t.apiKey);
|
|
9826
9826
|
const { style: n, requiresUrlMonitoring: a, isFallback: o } = Yn(t.style);
|
|
9827
9827
|
o && console.warn(
|
|
9828
9828
|
"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."
|
|
@@ -9844,27 +9844,27 @@ let co = class po extends k.Map {
|
|
|
9844
9844
|
};
|
|
9845
9845
|
delete l.style;
|
|
9846
9846
|
super(l);
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
|
|
9867
|
-
|
|
9847
|
+
b(this, "telemetry");
|
|
9848
|
+
b(this, "space");
|
|
9849
|
+
b(this, "halo");
|
|
9850
|
+
b(this, "options");
|
|
9851
|
+
b(this, "isTerrainEnabled", !1);
|
|
9852
|
+
b(this, "terrainExaggeration", 1);
|
|
9853
|
+
b(this, "primaryLanguage");
|
|
9854
|
+
b(this, "terrainGrowing", !1);
|
|
9855
|
+
b(this, "terrainFlattening", !1);
|
|
9856
|
+
b(this, "minimap");
|
|
9857
|
+
b(this, "forceLanguageUpdate");
|
|
9858
|
+
b(this, "languageAlwaysBeenStyle");
|
|
9859
|
+
b(this, "isReady", !1);
|
|
9860
|
+
b(this, "terrainAnimationDuration", 1e3);
|
|
9861
|
+
b(this, "monitoredStyleUrls");
|
|
9862
|
+
b(this, "styleInProcess", !1);
|
|
9863
|
+
b(this, "curentProjection");
|
|
9864
|
+
b(this, "originalLabelStyle", new window.Map());
|
|
9865
|
+
b(this, "isStyleLocalized", !1);
|
|
9866
|
+
b(this, "languageIsUpdated", !1);
|
|
9867
|
+
b(this, "spaceboxLoadingState", {
|
|
9868
9868
|
styleLoadCallbackSet: !1
|
|
9869
9869
|
});
|
|
9870
9870
|
this.options = t, this.setStyle(n), a && this.monitorStyleUrl(n);
|
|
@@ -9876,9 +9876,9 @@ let co = class po extends k.Map {
|
|
|
9876
9876
|
this.styleInProcess = !1;
|
|
9877
9877
|
}), this.on("error", (h) => {
|
|
9878
9878
|
if (h.error instanceof k.AJAXError) {
|
|
9879
|
-
const y = h.error.url,
|
|
9880
|
-
|
|
9881
|
-
const g =
|
|
9879
|
+
const y = h.error.url, w = new URL(y);
|
|
9880
|
+
w.search = "";
|
|
9881
|
+
const g = w.href;
|
|
9882
9882
|
this.monitoredStyleUrls && this.monitoredStyleUrls.has(g) && (this.monitoredStyleUrls.delete(g), u());
|
|
9883
9883
|
return;
|
|
9884
9884
|
}
|
|
@@ -9886,7 +9886,7 @@ let co = class po extends k.Map {
|
|
|
9886
9886
|
u();
|
|
9887
9887
|
return;
|
|
9888
9888
|
}
|
|
9889
|
-
}), N.caching && !Tr && console.warn("The cache API is only available in secure contexts. More info at https://developer.mozilla.org/en-US/docs/Web/API/Cache"), N.caching && Tr &&
|
|
9889
|
+
}), N.caching && !Tr && console.warn("The cache API is only available in secure contexts. More info at https://developer.mozilla.org/en-US/docs/Web/API/Cache"), N.caching && Tr && si(), typeof t.language > "u")
|
|
9890
9890
|
this.primaryLanguage = N.primaryLanguage;
|
|
9891
9891
|
else {
|
|
9892
9892
|
const h = xn(t.language, R);
|
|
@@ -9957,8 +9957,8 @@ let co = class po extends k.Map {
|
|
|
9957
9957
|
} else t.maptilerLogo && this.addControl(new _n(), t.logoPosition);
|
|
9958
9958
|
if (t.scaleControl) {
|
|
9959
9959
|
const m = t.scaleControl === !0 || t.scaleControl === void 0 ? "bottom-right" : t.scaleControl, y = new Si({ unit: N.unit });
|
|
9960
|
-
this.addControl(y, m), N.on("unit", (
|
|
9961
|
-
y.setUnit(
|
|
9960
|
+
this.addControl(y, m), N.on("unit", (w) => {
|
|
9961
|
+
y.setUnit(w);
|
|
9962
9962
|
});
|
|
9963
9963
|
}
|
|
9964
9964
|
if (t.navigationControl !== !1) {
|
|
@@ -10008,49 +10008,49 @@ let co = class po extends k.Map {
|
|
|
10008
10008
|
const {
|
|
10009
10009
|
zoom: m,
|
|
10010
10010
|
center: y,
|
|
10011
|
-
style:
|
|
10011
|
+
style: w,
|
|
10012
10012
|
language: g,
|
|
10013
10013
|
apiKey: S,
|
|
10014
|
-
maptilerLogo:
|
|
10015
|
-
canvasContextAttributes:
|
|
10014
|
+
maptilerLogo: E,
|
|
10015
|
+
canvasContextAttributes: C,
|
|
10016
10016
|
refreshExpiredTiles: z,
|
|
10017
10017
|
maxBounds: ve,
|
|
10018
|
-
scrollZoom:
|
|
10018
|
+
scrollZoom: Me,
|
|
10019
10019
|
minZoom: Ge,
|
|
10020
10020
|
maxZoom: He,
|
|
10021
10021
|
boxZoom: G,
|
|
10022
10022
|
locale: Pe,
|
|
10023
|
-
fadeDuration:
|
|
10024
|
-
crossSourceCollisions:
|
|
10025
|
-
clickTolerance:
|
|
10026
|
-
bounds:
|
|
10027
|
-
fitBoundsOptions:
|
|
10028
|
-
pixelRatio:
|
|
10029
|
-
validateStyle:
|
|
10023
|
+
fadeDuration: No,
|
|
10024
|
+
crossSourceCollisions: jo,
|
|
10025
|
+
clickTolerance: Do,
|
|
10026
|
+
bounds: Uo,
|
|
10027
|
+
fitBoundsOptions: Bo,
|
|
10028
|
+
pixelRatio: qo,
|
|
10029
|
+
validateStyle: Vo
|
|
10030
10030
|
} = t;
|
|
10031
10031
|
this.minimap = new gr(h, {
|
|
10032
10032
|
zoom: m,
|
|
10033
10033
|
center: y,
|
|
10034
|
-
style:
|
|
10034
|
+
style: w,
|
|
10035
10035
|
language: g,
|
|
10036
10036
|
apiKey: S,
|
|
10037
10037
|
container: "null",
|
|
10038
|
-
maptilerLogo:
|
|
10039
|
-
canvasContextAttributes:
|
|
10038
|
+
maptilerLogo: E,
|
|
10039
|
+
canvasContextAttributes: C,
|
|
10040
10040
|
refreshExpiredTiles: z,
|
|
10041
10041
|
maxBounds: ve,
|
|
10042
|
-
scrollZoom:
|
|
10042
|
+
scrollZoom: Me,
|
|
10043
10043
|
minZoom: Ge,
|
|
10044
10044
|
maxZoom: He,
|
|
10045
10045
|
boxZoom: G,
|
|
10046
10046
|
locale: Pe,
|
|
10047
|
-
fadeDuration:
|
|
10048
|
-
crossSourceCollisions:
|
|
10049
|
-
clickTolerance:
|
|
10050
|
-
bounds:
|
|
10051
|
-
fitBoundsOptions:
|
|
10052
|
-
pixelRatio:
|
|
10053
|
-
validateStyle:
|
|
10047
|
+
fadeDuration: No,
|
|
10048
|
+
crossSourceCollisions: jo,
|
|
10049
|
+
clickTolerance: Do,
|
|
10050
|
+
bounds: Uo,
|
|
10051
|
+
fitBoundsOptions: Bo,
|
|
10052
|
+
pixelRatio: qo,
|
|
10053
|
+
validateStyle: Vo
|
|
10054
10054
|
}), this.addControl(this.minimap, h.position ?? "bottom-left");
|
|
10055
10055
|
} else h === !0 ? (this.minimap = new gr({}, t), this.addControl(this.minimap, "bottom-left")) : h !== void 0 && h !== !1 && (this.minimap = new gr({}, t), this.addControl(this.minimap, h));
|
|
10056
10056
|
});
|
|
@@ -10104,7 +10104,7 @@ let co = class po extends k.Map {
|
|
|
10104
10104
|
});
|
|
10105
10105
|
return;
|
|
10106
10106
|
}
|
|
10107
|
-
if (!
|
|
10107
|
+
if (!co(n)) {
|
|
10108
10108
|
this.setSpace({
|
|
10109
10109
|
color: "transparent"
|
|
10110
10110
|
});
|
|
@@ -10207,7 +10207,7 @@ let co = class po extends k.Map {
|
|
|
10207
10207
|
bearing: this.getBearing(),
|
|
10208
10208
|
pitch: this.getPitch()
|
|
10209
10209
|
};
|
|
10210
|
-
this.remove(), Object.assign(this, new
|
|
10210
|
+
this.remove(), Object.assign(this, new fo({ ...this.options })), this.once("load", () => {
|
|
10211
10211
|
this.jumpTo(t);
|
|
10212
10212
|
});
|
|
10213
10213
|
}
|
|
@@ -10315,9 +10315,9 @@ let co = class po extends k.Map {
|
|
|
10315
10315
|
}
|
|
10316
10316
|
this.setSpaceFromStyle({ style: a.style }), this.setHaloFromStyle({ style: a.style });
|
|
10317
10317
|
}, l = (m) => {
|
|
10318
|
-
var g, S,
|
|
10319
|
-
const y = (m == null ? void 0 : m.target.getStyle()) ?? a.style,
|
|
10320
|
-
this.space ? this.setSpaceFromStyle({ style: y }) : this.initSpace({ before:
|
|
10318
|
+
var g, S, E, C;
|
|
10319
|
+
const y = (m == null ? void 0 : m.target.getStyle()) ?? a.style, w = this.getLayersOrder()[0];
|
|
10320
|
+
this.space ? this.setSpaceFromStyle({ style: y }) : this.initSpace({ before: w, spec: (S = (g = y.metadata) == null ? void 0 : g.maptiler) == null ? void 0 : S.space }), this.halo ? this.setHaloFromStyle({ style: y }) : this.initHalo({ before: w, spec: (C = (E = y.metadata) == null ? void 0 : E.maptiler) == null ? void 0 : C.halo });
|
|
10321
10321
|
};
|
|
10322
10322
|
if (this.styleInProcess && !this.spaceboxLoadingState.styleLoadCallbackSet)
|
|
10323
10323
|
return this.once("style.load", l), this.once("styledata", l), this.spaceboxLoadingState.styleLoadCallbackSet = !0, this;
|
|
@@ -10468,7 +10468,7 @@ let co = class po extends k.Map {
|
|
|
10468
10468
|
return (a = this.minimap) == null || a.setGlyphs(t, n), super.setGlyphs(t, n);
|
|
10469
10469
|
}
|
|
10470
10470
|
getStyleLanguage() {
|
|
10471
|
-
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" ?
|
|
10471
|
+
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" ? Wo(this.style.stylesheet.metadata["maptiler:language"]) : null;
|
|
10472
10472
|
}
|
|
10473
10473
|
/**
|
|
10474
10474
|
* Define the primary language of the map. Note that not all the languages shorthands provided are available.
|
|
@@ -10529,7 +10529,7 @@ let co = class po extends k.Map {
|
|
|
10529
10529
|
]) : o.flag === R.AUTO.flag ? (i = kn().flag, s = ["coalesce", ["get", i], ["get", R.LOCAL.flag]]) : o === R.LOCAL ? (i = R.LOCAL.flag, s = ["get", i]) : (i = o.flag, s = ["coalesce", ["get", i], ["get", R.LOCAL.flag]]);
|
|
10530
10530
|
const { layers: l } = this.getStyle(), u = this.originalLabelStyle.size === 0;
|
|
10531
10531
|
if (u) {
|
|
10532
|
-
const c =
|
|
10532
|
+
const c = bi(l, this);
|
|
10533
10533
|
this.isStyleLocalized = Object.keys(c.localized).length > 0;
|
|
10534
10534
|
}
|
|
10535
10535
|
for (const c of l) {
|
|
@@ -10543,17 +10543,17 @@ let co = class po extends k.Map {
|
|
|
10543
10543
|
continue;
|
|
10544
10544
|
let y;
|
|
10545
10545
|
if (u ? (y = this.getLayoutProperty(h, "text-field"), this.originalLabelStyle.set(h, y)) : y = this.originalLabelStyle.get(h), typeof y == "string") {
|
|
10546
|
-
const { contains:
|
|
10547
|
-
if (!
|
|
10546
|
+
const { contains: w, exactMatch: g } = hi(y, this.isStyleLocalized);
|
|
10547
|
+
if (!w) continue;
|
|
10548
10548
|
if (g)
|
|
10549
10549
|
this.setLayoutProperty(h, "text-field", s);
|
|
10550
10550
|
else {
|
|
10551
|
-
const S =
|
|
10551
|
+
const S = mi(y, s, this.isStyleLocalized);
|
|
10552
10552
|
this.setLayoutProperty(h, "text-field", S);
|
|
10553
10553
|
}
|
|
10554
10554
|
} else {
|
|
10555
|
-
const
|
|
10556
|
-
this.setLayoutProperty(h, "text-field",
|
|
10555
|
+
const w = di(y, s, this.isStyleLocalized);
|
|
10556
|
+
this.setLayoutProperty(h, "text-field", w);
|
|
10557
10557
|
}
|
|
10558
10558
|
}
|
|
10559
10559
|
this.languageIsUpdated = !0;
|
|
@@ -10686,7 +10686,7 @@ let co = class po extends k.Map {
|
|
|
10686
10686
|
}
|
|
10687
10687
|
getCameraHash() {
|
|
10688
10688
|
const t = new Float32Array(5), n = this.getCenter();
|
|
10689
|
-
return t[0] = n.lng, t[1] = n.lat, t[2] = this.getZoom(), t[3] = this.getPitch(), t[4] = this.getBearing(),
|
|
10689
|
+
return t[0] = n.lng, t[1] = n.lat, t[2] = this.getZoom(), t[3] = this.getPitch(), t[4] = this.getBearing(), ei.fromUint8Array(new Uint8Array(t.buffer));
|
|
10690
10690
|
}
|
|
10691
10691
|
/**
|
|
10692
10692
|
* Get the SDK config object.
|
|
@@ -10749,13 +10749,13 @@ let co = class po extends k.Map {
|
|
|
10749
10749
|
};
|
|
10750
10750
|
class ee {
|
|
10751
10751
|
constructor(e, t, n, a = {}) {
|
|
10752
|
-
|
|
10753
|
-
|
|
10754
|
-
|
|
10752
|
+
b(this, "type");
|
|
10753
|
+
b(this, "target");
|
|
10754
|
+
b(this, "originalEvent");
|
|
10755
10755
|
this.type = e, this.target = t, this.originalEvent = n ?? null, Object.assign(this, a);
|
|
10756
10756
|
}
|
|
10757
10757
|
}
|
|
10758
|
-
const
|
|
10758
|
+
const ho = [
|
|
10759
10759
|
// pass nothing other than target (map / viewer) and type
|
|
10760
10760
|
"idle",
|
|
10761
10761
|
"render",
|
|
@@ -10766,10 +10766,10 @@ const fo = [
|
|
|
10766
10766
|
// keeping them for reference
|
|
10767
10767
|
// "content",
|
|
10768
10768
|
// "visibility",
|
|
10769
|
-
],
|
|
10769
|
+
], mo = [
|
|
10770
10770
|
"error"
|
|
10771
10771
|
// ErrorEvent
|
|
10772
|
-
],
|
|
10772
|
+
], yo = ["resize"], go = ["webglcontextlost", "webglcontextrestored"], vo = [
|
|
10773
10773
|
"moveend",
|
|
10774
10774
|
"movestart",
|
|
10775
10775
|
"move",
|
|
@@ -10785,7 +10785,7 @@ const fo = [
|
|
|
10785
10785
|
"boxzoomcancel",
|
|
10786
10786
|
"boxzoomend",
|
|
10787
10787
|
"boxzoomstart"
|
|
10788
|
-
],
|
|
10788
|
+
], bo = ["click", "dblclick", "mousedown", "mouseup", "mousemove", "mouseout", "mouseover", "contextmenu", "touchstart", "touchend", "touchmove", "touchcancel"], wo = ["cooperativegestureprevented"], xo = [
|
|
10789
10789
|
"data",
|
|
10790
10790
|
"dataloading",
|
|
10791
10791
|
"sourcedata",
|
|
@@ -10796,21 +10796,21 @@ const fo = [
|
|
|
10796
10796
|
// keeping it for reference
|
|
10797
10797
|
// "metadata",
|
|
10798
10798
|
], Yu = [
|
|
10799
|
-
...fo,
|
|
10800
10799
|
...ho,
|
|
10801
10800
|
...mo,
|
|
10802
10801
|
...yo,
|
|
10803
10802
|
...go,
|
|
10804
10803
|
...vo,
|
|
10805
|
-
...
|
|
10806
|
-
...
|
|
10804
|
+
...bo,
|
|
10805
|
+
...xo,
|
|
10806
|
+
...wo
|
|
10807
10807
|
], Wu = ["lngLat", "_defaultPrevented"];
|
|
10808
10808
|
function Ju({ map: r, viewer: e, lngLatToPx: t }) {
|
|
10809
10809
|
Yu.forEach((n) => {
|
|
10810
10810
|
try {
|
|
10811
10811
|
r.on(n, (a) => {
|
|
10812
10812
|
const o = n;
|
|
10813
|
-
if (
|
|
10813
|
+
if (bo.includes(o)) {
|
|
10814
10814
|
const f = a, h = f.lngLat && t(f.lngLat), m = {
|
|
10815
10815
|
imageX: h[0],
|
|
10816
10816
|
imageY: h[1],
|
|
@@ -10820,43 +10820,43 @@ function Ju({ map: r, viewer: e, lngLatToPx: t }) {
|
|
|
10820
10820
|
return;
|
|
10821
10821
|
}
|
|
10822
10822
|
const i = n;
|
|
10823
|
-
if (
|
|
10823
|
+
if (vo.includes(i)) {
|
|
10824
10824
|
const f = a;
|
|
10825
10825
|
e.fire(new ee(n, e, f.originalEvent, f));
|
|
10826
10826
|
return;
|
|
10827
10827
|
}
|
|
10828
10828
|
const s = n;
|
|
10829
|
-
if (
|
|
10829
|
+
if (mo.includes(s)) {
|
|
10830
10830
|
const f = a;
|
|
10831
10831
|
e.fire(new ee(n, e, null, f));
|
|
10832
10832
|
return;
|
|
10833
10833
|
}
|
|
10834
10834
|
const l = n;
|
|
10835
|
-
if (
|
|
10835
|
+
if (yo.includes(l)) {
|
|
10836
10836
|
const f = a;
|
|
10837
10837
|
e.fire(new ee(n, e, null, f));
|
|
10838
10838
|
return;
|
|
10839
10839
|
}
|
|
10840
10840
|
const u = n;
|
|
10841
|
-
if (
|
|
10841
|
+
if (go.includes(u)) {
|
|
10842
10842
|
const f = a;
|
|
10843
10843
|
e.fire(new ee(n, e, f.originalEvent, f));
|
|
10844
10844
|
return;
|
|
10845
10845
|
}
|
|
10846
10846
|
const c = n;
|
|
10847
|
-
if (
|
|
10847
|
+
if (xo.includes(c)) {
|
|
10848
10848
|
const f = a;
|
|
10849
10849
|
e.fire(new ee(n, e, null, f));
|
|
10850
10850
|
return;
|
|
10851
10851
|
}
|
|
10852
10852
|
const p = n;
|
|
10853
|
-
if (
|
|
10853
|
+
if (wo.includes(p)) {
|
|
10854
10854
|
const f = a;
|
|
10855
10855
|
e.fire(new ee(n, e, null, f));
|
|
10856
10856
|
return;
|
|
10857
10857
|
}
|
|
10858
10858
|
const d = n;
|
|
10859
|
-
if (
|
|
10859
|
+
if (ho.includes(d)) {
|
|
10860
10860
|
e.fire(new ee(n, e));
|
|
10861
10861
|
return;
|
|
10862
10862
|
}
|
|
@@ -10870,8 +10870,8 @@ class Qu extends Error {
|
|
|
10870
10870
|
constructor(t, n, a) {
|
|
10871
10871
|
const o = `[${a}]: Failed to fetch ${n} at ${t.url}: ${t.status.toString()}: ${t.statusText}`;
|
|
10872
10872
|
super(o);
|
|
10873
|
-
|
|
10874
|
-
|
|
10873
|
+
b(this, "status");
|
|
10874
|
+
b(this, "statusText");
|
|
10875
10875
|
this.name = "FetchError", this.message = o, this.status = t.status, this.statusText = t.statusText;
|
|
10876
10876
|
}
|
|
10877
10877
|
}
|
|
@@ -10885,10 +10885,10 @@ function rc(r) {
|
|
|
10885
10885
|
function nc(r) {
|
|
10886
10886
|
return Math.log(r) / Math.LN2;
|
|
10887
10887
|
}
|
|
10888
|
-
function
|
|
10888
|
+
function So(r, e, t) {
|
|
10889
10889
|
return Math.min(t, Math.max(e, r));
|
|
10890
10890
|
}
|
|
10891
|
-
function
|
|
10891
|
+
function $r(r) {
|
|
10892
10892
|
return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + r * Math.PI / 360))) / 360;
|
|
10893
10893
|
}
|
|
10894
10894
|
function Or(r) {
|
|
@@ -10899,14 +10899,14 @@ function da(r, e, t) {
|
|
|
10899
10899
|
return a === e ? t : a;
|
|
10900
10900
|
}
|
|
10901
10901
|
function ac(r, e) {
|
|
10902
|
-
const t =
|
|
10903
|
-
return new
|
|
10902
|
+
const t = So(e.lat, -85.051129, ec);
|
|
10903
|
+
return new Oo(Or(e.lng) * r, $r(t) * r);
|
|
10904
10904
|
}
|
|
10905
10905
|
function oc(r) {
|
|
10906
10906
|
r.transform.getConstrained = function(e, t) {
|
|
10907
|
-
t =
|
|
10907
|
+
t = So(+t, this.minZoom, this.maxZoom);
|
|
10908
10908
|
const n = {
|
|
10909
|
-
center: new
|
|
10909
|
+
center: new Ac(e.lng, e.lat),
|
|
10910
10910
|
zoom: t
|
|
10911
10911
|
};
|
|
10912
10912
|
let a = this._helper._lngRange;
|
|
@@ -10916,34 +10916,55 @@ function oc(r) {
|
|
|
10916
10916
|
const { x: d, y: f } = this.size, h = 0.5;
|
|
10917
10917
|
if (this._helper._latRange) {
|
|
10918
10918
|
const G = this._helper._latRange;
|
|
10919
|
-
i =
|
|
10919
|
+
i = $r(G[1]) * o, s = $r(G[0]) * o, s - i < h * f && (c = h * f / (s - i));
|
|
10920
10920
|
}
|
|
10921
10921
|
a && (l = da(Or(a[0]) * o, 0, o), u = da(Or(a[1]) * o, 0, o), u < l && (u += o), u - l < h * d && (p = h * d / (u - l)));
|
|
10922
10922
|
const { x: m, y } = ac(o, e);
|
|
10923
|
-
let
|
|
10923
|
+
let w, g;
|
|
10924
10924
|
const S = Math.min(p || 0, c || 0);
|
|
10925
10925
|
if (S)
|
|
10926
10926
|
return n.zoom += nc(S), n;
|
|
10927
|
-
let
|
|
10928
|
-
const z = 1, ve = 1 - (s - i) / f,
|
|
10929
|
-
|
|
10930
|
-
const Ge = 1 -
|
|
10927
|
+
let E = 0, C = 0;
|
|
10928
|
+
const z = 1, ve = 1 - (s - i) / f, Me = 1 - (u - l) / d;
|
|
10929
|
+
E = Math.max(Me, z), C = Math.max(ve, z);
|
|
10930
|
+
const Ge = 1 - E, He = 1 - C;
|
|
10931
10931
|
if (this._helper._latRange) {
|
|
10932
10932
|
const G = He * f / 2;
|
|
10933
10933
|
y - G < i && (g = i + G), y + G > s && (g = s - G);
|
|
10934
10934
|
}
|
|
10935
10935
|
if (a) {
|
|
10936
10936
|
const G = m, Pe = Ge * d / 2;
|
|
10937
|
-
G - Pe < l && (
|
|
10937
|
+
G - Pe < l && (w = l + Pe), G + Pe > u && (w = u - Pe);
|
|
10938
10938
|
}
|
|
10939
|
-
if (
|
|
10940
|
-
const G = new
|
|
10939
|
+
if (w !== void 0 || g !== void 0) {
|
|
10940
|
+
const G = new Oo(w ?? m, g ?? y);
|
|
10941
10941
|
n.center = tc(o, G).wrap();
|
|
10942
10942
|
}
|
|
10943
10943
|
return n;
|
|
10944
10944
|
};
|
|
10945
10945
|
}
|
|
10946
|
-
|
|
10946
|
+
class ic {
|
|
10947
|
+
constructor({ imageViewer: e }) {
|
|
10948
|
+
b(this, "viewer");
|
|
10949
|
+
b(this, "container");
|
|
10950
|
+
b(this, "handleClick", () => {
|
|
10951
|
+
this.viewer.fitImageToViewport({ ease: !0 });
|
|
10952
|
+
});
|
|
10953
|
+
if (!e)
|
|
10954
|
+
throw new Error("ImageViewerFitImageToBoundsControl: an instance of 'ImageViewer' is required");
|
|
10955
|
+
this.viewer = e;
|
|
10956
|
+
}
|
|
10957
|
+
onAdd(e) {
|
|
10958
|
+
const t = document.createElement("button");
|
|
10959
|
+
this.container = document.createElement("div"), this.container.classList.add("maplibregl-ctrl", "maplibregl-ctrl-group"), t.classList.add("maplibregl-ctrl-fit-image-to-bounds");
|
|
10960
|
+
const n = document.createElement("span");
|
|
10961
|
+
return n.classList.add("maplibregl-ctrl-icon"), t.title = "Zoom image to viewport bounds", t.appendChild(n), t.addEventListener("click", this.handleClick), this.container.appendChild(t), this.container;
|
|
10962
|
+
}
|
|
10963
|
+
onRemove() {
|
|
10964
|
+
this.container.remove();
|
|
10965
|
+
}
|
|
10966
|
+
}
|
|
10967
|
+
const sc = k.Evented, lc = {
|
|
10947
10968
|
style: {
|
|
10948
10969
|
version: 8,
|
|
10949
10970
|
sources: {},
|
|
@@ -10954,17 +10975,20 @@ const ic = k.Evented, sc = {
|
|
|
10954
10975
|
pitch: 0,
|
|
10955
10976
|
bearing: 0,
|
|
10956
10977
|
projection: "mercator",
|
|
10957
|
-
projectionControl: !1,
|
|
10958
10978
|
geolocateControl: !1,
|
|
10979
|
+
navigationControl: !1,
|
|
10980
|
+
projectionControl: !1,
|
|
10959
10981
|
hash: !1,
|
|
10960
10982
|
renderWorldCopies: !1,
|
|
10961
10983
|
terrain: !1,
|
|
10962
10984
|
space: !1,
|
|
10963
10985
|
halo: !1
|
|
10964
|
-
},
|
|
10965
|
-
debug: !1
|
|
10986
|
+
}, uc = {
|
|
10987
|
+
debug: !1,
|
|
10988
|
+
fitToBoundsControl: !0,
|
|
10989
|
+
navigationControl: !0
|
|
10966
10990
|
};
|
|
10967
|
-
class
|
|
10991
|
+
class np extends sc {
|
|
10968
10992
|
//#region constructor
|
|
10969
10993
|
/**
|
|
10970
10994
|
* The constructor for the ImageViewer.
|
|
@@ -10978,19 +11002,19 @@ class rp extends ic {
|
|
|
10978
11002
|
*
|
|
10979
11003
|
* @internal
|
|
10980
11004
|
*/
|
|
10981
|
-
|
|
11005
|
+
b(this, "imageUUID");
|
|
10982
11006
|
/**
|
|
10983
11007
|
* Whether to enable debug mode.
|
|
10984
11008
|
*
|
|
10985
11009
|
* @internal
|
|
10986
11010
|
*/
|
|
10987
|
-
|
|
11011
|
+
b(this, "debug");
|
|
10988
11012
|
/**
|
|
10989
11013
|
* The metadata of the image.
|
|
10990
11014
|
*
|
|
10991
11015
|
* @internal
|
|
10992
11016
|
*/
|
|
10993
|
-
|
|
11017
|
+
b(this, "imageMetadata");
|
|
10994
11018
|
/**
|
|
10995
11019
|
* Why not extend the Map class?
|
|
10996
11020
|
* Because ImageViewer technically operates in screen space and not in map space.
|
|
@@ -10998,38 +11022,41 @@ class rp extends ic {
|
|
|
10998
11022
|
* We do not want to have to extend the Map class and give access to
|
|
10999
11023
|
* methods and properties that operate in LngLat space. *
|
|
11000
11024
|
*/
|
|
11001
|
-
|
|
11025
|
+
b(this, "sdk");
|
|
11002
11026
|
/**
|
|
11003
11027
|
* The options for the ImageViewer.
|
|
11004
11028
|
*
|
|
11005
11029
|
* @internal
|
|
11006
11030
|
*/
|
|
11007
|
-
|
|
11031
|
+
b(this, "options");
|
|
11008
11032
|
/**
|
|
11009
11033
|
* The size of the image.
|
|
11010
11034
|
*
|
|
11011
11035
|
* @internal
|
|
11012
11036
|
*/
|
|
11013
|
-
|
|
11037
|
+
b(this, "imageSize");
|
|
11014
11038
|
/**
|
|
11015
11039
|
* The padded size max.
|
|
11016
11040
|
*
|
|
11017
11041
|
* @internal
|
|
11018
11042
|
*/
|
|
11019
|
-
|
|
11043
|
+
b(this, "paddedSizeMax");
|
|
11044
|
+
// this flag is used to determine if the image should be fit to the viewport
|
|
11045
|
+
// when the map is resized
|
|
11046
|
+
b(this, "shouldFitImageToViewport", !0);
|
|
11020
11047
|
if (!t.imageUUID)
|
|
11021
11048
|
throw new Error("[ImageViewer]: `imageUUID` is required");
|
|
11022
11049
|
if (typeof t.container != "string" && !(t.container instanceof HTMLElement))
|
|
11023
11050
|
throw new Error("[ImageViewer]: `container` is required and must be a string or HTMLElement");
|
|
11024
11051
|
this.options = {
|
|
11025
|
-
...
|
|
11052
|
+
...uc,
|
|
11026
11053
|
...t
|
|
11027
11054
|
};
|
|
11028
11055
|
const n = {
|
|
11029
11056
|
...this.options,
|
|
11030
|
-
...
|
|
11057
|
+
...lc
|
|
11031
11058
|
};
|
|
11032
|
-
this.sdk = new
|
|
11059
|
+
delete n.center, this.sdk = new po(n), this.sdk.telemetry.registerViewerType("ImageViewer");
|
|
11033
11060
|
const { imageUUID: a, debug: o } = t;
|
|
11034
11061
|
this.imageUUID = a, this.debug = o ?? !1, this.debug && (this.sdk.showTileBoundaries = this.debug, this.sdk.showPadding = this.debug, this.sdk.showCollisionBoxes = this.debug, this.sdk.repaint = this.debug), this.init();
|
|
11035
11062
|
}
|
|
@@ -11079,18 +11106,46 @@ class rp extends ic {
|
|
|
11079
11106
|
* @returns {Promise<void>}
|
|
11080
11107
|
*/
|
|
11081
11108
|
async init() {
|
|
11082
|
-
var t, n;
|
|
11109
|
+
var t, n, a;
|
|
11083
11110
|
try {
|
|
11084
|
-
await this.fetchImageMetadata(), this.addImageSource(),
|
|
11111
|
+
await this.fetchImageMetadata(), this.addImageSource(), this.options.navigationControl && this.sdk.addControl(
|
|
11112
|
+
new xa({
|
|
11113
|
+
visualizePitch: !1,
|
|
11114
|
+
visualizeRoll: !1
|
|
11115
|
+
})
|
|
11116
|
+
), this.options.fitToBoundsControl && this.sdk.addControl(new ic({ imageViewer: this })), Ju({
|
|
11085
11117
|
map: this.sdk,
|
|
11086
11118
|
viewer: this,
|
|
11087
|
-
lngLatToPx: (
|
|
11119
|
+
lngLatToPx: (u) => this.lngLatToPx(u)
|
|
11088
11120
|
}), oc(this.sdk);
|
|
11089
|
-
const { center:
|
|
11090
|
-
this.setCenter(
|
|
11091
|
-
|
|
11092
|
-
this.
|
|
11093
|
-
|
|
11121
|
+
const { center: o, zoom: i, bearing: s } = this.options, l = o ?? [(((t = this.imageMetadata) == null ? void 0 : t.width) ?? 0) / 2, (((n = this.imageMetadata) == null ? void 0 : n.height) ?? 0) / 2];
|
|
11122
|
+
this.setCenter(l), this.setBearing(s ?? 0), this.options.zoom ? this.setZoom(i ?? ((a = this.imageMetadata) == null ? void 0 : a.maxzoom) ?? 5) : this.fitImageToViewport(), this.sdk.on("wheel", () => {
|
|
11123
|
+
this.shouldFitImageToViewport = !1;
|
|
11124
|
+
}), this.sdk.on("touchstart", () => {
|
|
11125
|
+
this.shouldFitImageToViewport = !1;
|
|
11126
|
+
}), this.sdk.on("drag", () => {
|
|
11127
|
+
this.shouldFitImageToViewport = !1;
|
|
11128
|
+
}), this.sdk.on("resize", () => {
|
|
11129
|
+
var d, f;
|
|
11130
|
+
const u = this.getCenter(), c = ((d = this.imageMetadata) == null ? void 0 : d.width) ?? 0, p = ((f = this.imageMetadata) == null ? void 0 : f.height) ?? 0;
|
|
11131
|
+
this.shouldFitImageToViewport && this.fitImageToViewport(), (u[0] !== c / 2 || u[1] !== p / 2) && this.setCenter(u);
|
|
11132
|
+
}), this.fire("imageviewerinit");
|
|
11133
|
+
} catch (o) {
|
|
11134
|
+
this.fire("imagevieweriniterror", { error: o });
|
|
11135
|
+
}
|
|
11136
|
+
}
|
|
11137
|
+
//#region fitImageToViewport
|
|
11138
|
+
/**
|
|
11139
|
+
* Fits the image to the viewport.
|
|
11140
|
+
*
|
|
11141
|
+
* @param {Object} options - The options for the fit image to viewport.
|
|
11142
|
+
* @param {boolean} options.ease - Whether to ease to the viewport bounds.
|
|
11143
|
+
*/
|
|
11144
|
+
fitImageToViewport({ ease: t = !1 } = {}) {
|
|
11145
|
+
if (!this.imageMetadata)
|
|
11146
|
+
throw new Error("[ImageViewer]: Image metadata not found");
|
|
11147
|
+
const n = this.pxToLngLat([0, 0]), a = this.pxToLngLat([this.imageMetadata.width ?? 0, this.imageMetadata.height ?? 0]), o = this.sdk.cameraForBounds([n, a], { padding: 50 });
|
|
11148
|
+
o && (t ? this.sdk.easeTo({ ...o, pitch: 0 }, null) : this.sdk.jumpTo({ ...o, pitch: 0 }, null)), this.shouldFitImageToViewport = !0;
|
|
11094
11149
|
}
|
|
11095
11150
|
//#region fetchImageMetadata
|
|
11096
11151
|
/**
|
|
@@ -11100,7 +11155,7 @@ class rp extends ic {
|
|
|
11100
11155
|
* @returns {Promise<void>}
|
|
11101
11156
|
*/
|
|
11102
11157
|
async fetchImageMetadata() {
|
|
11103
|
-
const t =
|
|
11158
|
+
const t = cc(this.imageUUID), n = await fetch(t);
|
|
11104
11159
|
if (!n.ok)
|
|
11105
11160
|
throw new Qu(n, "image metadata", "ImageViewer");
|
|
11106
11161
|
const a = await n.json();
|
|
@@ -11116,7 +11171,7 @@ class rp extends ic {
|
|
|
11116
11171
|
addImageSource() {
|
|
11117
11172
|
if (!this.imageMetadata)
|
|
11118
11173
|
throw this.fire("error", new ee("error", this, null, { error: new Error("[ImageViewer]: Image metadata not found") })), new Error("[ImageViewer]: Image metadata not found");
|
|
11119
|
-
const t =
|
|
11174
|
+
const t = pc(this.imageUUID), n = (s) => Math.pow(2, Math.ceil(Math.log(s) / Math.LN2));
|
|
11120
11175
|
this.imageSize = [this.imageMetadata.width, this.imageMetadata.height], this.paddedSizeMax = Math.max(n(this.imageSize[0]), n(this.imageSize[1]));
|
|
11121
11176
|
const a = this.pxToLngLat([0, 0]), o = this.pxToLngLat(this.imageSize), i = [a.lng, o.lat, o.lng, a.lat];
|
|
11122
11177
|
this.sdk.addSource("image", {
|
|
@@ -11399,13 +11454,13 @@ class rp extends ic {
|
|
|
11399
11454
|
this.sdk.panTo(this.pxToLngLat(t), { ...n, pitch: 0 }, a);
|
|
11400
11455
|
}
|
|
11401
11456
|
}
|
|
11402
|
-
function uc(r) {
|
|
11403
|
-
return `${So()}/${r}/image.json?key=${N.apiKey}`;
|
|
11404
|
-
}
|
|
11405
11457
|
function cc(r) {
|
|
11406
|
-
return `${
|
|
11458
|
+
return `${ko()}/${r}/image.json?key=${N.apiKey}`;
|
|
11407
11459
|
}
|
|
11408
|
-
function
|
|
11460
|
+
function pc(r) {
|
|
11461
|
+
return `${ko()}/${r}/{z}/{x}/{y}?key=${N.apiKey}`;
|
|
11462
|
+
}
|
|
11463
|
+
function ko() {
|
|
11409
11464
|
return "https://api.maptiler.com/images";
|
|
11410
11465
|
}
|
|
11411
11466
|
function yn(r) {
|
|
@@ -11417,7 +11472,7 @@ function yn(r) {
|
|
|
11417
11472
|
}
|
|
11418
11473
|
throw new Error("No XML parser found");
|
|
11419
11474
|
}
|
|
11420
|
-
function
|
|
11475
|
+
function Lo(r, e) {
|
|
11421
11476
|
if (!r.hasChildNodes())
|
|
11422
11477
|
return !1;
|
|
11423
11478
|
for (const t of Array.from(r.childNodes)) {
|
|
@@ -11432,29 +11487,29 @@ function ha(r) {
|
|
|
11432
11487
|
return new XMLSerializer().serializeToString(r);
|
|
11433
11488
|
throw new Error("No XML serializer found");
|
|
11434
11489
|
}
|
|
11435
|
-
function
|
|
11490
|
+
function Co(r) {
|
|
11436
11491
|
const e = typeof r == "string" ? yn(r) : r;
|
|
11437
|
-
if (!
|
|
11492
|
+
if (!Lo(e, "gpx"))
|
|
11438
11493
|
throw new Error("The XML document is not valid GPX");
|
|
11439
11494
|
const t = V(e, "trk"), n = V(e, "rte"), a = V(e, "wpt"), o = {
|
|
11440
11495
|
type: "FeatureCollection",
|
|
11441
11496
|
features: []
|
|
11442
11497
|
};
|
|
11443
11498
|
for (const i of Array.from(t)) {
|
|
11444
|
-
const s =
|
|
11499
|
+
const s = mc(i);
|
|
11445
11500
|
s && o.features.push(s);
|
|
11446
11501
|
}
|
|
11447
11502
|
for (const i of Array.from(n)) {
|
|
11448
|
-
const s =
|
|
11503
|
+
const s = yc(i);
|
|
11449
11504
|
s && o.features.push(s);
|
|
11450
11505
|
}
|
|
11451
11506
|
for (const i of Array.from(a))
|
|
11452
|
-
o.features.push(
|
|
11507
|
+
o.features.push(gc(i));
|
|
11453
11508
|
return o;
|
|
11454
11509
|
}
|
|
11455
11510
|
function Eo(r, e) {
|
|
11456
11511
|
let t = r;
|
|
11457
|
-
if (typeof t == "string" && (t = yn(t)), !
|
|
11512
|
+
if (typeof t == "string" && (t = yn(t)), !Lo(t, "kml"))
|
|
11458
11513
|
throw new Error("The XML document is not valid KML");
|
|
11459
11514
|
const n = {
|
|
11460
11515
|
type: "FeatureCollection",
|
|
@@ -11472,7 +11527,7 @@ function Eo(r, e) {
|
|
|
11472
11527
|
i[`#${Be(c, "id")}`] = d;
|
|
11473
11528
|
}
|
|
11474
11529
|
for (const c of Array.from(s))
|
|
11475
|
-
n.features = n.features.concat(
|
|
11530
|
+
n.features = n.features.concat(hc(c, a, o, i));
|
|
11476
11531
|
return n;
|
|
11477
11532
|
}
|
|
11478
11533
|
function ma(r) {
|
|
@@ -11480,15 +11535,15 @@ function ma(r) {
|
|
|
11480
11535
|
let e = "", t = 1, n = r;
|
|
11481
11536
|
return n.startsWith("#") && (n = n.substring(1)), (n.length === 6 || n.length === 3) && (e = n), n.length === 8 && (t = Number.parseInt(n.substring(0, 2), 16) / 255, e = `#${n.substring(6, 8)}${n.substring(4, 6)}${n.substring(2, 4)}`), [e ?? "#000000", t ?? 1];
|
|
11482
11537
|
}
|
|
11483
|
-
function pc(r) {
|
|
11484
|
-
return Ao(r.split(" "));
|
|
11485
|
-
}
|
|
11486
11538
|
function fc(r) {
|
|
11539
|
+
return _o(r.split(" "));
|
|
11540
|
+
}
|
|
11541
|
+
function dc(r) {
|
|
11487
11542
|
let e = V(r, "coord");
|
|
11488
11543
|
const t = [], n = [];
|
|
11489
11544
|
e.length === 0 && (e = V(r, "gx:coord"));
|
|
11490
11545
|
for (const o of Array.from(e))
|
|
11491
|
-
t.push(
|
|
11546
|
+
t.push(fc(O(o) ?? ""));
|
|
11492
11547
|
const a = V(r, "when");
|
|
11493
11548
|
for (const o of Array.from(a)) n.push(O(o));
|
|
11494
11549
|
return {
|
|
@@ -11496,23 +11551,23 @@ function fc(r) {
|
|
|
11496
11551
|
times: n
|
|
11497
11552
|
};
|
|
11498
11553
|
}
|
|
11499
|
-
function
|
|
11554
|
+
function Mt(r) {
|
|
11500
11555
|
const e = ["Polygon", "LineString", "Point", "Track", "gx:Track"];
|
|
11501
11556
|
let t, n, a, o, i;
|
|
11502
11557
|
const s = [], l = [];
|
|
11503
11558
|
if (T(r, "MultiGeometry") !== null)
|
|
11504
|
-
return
|
|
11559
|
+
return Mt(T(r, "MultiGeometry"));
|
|
11505
11560
|
if (T(r, "MultiTrack") !== null)
|
|
11506
|
-
return
|
|
11561
|
+
return Mt(T(r, "MultiTrack"));
|
|
11507
11562
|
if (T(r, "gx:MultiTrack") !== null)
|
|
11508
|
-
return
|
|
11563
|
+
return Mt(T(r, "gx:MultiTrack"));
|
|
11509
11564
|
for (a = 0; a < e.length; a++)
|
|
11510
11565
|
if (n = V(r, e[a]), n) {
|
|
11511
11566
|
for (o = 0; o < n.length; o++)
|
|
11512
11567
|
if (t = n[o], e[a] === "Point")
|
|
11513
11568
|
s.push({
|
|
11514
11569
|
type: "Point",
|
|
11515
|
-
coordinates:
|
|
11570
|
+
coordinates: Io(O(T(t, "coordinates")) ?? "")
|
|
11516
11571
|
});
|
|
11517
11572
|
else if (e[a] === "LineString")
|
|
11518
11573
|
s.push({
|
|
@@ -11528,7 +11583,7 @@ function It(r) {
|
|
|
11528
11583
|
coordinates: c
|
|
11529
11584
|
});
|
|
11530
11585
|
} else if (e[a] === "Track" || e[a] === "gx:Track") {
|
|
11531
|
-
const u =
|
|
11586
|
+
const u = dc(t);
|
|
11532
11587
|
s.push({
|
|
11533
11588
|
type: "LineString",
|
|
11534
11589
|
coordinates: u.coords
|
|
@@ -11537,8 +11592,8 @@ function It(r) {
|
|
|
11537
11592
|
}
|
|
11538
11593
|
return { geoms: s, coordTimes: l };
|
|
11539
11594
|
}
|
|
11540
|
-
function
|
|
11541
|
-
const a =
|
|
11595
|
+
function hc(r, e, t, n) {
|
|
11596
|
+
const a = Mt(r), o = {}, i = O(T(r, "name")), s = O(T(r, "address")), l = O(T(r, "description")), u = T(r, "TimeSpan"), c = T(r, "TimeStamp"), p = T(r, "ExtendedData"), d = T(r, "visibility");
|
|
11542
11597
|
let f, h = O(T(r, "styleUrl")), m = T(r, "LineStyle"), y = T(r, "PolyStyle");
|
|
11543
11598
|
if (!a.geoms.length) return [];
|
|
11544
11599
|
if (i && (o.name = i), s && (o.address = s), h) {
|
|
@@ -11548,10 +11603,10 @@ function dc(r, e, t, n) {
|
|
|
11548
11603
|
m || (m = T(g, "LineStyle")), y || (y = T(g, "PolyStyle"));
|
|
11549
11604
|
const S = T(g, "IconStyle");
|
|
11550
11605
|
if (S) {
|
|
11551
|
-
const
|
|
11552
|
-
if (
|
|
11553
|
-
const
|
|
11554
|
-
|
|
11606
|
+
const E = T(S, "Icon");
|
|
11607
|
+
if (E) {
|
|
11608
|
+
const C = O(T(E, "href"));
|
|
11609
|
+
C && (o.icon = C);
|
|
11555
11610
|
}
|
|
11556
11611
|
}
|
|
11557
11612
|
}
|
|
@@ -11561,12 +11616,12 @@ function dc(r, e, t, n) {
|
|
|
11561
11616
|
g && S && (o.timespan = { begin: g, end: S });
|
|
11562
11617
|
}
|
|
11563
11618
|
if (c !== null && (o.timestamp = O(T(c, "when")) ?? (/* @__PURE__ */ new Date()).toISOString()), m !== null) {
|
|
11564
|
-
const g = ma(O(T(m, "color"))), S = g[0],
|
|
11565
|
-
S && (o.stroke = S), Number.isNaN(
|
|
11619
|
+
const g = ma(O(T(m, "color"))), S = g[0], E = g[1], C = Number.parseFloat(O(T(m, "width")) ?? "");
|
|
11620
|
+
S && (o.stroke = S), Number.isNaN(E) || (o["stroke-opacity"] = E), Number.isNaN(C) || (o["stroke-width"] = C);
|
|
11566
11621
|
}
|
|
11567
11622
|
if (y) {
|
|
11568
|
-
const g = ma(O(T(y, "color"))), S = g[0],
|
|
11569
|
-
S && (o.fill = S), Number.isNaN(
|
|
11623
|
+
const g = ma(O(T(y, "color"))), S = g[0], E = g[1], C = O(T(y, "fill")), z = O(T(y, "outline"));
|
|
11624
|
+
S && (o.fill = S), Number.isNaN(E) || (o["fill-opacity"] = E), C && (o["fill-opacity"] = C === "1" ? o["fill-opacity"] || 1 : 0), z && (o["stroke-opacity"] = z === "1" ? o["stroke-opacity"] || 1 : 0);
|
|
11570
11625
|
}
|
|
11571
11626
|
if (p) {
|
|
11572
11627
|
const g = V(p, "Data"), S = V(p, "SimpleData");
|
|
@@ -11576,7 +11631,7 @@ function dc(r, e, t, n) {
|
|
|
11576
11631
|
o[S[f].getAttribute("name") ?? ""] = O(S[f]) ?? "";
|
|
11577
11632
|
}
|
|
11578
11633
|
d !== null && (o.visibility = O(d) ?? ""), a.coordTimes.length !== 0 && (o.coordTimes = a.coordTimes.length === 1 ? a.coordTimes[0] : a.coordTimes);
|
|
11579
|
-
const
|
|
11634
|
+
const w = {
|
|
11580
11635
|
type: "Feature",
|
|
11581
11636
|
geometry: a.geoms.length === 1 ? a.geoms[0] : {
|
|
11582
11637
|
type: "GeometryCollection",
|
|
@@ -11584,9 +11639,9 @@ function dc(r, e, t, n) {
|
|
|
11584
11639
|
},
|
|
11585
11640
|
properties: o
|
|
11586
11641
|
};
|
|
11587
|
-
return Be(r, "id") && (
|
|
11642
|
+
return Be(r, "id") && (w.id = Be(r, "id") ?? void 0), [w];
|
|
11588
11643
|
}
|
|
11589
|
-
function
|
|
11644
|
+
function To(r, e) {
|
|
11590
11645
|
const t = V(r, e), n = [], a = [];
|
|
11591
11646
|
let o = [];
|
|
11592
11647
|
const i = t.length;
|
|
@@ -11602,11 +11657,11 @@ function Co(r, e) {
|
|
|
11602
11657
|
};
|
|
11603
11658
|
}
|
|
11604
11659
|
}
|
|
11605
|
-
function
|
|
11660
|
+
function mc(r) {
|
|
11606
11661
|
const e = V(r, "trkseg"), t = [], n = [], a = [];
|
|
11607
11662
|
let o;
|
|
11608
11663
|
for (let s = 0; s < e.length; s++)
|
|
11609
|
-
if (o =
|
|
11664
|
+
if (o = To(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)) {
|
|
11610
11665
|
if (!a.length)
|
|
11611
11666
|
for (let l = 0; l < s; l++)
|
|
11612
11667
|
a.push(new Array(t[l].length).fill(null));
|
|
@@ -11615,7 +11670,7 @@ function hc(r) {
|
|
|
11615
11670
|
if (t.length === 0) return;
|
|
11616
11671
|
const i = {
|
|
11617
11672
|
...gn(r),
|
|
11618
|
-
...
|
|
11673
|
+
...Ao(T(r, "extensions"))
|
|
11619
11674
|
};
|
|
11620
11675
|
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 ? {
|
|
11621
11676
|
type: "Feature",
|
|
@@ -11633,13 +11688,13 @@ function hc(r) {
|
|
|
11633
11688
|
}
|
|
11634
11689
|
};
|
|
11635
11690
|
}
|
|
11636
|
-
function
|
|
11637
|
-
const e =
|
|
11691
|
+
function yc(r) {
|
|
11692
|
+
const e = To(r, "rtept");
|
|
11638
11693
|
return e === void 0 ? void 0 : {
|
|
11639
11694
|
type: "Feature",
|
|
11640
11695
|
properties: {
|
|
11641
11696
|
...gn(r),
|
|
11642
|
-
...
|
|
11697
|
+
...Ao(T(r, "extensions"))
|
|
11643
11698
|
},
|
|
11644
11699
|
geometry: {
|
|
11645
11700
|
type: "LineString",
|
|
@@ -11647,7 +11702,7 @@ function mc(r) {
|
|
|
11647
11702
|
}
|
|
11648
11703
|
};
|
|
11649
11704
|
}
|
|
11650
|
-
function
|
|
11705
|
+
function gc(r) {
|
|
11651
11706
|
return {
|
|
11652
11707
|
type: "Feature",
|
|
11653
11708
|
properties: { ...gn(r), ...Nr(r, ["sym"]) },
|
|
@@ -11657,7 +11712,7 @@ function yc(r) {
|
|
|
11657
11712
|
}
|
|
11658
11713
|
};
|
|
11659
11714
|
}
|
|
11660
|
-
function
|
|
11715
|
+
function Ao(r) {
|
|
11661
11716
|
const e = {};
|
|
11662
11717
|
if (r) {
|
|
11663
11718
|
const t = T(r, "line");
|
|
@@ -11702,14 +11757,14 @@ function T(r, e) {
|
|
|
11702
11757
|
const t = V(r, e);
|
|
11703
11758
|
return t.length ? t[0] : null;
|
|
11704
11759
|
}
|
|
11705
|
-
function
|
|
11760
|
+
function vc(r) {
|
|
11706
11761
|
return r.normalize && r.normalize(), r;
|
|
11707
11762
|
}
|
|
11708
|
-
function
|
|
11763
|
+
function _o(r) {
|
|
11709
11764
|
return r.map(Number.parseFloat).map((e) => Number.isNaN(e) ? null : e);
|
|
11710
11765
|
}
|
|
11711
11766
|
function O(r) {
|
|
11712
|
-
return r &&
|
|
11767
|
+
return r && vc(r), r && r.textContent;
|
|
11713
11768
|
}
|
|
11714
11769
|
function Nr(r, e) {
|
|
11715
11770
|
const t = {};
|
|
@@ -11718,12 +11773,12 @@ function Nr(r, e) {
|
|
|
11718
11773
|
n = T(r, e[a]), n && (t[e[a]] = O(n) ?? "");
|
|
11719
11774
|
return t;
|
|
11720
11775
|
}
|
|
11721
|
-
function
|
|
11722
|
-
return
|
|
11776
|
+
function Io(r) {
|
|
11777
|
+
return _o(r.replace(/\s*/g, "").split(","));
|
|
11723
11778
|
}
|
|
11724
11779
|
function va(r) {
|
|
11725
11780
|
const e = r.replace(/^\s*|\s*$/g, "").split(/\s+/), t = [];
|
|
11726
|
-
for (const n of e) t.push(
|
|
11781
|
+
for (const n of e) t.push(Io(n));
|
|
11727
11782
|
return t;
|
|
11728
11783
|
}
|
|
11729
11784
|
function Mo(r) {
|
|
@@ -11735,7 +11790,7 @@ function Mo(r) {
|
|
|
11735
11790
|
heartRate: n !== null ? Number.parseFloat(O(n) ?? "0") : null
|
|
11736
11791
|
};
|
|
11737
11792
|
}
|
|
11738
|
-
function
|
|
11793
|
+
function bc(r) {
|
|
11739
11794
|
let e = r;
|
|
11740
11795
|
try {
|
|
11741
11796
|
typeof e == "string" && (e = yn(e));
|
|
@@ -11743,7 +11798,7 @@ function vc(r) {
|
|
|
11743
11798
|
return null;
|
|
11744
11799
|
}
|
|
11745
11800
|
try {
|
|
11746
|
-
return
|
|
11801
|
+
return Co(e);
|
|
11747
11802
|
} catch {
|
|
11748
11803
|
}
|
|
11749
11804
|
try {
|
|
@@ -11752,8 +11807,8 @@ function vc(r) {
|
|
|
11752
11807
|
}
|
|
11753
11808
|
return null;
|
|
11754
11809
|
}
|
|
11755
|
-
async function
|
|
11756
|
-
const t = e.download ?? !1, n = await
|
|
11810
|
+
async function wc(r, e = {}) {
|
|
11811
|
+
const t = e.download ?? !1, n = await xc(r);
|
|
11757
11812
|
if (t) {
|
|
11758
11813
|
const a = e.filename ?? "maptiler_screenshot.png", o = document.createElement("a");
|
|
11759
11814
|
o.style.display = "none", document.body.appendChild(o), o.href = URL.createObjectURL(n), o.download = a, o.click(), setTimeout(() => {
|
|
@@ -11762,7 +11817,7 @@ async function bc(r, e = {}) {
|
|
|
11762
11817
|
}
|
|
11763
11818
|
return n;
|
|
11764
11819
|
}
|
|
11765
|
-
function
|
|
11820
|
+
function xc(r) {
|
|
11766
11821
|
return new Promise((e, t) => {
|
|
11767
11822
|
r.redraw(), r.once("idle", () => {
|
|
11768
11823
|
r.getCanvas().toBlob((n) => {
|
|
@@ -11819,10 +11874,10 @@ function Dr(r, e) {
|
|
|
11819
11874
|
function _e(r) {
|
|
11820
11875
|
return ["interpolate", ["linear"], ["zoom"], ...r.flatMap((e) => [e.zoom, e.value])];
|
|
11821
11876
|
}
|
|
11822
|
-
function
|
|
11877
|
+
function F(r) {
|
|
11823
11878
|
return ["interpolate", ["linear"], ["zoom"], ...r.flatMap((e) => [e.zoom, e.value])];
|
|
11824
11879
|
}
|
|
11825
|
-
function
|
|
11880
|
+
function Po(r, e) {
|
|
11826
11881
|
if (typeof e == "number" && typeof r == "number")
|
|
11827
11882
|
return 2 * e + r;
|
|
11828
11883
|
if (typeof e == "number" && Array.isArray(r))
|
|
@@ -11835,7 +11890,7 @@ function Io(r, e) {
|
|
|
11835
11890
|
}
|
|
11836
11891
|
return 0;
|
|
11837
11892
|
}
|
|
11838
|
-
function
|
|
11893
|
+
function Ro(r, e) {
|
|
11839
11894
|
return ["interpolate", ["linear"], ["get", e], ...r.flatMap((t) => [t.propertyValue, t.value])];
|
|
11840
11895
|
}
|
|
11841
11896
|
function vn(r) {
|
|
@@ -11871,7 +11926,7 @@ function Br(r, e, t = !0) {
|
|
|
11871
11926
|
["interpolate", ["linear"], ["get", e], ...r.flatMap((n) => [n.value, n.pointRadius])]
|
|
11872
11927
|
] : ["interpolate", ["linear"], ["get", e], ...r.flatMap((n) => [n.value, n.pointRadius])];
|
|
11873
11928
|
}
|
|
11874
|
-
function
|
|
11929
|
+
function zo(r, e, t = !0) {
|
|
11875
11930
|
return t ? [
|
|
11876
11931
|
"interpolate",
|
|
11877
11932
|
["linear"],
|
|
@@ -11899,7 +11954,7 @@ function qr(r, e) {
|
|
|
11899
11954
|
})
|
|
11900
11955
|
];
|
|
11901
11956
|
}
|
|
11902
|
-
function
|
|
11957
|
+
function Fo(r, e = 10) {
|
|
11903
11958
|
return [
|
|
11904
11959
|
"interpolate",
|
|
11905
11960
|
["linear"],
|
|
@@ -11914,14 +11969,14 @@ function Tt(r) {
|
|
|
11914
11969
|
const e = r.toString(16);
|
|
11915
11970
|
return e.length === 1 ? `0${e}` : e;
|
|
11916
11971
|
}
|
|
11917
|
-
function
|
|
11972
|
+
function Sc(r) {
|
|
11918
11973
|
return `#${Tt(r[0])}${Tt(r[1])}${Tt(r[2])}${r.length === 4 ? Tt(r[3]) : ""}`;
|
|
11919
11974
|
}
|
|
11920
11975
|
class L extends Array {
|
|
11921
11976
|
constructor(t = {}) {
|
|
11922
11977
|
super();
|
|
11923
|
-
|
|
11924
|
-
|
|
11978
|
+
b(this, "min", 0);
|
|
11979
|
+
b(this, "max", 1);
|
|
11925
11980
|
"min" in t && (this.min = t.min), "max" in t && (this.max = t.max), "stops" in t && this.setStops(t.stops, { clone: !1 });
|
|
11926
11981
|
}
|
|
11927
11982
|
/**
|
|
@@ -12008,7 +12063,7 @@ class L extends Array {
|
|
|
12008
12063
|
smooth: !0,
|
|
12009
12064
|
withAlpha: !1
|
|
12010
12065
|
}) {
|
|
12011
|
-
return
|
|
12066
|
+
return Sc(this.getColor(t, n));
|
|
12012
12067
|
}
|
|
12013
12068
|
/**
|
|
12014
12069
|
* Get the color of the color ramp at a relative position in [0, 1]
|
|
@@ -12851,7 +12906,7 @@ const $o = {
|
|
|
12851
12906
|
]
|
|
12852
12907
|
})
|
|
12853
12908
|
};
|
|
12854
|
-
async function
|
|
12909
|
+
async function kc(r, e, t = {}) {
|
|
12855
12910
|
var a, o;
|
|
12856
12911
|
if (!e.sourceId && !e.data)
|
|
12857
12912
|
throw new Error("Creating a polyline layer requires an existing .sourceId or a valid .data property");
|
|
@@ -12861,23 +12916,23 @@ async function Sc(r, e, t = {}) {
|
|
|
12861
12916
|
n = `https://api.maptiler.com/data/${e.data}/features.json?key=${N.apiKey}`;
|
|
12862
12917
|
else if (((a = n.split(".").pop()) == null ? void 0 : a.toLowerCase().trim()) === "gpx") {
|
|
12863
12918
|
const s = await (await fetch(n, t)).text();
|
|
12864
|
-
n =
|
|
12919
|
+
n = Co(s);
|
|
12865
12920
|
} else if (((o = n.split(".").pop()) == null ? void 0 : o.toLowerCase().trim()) === "kml") {
|
|
12866
12921
|
const s = await (await fetch(n, t)).text();
|
|
12867
12922
|
n = Eo(s);
|
|
12868
12923
|
} else {
|
|
12869
|
-
const i =
|
|
12924
|
+
const i = ci(n) ?? bc(n);
|
|
12870
12925
|
i && (n = i);
|
|
12871
12926
|
}
|
|
12872
12927
|
if (!n)
|
|
12873
12928
|
throw new Error("Polyline data was provided as string but is incompatible with valid formats.");
|
|
12874
12929
|
}
|
|
12875
|
-
return
|
|
12930
|
+
return Lc(r, {
|
|
12876
12931
|
...e,
|
|
12877
12932
|
data: n
|
|
12878
12933
|
});
|
|
12879
12934
|
}
|
|
12880
|
-
function
|
|
12935
|
+
function Lc(r, e) {
|
|
12881
12936
|
if (e.layerId && r.getLayer(e.layerId))
|
|
12882
12937
|
throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
|
|
12883
12938
|
const t = e.sourceId ?? xt(), n = e.layerId ?? St(), a = {
|
|
@@ -12906,10 +12961,10 @@ function kc(r, e) {
|
|
|
12906
12961
|
minzoom: e.minzoom ?? 0,
|
|
12907
12962
|
maxzoom: e.maxzoom ?? 23,
|
|
12908
12963
|
paint: {
|
|
12909
|
-
"line-opacity": typeof f == "number" ? f :
|
|
12964
|
+
"line-opacity": typeof f == "number" ? f : F(f),
|
|
12910
12965
|
"line-color": typeof d == "string" ? d : _e(d),
|
|
12911
|
-
"line-width":
|
|
12912
|
-
"line-blur": typeof h == "number" ? h :
|
|
12966
|
+
"line-width": Po(o, p),
|
|
12967
|
+
"line-blur": typeof h == "number" ? h : F(h)
|
|
12913
12968
|
}
|
|
12914
12969
|
},
|
|
12915
12970
|
e.beforeId
|
|
@@ -12927,11 +12982,11 @@ function kc(r, e) {
|
|
|
12927
12982
|
minzoom: e.minzoom ?? 0,
|
|
12928
12983
|
maxzoom: e.maxzoom ?? 23,
|
|
12929
12984
|
paint: {
|
|
12930
|
-
"line-opacity": typeof s == "number" ? s :
|
|
12985
|
+
"line-opacity": typeof s == "number" ? s : F(s),
|
|
12931
12986
|
"line-color": typeof i == "string" ? i : _e(i),
|
|
12932
|
-
"line-width": typeof o == "number" ? o :
|
|
12933
|
-
"line-blur": typeof l == "number" ? l :
|
|
12934
|
-
"line-gap-width": typeof u == "number" ? u :
|
|
12987
|
+
"line-width": typeof o == "number" ? o : F(o),
|
|
12988
|
+
"line-blur": typeof l == "number" ? l : F(l),
|
|
12989
|
+
"line-gap-width": typeof u == "number" ? u : F(u),
|
|
12935
12990
|
// For some reasons passing "line-dasharray" with the value "undefined"
|
|
12936
12991
|
// results in no showing the line while it should have the same behavior
|
|
12937
12992
|
// of not adding the property "line-dasharray" as all.
|
|
@@ -12943,7 +12998,7 @@ function kc(r, e) {
|
|
|
12943
12998
|
e.beforeId
|
|
12944
12999
|
), a;
|
|
12945
13000
|
}
|
|
12946
|
-
function
|
|
13001
|
+
function Cc(r, e) {
|
|
12947
13002
|
if (e.layerId && r.getLayer(e.layerId))
|
|
12948
13003
|
throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
|
|
12949
13004
|
const t = e.sourceId ?? xt(), n = e.layerId ?? St(), a = {
|
|
@@ -12971,7 +13026,7 @@ function Lc(r, e) {
|
|
|
12971
13026
|
maxzoom: e.maxzoom ?? 23,
|
|
12972
13027
|
paint: {
|
|
12973
13028
|
"fill-color": typeof c == "string" ? c : _e(c),
|
|
12974
|
-
"fill-opacity": typeof p == "number" ? p :
|
|
13029
|
+
"fill-opacity": typeof p == "number" ? p : F(p),
|
|
12975
13030
|
// Adding a pattern if provided
|
|
12976
13031
|
...m && { "fill-pattern": m }
|
|
12977
13032
|
}
|
|
@@ -12979,15 +13034,15 @@ function Lc(r, e) {
|
|
|
12979
13034
|
e.beforeId
|
|
12980
13035
|
), e.outline === !0) {
|
|
12981
13036
|
let y;
|
|
12982
|
-
d === "inside" ? typeof i == "number" ? y = 0.5 * i : y =
|
|
12983
|
-
i.map(({ zoom:
|
|
12984
|
-
zoom:
|
|
13037
|
+
d === "inside" ? typeof i == "number" ? y = 0.5 * i : y = F(
|
|
13038
|
+
i.map(({ zoom: w, value: g }) => ({
|
|
13039
|
+
zoom: w,
|
|
12985
13040
|
value: 0.5 * g
|
|
12986
13041
|
}))
|
|
12987
|
-
) : d === "outside" ? typeof i == "number" ? y = -0.5 * i : y =
|
|
12988
|
-
i.map((
|
|
12989
|
-
zoom:
|
|
12990
|
-
value: -0.5 *
|
|
13042
|
+
) : d === "outside" ? typeof i == "number" ? y = -0.5 * i : y = F(
|
|
13043
|
+
i.map((w) => ({
|
|
13044
|
+
zoom: w.zoom,
|
|
13045
|
+
value: -0.5 * w.value
|
|
12991
13046
|
}))
|
|
12992
13047
|
) : y = 0, r.addLayer(
|
|
12993
13048
|
{
|
|
@@ -13001,10 +13056,10 @@ function Lc(r, e) {
|
|
|
13001
13056
|
minzoom: e.minzoom ?? 0,
|
|
13002
13057
|
maxzoom: e.maxzoom ?? 23,
|
|
13003
13058
|
paint: {
|
|
13004
|
-
"line-opacity": typeof l == "number" ? l :
|
|
13059
|
+
"line-opacity": typeof l == "number" ? l : F(l),
|
|
13005
13060
|
"line-color": typeof s == "string" ? s : _e(s),
|
|
13006
|
-
"line-width": typeof i == "number" ? i :
|
|
13007
|
-
"line-blur": typeof u == "number" ? u :
|
|
13061
|
+
"line-width": typeof i == "number" ? i : F(i),
|
|
13062
|
+
"line-blur": typeof u == "number" ? u : F(u),
|
|
13008
13063
|
"line-offset": y,
|
|
13009
13064
|
// For some reasons passing "line-dasharray" with the value "undefined"
|
|
13010
13065
|
// results in no showing the line while it should have the same behavior
|
|
@@ -13031,54 +13086,54 @@ function Ec(r, e) {
|
|
|
13031
13086
|
throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
|
|
13032
13087
|
const t = e.minPointRadius ?? 10, n = e.maxPointRadius ?? 50, a = e.cluster ?? !1, o = 20, i = Array.isArray(e.pointColor) ? e.pointColor : $o.TURBO.scale(10, e.cluster ? 1e4 : 1e3).resample("ease-out-square"), s = i.getBounds(), l = e.sourceId ?? xt(), u = e.layerId ?? St(), c = e.showLabel ?? a, p = e.alignOnViewport ?? !0, d = e.outline ?? !1, f = e.outlineOpacity ?? 1, h = e.outlineWidth ?? 1, m = e.outlineColor ?? "#FFFFFF";
|
|
13033
13088
|
let y;
|
|
13034
|
-
const
|
|
13035
|
-
typeof e.pointOpacity == "number" ? y = e.pointOpacity : Array.isArray(e.pointOpacity) ? y =
|
|
13089
|
+
const w = e.zoomCompensation ?? !0, g = e.minzoom ?? 0, S = e.maxzoom ?? 23;
|
|
13090
|
+
typeof e.pointOpacity == "number" ? y = e.pointOpacity : Array.isArray(e.pointOpacity) ? y = F(e.pointOpacity) : e.cluster ? y = qr(i, "point_count") : e.property ? y = qr(i, e.property) : y = F([
|
|
13036
13091
|
{ zoom: g, value: 0 },
|
|
13037
13092
|
{ zoom: g + 0.25, value: 1 },
|
|
13038
13093
|
{ zoom: S - 0.25, value: 1 },
|
|
13039
13094
|
{ zoom: S, value: 0 }
|
|
13040
13095
|
]);
|
|
13041
|
-
const
|
|
13096
|
+
const E = {
|
|
13042
13097
|
pointLayerId: u,
|
|
13043
13098
|
clusterLayerId: "",
|
|
13044
13099
|
labelLayerId: "",
|
|
13045
13100
|
pointSourceId: l
|
|
13046
13101
|
};
|
|
13047
13102
|
if (e.data && !r.getSource(l)) {
|
|
13048
|
-
let
|
|
13049
|
-
typeof
|
|
13103
|
+
let C = e.data;
|
|
13104
|
+
typeof C == "string" && Ut(C) && (C = `https://api.maptiler.com/data/${C}/features.json?key=${N.apiKey}`), r.addSource(l, {
|
|
13050
13105
|
type: "geojson",
|
|
13051
|
-
data:
|
|
13106
|
+
data: C,
|
|
13052
13107
|
cluster: a
|
|
13053
13108
|
});
|
|
13054
13109
|
}
|
|
13055
13110
|
if (a) {
|
|
13056
|
-
|
|
13057
|
-
const
|
|
13058
|
-
const
|
|
13111
|
+
E.clusterLayerId = `${u}_cluster`;
|
|
13112
|
+
const C = Array.from({ length: o }, (z, ve) => {
|
|
13113
|
+
const Me = s.min + ve * (s.max - s.min) / (o - 1);
|
|
13059
13114
|
return {
|
|
13060
|
-
value:
|
|
13115
|
+
value: Me,
|
|
13061
13116
|
pointRadius: t + (n - t) * (ve / (o - 1)) ** 0.5,
|
|
13062
|
-
color: i.getColorHex(
|
|
13117
|
+
color: i.getColorHex(Me)
|
|
13063
13118
|
};
|
|
13064
13119
|
});
|
|
13065
13120
|
r.addLayer(
|
|
13066
13121
|
{
|
|
13067
|
-
id:
|
|
13122
|
+
id: E.clusterLayerId,
|
|
13068
13123
|
type: "circle",
|
|
13069
13124
|
source: l,
|
|
13070
13125
|
filter: ["has", "point_count"],
|
|
13071
13126
|
paint: {
|
|
13072
13127
|
// 'circle-color': options.pointColor ?? colorDrivenByProperty(clusterStyle, "point_count"),
|
|
13073
|
-
"circle-color": typeof e.pointColor == "string" ? e.pointColor : Ur(
|
|
13074
|
-
"circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ?
|
|
13128
|
+
"circle-color": typeof e.pointColor == "string" ? e.pointColor : Ur(C, "point_count"),
|
|
13129
|
+
"circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ? F(e.pointRadius) : Br(C, "point_count", !1),
|
|
13075
13130
|
"circle-pitch-alignment": p ? "viewport" : "map",
|
|
13076
13131
|
"circle-pitch-scale": "map",
|
|
13077
13132
|
// scale with camera distance regardless of viewport/biewport alignement
|
|
13078
13133
|
"circle-opacity": y,
|
|
13079
13134
|
...d && {
|
|
13080
|
-
"circle-stroke-opacity": typeof f == "number" ? f :
|
|
13081
|
-
"circle-stroke-width": typeof h == "number" ? h :
|
|
13135
|
+
"circle-stroke-opacity": typeof f == "number" ? f : F(f),
|
|
13136
|
+
"circle-stroke-width": typeof h == "number" ? h : F(h),
|
|
13082
13137
|
"circle-stroke-color": typeof m == "string" ? m : _e(m)
|
|
13083
13138
|
}
|
|
13084
13139
|
},
|
|
@@ -13088,7 +13143,7 @@ function Ec(r, e) {
|
|
|
13088
13143
|
e.beforeId
|
|
13089
13144
|
), r.addLayer(
|
|
13090
13145
|
{
|
|
13091
|
-
id:
|
|
13146
|
+
id: E.pointLayerId,
|
|
13092
13147
|
type: "circle",
|
|
13093
13148
|
source: l,
|
|
13094
13149
|
filter: ["!", ["has", "point_count"]],
|
|
@@ -13098,11 +13153,11 @@ function Ec(r, e) {
|
|
|
13098
13153
|
// scale with camera distance regardless of viewport/biewport alignement
|
|
13099
13154
|
// 'circle-color': options.pointColor ?? clusterStyle[0].color,
|
|
13100
13155
|
"circle-color": typeof e.pointColor == "string" ? e.pointColor : i.getColorHex(i.getBounds().min),
|
|
13101
|
-
"circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ?
|
|
13156
|
+
"circle-radius": typeof e.pointRadius == "number" ? e.pointRadius : Array.isArray(e.pointRadius) ? F(e.pointRadius) : C[0].pointRadius * 0.75,
|
|
13102
13157
|
"circle-opacity": y,
|
|
13103
13158
|
...d && {
|
|
13104
|
-
"circle-stroke-opacity": typeof f == "number" ? f :
|
|
13105
|
-
"circle-stroke-width": typeof h == "number" ? h :
|
|
13159
|
+
"circle-stroke-opacity": typeof f == "number" ? f : F(f),
|
|
13160
|
+
"circle-stroke-width": typeof h == "number" ? h : F(h),
|
|
13106
13161
|
"circle-stroke-color": typeof m == "string" ? m : _e(m)
|
|
13107
13162
|
}
|
|
13108
13163
|
},
|
|
@@ -13112,13 +13167,13 @@ function Ec(r, e) {
|
|
|
13112
13167
|
e.beforeId
|
|
13113
13168
|
);
|
|
13114
13169
|
} else {
|
|
13115
|
-
let
|
|
13170
|
+
let C = typeof e.pointColor == "string" ? e.pointColor : Array.isArray(e.pointColor) ? e.pointColor.getColorHex(e.pointColor.getBounds().min) : ar(), z = typeof e.pointRadius == "number" ? w ? F([
|
|
13116
13171
|
{ zoom: 0, value: e.pointRadius * 0.025 },
|
|
13117
13172
|
{ zoom: 2, value: e.pointRadius * 0.05 },
|
|
13118
13173
|
{ zoom: 4, value: e.pointRadius * 0.1 },
|
|
13119
13174
|
{ zoom: 8, value: e.pointRadius * 0.25 },
|
|
13120
13175
|
{ zoom: 16, value: e.pointRadius * 1 }
|
|
13121
|
-
]) : e.pointRadius : Array.isArray(e.pointRadius) ?
|
|
13176
|
+
]) : e.pointRadius : Array.isArray(e.pointRadius) ? F(e.pointRadius) : w ? F([
|
|
13122
13177
|
{ zoom: 0, value: t * 0.05 },
|
|
13123
13178
|
{ zoom: 2, value: t * 0.1 },
|
|
13124
13179
|
{ zoom: 4, value: t * 0.2 },
|
|
@@ -13126,7 +13181,7 @@ function Ec(r, e) {
|
|
|
13126
13181
|
{ zoom: 16, value: t * 1 }
|
|
13127
13182
|
]) : t;
|
|
13128
13183
|
if (e.property && Array.isArray(e.pointColor)) {
|
|
13129
|
-
const ve = Array.from({ length: o }, (
|
|
13184
|
+
const ve = Array.from({ length: o }, (Me, Ge) => {
|
|
13130
13185
|
const He = s.min + Ge * (s.max - s.min) / (o - 1);
|
|
13131
13186
|
return {
|
|
13132
13187
|
value: He,
|
|
@@ -13134,11 +13189,11 @@ function Ec(r, e) {
|
|
|
13134
13189
|
color: typeof e.pointColor == "string" ? e.pointColor : i.getColorHex(He)
|
|
13135
13190
|
};
|
|
13136
13191
|
});
|
|
13137
|
-
|
|
13192
|
+
C = Ur(ve, e.property), z = Br(ve, e.property, w);
|
|
13138
13193
|
}
|
|
13139
13194
|
r.addLayer(
|
|
13140
13195
|
{
|
|
13141
|
-
id:
|
|
13196
|
+
id: E.pointLayerId,
|
|
13142
13197
|
type: "circle",
|
|
13143
13198
|
source: l,
|
|
13144
13199
|
layout: {
|
|
@@ -13149,12 +13204,12 @@ function Ec(r, e) {
|
|
|
13149
13204
|
"circle-pitch-alignment": p ? "viewport" : "map",
|
|
13150
13205
|
"circle-pitch-scale": "map",
|
|
13151
13206
|
// scale with camera distance regardless of viewport/biewport alignement
|
|
13152
|
-
"circle-color":
|
|
13207
|
+
"circle-color": C,
|
|
13153
13208
|
"circle-opacity": y,
|
|
13154
13209
|
"circle-radius": z,
|
|
13155
13210
|
...d && {
|
|
13156
|
-
"circle-stroke-opacity": typeof f == "number" ? f :
|
|
13157
|
-
"circle-stroke-width": typeof h == "number" ? h :
|
|
13211
|
+
"circle-stroke-opacity": typeof f == "number" ? f : F(f),
|
|
13212
|
+
"circle-stroke-width": typeof h == "number" ? h : F(h),
|
|
13158
13213
|
"circle-stroke-color": typeof m == "string" ? m : _e(m)
|
|
13159
13214
|
}
|
|
13160
13215
|
},
|
|
@@ -13165,11 +13220,11 @@ function Ec(r, e) {
|
|
|
13165
13220
|
);
|
|
13166
13221
|
}
|
|
13167
13222
|
if (c !== !1 && (e.cluster || e.property)) {
|
|
13168
|
-
|
|
13169
|
-
const
|
|
13223
|
+
E.labelLayerId = `${u}_label`;
|
|
13224
|
+
const C = e.labelColor ?? "#fff", z = e.labelSize ?? 12;
|
|
13170
13225
|
r.addLayer(
|
|
13171
13226
|
{
|
|
13172
|
-
id:
|
|
13227
|
+
id: E.labelLayerId,
|
|
13173
13228
|
type: "symbol",
|
|
13174
13229
|
source: l,
|
|
13175
13230
|
filter: ["has", e.cluster ? "point_count" : e.property],
|
|
@@ -13182,7 +13237,7 @@ function Ec(r, e) {
|
|
|
13182
13237
|
// so that the largest value goes on top
|
|
13183
13238
|
},
|
|
13184
13239
|
paint: {
|
|
13185
|
-
"text-color":
|
|
13240
|
+
"text-color": C,
|
|
13186
13241
|
"text-opacity": y
|
|
13187
13242
|
},
|
|
13188
13243
|
minzoom: g,
|
|
@@ -13191,9 +13246,9 @@ function Ec(r, e) {
|
|
|
13191
13246
|
e.beforeId
|
|
13192
13247
|
);
|
|
13193
13248
|
}
|
|
13194
|
-
return
|
|
13249
|
+
return E;
|
|
13195
13250
|
}
|
|
13196
|
-
function
|
|
13251
|
+
function Tc(r, e) {
|
|
13197
13252
|
if (e.layerId && r.getLayer(e.layerId))
|
|
13198
13253
|
throw new Error(`A layer already exists with the layer id: ${e.layerId}`);
|
|
13199
13254
|
const t = e.sourceId ?? xt(), n = e.layerId ?? St(), a = e.minzoom ?? 0, o = e.maxzoom ?? 23, i = e.zoomCompensation ?? !0, s = e.opacity ?? [
|
|
@@ -13211,7 +13266,7 @@ function Cc(r, e) {
|
|
|
13211
13266
|
{ zoom: 16, value: 1 }
|
|
13212
13267
|
], p = e.property ?? null, d = e.weight ?? 1;
|
|
13213
13268
|
let f = 1;
|
|
13214
|
-
p ? typeof d == "number" ? (f = d, typeof e.weight == "number" && console.warn("The option `.property` is ignored when `.propertyValueWeights` is not of type `PropertyValueWeights`")) : Array.isArray(d) ? f =
|
|
13269
|
+
p ? typeof d == "number" ? (f = d, typeof e.weight == "number" && console.warn("The option `.property` is ignored when `.propertyValueWeights` is not of type `PropertyValueWeights`")) : Array.isArray(d) ? f = Ro(d, p) : console.warn("The option `.property` is ignored when `.propertyValueWeights` is not of type `PropertyValueWeights`") : typeof d == "number" ? f = d : Array.isArray(d) && console.warn("The options `.propertyValueWeights` can only be used when `.property` is provided.");
|
|
13215
13270
|
const h = [
|
|
13216
13271
|
{ zoom: 0, value: 50 * 0.025 },
|
|
13217
13272
|
{ zoom: 2, value: 50 * 0.05 },
|
|
@@ -13220,8 +13275,8 @@ function Cc(r, e) {
|
|
|
13220
13275
|
{ zoom: 16, value: 50 }
|
|
13221
13276
|
], m = e.radius ?? (i ? h : 10);
|
|
13222
13277
|
let y = 1;
|
|
13223
|
-
typeof m == "number" ? y = m : Array.isArray(m) && "zoom" in m[0] ? y =
|
|
13224
|
-
const
|
|
13278
|
+
typeof m == "number" ? y = m : Array.isArray(m) && "zoom" in m[0] ? y = F(m) : p && Array.isArray(m) && "propertyValue" in m[0] ? y = zo(m, p, i) : !p && Array.isArray(m) && "propertyValue" in m[0] ? (y = F(h), console.warn("The option `.radius` can only be property-driven if the option `.property` is provided.")) : y = F(h);
|
|
13279
|
+
const w = {
|
|
13225
13280
|
heatmapLayerId: n,
|
|
13226
13281
|
heatmapSourceId: t
|
|
13227
13282
|
};
|
|
@@ -13241,212 +13296,212 @@ function Cc(r, e) {
|
|
|
13241
13296
|
maxzoom: o,
|
|
13242
13297
|
paint: {
|
|
13243
13298
|
"heatmap-weight": f,
|
|
13244
|
-
"heatmap-intensity": typeof c == "number" ? c :
|
|
13245
|
-
"heatmap-color":
|
|
13299
|
+
"heatmap-intensity": typeof c == "number" ? c : F(c),
|
|
13300
|
+
"heatmap-color": Fo(l),
|
|
13246
13301
|
"heatmap-radius": y,
|
|
13247
|
-
"heatmap-opacity": typeof s == "number" ? s :
|
|
13302
|
+
"heatmap-opacity": typeof s == "number" ? s : F(s)
|
|
13248
13303
|
}
|
|
13249
13304
|
},
|
|
13250
13305
|
e.beforeId
|
|
13251
|
-
),
|
|
13306
|
+
), w;
|
|
13252
13307
|
}
|
|
13253
|
-
const
|
|
13308
|
+
const ap = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
13254
13309
|
__proto__: null,
|
|
13255
|
-
addHeatmap:
|
|
13310
|
+
addHeatmap: Tc,
|
|
13256
13311
|
addPoint: Ec,
|
|
13257
|
-
addPolygon:
|
|
13258
|
-
addPolyline:
|
|
13312
|
+
addPolygon: Cc,
|
|
13313
|
+
addPolyline: kc,
|
|
13259
13314
|
colorDrivenByProperty: Ur,
|
|
13260
13315
|
colorPalettes: jr,
|
|
13261
|
-
computeRampedOutlineWidth:
|
|
13316
|
+
computeRampedOutlineWidth: Po,
|
|
13262
13317
|
dashArrayMaker: vn,
|
|
13263
13318
|
generateRandomLayerName: St,
|
|
13264
13319
|
generateRandomSourceName: xt,
|
|
13265
13320
|
getRandomColor: ar,
|
|
13266
|
-
heatmapIntensityFromColorRamp:
|
|
13321
|
+
heatmapIntensityFromColorRamp: Fo,
|
|
13267
13322
|
lerpZoomNumberValues: Dr,
|
|
13268
13323
|
opacityDrivenByProperty: qr,
|
|
13269
13324
|
paintColorOptionsToPaintSpec: _e,
|
|
13270
13325
|
radiusDrivenByProperty: Br,
|
|
13271
|
-
radiusDrivenByPropertyHeatmap:
|
|
13272
|
-
rampedOptionsToLayerPaintSpec:
|
|
13273
|
-
rampedPropertyValueWeight:
|
|
13274
|
-
takeScreenshot:
|
|
13326
|
+
radiusDrivenByPropertyHeatmap: zo,
|
|
13327
|
+
rampedOptionsToLayerPaintSpec: F,
|
|
13328
|
+
rampedPropertyValueWeight: Ro,
|
|
13329
|
+
takeScreenshot: wc
|
|
13275
13330
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
13276
|
-
|
|
13277
|
-
function
|
|
13278
|
-
return "3.8.0-
|
|
13279
|
-
}
|
|
13280
|
-
const
|
|
13281
|
-
setRTLTextPlugin:
|
|
13282
|
-
getRTLTextPluginStatus:
|
|
13283
|
-
LngLat:
|
|
13331
|
+
li();
|
|
13332
|
+
function op() {
|
|
13333
|
+
return "3.8.0-rc8";
|
|
13334
|
+
}
|
|
13335
|
+
const ip = k.Map, sp = k.Marker, lp = k.Popup, up = k.Style, cp = k.CanvasSource, pp = k.GeoJSONSource, fp = k.ImageSource, dp = k.RasterTileSource, hp = k.RasterDEMTileSource, mp = k.VectorTileSource, yp = k.VideoSource, gp = k.NavigationControl, vp = k.GeolocateControl, bp = k.AttributionControl, wp = k.LogoControl, xp = k.ScaleControl, Sp = k.FullscreenControl, kp = k.TerrainControl, Lp = k.BoxZoomHandler, Cp = k.ScrollZoomHandler, Ep = k.CooperativeGesturesHandler, Tp = k.KeyboardHandler, Ap = k.TwoFingersTouchPitchHandler, _p = k.MapWheelEvent, Ip = k.MapTouchEvent, Mp = k.MapMouseEvent, Pp = k.config, Rp = k.getVersion, {
|
|
13336
|
+
setRTLTextPlugin: zp,
|
|
13337
|
+
getRTLTextPluginStatus: Fp,
|
|
13338
|
+
LngLat: Ac,
|
|
13284
13339
|
LngLatBounds: $p,
|
|
13285
13340
|
MercatorCoordinate: Vr,
|
|
13286
|
-
Evented:
|
|
13287
|
-
AJAXError:
|
|
13288
|
-
prewarm:
|
|
13289
|
-
clearPrewarmedResources:
|
|
13290
|
-
Hash:
|
|
13291
|
-
Point:
|
|
13292
|
-
EdgeInsets:
|
|
13293
|
-
DragRotateHandler:
|
|
13294
|
-
DragPanHandler:
|
|
13295
|
-
TwoFingersTouchZoomRotateHandler:
|
|
13296
|
-
DoubleClickZoomHandler:
|
|
13297
|
-
TwoFingersTouchZoomHandler:
|
|
13298
|
-
TwoFingersTouchRotateHandler:
|
|
13299
|
-
getWorkerCount:
|
|
13300
|
-
setWorkerCount:
|
|
13301
|
-
getMaxParallelImageRequests:
|
|
13302
|
-
setMaxParallelImageRequests:
|
|
13303
|
-
getWorkerUrl:
|
|
13304
|
-
setWorkerUrl:
|
|
13305
|
-
addSourceType:
|
|
13306
|
-
importScriptInWorkers:
|
|
13307
|
-
addProtocol:
|
|
13308
|
-
removeProtocol:
|
|
13341
|
+
Evented: Op,
|
|
13342
|
+
AJAXError: Np,
|
|
13343
|
+
prewarm: jp,
|
|
13344
|
+
clearPrewarmedResources: Dp,
|
|
13345
|
+
Hash: Up,
|
|
13346
|
+
Point: Oo,
|
|
13347
|
+
EdgeInsets: Bp,
|
|
13348
|
+
DragRotateHandler: qp,
|
|
13349
|
+
DragPanHandler: Vp,
|
|
13350
|
+
TwoFingersTouchZoomRotateHandler: Gp,
|
|
13351
|
+
DoubleClickZoomHandler: Hp,
|
|
13352
|
+
TwoFingersTouchZoomHandler: Zp,
|
|
13353
|
+
TwoFingersTouchRotateHandler: Xp,
|
|
13354
|
+
getWorkerCount: Kp,
|
|
13355
|
+
setWorkerCount: Yp,
|
|
13356
|
+
getMaxParallelImageRequests: Wp,
|
|
13357
|
+
setMaxParallelImageRequests: Jp,
|
|
13358
|
+
getWorkerUrl: Qp,
|
|
13359
|
+
setWorkerUrl: ef,
|
|
13360
|
+
addSourceType: tf,
|
|
13361
|
+
importScriptInWorkers: rf,
|
|
13362
|
+
addProtocol: nf,
|
|
13363
|
+
removeProtocol: af
|
|
13309
13364
|
} = k;
|
|
13310
13365
|
export {
|
|
13311
|
-
|
|
13312
|
-
|
|
13313
|
-
|
|
13314
|
-
|
|
13315
|
-
|
|
13316
|
-
|
|
13317
|
-
|
|
13366
|
+
Np as AJAXError,
|
|
13367
|
+
Zc as AttributionControl,
|
|
13368
|
+
bp as AttributionControlMLGL,
|
|
13369
|
+
Kc as BoxZoomHandler,
|
|
13370
|
+
Lp as BoxZoomHandlerMLGL,
|
|
13371
|
+
Dc as CanvasSource,
|
|
13372
|
+
cp as CanvasSourceMLGL,
|
|
13318
13373
|
L as ColorRamp,
|
|
13319
13374
|
$o as ColorRampCollection,
|
|
13320
|
-
|
|
13375
|
+
Wc as CooperativeGesturesHandler,
|
|
13321
13376
|
Ep as CooperativeGesturesHandlerMLGL,
|
|
13322
|
-
|
|
13377
|
+
Fe as CubemapFaceNames,
|
|
13323
13378
|
zu as CubemapImagesPresets,
|
|
13324
13379
|
kr as CubemapLayer,
|
|
13325
13380
|
we as DOMcreate,
|
|
13326
13381
|
hn as DOMremove,
|
|
13327
|
-
|
|
13328
|
-
|
|
13329
|
-
|
|
13330
|
-
|
|
13331
|
-
|
|
13382
|
+
Hp as DoubleClickZoomHandler,
|
|
13383
|
+
Vp as DragPanHandler,
|
|
13384
|
+
qp as DragRotateHandler,
|
|
13385
|
+
Bp as EdgeInsets,
|
|
13386
|
+
Op as Evented,
|
|
13332
13387
|
ki as FullscreenControl,
|
|
13333
|
-
|
|
13334
|
-
|
|
13335
|
-
|
|
13388
|
+
Sp as FullscreenControlMLGL,
|
|
13389
|
+
Uc as GeoJSONSource,
|
|
13390
|
+
pp as GeoJSONSourceMLGL,
|
|
13336
13391
|
wi as GeolocateControl,
|
|
13337
|
-
|
|
13392
|
+
vp as GeolocateControlMLGL,
|
|
13338
13393
|
Ku as GeolocationType,
|
|
13339
|
-
|
|
13340
|
-
|
|
13341
|
-
|
|
13342
|
-
|
|
13394
|
+
Up as Hash,
|
|
13395
|
+
Bc as ImageSource,
|
|
13396
|
+
fp as ImageSourceMLGL,
|
|
13397
|
+
np as ImageViewer,
|
|
13343
13398
|
ee as ImageViewerEvent,
|
|
13344
|
-
|
|
13345
|
-
|
|
13399
|
+
Jc as KeyboardHandler,
|
|
13400
|
+
Tp as KeyboardHandlerMLGL,
|
|
13346
13401
|
R as Language,
|
|
13347
|
-
|
|
13402
|
+
Ac as LngLat,
|
|
13348
13403
|
$p as LngLatBounds,
|
|
13349
13404
|
xi as LogoControl,
|
|
13350
|
-
|
|
13351
|
-
|
|
13352
|
-
|
|
13353
|
-
|
|
13405
|
+
wp as LogoControlMLGL,
|
|
13406
|
+
po as Map,
|
|
13407
|
+
ip as MapMLGL,
|
|
13408
|
+
rp as MapMouseEvent,
|
|
13354
13409
|
Mp as MapMouseEventMLGL,
|
|
13355
|
-
|
|
13356
|
-
|
|
13357
|
-
|
|
13358
|
-
|
|
13359
|
-
|
|
13360
|
-
|
|
13410
|
+
lf as MapStyle,
|
|
13411
|
+
uf as MapStyleVariant,
|
|
13412
|
+
tp as MapTouchEvent,
|
|
13413
|
+
Ip as MapTouchEventMLGL,
|
|
13414
|
+
ep as MapWheelEvent,
|
|
13415
|
+
_p as MapWheelEventMLGL,
|
|
13361
13416
|
Bl as MaptilerGeolocateControl,
|
|
13362
13417
|
_n as MaptilerLogoControl,
|
|
13363
13418
|
Dl as MaptilerNavigationControl,
|
|
13364
13419
|
ql as MaptilerProjectionControl,
|
|
13365
13420
|
jl as MaptilerTerrainControl,
|
|
13366
13421
|
$c as Marker,
|
|
13367
|
-
|
|
13422
|
+
sp as MarkerMLGL,
|
|
13368
13423
|
Vr as MercatorCoordinate,
|
|
13369
|
-
|
|
13370
|
-
|
|
13371
|
-
|
|
13372
|
-
|
|
13373
|
-
|
|
13424
|
+
gp as NavigationControMLGL,
|
|
13425
|
+
xa as NavigationControl,
|
|
13426
|
+
Oo as Point,
|
|
13427
|
+
Nc as Popup,
|
|
13428
|
+
lp as PopupMLGL,
|
|
13374
13429
|
Lr as RadialGradientLayer,
|
|
13375
|
-
|
|
13376
|
-
|
|
13377
|
-
|
|
13378
|
-
|
|
13379
|
-
|
|
13430
|
+
Vc as RasterDEMTileSource,
|
|
13431
|
+
hp as RasterDEMTileSourceMLGL,
|
|
13432
|
+
qc as RasterTileSource,
|
|
13433
|
+
dp as RasterTileSourceMLGL,
|
|
13434
|
+
cf as ReferenceMapStyle,
|
|
13380
13435
|
Si as ScaleControl,
|
|
13381
|
-
|
|
13382
|
-
|
|
13383
|
-
|
|
13384
|
-
|
|
13385
|
-
|
|
13386
|
-
|
|
13387
|
-
|
|
13388
|
-
|
|
13389
|
-
|
|
13390
|
-
|
|
13391
|
-
|
|
13392
|
-
|
|
13393
|
-
|
|
13394
|
-
|
|
13395
|
-
|
|
13396
|
-
|
|
13397
|
-
|
|
13398
|
-
|
|
13399
|
-
|
|
13400
|
-
|
|
13401
|
-
|
|
13402
|
-
|
|
13403
|
-
|
|
13404
|
-
|
|
13405
|
-
|
|
13436
|
+
xp as ScaleControlMLGL,
|
|
13437
|
+
Yc as ScrollZoomHandler,
|
|
13438
|
+
Cp as ScrollZoomHandlerMLGL,
|
|
13439
|
+
ti as SdkConfig,
|
|
13440
|
+
pf as ServiceError,
|
|
13441
|
+
jc as Style,
|
|
13442
|
+
up as StyleMLGL,
|
|
13443
|
+
kp as TerrainControMLGL,
|
|
13444
|
+
Xc as TerrainControl,
|
|
13445
|
+
Qc as TwoFingersTouchPitchHandler,
|
|
13446
|
+
Ap as TwoFingersTouchPitchHandlerMLGL,
|
|
13447
|
+
Xp as TwoFingersTouchRotateHandler,
|
|
13448
|
+
Zp as TwoFingersTouchZoomHandler,
|
|
13449
|
+
Gp as TwoFingersTouchZoomRotateHandler,
|
|
13450
|
+
Gc as VectorTileSource,
|
|
13451
|
+
mp as VectorTileSourceMLGL,
|
|
13452
|
+
Hc as VideoSource,
|
|
13453
|
+
yp as VideoSourceMLGL,
|
|
13454
|
+
nf as addProtocol,
|
|
13455
|
+
tf as addSourceType,
|
|
13456
|
+
ff as areSameLanguages,
|
|
13457
|
+
df as bufferToPixelDataBrowser,
|
|
13458
|
+
hf as canParsePixelData,
|
|
13459
|
+
mf as circumferenceAtLatitude,
|
|
13460
|
+
Dp as clearPrewarmedResources,
|
|
13406
13461
|
N as config,
|
|
13407
|
-
|
|
13408
|
-
|
|
13462
|
+
Pp as configMLGL,
|
|
13463
|
+
yf as coordinates,
|
|
13409
13464
|
Ue as cubemapPresets,
|
|
13410
|
-
|
|
13411
|
-
|
|
13412
|
-
|
|
13413
|
-
|
|
13414
|
-
|
|
13415
|
-
|
|
13416
|
-
|
|
13465
|
+
gf as data,
|
|
13466
|
+
Fc as displayWebGLContextLostWarning,
|
|
13467
|
+
vf as elevation,
|
|
13468
|
+
bf as expandMapStyle,
|
|
13469
|
+
wf as geocoding,
|
|
13470
|
+
xf as geolocation,
|
|
13471
|
+
Sf as getAutoLanguage,
|
|
13417
13472
|
kn as getBrowserLanguage,
|
|
13418
|
-
|
|
13419
|
-
|
|
13420
|
-
|
|
13473
|
+
kf as getBufferToPixelDataParser,
|
|
13474
|
+
Lf as getLanguageInfoFromCode,
|
|
13475
|
+
Cf as getLanguageInfoFromFlag,
|
|
13421
13476
|
Ef as getLanguageInfoFromKey,
|
|
13422
|
-
|
|
13423
|
-
|
|
13424
|
-
|
|
13425
|
-
|
|
13426
|
-
|
|
13427
|
-
|
|
13428
|
-
|
|
13429
|
-
|
|
13430
|
-
|
|
13431
|
-
|
|
13432
|
-
|
|
13433
|
-
|
|
13434
|
-
|
|
13435
|
-
|
|
13477
|
+
Rp as getMapLibreVersion,
|
|
13478
|
+
Wp as getMaxParallelImageRequests,
|
|
13479
|
+
Fp as getRTLTextPluginStatus,
|
|
13480
|
+
Tf as getTileCache,
|
|
13481
|
+
op as getVersion,
|
|
13482
|
+
pi as getWebGLSupportError,
|
|
13483
|
+
Kp as getWorkerCount,
|
|
13484
|
+
Qp as getWorkerUrl,
|
|
13485
|
+
Co as gpx,
|
|
13486
|
+
bc as gpxOrKml,
|
|
13487
|
+
Lo as hasChildNodeWithName,
|
|
13488
|
+
ap as helpers,
|
|
13489
|
+
rf as importScriptInWorkers,
|
|
13490
|
+
Af as isLanguageInfo,
|
|
13436
13491
|
Eo as kml,
|
|
13437
|
-
|
|
13438
|
-
|
|
13492
|
+
_f as mapStylePresetList,
|
|
13493
|
+
If as math,
|
|
13439
13494
|
Mf as misc,
|
|
13440
|
-
|
|
13441
|
-
|
|
13442
|
-
|
|
13443
|
-
|
|
13444
|
-
|
|
13445
|
-
|
|
13446
|
-
|
|
13495
|
+
jp as prewarm,
|
|
13496
|
+
af as removeProtocol,
|
|
13497
|
+
Jp as setMaxParallelImageRequests,
|
|
13498
|
+
zp as setRTLTextPlugin,
|
|
13499
|
+
Yp as setWorkerCount,
|
|
13500
|
+
ef as setWorkerUrl,
|
|
13501
|
+
Pf as staticMaps,
|
|
13447
13502
|
yn as str2xml,
|
|
13448
|
-
|
|
13449
|
-
|
|
13503
|
+
Rf as styleToStyle,
|
|
13504
|
+
zf as toLanguageInfo,
|
|
13450
13505
|
ha as xml2str
|
|
13451
13506
|
};
|
|
13452
13507
|
//# sourceMappingURL=maptiler-sdk.mjs.map
|