@maptiler/sdk 1.0.8 → 1.0.10

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/demos/simple.html CHANGED
@@ -36,15 +36,16 @@
36
36
  <script src ="maptiler-sdk.umd.js"></script>
37
37
 
38
38
  <script>
39
- // maptilersdk.config.apiKey = "ZFEK2gQSwT4Jcimbtcy7";
39
+ maptilersdk.config.apiKey = "YOUR_API_KEY";
40
40
 
41
41
  const map = new maptilersdk.Map({
42
42
  container: document.getElementById("map-container"),
43
+ style: maptilersdk.MapStyle.OUTDOOR.DARK,
43
44
  hash: true,
44
- maxPitch: 85,
45
45
  scaleControl: true,
46
46
  fullscreenControl: true,
47
47
  terrainControl: true,
48
+ geolocate: true,
48
49
  })
49
50
 
50
51
  const styleDropDown = document.getElementById("mapstyles-picker")
@@ -1,5 +1,5 @@
1
1
  import * as maplibre_gl from 'maplibre-gl';
2
- import maplibre_gl__default, { MapOptions as MapOptions$1, StyleSpecification, ControlPosition, StyleOptions, LogoOptions as LogoOptions$1 } from 'maplibre-gl';
2
+ import maplibre_gl__default, { MapOptions as MapOptions$1, StyleSpecification, ControlPosition, StyleOptions, Map as Map$1, LogoOptions as LogoOptions$1 } from 'maplibre-gl';
3
3
  export * from 'maplibre-gl';
4
4
  import * as _mapbox_mapbox_gl_supported from '@mapbox/mapbox-gl-supported';
5
5
  import { FetchFunction, ReferenceMapStyle, MapStyleVariant } from '@maptiler/client';
@@ -100,14 +100,14 @@ declare const Language: {
100
100
  /**
101
101
  * Type representing the key of the Language object
102
102
  */
103
- declare type LanguageKey = keyof typeof Language;
104
- declare type Values<T> = T[keyof T];
103
+ type LanguageKey = keyof typeof Language;
104
+ type Values<T> = T[keyof T];
105
105
  /**
106
106
  * Built-in languages values as strings
107
107
  */
108
- declare type LanguageString = Values<typeof Language>;
108
+ type LanguageString = Values<typeof Language>;
109
109
 
110
- declare type Unit = "imperial" | "metric" | "nautical";
110
+ type Unit = "imperial" | "metric" | "nautical";
111
111
 
112
112
  /**
113
113
  * Configuration class for the SDK
@@ -166,8 +166,16 @@ declare class SdkConfig extends EventEmitter {
166
166
  }
167
167
  declare const config: SdkConfig;
168
168
 
169
- declare type TransformStyleFunction = (previous: StyleSpecification, next: StyleSpecification) => StyleSpecification;
170
- declare type StyleSwapOptions = {
169
+ type LoadWithTerrainEvent = {
170
+ type: "loadWithTerrain";
171
+ target: Map;
172
+ terrain: {
173
+ source: string;
174
+ exaggeration: number;
175
+ };
176
+ };
177
+ type TransformStyleFunction = (previous: StyleSpecification, next: StyleSpecification) => StyleSpecification;
178
+ type StyleSwapOptions = {
171
179
  diff?: boolean;
172
180
  transformStyle?: TransformStyleFunction;
173
181
  };
@@ -178,7 +186,7 @@ declare const GeolocationType: {
178
186
  /**
179
187
  * Options to provide to the `Map` constructor
180
188
  */
181
- declare type MapOptions = Omit<MapOptions$1, "style" | "maplibreLogo"> & {
189
+ type MapOptions = Omit<MapOptions$1, "style" | "maplibreLogo"> & {
182
190
  /**
183
191
  * Style of the map. Can be:
184
192
  * - a full style URL (possibly with API key)
@@ -248,19 +256,34 @@ declare type MapOptions = Omit<MapOptions$1, "style" | "maplibreLogo"> & {
248
256
  *
249
257
  * Default: `false`
250
258
  */
251
- geolocate?: typeof GeolocationType[keyof typeof GeolocationType] | boolean;
259
+ geolocate?: (typeof GeolocationType)[keyof typeof GeolocationType] | boolean;
252
260
  };
253
261
  /**
254
262
  * The Map class can be instanciated to display a map in a `<div>`
255
263
  */
256
264
  declare class Map extends maplibre_gl__default.Map {
257
- private languageShouldUpdate;
258
- private isStyleInitialized;
259
265
  private isTerrainEnabled;
260
266
  private terrainExaggeration;
261
267
  private primaryLanguage;
262
268
  private secondaryLanguage;
269
+ private terrainGrowing;
270
+ private terrainFlattening;
263
271
  constructor(options: MapOptions);
272
+ /**
273
+ * Awaits for _this_ Map instance to be "loaded" and returns a Promise to the Map.
274
+ * If _this_ Map instance is already loaded, the Promise is resolved directly,
275
+ * otherwise, it is resolved as a result of the "load" event.
276
+ * @returns
277
+ */
278
+ onLoadAsync(): Promise<Map>;
279
+ /**
280
+ * Awaits for _this_ Map instance to be "loaded" as well as with terrain being non-null for the first time
281
+ * and returns a Promise to the Map.
282
+ * If _this_ Map instance is already loaded with terrain, the Promise is resolved directly,
283
+ * otherwise, it is resolved as a result of the "loadWithTerrain" event.
284
+ * @returns
285
+ */
286
+ onLoadWithTerrainAsync(): Promise<Map>;
264
287
  /**
265
288
  * Update the style of the map.
266
289
  * Can be:
@@ -309,6 +332,7 @@ declare class Map extends maplibre_gl__default.Map {
309
332
  * @returns
310
333
  */
311
334
  hasTerrain(): boolean;
335
+ private growTerrain;
312
336
  /**
313
337
  * Enables the 3D terrain visualization
314
338
  * @param exaggeration
@@ -321,10 +345,14 @@ declare class Map extends maplibre_gl__default.Map {
321
345
  disableTerrain(): void;
322
346
  /**
323
347
  * Sets the 3D terrain exageration factor.
324
- * Note: this is only a shortcut to `.enableTerrain()`
348
+ * If the terrain was not enabled prior to the call of this method,
349
+ * the method `.enableTerrain()` will be called.
350
+ * If `animate` is `true`, the terrain transformation will be animated in the span of 1 second.
351
+ * If `animate` is `false`, no animated transition to the newly defined exaggeration.
325
352
  * @param exaggeration
353
+ * @param animate
326
354
  */
327
- setTerrainExaggeration(exaggeration: number): void;
355
+ setTerrainExaggeration(exaggeration: number, animate?: boolean): void;
328
356
  /**
329
357
  * Perform an action when the style is ready. It could be at the moment of calling this method
330
358
  * or later.
@@ -349,14 +377,149 @@ declare class Map extends maplibre_gl__default.Map {
349
377
  getMaptilerSessionId(): string;
350
378
  }
351
379
 
352
- declare const GeolocateControl$1: typeof maplibre_gl.GeolocateControl;
380
+ /**
381
+ * This is an extension of MapLibre Marker to make it fully type compatible with the SDK
382
+ */
383
+
384
+ declare class Marker extends maplibre_gl__default.Marker {
385
+ addTo(map: Map | Map$1): this;
386
+ }
387
+
388
+ /**
389
+ * This is an extension of MapLibre Popup to make it fully type compatible with the SDK
390
+ */
391
+
392
+ declare class Popup extends maplibre_gl__default.Popup {
393
+ addTo(map: Map | Map$1): this;
394
+ }
395
+
396
+ /**
397
+ * This is an extension of MapLibre Style to make it fully type compatible with the SDK
398
+ */
399
+
400
+ declare class Style extends maplibre_gl__default.Style {
401
+ constructor(map: Map, options?: StyleOptions);
402
+ }
403
+
404
+ /**
405
+ * This is an extension of MapLibre CanvasSource to make it fully type compatible with the SDK
406
+ */
407
+
408
+ declare class CanvasSource extends maplibre_gl__default.CanvasSource {
409
+ onAdd(map: Map | Map$1): void;
410
+ }
411
+
412
+ /**
413
+ * This is an extension of MapLibre GeoJSONSource to make it fully type compatible with the SDK
414
+ */
415
+
416
+ declare class GeoJSONSource extends maplibre_gl__default.GeoJSONSource {
417
+ onAdd(map: Map | Map$1): void;
418
+ }
419
+
420
+ /**
421
+ * This is an extension of MapLibre ImageSource to make it fully type compatible with the SDK
422
+ */
423
+
424
+ declare class ImageSource extends maplibre_gl__default.ImageSource {
425
+ onAdd(map: Map | Map$1): void;
426
+ }
427
+
428
+ /**
429
+ * This is an extension of MapLibre RasterTileSource to make it fully type compatible with the SDK
430
+ */
431
+
432
+ declare class RasterTileSource extends maplibre_gl__default.RasterTileSource {
433
+ onAdd(map: Map | Map$1): void;
434
+ }
435
+
436
+ /**
437
+ * This is an extension of MapLibre RasterDEMTileSource to make it fully type compatible with the SDK
438
+ */
439
+
440
+ declare class RasterDEMTileSource extends maplibre_gl__default.RasterDEMTileSource {
441
+ onAdd(map: Map | Map$1): void;
442
+ }
443
+
444
+ /**
445
+ * This is an extension of MapLibre VectorTileSource to make it fully type compatible with the SDK
446
+ */
447
+
448
+ declare class VectorTileSource extends maplibre_gl__default.VectorTileSource {
449
+ onAdd(map: Map | Map$1): void;
450
+ }
451
+
452
+ /**
453
+ * This is an extension of MapLibre VideoSource to make it fully type compatible with the SDK
454
+ */
455
+
456
+ declare class VideoSource extends maplibre_gl__default.VideoSource {
457
+ onAdd(map: Map | Map$1): void;
458
+ }
459
+
460
+ /**
461
+ * This is an extension of MapLibre NavigationControl to make it fully type compatible with the SDK
462
+ */
463
+
464
+ declare class NavigationControl extends maplibre_gl__default.NavigationControl {
465
+ onAdd(map: Map | Map$1): HTMLElement;
466
+ }
467
+
468
+ /**
469
+ * This is an extension of MapLibre GeolocateControl to make it fully type compatible with the SDK
470
+ */
471
+
472
+ declare class GeolocateControl extends maplibre_gl__default.GeolocateControl {
473
+ onAdd(map: Map | Map$1): HTMLElement;
474
+ }
475
+
476
+ /**
477
+ * This is an extension of MapLibre AttributionControl to make it fully type compatible with the SDK
478
+ */
479
+
480
+ declare class AttributionControl extends maplibre_gl__default.AttributionControl {
481
+ onAdd(map: Map | Map$1): HTMLElement;
482
+ }
483
+
484
+ /**
485
+ * This is an extension of MapLibre LogoControl to make it fully type compatible with the SDK
486
+ */
487
+
488
+ declare class LogoControl extends maplibre_gl__default.LogoControl {
489
+ onAdd(map: Map | Map$1): HTMLElement;
490
+ }
491
+
492
+ /**
493
+ * This is an extension of MapLibre ScaleControl to make it fully type compatible with the SDK
494
+ */
495
+
496
+ declare class ScaleControl extends maplibre_gl__default.ScaleControl {
497
+ onAdd(map: Map | Map$1): HTMLElement;
498
+ }
499
+
500
+ /**
501
+ * This is an extension of MapLibre FullscreenControl to make it fully type compatible with the SDK
502
+ */
503
+
504
+ declare class FullscreenControl extends maplibre_gl__default.FullscreenControl {
505
+ onAdd(map: Map | Map$1): HTMLElement;
506
+ }
507
+
508
+ /**
509
+ * This is an extension of MapLibre TerrainControl to make it fully type compatible with the SDK
510
+ */
511
+
512
+ declare class TerrainControl extends maplibre_gl__default.TerrainControl {
513
+ onAdd(map: Map | Map$1): HTMLElement;
514
+ }
515
+
353
516
  /**
354
517
  * The MaptilerGeolocateControl is an extension of the original GeolocateControl
355
518
  * with a few changes. In this version, the active mode persists as long as the
356
519
  * location is still centered. This means it's robust to rotation, pitch and zoom.
357
520
  *
358
521
  */
359
- declare class MaptilerGeolocateControl extends GeolocateControl$1 {
522
+ declare class MaptilerGeolocateControl extends GeolocateControl {
360
523
  private lastUpdatedCenter;
361
524
  /**
362
525
  * Update the camera location to center on the current position
@@ -370,7 +533,7 @@ declare class MaptilerGeolocateControl extends GeolocateControl$1 {
370
533
  _onZoom(): void;
371
534
  }
372
535
 
373
- declare type LogoOptions = LogoOptions$1 & {
536
+ type LogoOptions = LogoOptions$1 & {
374
537
  logoURL?: string;
375
538
  linkURL?: string;
376
539
  };
@@ -378,7 +541,7 @@ declare type LogoOptions = LogoOptions$1 & {
378
541
  * This LogoControl extends the MapLibre LogoControl but instead can use any image URL and
379
542
  * any link URL. By default this is using MapTiler logo and URL.
380
543
  */
381
- declare class MaptilerLogoControl extends maplibre_gl__default.LogoControl {
544
+ declare class MaptilerLogoControl extends LogoControl {
382
545
  private logoURL;
383
546
  private linkURL;
384
547
  constructor(options?: LogoOptions);
@@ -407,7 +570,7 @@ declare class MaptilerTerrainControl implements maplibregl.IControl {
407
570
  /**
408
571
  * Row major 2x2 matrix
409
572
  */
410
- declare type Matrix2 = [number, number, number, number];
573
+ type Matrix2 = [number, number, number, number];
411
574
  /**
412
575
  * a point
413
576
  * @param x
@@ -583,36 +746,60 @@ declare class Point {
583
746
  declare const supported: _mapbox_mapbox_gl_supported.IsSupported;
584
747
  declare const setRTLTextPlugin: (url: string, callback: (error?: Error) => void, deferred?: boolean) => void;
585
748
  declare const getRTLTextPluginStatus: () => string;
586
- declare const NavigationControl: typeof maplibre_gl.NavigationControl;
587
- declare const GeolocateControl: typeof maplibre_gl.GeolocateControl;
588
- declare const AttributionControl: typeof maplibre_gl.AttributionControl;
589
- declare const LogoControl: typeof maplibre_gl.LogoControl;
590
- declare const ScaleControl: typeof maplibre_gl.ScaleControl;
591
- declare const FullscreenControl: typeof maplibre_gl.FullscreenControl;
592
- declare const TerrainControl: typeof maplibre_gl.TerrainControl;
593
- declare const Popup: typeof maplibre_gl.Popup;
594
- declare const Marker: typeof maplibre_gl.Marker;
595
- declare const Style: typeof maplibre_gl.Style;
596
- declare const LngLat: typeof maplibre_gl.LngLat;
597
- declare const LngLatBounds: typeof maplibre_gl.LngLatBounds;
598
- declare const MercatorCoordinate: typeof maplibre_gl.MercatorCoordinate;
599
- declare const Evented: typeof maplibre_gl.Evented;
600
- declare const AJAXError: typeof maplibre_gl.AJAXError;
601
- declare const CanvasSource: typeof maplibre_gl.CanvasSource;
602
- declare const GeoJSONSource: typeof maplibre_gl.GeoJSONSource;
603
- declare const ImageSource: typeof maplibre_gl.ImageSource;
604
- declare const RasterDEMTileSource: typeof maplibre_gl.RasterDEMTileSource;
605
- declare const RasterTileSource: typeof maplibre_gl.RasterTileSource;
606
- declare const VectorTileSource: typeof maplibre_gl.VectorTileSource;
607
- declare const VideoSource: typeof maplibre_gl.VideoSource;
608
749
  declare const prewarm: () => void;
609
750
  declare const clearPrewarmedResources: () => void;
610
751
  declare const version: string;
611
752
  declare const workerCount: number;
612
753
  declare const maxParallelImageRequests: number;
613
- declare const clearStorage: (callback?: (err?: Error) => void) => void;
614
754
  declare const workerUrl: string;
615
755
  declare const addProtocol: (customProtocol: string, loadFn: (requestParameters: maplibre_gl.RequestParameters, callback: maplibre_gl.ResponseCallback<any>) => maplibre_gl.Cancelable) => void;
616
756
  declare const removeProtocol: (customProtocol: string) => void;
617
757
 
618
- export { AJAXError, AttributionControl, CanvasSource, Evented, FullscreenControl, GeoJSONSource, GeolocateControl, GeolocationType, ImageSource, Language, LanguageKey, LanguageString, LngLat, LngLatBounds, LogoControl, Map, MapOptions, MaptilerGeolocateControl, MaptilerLogoControl, MaptilerTerrainControl, Marker, Matrix2, MercatorCoordinate, NavigationControl, Point, Popup, RasterDEMTileSource, RasterTileSource, ScaleControl, SdkConfig, Style, TerrainControl, Unit, VectorTileSource, VideoSource, addProtocol, clearPrewarmedResources, clearStorage, config, getRTLTextPluginStatus, maxParallelImageRequests, prewarm, removeProtocol, setRTLTextPlugin, supported, version, workerCount, workerUrl };
758
+ declare const NavigationControlMLGL: typeof maplibre_gl.NavigationControl;
759
+ type NavigationControlMLGL = InstanceType<typeof NavigationControlMLGL>;
760
+ declare const GeolocateControlMLGL: typeof maplibre_gl.GeolocateControl;
761
+ type GeolocateControlMLGL = InstanceType<typeof GeolocateControlMLGL>;
762
+ declare const AttributionControlMLGL: typeof maplibre_gl.AttributionControl;
763
+ type AttributionControlMLGL = InstanceType<typeof AttributionControlMLGL>;
764
+ declare const LogoControlMLGL: typeof maplibre_gl.LogoControl;
765
+ type LogoControlMLGL = InstanceType<typeof LogoControlMLGL>;
766
+ declare const ScaleControlMLGL: typeof maplibre_gl.ScaleControl;
767
+ type ScaleControlMLGL = InstanceType<typeof ScaleControlMLGL>;
768
+ declare const FullscreenControlMLGL: typeof maplibre_gl.FullscreenControl;
769
+ type FullscreenControlMLGL = InstanceType<typeof FullscreenControlMLGL>;
770
+ declare const TerrainControlMLGL: typeof maplibre_gl.TerrainControl;
771
+ type TerrainControlMLGL = InstanceType<typeof TerrainControlMLGL>;
772
+ declare const MarkerMLGL: typeof maplibre_gl.Marker;
773
+ type MarkerMLGL = InstanceType<typeof MarkerMLGL>;
774
+ declare const PopupMLGL: typeof maplibre_gl.Popup;
775
+ type PopupMLGL = InstanceType<typeof PopupMLGL>;
776
+ declare const StyleMLGL: typeof maplibre_gl.Style;
777
+ type StyleMLGL = InstanceType<typeof StyleMLGL>;
778
+ declare const LngLat: typeof maplibre_gl.LngLat;
779
+ type LngLat = InstanceType<typeof LngLat>;
780
+ declare const LngLatBounds: typeof maplibre_gl.LngLatBounds;
781
+ type LngLatBounds = InstanceType<typeof LngLatBounds>;
782
+ declare const MercatorCoordinate: typeof maplibre_gl.MercatorCoordinate;
783
+ type MercatorCoordinate = InstanceType<typeof MercatorCoordinate>;
784
+ declare const Evented: typeof maplibre_gl.Evented;
785
+ type Evented = InstanceType<typeof Evented>;
786
+ declare const AJAXError: typeof maplibre_gl.AJAXError;
787
+ type AJAXError = InstanceType<typeof AJAXError>;
788
+ declare const CanvasSourceMLGL: typeof maplibre_gl.CanvasSource;
789
+ type CanvasSourceMLGL = InstanceType<typeof CanvasSourceMLGL>;
790
+ declare const GeoJSONSourceMLGL: typeof maplibre_gl.GeoJSONSource;
791
+ type GeoJSONSourceMLGL = InstanceType<typeof GeoJSONSourceMLGL>;
792
+ declare const ImageSourceMLGL: typeof maplibre_gl.ImageSource;
793
+ type ImageSourceMLGL = InstanceType<typeof ImageSourceMLGL>;
794
+ declare const RasterDEMTileSourceMLGL: typeof maplibre_gl.RasterDEMTileSource;
795
+ type RasterDEMTileSourceMLGL = InstanceType<typeof RasterDEMTileSourceMLGL>;
796
+ declare const RasterTileSourceMLGL: typeof maplibre_gl.RasterTileSource;
797
+ type RasterTileSourceMLGL = InstanceType<typeof RasterTileSourceMLGL>;
798
+ declare const VectorTileSourceMLGL: typeof maplibre_gl.VectorTileSource;
799
+ type VectorTileSourceMLGL = InstanceType<typeof VectorTileSourceMLGL>;
800
+ declare const VideoSourceMLGL: typeof maplibre_gl.VideoSource;
801
+ type VideoSourceMLGL = InstanceType<typeof VideoSourceMLGL>;
802
+ declare const MapMLGL: typeof maplibre_gl.Map;
803
+ type MapMLGL = InstanceType<typeof MapMLGL>;
804
+
805
+ export { AJAXError, AttributionControl, AttributionControlMLGL, CanvasSource, CanvasSourceMLGL, Evented, FullscreenControl, FullscreenControlMLGL, GeoJSONSource, GeoJSONSourceMLGL, GeolocateControl, GeolocateControlMLGL, GeolocationType, ImageSource, ImageSourceMLGL, Language, LanguageKey, LanguageString, LngLat, LngLatBounds, LoadWithTerrainEvent, LogoControl, LogoControlMLGL, Map, MapMLGL, MapOptions, MaptilerGeolocateControl, MaptilerLogoControl, MaptilerTerrainControl, Marker, MarkerMLGL, Matrix2, MercatorCoordinate, NavigationControl, NavigationControlMLGL, Point, Popup, PopupMLGL, RasterDEMTileSource, RasterDEMTileSourceMLGL, RasterTileSource, RasterTileSourceMLGL, ScaleControl, ScaleControlMLGL, SdkConfig, Style, StyleMLGL, TerrainControl, TerrainControlMLGL, Unit, VectorTileSource, VectorTileSourceMLGL, VideoSource, VideoSourceMLGL, addProtocol, clearPrewarmedResources, config, getRTLTextPluginStatus, maxParallelImageRequests, prewarm, removeProtocol, setRTLTextPlugin, supported, version, workerCount, workerUrl };
@@ -1 +1 @@
1
- import m from"maplibre-gl";export*from"maplibre-gl";import{Base64 as D}from"js-base64";import{v4 as z}from"uuid";import F from"events";import{config as x,expandMapStyle as V,MapStyleVariant as Z,ReferenceMapStyle as q,MapStyle as J,mapStylePresetList as W,geolocation as v}from"@maptiler/client";import{LanguageGeocoding as ne,MapStyle as oe,MapStyleVariant as se,ReferenceMapStyle as le,ServiceError as ce,coordinates as he,data as ue,geocoding as ge,geolocation as pe,staticMaps as de}from"@maptiler/client";const L={AUTO:"auto",LATIN:"latin",NON_LATIN:"nonlatin",LOCAL:"",ALBANIAN:"sq",AMHARIC:"am",ARABIC:"ar",ARMENIAN:"hy",AZERBAIJANI:"az",BASQUE:"eu",BELORUSSIAN:"be",BOSNIAN:"bs",BRETON:"br",BULGARIAN:"bg",CATALAN:"ca",CHINESE:"zh",CORSICAN:"co",CROATIAN:"hr",CZECH:"cs",DANISH:"da",DUTCH:"nl",ENGLISH:"en",ESPERANTO:"eo",ESTONIAN:"et",FINNISH:"fi",FRENCH:"fr",FRISIAN:"fy",GEORGIAN:"ka",GERMAN:"de",GREEK:"el",HEBREW:"he",HINDI:"hi",HUNGARIAN:"hu",ICELANDIC:"is",INDONESIAN:"id",IRISH:"ga",ITALIAN:"it",JAPANESE:"ja",JAPANESE_HIRAGANA:"ja-Hira",JAPANESE_KANA:"ja_kana",JAPANESE_LATIN:"ja_rm",JAPANESE_2018:"ja-Latn",KANNADA:"kn",KAZAKH:"kk",KOREAN:"ko",KOREAN_LATIN:"ko-Latn",KURDISH:"ku",ROMAN_LATIN:"la",LATVIAN:"lv",LITHUANIAN:"lt",LUXEMBOURGISH:"lb",MACEDONIAN:"mk",MALAYALAM:"ml",MALTESE:"mt",NORWEGIAN:"no",OCCITAN:"oc",POLISH:"pl",PORTUGUESE:"pt",ROMANIAN:"ro",ROMANSH:"rm",RUSSIAN:"ru",SCOTTISH_GAELIC:"gd",SERBIAN_CYRILLIC:"sr",SERBIAN_LATIN:"sr-Latn",SLOVAK:"sk",SLOVENE:"sl",SPANISH:"es",SWEDISH:"sv",TAMIL:"ta",TELUGU:"te",THAI:"th",TURKISH:"tr",UKRAINIAN:"uk",WELSH:"cy"},Y=new Set(Object.values(L));function E(r){return Y.has(r)}const X=new Set(Object.values(L));function T(){if(typeof navigator>"u")return Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0];const r=Array.from(new Set(navigator.languages.map(t=>t.split("-")[0]))).filter(t=>X.has(t));return r.length?r[0]:L.LATIN}class N extends F{constructor(){super(),this.primaryLanguage=L.AUTO,this.secondaryLanguage=null,this.session=!0,this._unit="metric",this._apiKey=""}set unit(t){this._unit=t,this.emit("unit",t)}get unit(){return this._unit}set apiKey(t){this._apiKey=t,x.apiKey=t,this.emit("apiKey",t)}get apiKey(){return this._apiKey}set fetch(t){x.fetch=t}get fetch(){return x.fetch}}const y=new N,p={maptilerLogoURL:"https://api.maptiler.com/resources/logo.svg",maptilerURL:"https://www.maptiler.com/",maptilerApiHost:"api.maptiler.com",rtlPluginURL:"https://cdn.maptiler.com/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.min.js",primaryLanguage:L.AUTO,secondaryLanguage:L.LOCAL,terrainSourceURL:"https://api.maptiler.com/tiles/terrain-rgb-v2/tiles.json",terrainSourceId:"maptiler-terrain"};Object.freeze(p);class I extends m.LogoControl{constructor(t={}){var e,n;super(t),this.logoURL="",this.linkURL="",this.logoURL=(e=t.logoURL)!=null?e:p.maptilerLogoURL,this.linkURL=(n=t.linkURL)!=null?n:p.maptilerURL}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=window.document.createElement("div"),this._container.className="maplibregl-ctrl";const e=window.document.createElement("a");return e.style.backgroundRepeat="no-repeat",e.style.cursor="pointer",e.style.display="block",e.style.height="23px",e.style.margin="0 0 -4px -4px",e.style.overflow="hidden",e.style.width="88px",e.style.backgroundImage=`url(${this.logoURL})`,e.style.backgroundSize="100px 30px",e.style.width="100px",e.style.height="30px",e.target="_blank",e.rel="noopener nofollow",e.href=this.linkURL,e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}}function Q(){m.getRTLTextPluginStatus()==="unavailable"&&m.setRTLTextPlugin(p.rtlPluginURL,null,!0)}function tt(r,t){r.forEach(e=>{!t[e]||(t[e]=t[e].bind(t))})}function S(r,t,e){const n=window.document.createElement(r);return t!==void 0&&(n.className=t),e&&e.appendChild(n),n}function et(r){r.parentNode&&r.parentNode.removeChild(r)}function w(r){return r?typeof r=="string"||r instanceof String?!r.startsWith("http")&&r.toLowerCase().includes(".json")?r:V(r):r instanceof Z?r.getExpandedStyleURL():r instanceof q?r.getDefaultVariant().getExpandedStyleURL():r:J[W[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL()}class R{constructor(){tt(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(t){return this._map=t,this._container=S("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=S("button","maplibregl-ctrl-terrain",this._container),S("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}onRemove(){et(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.hasTerrain()?this._map.disableTerrain():this._map.enableTerrain(),this._updateTerrainIcon()}_updateTerrainIcon(){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.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}}class rt extends m.NavigationControl{constructor(){super({showCompass:!0,showZoom:!0,visualizePitch:!0}),this._compass.removeEventListener("click",this._compass.clickFunction),this._compass.addEventListener("click",t=>{this._map.getPitch()===0?this._map.easeTo({pitch:Math.min(this._map.getMaxPitch(),80)}):this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})})}_createButton(t,e){const n=super._createButton(t,e);return n.clickFunction=e,n}_rotateCompassArrow(){const t=this.options.visualizePitch?`scale(${Math.min(1.5,1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5))}) rotateX(${Math.min(70,this._map.transform.pitch)}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t}}var it=Object.defineProperty,at=Object.defineProperties,nt=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,ot=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,O=(r,t,e)=>t in r?it(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,lt=(r,t)=>{for(var e in t||(t={}))ot.call(t,e)&&O(r,e,t[e]);if(P)for(var e of P(t))st.call(t,e)&&O(r,e,t[e]);return r},ct=(r,t)=>at(r,nt(t));const ht=m.GeolocateControl,U=m.Marker,M=m.LngLat;class k extends ht{constructor(){super(...arguments),this.lastUpdatedCenter=new M(0,0)}_updateCamera(t){const e=new M(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,c=this._map.getBearing(),g=ct(lt({bearing:c},this.options.fitBoundsOptions),{linear:!0}),s=this._map.getZoom();s>this.options.fitBoundsOptions.maxZoom&&(g.zoom=s),this._map.fitBounds(e.toBounds(n),g,{geolocateSource:!0});let i=!1;const a=()=>{i=!0};this._map.once("click",a),this._map.once("dblclick",a),this._map.once("dragstart",a),this._map.once("mousedown",a),this._map.once("touchstart",a),this._map.once("wheel",a),this._map.once("moveend",()=>{this._map.off("click",a),this._map.off("dblclick",a),this._map.off("dragstart",a),this._map.off("mousedown",a),this._map.off("touchstart",a),this._map.off("wheel",a),!i&&(this.lastUpdatedCenter=this._map.getCenter())})}_setupUI(t){if(this.lastUpdatedCenter=this._map.getCenter(),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=S("button","maplibregl-ctrl-geolocate",this._container),S("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",t===!1){const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}else{const e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=S("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new U(this._dotElement),this._circleElement=S("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new U({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("move",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("moveend",e=>{const n=e.originalEvent&&e.originalEvent.type==="resize",c=this.lastUpdatedCenter.distanceTo(this._map.getCenter());!e.geolocateSource&&this._watchState==="ACTIVE_LOCK"&&!n&&c>1&&(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new Event("trackuserlocationend")))})}_updateCircleRadius(){if(this._watchState!=="BACKGROUND"&&this._watchState!=="ACTIVE_LOCK")return;const t=[this._lastKnownPosition.coords.longitude,this._lastKnownPosition.coords.latitude],e=this._map.project(t),n=this._map.unproject([e.x,e.y]),c=this._map.unproject([e.x+20,e.y]),g=n.distanceTo(c)/20,s=Math.ceil(2*this._accuracy/g);this._circleElement.style.width=`${s}px`,this._circleElement.style.height=`${s}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}}var ut=Object.defineProperty,gt=Object.defineProperties,pt=Object.getOwnPropertyDescriptors,B=Object.getOwnPropertySymbols,dt=Object.prototype.hasOwnProperty,mt=Object.prototype.propertyIsEnumerable,$=(r,t,e)=>t in r?ut(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,H=(r,t)=>{for(var e in t||(t={}))dt.call(t,e)&&$(r,e,t[e]);if(B)for(var e of B(t))mt.call(t,e)&&$(r,e,t[e]);return r},j=(r,t)=>gt(r,pt(t)),C=(r,t,e)=>new Promise((n,c)=>{var g=a=>{try{i(e.next(a))}catch(u){c(u)}},s=a=>{try{i(e.throw(a))}catch(u){c(u)}},i=a=>a.done?n(a.value):Promise.resolve(a.value).then(g,s);i((e=e.apply(r,t)).next())});const K=z(),G={POINT:"POINT",COUNTRY:"COUNTRY"};class yt extends m.Map{constructor(t){var e,n;t.apiKey&&(y.apiKey=t.apiKey);const c=w(t.style),g=location.hash;y.apiKey||console.warn("MapTiler Cloud API key is not set. Visit https://maptiler.com and try Cloud for free!"),super(j(H({},t),{style:c,maplibreLogo:!1,transformRequest:s=>{let i=null;try{i=new URL(s)}catch{return{url:s,headers:{}}}return i.host===p.maptilerApiHost&&(i.searchParams.has("key")||i.searchParams.append("key",y.apiKey),y.session&&i.searchParams.append("mtsid",K)),{url:i.href,headers:{}}}})),this.languageShouldUpdate=!1,this.isStyleInitialized=!1,this.isTerrainEnabled=!1,this.terrainExaggeration=1,this.primaryLanguage=null,this.secondaryLanguage=null,this.primaryLanguage=(e=t.language)!=null?e:y.primaryLanguage,this.secondaryLanguage=y.secondaryLanguage,this.once("styledata",()=>C(this,null,function*(){if(t.geolocate===!1||t.center||t.hash&&!!g)return;try{if(t.geolocate===G.COUNTRY){yield this.fitToIpBounds();return}}catch(i){console.warn(i.message)}let s=null;try{yield this.centerOnIpPoint(t.zoom),s=this.getCameraHash()}catch(i){console.warn(i.message)}(yield navigator.permissions.query({name:"geolocation"})).state==="granted"&&navigator.geolocation.getCurrentPosition(i=>{s===this.getCameraHash()&&this.easeTo({center:[i.coords.longitude,i.coords.latitude],zoom:t.zoom||12,duration:2e3})},null,{maximumAge:24*3600*1e3,timeout:5e3,enableHighAccuracy:!1})})),this.on("styledata",()=>{this.setPrimaryLanguage(this.primaryLanguage),this.setSecondaryLanguage(this.secondaryLanguage)}),this.on("styledata",()=>{this.getTerrain()===null&&this.isTerrainEnabled&&this.enableTerrain(this.terrainExaggeration)}),this.once("load",()=>C(this,null,function*(){Q()})),this.once("load",()=>C(this,null,function*(){let s={logo:null};try{const i=Object.keys(this.style.sourceCaches).map(u=>this.getSource(u)).filter(u=>typeof u.url=="string"&&u.url.includes("tiles.json")),a=new URL(i[0].url);a.searchParams.has("key")||a.searchParams.append("key",y.apiKey),s=yield(yield fetch(a.href)).json()}catch{}if("logo"in s&&s.logo){const i=s.logo;this.addControl(new I({logoURL:i}),t.logoPosition),t.attributionControl===!1&&this.addControl(new m.AttributionControl(t))}else t.maptilerLogo&&this.addControl(new I,t.logoPosition);if(t.scaleControl){const i=t.scaleControl===!0||t.scaleControl===void 0?"bottom-right":t.scaleControl,a=new m.ScaleControl({unit:y.unit});this.addControl(a,i),y.on("unit",u=>{a.setUnit(u)})}if(t.navigationControl!==!1){const i=t.navigationControl===!0||t.navigationControl===void 0?"top-right":t.navigationControl;this.addControl(new rt,i)}if(t.geolocateControl!==!1){const i=t.geolocateControl===!0||t.geolocateControl===void 0?"top-right":t.geolocateControl;this.addControl(new k({positionOptions:{enableHighAccuracy:!0,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!0,showAccuracyCircle:!0,showUserLocation:!0}),i)}if(t.terrainControl){const i=t.terrainControl===!0||t.terrainControl===void 0?"top-right":t.terrainControl;this.addControl(new R,i)}if(t.fullscreenControl){const i=t.fullscreenControl===!0||t.fullscreenControl===void 0?"top-right":t.fullscreenControl;this.addControl(new m.FullscreenControl({}),i)}})),t.terrain&&this.enableTerrain((n=t.terrainExaggeration)!=null?n:this.terrainExaggeration)}setStyle(t,e){return super.setStyle(w(t),e)}setLanguage(t=p.primaryLanguage){if(t===L.AUTO)return this.setLanguage(T());this.setPrimaryLanguage(t)}setPrimaryLanguage(t=p.primaryLanguage){!E(t)||(this.primaryLanguage=t,this.onStyleReady(()=>{if(t===L.AUTO)return this.setPrimaryLanguage(T());const e=this.getStyle().layers,n=/^\s*{\s*name\s*(:\s*(\S*))?\s*}$/,c=/^\s*name\s*(:\s*(\S*))?\s*$/,g=/^\s*{\s*name\s*(:\s*(\S*))?\s*}(\s*){\s*name\s*(:\s*(\S*))?\s*}$/,s=/^(.*)({\s*name\s*(:\s*(\S*))?\s*})(.*)$/,i=t?`name:${t}`:"name",a=["case",["has",i],["get",i],["get","name:latin"]];for(let u=0;u<e.length;u+=1){const h=e[u],f=h.layout;if(!f||!f["text-field"])continue;const o=this.getLayoutProperty(h.id,"text-field");let d;if(Array.isArray(o)&&o.length>=2&&o[0].trim().toLowerCase()==="concat"){const l=o.slice();for(let A=0;A<o.length;A+=1){const _=o[A];if((typeof _=="string"||_ instanceof String)&&n.exec(_.toString())){l[A]=a;break}else if(Array.isArray(_)&&_.length>=2&&_[0].trim().toLowerCase()==="get"&&c.exec(_[1].toString())){l[A]=a;break}else if(Array.isArray(_)&&_.length===4&&_[0].trim().toLowerCase()==="case"){l[A]=a;break}}this.setLayoutProperty(h.id,"text-field",l)}else if(Array.isArray(o)&&o.length>=2&&o[0].trim().toLowerCase()==="get"&&c.exec(o[1].toString())){const l=a;this.setLayoutProperty(h.id,"text-field",l)}else if((typeof o=="string"||o instanceof String)&&n.exec(o.toString())){const l=a;this.setLayoutProperty(h.id,"text-field",l)}else if(Array.isArray(o)&&o.length===4&&o[0].trim().toLowerCase()==="case"){const l=a;this.setLayoutProperty(h.id,"text-field",l)}else if((typeof o=="string"||o instanceof String)&&(d=g.exec(o.toString()))!==null){const l=`{${i}}${d[3]}{name${d[4]||""}}`;this.setLayoutProperty(h.id,"text-field",l)}else if((typeof o=="string"||o instanceof String)&&(d=s.exec(o.toString()))!==null){const l=`${d[1]}{${i}}${d[5]}`;this.setLayoutProperty(h.id,"text-field",l)}}}))}setSecondaryLanguage(t=p.secondaryLanguage){!E(t)||(this.secondaryLanguage=t,this.onStyleReady(()=>{if(t===L.AUTO)return this.setSecondaryLanguage(T());const e=this.getStyle().layers,n=/^\s*{\s*name\s*(:\s*(\S*))?\s*}$/,c=/^\s*name\s*(:\s*(\S*))?\s*$/,g=/^\s*{\s*name\s*(:\s*(\S*))?\s*}(\s*){\s*name\s*(:\s*(\S*))?\s*}$/;let s;for(let i=0;i<e.length;i+=1){const a=e[i],u=a.layout;if(!u||!u["text-field"])continue;const h=this.getLayoutProperty(a.id,"text-field");let f;if(Array.isArray(h)&&h.length>=2&&h[0].trim().toLowerCase()==="concat"){f=h.slice();let o=0;for(let d=0;d<h.length;d+=1){const l=h[d];if((typeof l=="string"||l instanceof String)&&n.exec(l.toString())){if(o===1){f[d]=`{name:${t}}`;break}o+=1}else if(Array.isArray(l)&&l.length>=2&&l[0].trim().toLowerCase()==="get"&&c.exec(l[1].toString())){if(o===1){f[d][1]=`name:${t}`;break}o+=1}else if(Array.isArray(l)&&l.length===4&&l[0].trim().toLowerCase()==="case"){if(o===1){f[d]=["get",`name:${t}`];break}o+=1}}this.setLayoutProperty(a.id,"text-field",f)}else if((typeof h=="string"||h instanceof String)&&(s=g.exec(h.toString()))!==null){const o=t?`name:${t}`:"name";f=`{name${s[1]||""}}${s[3]}{${o}}`,this.setLayoutProperty(a.id,"text-field",f)}}}))}getPrimaryLanguage(){return this.primaryLanguage}getSecondaryLanguage(){return this.secondaryLanguage}getTerrainExaggeration(){return this.terrainExaggeration}hasTerrain(){return this.isTerrainEnabled}enableTerrain(t=this.terrainExaggeration){if(t<0){console.warn("Terrain exaggeration cannot be negative.");return}const e=this.getTerrain(),n=()=>{this.isTerrainEnabled=!0,this.terrainExaggeration=t,this.addSource(p.terrainSourceId,{type:"raster-dem",url:p.terrainSourceURL}),this.setTerrain({source:p.terrainSourceId,exaggeration:t})};if(e){this.setTerrain(j(H({},e),{exaggeration:t}));return}this.loaded()||this.isTerrainEnabled?n():this.once("load",()=>{this.getTerrain()&&this.getSource(p.terrainSourceId)||n()})}disableTerrain(){this.isTerrainEnabled=!1,this.setTerrain(null),this.getSource(p.terrainSourceId)&&this.removeSource(p.terrainSourceId)}setTerrainExaggeration(t){this.enableTerrain(t)}onStyleReady(t){this.isStyleLoaded()?t():this.once("styledata",()=>{t()})}fitToIpBounds(){return C(this,null,function*(){const t=yield v.info();this.fitBounds(t.country_bounds,{duration:0,padding:100})})}centerOnIpPoint(t){return C(this,null,function*(){const e=yield v.info();this.jumpTo({center:[e.longitude,e.latitude],zoom:t||11})})}getCameraHash(){const t=new Float32Array(5),e=this.getCenter();return t[0]=e.lng,t[1]=e.lat,t[2]=this.getZoom(),t[3]=this.getPitch(),t[4]=this.getBearing(),D.fromUint8Array(new Uint8Array(t.buffer))}getSdkConfig(){return y}getMaptilerSessionId(){return K}}class b{constructor(t,e){this.x=t,this.y=e}_matMult(t){const e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this}_add(t){return this.x+=t.x,this.y+=t.y,this}_sub(t){return this.x-=t.x,this.y-=t.y,this}_mult(t){return this.x*=t,this.y*=t,this}_div(t){return this.x/=t,this.y/=t,this}_multByPoint(t){return this.x*=t.x,this.y*=t.y,this}_divByPoint(t){return this.x/=t.x,this.y/=t.y,this}_unit(){return this._div(this.mag()),this}_perp(){const t=this.y;return this.y=this.x,this.x=-t,this}_rotate(t){const e=Math.cos(t),n=Math.sin(t),c=e*this.x-n*this.y,g=n*this.x+e*this.y;return this.x=c,this.y=g,this}_rotateAround(t,e){const n=Math.cos(t),c=Math.sin(t),g=e.x+n*(this.x-e.x)-c*(this.y-e.y),s=e.y+c*(this.x-e.x)+n*(this.y-e.y);return this.x=g,this.y=s,this}_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}clone(){return new b(this.x,this.y)}add(t){return this.clone()._add(t)}sub(t){return this.clone()._sub(t)}multByPoint(t){return this.clone()._multByPoint(t)}divByPoint(t){return this.clone()._divByPoint(t)}mult(t){return this.clone()._mult(t)}div(t){return this.clone()._div(t)}rotate(t){return this.clone()._rotate(t)}rotateAround(t,e){return this.clone()._rotateAround(t,e)}matMult(t){return this.clone()._matMult(t)}unit(){return this.clone()._unit()}perp(){return this.clone()._perp()}round(){return this.clone()._round()}mag(){return Math.sqrt(this.x*this.x+this.y*this.y)}equals(t){return this.x===t.x&&this.y===t.y}dist(t){return Math.sqrt(this.distSqr(t))}distSqr(t){const e=t.x-this.x,n=t.y-this.y;return e*e+n*n}angle(){return Math.atan2(this.y,this.x)}angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)}angleWith(t){return this.angleWithSep(t.x,t.y)}angleWithSep(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)}static convert(t){return t instanceof b?t:Array.isArray(t)?new b(t[0],t[1]):t}}const{supported:ft,setRTLTextPlugin:_t,getRTLTextPluginStatus:Lt,NavigationControl:St,GeolocateControl:At,AttributionControl:Ct,LogoControl:bt,ScaleControl:xt,FullscreenControl:Tt,TerrainControl:It,Popup:vt,Marker:Et,Style:Nt,LngLat:wt,LngLatBounds:Rt,MercatorCoordinate:Pt,Evented:Ot,AJAXError:Ut,CanvasSource:Mt,GeoJSONSource:kt,ImageSource:Bt,RasterDEMTileSource:$t,RasterTileSource:Ht,VectorTileSource:jt,VideoSource:Kt,prewarm:Gt,clearPrewarmedResources:Dt,version:zt,workerCount:Ft,maxParallelImageRequests:Vt,clearStorage:Zt,workerUrl:qt,addProtocol:Jt,removeProtocol:Wt}=m;export{Ut as AJAXError,Ct as AttributionControl,Mt as CanvasSource,Ot as Evented,Tt as FullscreenControl,kt as GeoJSONSource,At as GeolocateControl,G as GeolocationType,Bt as ImageSource,L as Language,ne as LanguageGeocoding,wt as LngLat,Rt as LngLatBounds,bt as LogoControl,yt as Map,oe as MapStyle,se as MapStyleVariant,k as MaptilerGeolocateControl,I as MaptilerLogoControl,R as MaptilerTerrainControl,Et as Marker,Pt as MercatorCoordinate,St as NavigationControl,b as Point,vt as Popup,$t as RasterDEMTileSource,Ht as RasterTileSource,le as ReferenceMapStyle,xt as ScaleControl,N as SdkConfig,ce as ServiceError,Nt as Style,It as TerrainControl,jt as VectorTileSource,Kt as VideoSource,Jt as addProtocol,Dt as clearPrewarmedResources,Zt as clearStorage,y as config,he as coordinates,ue as data,ge as geocoding,pe as geolocation,Lt as getRTLTextPluginStatus,Vt as maxParallelImageRequests,Gt as prewarm,Wt as removeProtocol,_t as setRTLTextPlugin,de as staticMaps,ft as supported,zt as version,Ft as workerCount,qt as workerUrl};
1
+ import a from"maplibre-gl";export*from"maplibre-gl";import{Base64 as q}from"js-base64";import{v4 as W}from"uuid";import J from"events";import{config as T,expandMapStyle as Z,MapStyleVariant as Y,ReferenceMapStyle as X,MapStyle as Q,mapStylePresetList as tt,geolocation as w}from"@maptiler/client";import{LanguageGeocoding as me,MapStyle as ye,MapStyleVariant as Ae,ReferenceMapStyle as fe,ServiceError as Le,coordinates as _e,data as Se,geocoding as xe,geolocation as Ce,staticMaps as Te}from"@maptiler/client";const L={AUTO:"auto",LATIN:"latin",NON_LATIN:"nonlatin",LOCAL:"",ALBANIAN:"sq",AMHARIC:"am",ARABIC:"ar",ARMENIAN:"hy",AZERBAIJANI:"az",BASQUE:"eu",BELORUSSIAN:"be",BOSNIAN:"bs",BRETON:"br",BULGARIAN:"bg",CATALAN:"ca",CHINESE:"zh",CORSICAN:"co",CROATIAN:"hr",CZECH:"cs",DANISH:"da",DUTCH:"nl",ENGLISH:"en",ESPERANTO:"eo",ESTONIAN:"et",FINNISH:"fi",FRENCH:"fr",FRISIAN:"fy",GEORGIAN:"ka",GERMAN:"de",GREEK:"el",HEBREW:"he",HINDI:"hi",HUNGARIAN:"hu",ICELANDIC:"is",INDONESIAN:"id",IRISH:"ga",ITALIAN:"it",JAPANESE:"ja",JAPANESE_HIRAGANA:"ja-Hira",JAPANESE_KANA:"ja_kana",JAPANESE_LATIN:"ja_rm",JAPANESE_2018:"ja-Latn",KANNADA:"kn",KAZAKH:"kk",KOREAN:"ko",KOREAN_LATIN:"ko-Latn",KURDISH:"ku",ROMAN_LATIN:"la",LATVIAN:"lv",LITHUANIAN:"lt",LUXEMBOURGISH:"lb",MACEDONIAN:"mk",MALAYALAM:"ml",MALTESE:"mt",NORWEGIAN:"no",OCCITAN:"oc",POLISH:"pl",PORTUGUESE:"pt",ROMANIAN:"ro",ROMANSH:"rm",RUSSIAN:"ru",SCOTTISH_GAELIC:"gd",SERBIAN_CYRILLIC:"sr",SERBIAN_LATIN:"sr-Latn",SLOVAK:"sk",SLOVENE:"sl",SPANISH:"es",SWEDISH:"sv",TAMIL:"ta",TELUGU:"te",THAI:"th",TURKISH:"tr",UKRAINIAN:"uk",WELSH:"cy"},et=new Set(Object.values(L));function v(r){return et.has(r)}const rt=new Set(Object.values(L));function b(){if(typeof navigator>"u")return Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0];const r=Array.from(new Set(navigator.languages.map(t=>t.split("-")[0]))).filter(t=>rt.has(t));return r.length?r[0]:L.LATIN}let E=class extends J{constructor(){super(),this.primaryLanguage=L.AUTO,this.secondaryLanguage=null,this.session=!0,this._unit="metric",this._apiKey=""}set unit(t){this._unit=t,this.emit("unit",t)}get unit(){return this._unit}set apiKey(t){this._apiKey=t,T.apiKey=t,this.emit("apiKey",t)}get apiKey(){return this._apiKey}set fetch(t){T.fetch=t}get fetch(){return T.fetch}};const A=new E,y={maptilerLogoURL:"https://api.maptiler.com/resources/logo.svg",maptilerURL:"https://www.maptiler.com/",maptilerApiHost:"api.maptiler.com",rtlPluginURL:"https://cdn.maptiler.com/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.min.js",primaryLanguage:L.AUTO,secondaryLanguage:L.LOCAL,terrainSourceURL:"https://api.maptiler.com/tiles/terrain-rgb-v2/tiles.json",terrainSourceId:"maptiler-terrain"};Object.freeze(y);class N extends a.LogoControl{onAdd(t){return super.onAdd(t)}}class I extends N{constructor(t={}){var e,n;super(t),this.logoURL="",this.linkURL="",this.logoURL=(e=t.logoURL)!=null?e:y.maptilerLogoURL,this.linkURL=(n=t.linkURL)!=null?n:y.maptilerURL}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=window.document.createElement("div"),this._container.className="maplibregl-ctrl";const e=window.document.createElement("a");return e.style.backgroundRepeat="no-repeat",e.style.cursor="pointer",e.style.display="block",e.style.height="23px",e.style.margin="0 0 -4px -4px",e.style.overflow="hidden",e.style.width="88px",e.style.backgroundImage=`url(${this.logoURL})`,e.style.backgroundSize="100px 30px",e.style.width="100px",e.style.height="30px",e.target="_blank",e.rel="noopener nofollow",e.href=this.linkURL,e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}}function it(){a.getRTLTextPluginStatus()==="unavailable"&&a.setRTLTextPlugin(y.rtlPluginURL,null,!0)}function nt(r,t){r.forEach(e=>{t[e]&&(t[e]=t[e].bind(t))})}function S(r,t,e){const n=window.document.createElement(r);return t!==void 0&&(n.className=t),e&&e.appendChild(n),n}function at(r){r.parentNode&&r.parentNode.removeChild(r)}function R(r){return r?typeof r=="string"||r instanceof String?!r.startsWith("http")&&r.toLowerCase().includes(".json")?r:Z(r):r instanceof Y?r.getExpandedStyleURL():r instanceof X?r.getDefaultVariant().getExpandedStyleURL():r:Q[tt[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL()}class P{constructor(){nt(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(t){return this._map=t,this._container=S("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=S("button","maplibregl-ctrl-terrain",this._container),S("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}onRemove(){at(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.hasTerrain()?this._map.disableTerrain():this._map.enableTerrain(),this._updateTerrainIcon()}_updateTerrainIcon(){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.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}}class M extends a.NavigationControl{onAdd(t){return super.onAdd(t)}}class ot extends M{constructor(){super({showCompass:!0,showZoom:!0,visualizePitch:!0}),this._compass.removeEventListener("click",this._compass.clickFunction),this._compass.addEventListener("click",t=>{this._map.getPitch()===0?this._map.easeTo({pitch:Math.min(this._map.getMaxPitch(),80)}):this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})})}_createButton(t,e){const n=super._createButton(t,e);return n.clickFunction=e,n}_rotateCompassArrow(){const t=this.options.visualizePitch?`scale(${Math.min(1.5,1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5))}) rotateX(${Math.min(70,this._map.transform.pitch)}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t}}class O extends a.GeolocateControl{onAdd(t){return super.onAdd(t)}}var st=Object.defineProperty,lt=Object.defineProperties,ct=Object.getOwnPropertyDescriptors,U=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,ut=Object.prototype.propertyIsEnumerable,k=(r,t,e)=>t in r?st(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,dt=(r,t)=>{for(var e in t||(t={}))ht.call(t,e)&&k(r,e,t[e]);if(U)for(var e of U(t))ut.call(t,e)&&k(r,e,t[e]);return r},gt=(r,t)=>lt(r,ct(t));const B=a.Marker,$=a.LngLat;class G extends O{constructor(){super(...arguments),this.lastUpdatedCenter=new $(0,0)}_updateCamera(t){const e=new $(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,s=this._map.getBearing(),d=gt(dt({bearing:s},this.options.fitBoundsOptions),{linear:!0}),u=this._map.getZoom();u>this.options.fitBoundsOptions.maxZoom&&(d.zoom=u),this._map.fitBounds(e.toBounds(n),d,{geolocateSource:!0});let h=!1;const o=()=>{h=!0};this._map.once("click",o),this._map.once("dblclick",o),this._map.once("dragstart",o),this._map.once("mousedown",o),this._map.once("touchstart",o),this._map.once("wheel",o),this._map.once("moveend",()=>{this._map.off("click",o),this._map.off("dblclick",o),this._map.off("dragstart",o),this._map.off("mousedown",o),this._map.off("touchstart",o),this._map.off("wheel",o),!h&&(this.lastUpdatedCenter=this._map.getCenter())})}_setupUI(t){if(this.lastUpdatedCenter=this._map.getCenter(),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=S("button","maplibregl-ctrl-geolocate",this._container),S("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",t===!1){const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}else{const e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=S("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new B(this._dotElement),this._circleElement=S("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new B({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("move",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("moveend",e=>{const n=e.originalEvent&&e.originalEvent.type==="resize",s=this.lastUpdatedCenter.distanceTo(this._map.getCenter());!e.geolocateSource&&this._watchState==="ACTIVE_LOCK"&&!n&&s>1&&(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new Event("trackuserlocationend")))})}_updateCircleRadius(){if(this._watchState!=="BACKGROUND"&&this._watchState!=="ACTIVE_LOCK")return;const t=[this._lastKnownPosition.coords.longitude,this._lastKnownPosition.coords.latitude],e=this._map.project(t),n=this._map.unproject([e.x,e.y]),s=this._map.unproject([e.x+20,e.y]),d=n.distanceTo(s)/20,u=Math.ceil(2*this._accuracy/d);this._circleElement.style.width=`${u}px`,this._circleElement.style.height=`${u}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}}class H extends a.AttributionControl{onAdd(t){return super.onAdd(t)}}class j extends a.ScaleControl{onAdd(t){return super.onAdd(t)}}class K extends a.FullscreenControl{onAdd(t){return super.onAdd(t)}}var pt=Object.defineProperty,mt=Object.defineProperties,yt=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertySymbols,At=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable,D=(r,t,e)=>t in r?pt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Lt=(r,t)=>{for(var e in t||(t={}))At.call(t,e)&&D(r,e,t[e]);if(F)for(var e of F(t))ft.call(t,e)&&D(r,e,t[e]);return r},_t=(r,t)=>mt(r,yt(t)),_=(r,t,e)=>new Promise((n,s)=>{var d=o=>{try{h(e.next(o))}catch(m){s(m)}},u=o=>{try{h(e.throw(o))}catch(m){s(m)}},h=o=>o.done?n(o.value):Promise.resolve(o.value).then(d,u);h((e=e.apply(r,t)).next())});const V=W(),z={POINT:"POINT",COUNTRY:"COUNTRY"};class St extends a.Map{constructor(t){var e,n,s;t.apiKey&&(A.apiKey=t.apiKey);const d=R(t.style),u=location.hash;A.apiKey||console.warn("MapTiler Cloud API key is not set. Visit https://maptiler.com and try Cloud for free!"),super(_t(Lt({},t),{style:d,maplibreLogo:!1,transformRequest:c=>{let i=null;try{i=new URL(c)}catch{return{url:c,headers:{}}}return i.host===y.maptilerApiHost&&(i.searchParams.has("key")||i.searchParams.append("key",A.apiKey),A.session&&i.searchParams.append("mtsid",V)),{url:i.href,headers:{}}}})),this.isTerrainEnabled=!1,this.terrainExaggeration=1,this.primaryLanguage=null,this.secondaryLanguage=null,this.terrainGrowing=!1,this.terrainFlattening=!1,this.primaryLanguage=(e=t.language)!=null?e:A.primaryLanguage,this.secondaryLanguage=A.secondaryLanguage,this.terrainExaggeration=(n=t.terrainExaggeration)!=null?n:this.terrainExaggeration,this.once("styledata",()=>_(this,null,function*(){if(!t.geolocate||t.center||t.hash&&u)return;try{if(t.geolocate===z.COUNTRY){yield this.fitToIpBounds();return}}catch(i){console.warn(i.message)}let c=null;try{yield this.centerOnIpPoint(t.zoom),c=this.getCameraHash()}catch(i){console.warn(i.message)}(yield navigator.permissions.query({name:"geolocation"})).state==="granted"&&navigator.geolocation.getCurrentPosition(i=>{c===this.getCameraHash()&&(this.terrain?this.easeTo({center:[i.coords.longitude,i.coords.latitude],zoom:t.zoom||12,duration:2e3}):this.once("terrain",()=>{this.easeTo({center:[i.coords.longitude,i.coords.latitude],zoom:t.zoom||12,duration:2e3})}))},null,{maximumAge:24*3600*1e3,timeout:5e3,enableHighAccuracy:!1})})),this.on("styledata",()=>{this.setPrimaryLanguage(this.primaryLanguage),this.setSecondaryLanguage(this.secondaryLanguage)}),this.on("styledata",()=>{this.getTerrain()===null&&this.isTerrainEnabled&&this.enableTerrain(this.terrainExaggeration)}),this.once("load",()=>_(this,null,function*(){it()})),this.once("load",()=>_(this,null,function*(){let c={logo:null};try{const i=Object.keys(this.style.sourceCaches).map(l=>this.getSource(l)).filter(l=>typeof l.url=="string"&&l.url.includes("tiles.json")),p=new URL(i[0].url);p.searchParams.has("key")||p.searchParams.append("key",A.apiKey),c=yield(yield fetch(p.href)).json()}catch{}if("logo"in c&&c.logo){const i=c.logo;this.addControl(new I({logoURL:i}),t.logoPosition),t.attributionControl===!1&&this.addControl(new H(t))}else t.maptilerLogo&&this.addControl(new I,t.logoPosition);if(t.scaleControl){const i=t.scaleControl===!0||t.scaleControl===void 0?"bottom-right":t.scaleControl,p=new j({unit:A.unit});this.addControl(p,i),A.on("unit",l=>{p.setUnit(l)})}if(t.navigationControl!==!1){const i=t.navigationControl===!0||t.navigationControl===void 0?"top-right":t.navigationControl;this.addControl(new ot,i)}if(t.geolocateControl!==!1){const i=t.geolocateControl===!0||t.geolocateControl===void 0?"top-right":t.geolocateControl;this.addControl(new G({positionOptions:{enableHighAccuracy:!0,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!0,showAccuracyCircle:!0,showUserLocation:!0}),i)}if(t.terrainControl){const i=t.terrainControl===!0||t.terrainControl===void 0?"top-right":t.terrainControl;this.addControl(new P,i)}if(t.fullscreenControl){const i=t.fullscreenControl===!0||t.fullscreenControl===void 0?"top-right":t.fullscreenControl;this.addControl(new K({}),i)}}));let h=!1,o=!1,m=null;this.once("load",c=>{h=!0,o&&this.fire("loadWithTerrain",m)});const g=c=>{c.terrain&&(o=!0,m={type:"loadWithTerrain",target:this,terrain:c.terrain},this.off("terrain",g),h&&this.fire("loadWithTerrain",m))};this.on("terrain",g),t.terrain&&this.enableTerrain((s=t.terrainExaggeration)!=null?s:this.terrainExaggeration)}onLoadAsync(){return _(this,null,function*(){return new Promise((t,e)=>{if(this.loaded())return t(this);this.once("load",n=>{t(this)})})})}onLoadWithTerrainAsync(){return _(this,null,function*(){return new Promise((t,e)=>{if(this.loaded()&&this.terrain)return t(this);this.once("loadWithTerrain",n=>{t(this)})})})}setStyle(t,e){return super.setStyle(R(t),e)}setLanguage(t=y.primaryLanguage){if(t===L.AUTO)return this.setLanguage(b());this.setPrimaryLanguage(t)}setPrimaryLanguage(t=y.primaryLanguage){v(t)&&(this.primaryLanguage=t,this.onStyleReady(()=>{if(t===L.AUTO)return this.setPrimaryLanguage(b());const e=this.getStyle().layers,n=/^\s*{\s*name\s*(:\s*(\S*))?\s*}$/,s=/^\s*name\s*(:\s*(\S*))?\s*$/,d=/^\s*{\s*name\s*(:\s*(\S*))?\s*}(\s*){\s*name\s*(:\s*(\S*))?\s*}$/,u=/^(.*)({\s*name\s*(:\s*(\S*))?\s*})(.*)$/,h=t?`name:${t}`:"name",o=["case",["has",h],["get",h],["get","name:latin"]];for(let m=0;m<e.length;m+=1){const g=e[m],c=g.layout;if(!c||!c["text-field"])continue;const i=this.getLayoutProperty(g.id,"text-field");let p;if(Array.isArray(i)&&i.length>=2&&i[0].trim().toLowerCase()==="concat"){const l=i.slice();for(let x=0;x<i.length;x+=1){const f=i[x];if((typeof f=="string"||f instanceof String)&&n.exec(f.toString())){l[x]=o;break}else if(Array.isArray(f)&&f.length>=2&&f[0].trim().toLowerCase()==="get"&&s.exec(f[1].toString())){l[x]=o;break}else if(Array.isArray(f)&&f.length===4&&f[0].trim().toLowerCase()==="case"){l[x]=o;break}}this.setLayoutProperty(g.id,"text-field",l)}else if(Array.isArray(i)&&i.length>=2&&i[0].trim().toLowerCase()==="get"&&s.exec(i[1].toString())){const l=o;this.setLayoutProperty(g.id,"text-field",l)}else if((typeof i=="string"||i instanceof String)&&n.exec(i.toString())){const l=o;this.setLayoutProperty(g.id,"text-field",l)}else if(Array.isArray(i)&&i.length===4&&i[0].trim().toLowerCase()==="case"){const l=o;this.setLayoutProperty(g.id,"text-field",l)}else if((typeof i=="string"||i instanceof String)&&(p=d.exec(i.toString()))!==null){const l=`{${h}}${p[3]}{name${p[4]||""}}`;this.setLayoutProperty(g.id,"text-field",l)}else if((typeof i=="string"||i instanceof String)&&(p=u.exec(i.toString()))!==null){const l=`${p[1]}{${h}}${p[5]}`;this.setLayoutProperty(g.id,"text-field",l)}}}))}setSecondaryLanguage(t=y.secondaryLanguage){v(t)&&(this.secondaryLanguage=t,this.onStyleReady(()=>{if(t===L.AUTO)return this.setSecondaryLanguage(b());const e=this.getStyle().layers,n=/^\s*{\s*name\s*(:\s*(\S*))?\s*}$/,s=/^\s*name\s*(:\s*(\S*))?\s*$/,d=/^\s*{\s*name\s*(:\s*(\S*))?\s*}(\s*){\s*name\s*(:\s*(\S*))?\s*}$/;let u;for(let h=0;h<e.length;h+=1){const o=e[h],m=o.layout;if(!m||!m["text-field"])continue;const g=this.getLayoutProperty(o.id,"text-field");let c;if(Array.isArray(g)&&g.length>=2&&g[0].trim().toLowerCase()==="concat"){c=g.slice();let i=0;for(let p=0;p<g.length;p+=1){const l=g[p];if((typeof l=="string"||l instanceof String)&&n.exec(l.toString())){if(i===1){c[p]=`{name:${t}}`;break}i+=1}else if(Array.isArray(l)&&l.length>=2&&l[0].trim().toLowerCase()==="get"&&s.exec(l[1].toString())){if(i===1){c[p][1]=`name:${t}`;break}i+=1}else if(Array.isArray(l)&&l.length===4&&l[0].trim().toLowerCase()==="case"){if(i===1){c[p]=["get",`name:${t}`];break}i+=1}}this.setLayoutProperty(o.id,"text-field",c)}else if((typeof g=="string"||g instanceof String)&&(u=d.exec(g.toString()))!==null){const i=t?`name:${t}`:"name";c=`{name${u[1]||""}}${u[3]}{${i}}`,this.setLayoutProperty(o.id,"text-field",c)}}}))}getPrimaryLanguage(){return this.primaryLanguage}getSecondaryLanguage(){return this.secondaryLanguage}getTerrainExaggeration(){return this.terrainExaggeration}hasTerrain(){return this.isTerrainEnabled}growTerrain(t,e=1e3){if(!this.terrain)return;const n=performance.now(),s=this.terrain.exaggeration,d=t-s,u=()=>{if(!this.terrain||this.terrainFlattening)return;const h=(performance.now()-n)/e;if(h<.99){const o=1-Math.pow(1-h,4),m=s+o*d;this.terrain.exaggeration=m,requestAnimationFrame(u)}else this.terrainGrowing=!1,this.terrainFlattening=!1,this.terrain.exaggeration=t;this.triggerRepaint()};this.terrainGrowing=!0,this.terrainFlattening=!1,requestAnimationFrame(u)}enableTerrain(t=this.terrainExaggeration){if(t<0){console.warn("Terrain exaggeration cannot be negative.");return}const e=s=>_(this,null,function*(){!this.terrain||s.type!=="data"||s.dataType!=="source"||!("source"in s)||s.sourceId!=="maptiler-terrain"||s.source.type!=="raster-dem"||s.isSourceLoaded&&(this.off("data",e),this.growTerrain(t))}),n=()=>{this.isTerrainEnabled=!0,this.terrainExaggeration=t,this.on("data",e),this.addSource(y.terrainSourceId,{type:"raster-dem",url:y.terrainSourceURL}),this.setTerrain({source:y.terrainSourceId,exaggeration:0})};if(this.getTerrain()){this.isTerrainEnabled=!0,this.growTerrain(t);return}this.loaded()||this.isTerrainEnabled?n():this.once("load",()=>{this.getTerrain()&&this.getSource(y.terrainSourceId)||n()})}disableTerrain(){if(!this.terrain)return;this.isTerrainEnabled=!1;const t=1*1e3,e=performance.now(),n=this.terrain.exaggeration,s=()=>{if(!this.terrain||this.terrainGrowing)return;const d=(performance.now()-e)/t;if(d<.99){const u=Math.pow(1-d,4),h=n*u;this.terrain.exaggeration=h,requestAnimationFrame(s)}else this.terrain.exaggeration=0,this.terrainGrowing=!1,this.terrainFlattening=!1,this.setTerrain(null),this.getSource(y.terrainSourceId)&&this.removeSource(y.terrainSourceId);this.triggerRepaint()};this.terrainGrowing=!1,this.terrainFlattening=!0,requestAnimationFrame(s)}setTerrainExaggeration(t,e=!0){!e&&this.terrain?(this.terrainExaggeration=t,this.terrain.exaggeration=t,this.triggerRepaint()):this.enableTerrain(t)}onStyleReady(t){this.isStyleLoaded()?t():this.once("styledata",()=>{t()})}fitToIpBounds(){return _(this,null,function*(){const t=yield w.info();this.fitBounds(t.country_bounds,{duration:0,padding:100})})}centerOnIpPoint(t){return _(this,null,function*(){const e=yield w.info();this.jumpTo({center:[e.longitude,e.latitude],zoom:t||11})})}getCameraHash(){const t=new Float32Array(5),e=this.getCenter();return t[0]=e.lng,t[1]=e.lat,t[2]=this.getZoom(),t[3]=this.getPitch(),t[4]=this.getBearing(),q.fromUint8Array(new Uint8Array(t.buffer))}getSdkConfig(){return A}getMaptilerSessionId(){return V}}class xt extends a.Marker{addTo(t){return super.addTo(t)}}class Ct extends a.Popup{addTo(t){return super.addTo(t)}}class Tt extends a.Style{constructor(t,e={}){super(t,e)}}class bt extends a.CanvasSource{onAdd(t){super.onAdd(t)}}class It extends a.GeoJSONSource{onAdd(t){super.onAdd(t)}}class wt extends a.ImageSource{onAdd(t){super.onAdd(t)}}class vt extends a.RasterTileSource{onAdd(t){super.onAdd(t)}}class Et extends a.RasterDEMTileSource{onAdd(t){super.onAdd(t)}}class Nt extends a.VectorTileSource{onAdd(t){super.onAdd(t)}}class Rt extends a.VideoSource{onAdd(t){super.onAdd(t)}}class Pt extends a.TerrainControl{onAdd(t){return super.onAdd(t)}}class C{constructor(t,e){this.x=t,this.y=e}_matMult(t){const e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this}_add(t){return this.x+=t.x,this.y+=t.y,this}_sub(t){return this.x-=t.x,this.y-=t.y,this}_mult(t){return this.x*=t,this.y*=t,this}_div(t){return this.x/=t,this.y/=t,this}_multByPoint(t){return this.x*=t.x,this.y*=t.y,this}_divByPoint(t){return this.x/=t.x,this.y/=t.y,this}_unit(){return this._div(this.mag()),this}_perp(){const t=this.y;return this.y=this.x,this.x=-t,this}_rotate(t){const e=Math.cos(t),n=Math.sin(t),s=e*this.x-n*this.y,d=n*this.x+e*this.y;return this.x=s,this.y=d,this}_rotateAround(t,e){const n=Math.cos(t),s=Math.sin(t),d=e.x+n*(this.x-e.x)-s*(this.y-e.y),u=e.y+s*(this.x-e.x)+n*(this.y-e.y);return this.x=d,this.y=u,this}_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}clone(){return new C(this.x,this.y)}add(t){return this.clone()._add(t)}sub(t){return this.clone()._sub(t)}multByPoint(t){return this.clone()._multByPoint(t)}divByPoint(t){return this.clone()._divByPoint(t)}mult(t){return this.clone()._mult(t)}div(t){return this.clone()._div(t)}rotate(t){return this.clone()._rotate(t)}rotateAround(t,e){return this.clone()._rotateAround(t,e)}matMult(t){return this.clone()._matMult(t)}unit(){return this.clone()._unit()}perp(){return this.clone()._perp()}round(){return this.clone()._round()}mag(){return Math.sqrt(this.x*this.x+this.y*this.y)}equals(t){return this.x===t.x&&this.y===t.y}dist(t){return Math.sqrt(this.distSqr(t))}distSqr(t){const e=t.x-this.x,n=t.y-this.y;return e*e+n*n}angle(){return Math.atan2(this.y,this.x)}angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)}angleWith(t){return this.angleWithSep(t.x,t.y)}angleWithSep(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)}static convert(t){return t instanceof C?t:Array.isArray(t)?new C(t[0],t[1]):t}}const{supported:Mt,setRTLTextPlugin:Ot,getRTLTextPluginStatus:Ut,LngLat:kt,LngLatBounds:Bt,MercatorCoordinate:$t,Evented:Gt,AJAXError:Ht,prewarm:jt,clearPrewarmedResources:Kt,version:Ft,workerCount:Dt,maxParallelImageRequests:Vt,workerUrl:zt,addProtocol:qt,removeProtocol:Wt}=a,Jt=a.Map,Zt=a.Marker,Yt=a.Popup,Xt=a.Style,Qt=a.CanvasSource,te=a.GeoJSONSource,ee=a.ImageSource,re=a.RasterTileSource,ie=a.RasterDEMTileSource,ne=a.VectorTileSource,ae=a.VideoSource;a.NavigationControl,a.GeolocateControl,a.AttributionControl,a.LogoControl,a.ScaleControl,a.FullscreenControl,a.TerrainControl;export{Ht as AJAXError,H as AttributionControl,bt as CanvasSource,Qt as CanvasSourceMLGL,Gt as Evented,K as FullscreenControl,It as GeoJSONSource,te as GeoJSONSourceMLGL,O as GeolocateControl,z as GeolocationType,wt as ImageSource,ee as ImageSourceMLGL,L as Language,me as LanguageGeocoding,kt as LngLat,Bt as LngLatBounds,N as LogoControl,St as Map,Jt as MapMLGL,ye as MapStyle,Ae as MapStyleVariant,G as MaptilerGeolocateControl,I as MaptilerLogoControl,P as MaptilerTerrainControl,xt as Marker,Zt as MarkerMLGL,$t as MercatorCoordinate,M as NavigationControl,C as Point,Ct as Popup,Yt as PopupMLGL,Et as RasterDEMTileSource,ie as RasterDEMTileSourceMLGL,vt as RasterTileSource,re as RasterTileSourceMLGL,fe as ReferenceMapStyle,j as ScaleControl,E as SdkConfig,Le as ServiceError,Tt as Style,Xt as StyleMLGL,Pt as TerrainControl,Nt as VectorTileSource,ne as VectorTileSourceMLGL,Rt as VideoSource,ae as VideoSourceMLGL,qt as addProtocol,Kt as clearPrewarmedResources,A as config,_e as coordinates,Se as data,xe as geocoding,Ce as geolocation,Ut as getRTLTextPluginStatus,Vt as maxParallelImageRequests,jt as prewarm,Wt as removeProtocol,Ot as setRTLTextPlugin,Te as staticMaps,Mt as supported,Ft as version,Dt as workerCount,zt as workerUrl};