@smartmaps/smartmaps-gl 2.0.2

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.
@@ -0,0 +1,1132 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __typeError = (msg) => {
3
+ throw TypeError(msg);
4
+ };
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
8
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
9
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
11
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
12
+ var _options, _container, _map, _apiKey, _terrainVisible, _terrainControl, _map2, _options2, _showDropdown, _dropdown, _select, _container2, _button, _LanguageControl_instances, createControlButton_fn, createDropdown_fn, changeLanguage_fn, closeDropdown_fn, toggleDropdown_fn, validateLanguage_fn, getControlLanguage_fn, getLanguageFromEvent_fn, isMobileDevice_fn, isFirefox_fn, _logger, _languageManager, _terrainManager, _colorSchemeManager, _contextmenu, _map3, _contextmenuItems, _contextMenuContainer, _currentCoords, _ContextMenu_instances, createMenuContainer_fn, attachEventListeners_fn, showMenu_fn, createMenuItem_fn, calculateMenuPosition_fn, _container3;
13
+ import { TerrainControl, GeolocateControl as GeolocateControl$1, Map, FullscreenControl, NavigationControl, Marker as Marker$1 } from "maplibre-gl";
14
+ import { LngLat, Point } from "maplibre-gl";
15
+ class DOM {
16
+ static create(tagName, className, container) {
17
+ const el = window.document.createElement(tagName);
18
+ if (className !== void 0) el.className = className;
19
+ if (container) container.appendChild(el);
20
+ return el;
21
+ }
22
+ static remove(node) {
23
+ if (node.parentNode) {
24
+ node.parentNode.removeChild(node);
25
+ }
26
+ }
27
+ static addEventListener(target, type, callback, options = {}) {
28
+ if ("passive" in options) {
29
+ target.addEventListener(type, callback, options);
30
+ } else {
31
+ target.addEventListener(type, callback, options.capture);
32
+ }
33
+ }
34
+ static removeEventListener(target, type, callback, options = {}) {
35
+ if ("passive" in options) {
36
+ target.removeEventListener(type, callback, options);
37
+ } else {
38
+ target.removeEventListener(type, callback, options.capture);
39
+ }
40
+ }
41
+ static getElementById(elementId) {
42
+ return window.document.getElementById(elementId);
43
+ }
44
+ }
45
+ const DefaultOptions = {
46
+ className: "",
47
+ width: 100,
48
+ height: 26
49
+ };
50
+ class BrandControl {
51
+ constructor(options = {}) {
52
+ __privateAdd(this, _options);
53
+ __privateAdd(this, _container);
54
+ __privateSet(this, _options, {
55
+ ...DefaultOptions,
56
+ ...options
57
+ });
58
+ }
59
+ onAdd(map) {
60
+ __privateSet(this, _container, DOM.create("div", __privateGet(this, _options).className || "smartmaps-gl-ctrl"));
61
+ const anchor = DOM.create("a", "smartmaps-gl-ctrl-brand");
62
+ anchor.target = "_blank";
63
+ anchor.rel = "noopener nofollow";
64
+ if (__privateGet(this, _options).link) anchor.href = __privateGet(this, _options).link;
65
+ anchor.setAttribute("aria-label", "Brand control");
66
+ anchor.setAttribute("rel", "noopener nofollow");
67
+ __privateGet(this, _container).style.width = __privateGet(this, _options).width + "px";
68
+ __privateGet(this, _container).style.height = __privateGet(this, _options).height + "px";
69
+ if (__privateGet(this, _options).logo) {
70
+ const logo = DOM.create("img", "smartmaps-gl-ctrl-brand-logo");
71
+ logo.src = __privateGet(this, _options).logo;
72
+ logo.style.width = "100%";
73
+ logo.style.height = "100%";
74
+ anchor.appendChild(logo);
75
+ }
76
+ __privateGet(this, _container).appendChild(anchor);
77
+ __privateGet(this, _container).style.display = "block";
78
+ return __privateGet(this, _container);
79
+ }
80
+ onRemove() {
81
+ if (__privateGet(this, _container)) {
82
+ DOM.remove(__privateGet(this, _container));
83
+ }
84
+ }
85
+ getDefaultPosition() {
86
+ return "bottom-left";
87
+ }
88
+ }
89
+ _options = new WeakMap();
90
+ _container = new WeakMap();
91
+ const MapLanguage = {
92
+ AUTO: "auto",
93
+ AR: "ar",
94
+ BG: "bg",
95
+ CS: "cs",
96
+ DA: "da",
97
+ DE: "de",
98
+ EL: "el",
99
+ EN: "en",
100
+ ES: "es",
101
+ ET: "et",
102
+ FI: "fi",
103
+ FR: "fr",
104
+ GA: "ga",
105
+ HI: "hi",
106
+ HR: "hr",
107
+ HU: "hu",
108
+ IT: "it",
109
+ JA: "ja",
110
+ KO: "ko",
111
+ LB: "lb",
112
+ LT: "lt",
113
+ LV: "lv",
114
+ MT: "mt",
115
+ NL: "nl",
116
+ PL: "pl",
117
+ PT: "pt",
118
+ RO: "ro",
119
+ RU: "ru",
120
+ SK: "sk",
121
+ SL: "sl",
122
+ SV: "sv",
123
+ TR: "tr",
124
+ UK: "uk",
125
+ ZH: "zh",
126
+ LOCAL: "local"
127
+ };
128
+ const SupportedLanguages = Object.values(MapLanguage);
129
+ const SupportedFallbackLanguages = ["de", "en", "local"];
130
+ class LanguageManager {
131
+ constructor(map, language = void 0, fallbackLanguage = void 0) {
132
+ __publicField(this, "map");
133
+ __publicField(this, "language");
134
+ __publicField(this, "fallbackLanguage");
135
+ __publicField(this, "allowedLanguages");
136
+ this.map = map;
137
+ this.language = language ?? "default";
138
+ this.fallbackLanguage = fallbackLanguage ?? "default";
139
+ this.allowedLanguages = SupportedLanguages;
140
+ this.setInternalMapLanguage(this.language);
141
+ this.map.on("styledata", () => this.setInternalMapLanguage(this.language));
142
+ }
143
+ setFallbackLanguage(language) {
144
+ const fallbackLanguage = this.parseFallbackLanguage(language);
145
+ if (!fallbackLanguage) {
146
+ return;
147
+ }
148
+ if (this.language === "default") {
149
+ console.warn("Please set a valid language first");
150
+ return;
151
+ }
152
+ this.fallbackLanguage = fallbackLanguage;
153
+ if (this.map.isStyleLoaded()) {
154
+ this.applyMapLanguage();
155
+ } else {
156
+ this.map.once("styledata", () => this.applyMapLanguage());
157
+ }
158
+ }
159
+ getFallbackLanguage() {
160
+ return this.fallbackLanguage;
161
+ }
162
+ getMapLanguage() {
163
+ return this.language;
164
+ }
165
+ setInternalMapLanguage(language) {
166
+ if (language == "default") return;
167
+ return this.setMapLanguage(language);
168
+ }
169
+ setMapLanguage(language) {
170
+ const parsedMapLanguage = this.parseLanguage(language);
171
+ if (!parsedMapLanguage) return;
172
+ this.language = parsedMapLanguage === "auto" ? this.determineAutoLanguage() : parsedMapLanguage;
173
+ if (this.language !== "default" && this.fallbackLanguage === "default") {
174
+ this.fallbackLanguage = MapLanguage.EN;
175
+ }
176
+ if (this.map.isStyleLoaded()) {
177
+ this.applyMapLanguage();
178
+ } else {
179
+ this.map.once("styledata", () => this.applyMapLanguage());
180
+ }
181
+ }
182
+ getMapAllowedLanguages() {
183
+ return this.allowedLanguages;
184
+ }
185
+ setMapAllowedLanguages(languages) {
186
+ this.allowedLanguages = languages;
187
+ }
188
+ parseLanguage(language) {
189
+ const validLanguages = Object.values(MapLanguage);
190
+ const mapLanguage = validLanguages.find((v) => v === language.toLowerCase());
191
+ if (mapLanguage) {
192
+ const allowedMapLanguage = this.allowedLanguages.find((v) => v === mapLanguage.toLowerCase());
193
+ if (allowedMapLanguage) {
194
+ return allowedMapLanguage;
195
+ }
196
+ console.warn(
197
+ `The language '${language}' is supported but has been excluded in the options via selectedLanguages.
198
+ The following language is selected '${this.allowedLanguages[0]}'`
199
+ );
200
+ return this.allowedLanguages[0];
201
+ }
202
+ console.warn(`'${language}' is not supported as language`);
203
+ return void 0;
204
+ }
205
+ parseFallbackLanguage(language) {
206
+ const fallbackLanguage = SupportedFallbackLanguages.find((v) => v === language.toLowerCase());
207
+ if (fallbackLanguage) {
208
+ return fallbackLanguage;
209
+ }
210
+ console.warn(`'${language}' is not supported as fallback language`);
211
+ return void 0;
212
+ }
213
+ determineAutoLanguage() {
214
+ const browserLanguageNotSupported = MapLanguage.EN;
215
+ const preferredLanguage = this.getPreferredLanguage().split("-")[0];
216
+ if (preferredLanguage) {
217
+ return this.parseLanguage(preferredLanguage) ?? browserLanguageNotSupported;
218
+ }
219
+ return browserLanguageNotSupported;
220
+ }
221
+ applyMapLanguage() {
222
+ const layers = this.map.getStyle().layers;
223
+ const language = this.getLanguageProperty(this.language);
224
+ const fallbackLanguage = this.getFallbackLanguageProperty(this.fallbackLanguage);
225
+ for (const layer of layers) {
226
+ const layerId = layer.id;
227
+ if (this.shouldUpdateLayer(layerId)) {
228
+ this.map.setLayoutProperty(layerId, "text-field", ["coalesce", language, fallbackLanguage]);
229
+ }
230
+ }
231
+ }
232
+ getLanguageProperty(language) {
233
+ return language === MapLanguage.LOCAL ? ["get", "name"] : ["get", `name:${language}`];
234
+ }
235
+ getFallbackLanguageProperty(language) {
236
+ return language === MapLanguage.LOCAL ? ["get", "name"] : ["get", `name_${language}`];
237
+ }
238
+ shouldUpdateLayer(layerId) {
239
+ return layerId.startsWith("label-") && !layerId.includes("shield") && layerId !== "label-address-housenumber";
240
+ }
241
+ getPreferredLanguage() {
242
+ var _a;
243
+ return ((_a = navigator.languages) == null ? void 0 : _a[0]) || navigator.language;
244
+ }
245
+ }
246
+ const translations = {
247
+ en: {
248
+ auto: "Auto",
249
+ ar: "Arabic",
250
+ bg: "Bulgarian",
251
+ cs: "Czech",
252
+ da: "Danish",
253
+ de: "German",
254
+ el: "Greek",
255
+ en: "English",
256
+ es: "Spanish",
257
+ et: "Estonian",
258
+ fi: "Finnish",
259
+ fr: "French",
260
+ ga: "Irish",
261
+ hi: "Hindi",
262
+ hr: "Croatian",
263
+ hu: "Hungarian",
264
+ it: "Italian",
265
+ ja: "Japanese",
266
+ ko: "Korean",
267
+ lb: "Luxembourgish",
268
+ lt: "Lithuanian",
269
+ lv: "Latvian",
270
+ mt: "Maltese",
271
+ nl: "Dutch",
272
+ pl: "Polish",
273
+ pt: "Portuguese",
274
+ ro: "Romanian",
275
+ ru: "Russian",
276
+ sk: "Slovak",
277
+ sl: "Slovenian",
278
+ sv: "Swedish",
279
+ tr: "Turkish",
280
+ uk: "Ukrainian",
281
+ zh: "Chinese",
282
+ local: "Local language"
283
+ },
284
+ de: {
285
+ auto: "Auto",
286
+ ar: "Arabisch",
287
+ bg: "Bulgarisch",
288
+ cs: "Tschechisch",
289
+ da: "Dänisch",
290
+ de: "Deutsch",
291
+ el: "Griechisch",
292
+ en: "Englisch",
293
+ es: "Spanisch",
294
+ et: "Estnisch",
295
+ fi: "Finnisch",
296
+ fr: "Französisch",
297
+ ga: "Irisch",
298
+ hi: "Hindi",
299
+ hr: "Kroatisch",
300
+ hu: "Ungarisch",
301
+ it: "Italienisch",
302
+ ja: "Japanisch",
303
+ ko: "Koreanisch",
304
+ lb: "Luxemburgisch",
305
+ lt: "Litauisch",
306
+ lv: "Lettisch",
307
+ mt: "Maltesisch",
308
+ nl: "Niederländisch",
309
+ pl: "Polnisch",
310
+ pt: "Portugiesisch",
311
+ ro: "Rumänisch",
312
+ ru: "Russisch",
313
+ sk: "Slowakisch",
314
+ sl: "Slowenisch",
315
+ sv: "Schwedisch",
316
+ tr: "Türkisch",
317
+ uk: "Ukrainisch",
318
+ zh: "Chinesisch",
319
+ local: "Landessprache"
320
+ },
321
+ fr: {
322
+ auto: "Auto",
323
+ ar: "Arabe",
324
+ bg: "Bulgare",
325
+ cs: "Tchèque",
326
+ da: "Danois",
327
+ de: "Allemand",
328
+ el: "Grec",
329
+ en: "Anglais",
330
+ es: "Espagnol",
331
+ et: "Estonien",
332
+ fi: "Finnois",
333
+ fr: "Français",
334
+ ga: "Irlandais",
335
+ hi: "Hindi",
336
+ hr: "Croate",
337
+ hu: "Hongrois",
338
+ it: "Italien",
339
+ ja: "Japonais",
340
+ ko: "Coréen",
341
+ lb: "Luxembourgeois",
342
+ lt: "Lituanien",
343
+ lv: "Letton",
344
+ mt: "Maltais",
345
+ nl: "Néerlandais",
346
+ pl: "Polonais",
347
+ pt: "Portugais",
348
+ ro: "Roumain",
349
+ ru: "Russe",
350
+ sk: "Slovaque",
351
+ sl: "Slovène",
352
+ sv: "Suédois",
353
+ tr: "Turc",
354
+ uk: "Ukrainien",
355
+ zh: "Chinois",
356
+ local: "Langue nationale"
357
+ },
358
+ es: {
359
+ auto: "Auto",
360
+ ar: "Árabe",
361
+ bg: "Búlgaro",
362
+ cs: "Checo",
363
+ da: "Danés",
364
+ de: "Alemán",
365
+ el: "Griego",
366
+ en: "Inglés",
367
+ es: "Español",
368
+ et: "Estonio",
369
+ fi: "Finlandés",
370
+ fr: "Francés",
371
+ ga: "Irlandés",
372
+ hi: "Hindi",
373
+ hr: "Croata",
374
+ hu: "Húngaro",
375
+ it: "Italiano",
376
+ ja: "Japonés",
377
+ ko: "Coreano",
378
+ lb: "Luxemburgués",
379
+ lt: "Lituano",
380
+ lv: "Letón",
381
+ mt: "Maltés",
382
+ nl: "Neerlandés",
383
+ pl: "Polaco",
384
+ pt: "Portugués",
385
+ ro: "Rumano",
386
+ ru: "Ruso",
387
+ sk: "Eslovaco",
388
+ sl: "Esloveno",
389
+ sv: "Sueco",
390
+ tr: "Turco",
391
+ uk: "Ucraniano",
392
+ zh: "Chino",
393
+ local: "Lengua nacional"
394
+ }
395
+ };
396
+ const applyDefaultsFn = (defaults) => (s) => {
397
+ const entries = Object.entries(defaults).map(([key, defaultValue]) => {
398
+ const keyOfT = key;
399
+ const valueOfT = s[keyOfT];
400
+ return [key, valueOfT === void 0 ? defaultValue : valueOfT];
401
+ });
402
+ const r = Object.fromEntries(entries);
403
+ return r;
404
+ };
405
+ function encodeString(s) {
406
+ try {
407
+ if (s !== decodeURIComponent(s)) {
408
+ return s;
409
+ } else {
410
+ return encodeURIComponent(s);
411
+ }
412
+ } catch {
413
+ return s;
414
+ }
415
+ }
416
+ function assertNotNull(obj, msg = "Assertion for not null failed!") {
417
+ if (obj == null) {
418
+ throw new Error(msg);
419
+ }
420
+ }
421
+ function toLatLngLiteral(coordinates) {
422
+ if (Array.isArray(coordinates)) {
423
+ const [x2, y2, z2] = coordinates;
424
+ return {
425
+ lat: y2,
426
+ lng: x2,
427
+ alt: z2 ?? void 0
428
+ };
429
+ }
430
+ const { x, y, z } = coordinates;
431
+ return {
432
+ lat: Number(y),
433
+ lng: Number(x),
434
+ alt: Number(z) ?? void 0
435
+ };
436
+ }
437
+ const defaultTerrainOptions = (cp = "top-right") => ({
438
+ exaggeration: 1,
439
+ position: cp,
440
+ activated: false
441
+ });
442
+ class TerrainManager {
443
+ constructor(map, apiKey) {
444
+ __privateAdd(this, _map);
445
+ __privateAdd(this, _apiKey);
446
+ __privateAdd(this, _terrainVisible, false);
447
+ __privateAdd(this, _terrainControl);
448
+ __privateSet(this, _map, map);
449
+ __privateSet(this, _apiKey, encodeString(apiKey));
450
+ __privateGet(this, _map).on("styledata", () => {
451
+ if (__privateGet(this, _terrainControl)) {
452
+ const terrainSourceExists = __privateGet(this, _map).getSource("terrainSource");
453
+ const hillshadeSourceExists = __privateGet(this, _map).getSource("hillshade");
454
+ if (!terrainSourceExists && !hillshadeSourceExists) {
455
+ this.addTerrainSources();
456
+ if (__privateGet(this, _terrainVisible)) {
457
+ __privateGet(this, _terrainControl)._toggleTerrain();
458
+ __privateGet(this, _terrainControl)._updateTerrainIcon();
459
+ __privateGet(this, _map).setLayoutProperty("hillshade", "visibility", "visible");
460
+ }
461
+ }
462
+ }
463
+ });
464
+ }
465
+ initialize(options) {
466
+ if (typeof options === "boolean" && options === false) {
467
+ return;
468
+ }
469
+ __privateGet(this, _map).once("styledata", () => {
470
+ this.addTerrainSources();
471
+ const terrainOptions = typeof options === "boolean" ? defaultTerrainOptions() : options;
472
+ this.addTerrainControl(terrainOptions);
473
+ });
474
+ }
475
+ terrainVisible() {
476
+ return __privateGet(this, _terrainVisible);
477
+ }
478
+ addTerrainSources() {
479
+ const layers = __privateGet(this, _map).getStyle().layers;
480
+ let firstSymbolId;
481
+ for (let layer of layers) {
482
+ if (layer.type === "symbol") {
483
+ firstSymbolId = layer.id;
484
+ break;
485
+ }
486
+ }
487
+ __privateGet(this, _map).addSource("terrainSource", {
488
+ type: "raster-dem",
489
+ url: `https://tiles.smartmaps.cloud/tiles/v1/terrain_rgb/tiles.json?apiKey=${__privateGet(this, _apiKey)}`,
490
+ tileSize: 256
491
+ });
492
+ __privateGet(this, _map).addSource("hillshadeSource", {
493
+ type: "raster-dem",
494
+ url: `https://tiles.smartmaps.cloud/tiles/v1/terrain_rgb/tiles.json?apiKey=${__privateGet(this, _apiKey)}`,
495
+ tileSize: 256
496
+ });
497
+ __privateGet(this, _map).addLayer(
498
+ {
499
+ id: "hillshade",
500
+ type: "hillshade",
501
+ source: "hillshadeSource",
502
+ layout: {
503
+ visibility: "none"
504
+ },
505
+ paint: {
506
+ "hillshade-shadow-color": "#635d50"
507
+ }
508
+ },
509
+ firstSymbolId
510
+ );
511
+ }
512
+ addTerrainControl(options) {
513
+ const terrainControl = new TerrainControl({
514
+ source: "terrainSource",
515
+ exaggeration: options.exaggeration
516
+ });
517
+ __privateSet(this, _terrainControl, terrainControl);
518
+ __privateGet(this, _map).addControl(terrainControl, options.position);
519
+ if (options.activated) {
520
+ terrainControl._toggleTerrain();
521
+ terrainControl._updateTerrainIcon();
522
+ __privateGet(this, _map).setLayoutProperty("hillshade", "visibility", "visible");
523
+ __privateSet(this, _terrainVisible, true);
524
+ }
525
+ this.addTerrainControlEventListener(terrainControl._terrainButton);
526
+ }
527
+ addTerrainControlEventListener(terrainControlElement) {
528
+ terrainControlElement.addEventListener("mousedown", () => {
529
+ __privateSet(this, _terrainVisible, !__privateGet(this, _terrainVisible));
530
+ __privateGet(this, _map).setLayoutProperty("hillshade", "visibility", __privateGet(this, _terrainVisible) ? "visible" : "none");
531
+ });
532
+ }
533
+ }
534
+ _map = new WeakMap();
535
+ _apiKey = new WeakMap();
536
+ _terrainVisible = new WeakMap();
537
+ _terrainControl = new WeakMap();
538
+ const loggerUrls = {
539
+ prod: "https://www.yellowmap.de",
540
+ staging: "https://staging.yellowmap.de"
541
+ };
542
+ const tilesUrls = {
543
+ prod: "https://tiles.smartmaps.cloud",
544
+ staging: "https://staging.tiles.smartmaps.cloud"
545
+ };
546
+ let useHost = "prod";
547
+ const setHost = (host) => useHost = host;
548
+ const useStagingUrls = () => setHost("staging");
549
+ const useProductionUrls = () => setHost("prod");
550
+ const getTilesUrl = () => tilesUrls[useHost];
551
+ const getLoggerUrl = () => loggerUrls[useHost];
552
+ const MapStyle = {
553
+ ACCESSIBLE: "accessible",
554
+ AUTO: "auto",
555
+ DARK: "dark",
556
+ ESSENTIAL: "essential",
557
+ GREY: "grey",
558
+ LIGHT: "light",
559
+ SATELLITE: "satellite"
560
+ };
561
+ const defaultMapOptions = {
562
+ style: MapStyle["LIGHT"],
563
+ smartmapsLogo: true,
564
+ channel: null,
565
+ terrain: false,
566
+ attributionControl: {
567
+ compact: true
568
+ }
569
+ };
570
+ const applyDefaults$1 = (options) => {
571
+ const defaultsfn = applyDefaultsFn(defaultMapOptions);
572
+ return { ...options, ...defaultsfn(options) };
573
+ };
574
+ const mapOptions = (options) => {
575
+ const optionsWithDefaults = applyDefaults$1(options);
576
+ const { style, apiKey, attributionControl, gestureHandling } = optionsWithDefaults;
577
+ const result = {
578
+ ...options,
579
+ style: isMapStyle(style) ? createStyleURL(style, apiKey) : style,
580
+ attributionControl,
581
+ cooperativeGestures: !!gestureHandling,
582
+ locale: mapGestureHandlingToLocale(gestureHandling)
583
+ };
584
+ return result;
585
+ };
586
+ function isMapStyle(style) {
587
+ if (typeof style != "string") return false;
588
+ const validStyles = Object.values(MapStyle);
589
+ const found = validStyles.find((v) => v === style.toLowerCase());
590
+ return found != null;
591
+ }
592
+ function createStyleURL(mapStyle, apiKey) {
593
+ let style = mapStyle.toLowerCase();
594
+ if (style === "auto") {
595
+ if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
596
+ style = "dark";
597
+ } else {
598
+ style = "light";
599
+ }
600
+ }
601
+ const hostname = getTilesUrl();
602
+ const stylesPath = `styles/v1/smartmaps/${style}/style.json`;
603
+ const apiKeyQueryString = `apiKey=${encodeString(apiKey)}`;
604
+ const baseURL = `${hostname}/${stylesPath}`;
605
+ const styleURL = `${baseURL}?${apiKeyQueryString}`;
606
+ return styleURL;
607
+ }
608
+ function mapGestureHandlingToLocale(gestureHandling) {
609
+ var _a, _b, _c;
610
+ let locale;
611
+ if (typeof gestureHandling === "object") {
612
+ if ((_a = gestureHandling.text) == null ? void 0 : _a.windows) {
613
+ locale = { ...locale, "CooperativeGesturesHandler.WindowsHelpText": gestureHandling.text.windows };
614
+ }
615
+ if ((_b = gestureHandling.text) == null ? void 0 : _b.mac) {
616
+ locale = { ...locale, "CooperativeGesturesHandler.MacHelpText": gestureHandling.text.mac };
617
+ }
618
+ if ((_c = gestureHandling.text) == null ? void 0 : _c.touch) {
619
+ locale = { ...locale, "CooperativeGesturesHandler.MobileHelpText": gestureHandling.text.touch };
620
+ }
621
+ }
622
+ return locale;
623
+ }
624
+ class GeolocateControl extends GeolocateControl$1 {
625
+ constructor(options) {
626
+ super(options);
627
+ }
628
+ onAdd(map) {
629
+ super.onAdd(map);
630
+ this.on("geolocate", (e) => {
631
+ const { latitude, longitude, altitude } = e.coords;
632
+ const LatLngLiteral = {
633
+ lat: latitude,
634
+ lng: longitude,
635
+ alt: altitude ?? void 0
636
+ };
637
+ map.fire("location-found", { latlng: LatLngLiteral });
638
+ });
639
+ this.on("error", (e) => {
640
+ const locateError = { message: e.message, error: e };
641
+ map.fire("location-error", { error: locateError });
642
+ });
643
+ return this._container;
644
+ }
645
+ }
646
+ const defaultOptions = {
647
+ selectedLanguages: SupportedLanguages,
648
+ controlLanguage: "en"
649
+ };
650
+ const applyDefaults = (options) => {
651
+ const defaultsfn = applyDefaultsFn(defaultOptions);
652
+ if ((options == null ? void 0 : options.selectedLanguages) && options.selectedLanguages.length === 0) {
653
+ options.selectedLanguages = void 0;
654
+ console.warn("You have specified an invalid list of selectedLanguages. Supported languages are used instead.");
655
+ }
656
+ return defaultsfn(options ?? {});
657
+ };
658
+ class LanguageControl {
659
+ /**
660
+ * @param options - the control's options
661
+ */
662
+ constructor(options) {
663
+ __privateAdd(this, _LanguageControl_instances);
664
+ __privateAdd(this, _map2);
665
+ __privateAdd(this, _options2);
666
+ __privateAdd(this, _showDropdown, false);
667
+ __privateAdd(this, _dropdown);
668
+ __privateAdd(this, _select);
669
+ __privateAdd(this, _container2);
670
+ __privateAdd(this, _button);
671
+ __privateSet(this, _options2, applyDefaults(options));
672
+ __privateSet(this, _button, __privateMethod(this, _LanguageControl_instances, createControlButton_fn).call(this));
673
+ __privateSet(this, _dropdown, __privateMethod(this, _LanguageControl_instances, createDropdown_fn).call(this));
674
+ __privateSet(this, _select, DOM.create("select", "languages"));
675
+ __privateSet(this, _container2, DOM.create("div", "maplibregl-ctrl maplibregl-ctrl-group"));
676
+ }
677
+ onAdd(map) {
678
+ __privateSet(this, _map2, map);
679
+ __privateGet(this, _map2).setMapAllowedLanguages(__privateGet(this, _options2).selectedLanguages);
680
+ let isDropdownOpened = false;
681
+ let previousLanguage = __privateGet(this, _select).value;
682
+ __privateGet(this, _select).addEventListener("change", (event) => {
683
+ __privateMethod(this, _LanguageControl_instances, toggleDropdown_fn).call(this);
684
+ __privateMethod(this, _LanguageControl_instances, changeLanguage_fn).call(this, __privateMethod(this, _LanguageControl_instances, getLanguageFromEvent_fn).call(this, event));
685
+ });
686
+ __privateGet(this, _select).addEventListener("mousedown", () => {
687
+ if (!__privateMethod(this, _LanguageControl_instances, isMobileDevice_fn).call(this)) {
688
+ isDropdownOpened = true;
689
+ previousLanguage = map.getMapLanguage();
690
+ }
691
+ });
692
+ __privateGet(this, _select).addEventListener("click", (event) => {
693
+ if (!__privateMethod(this, _LanguageControl_instances, isMobileDevice_fn).call(this)) {
694
+ if (isDropdownOpened) {
695
+ isDropdownOpened = false;
696
+ return;
697
+ }
698
+ if (map.getMapLanguage() === __privateMethod(this, _LanguageControl_instances, getLanguageFromEvent_fn).call(this, event)) {
699
+ __privateMethod(this, _LanguageControl_instances, toggleDropdown_fn).call(this);
700
+ }
701
+ }
702
+ });
703
+ __privateGet(this, _select).addEventListener("click", (event) => {
704
+ if (__privateMethod(this, _LanguageControl_instances, isFirefox_fn).call(this)) {
705
+ if (previousLanguage === __privateMethod(this, _LanguageControl_instances, getLanguageFromEvent_fn).call(this, event)) {
706
+ __privateMethod(this, _LanguageControl_instances, toggleDropdown_fn).call(this);
707
+ }
708
+ }
709
+ });
710
+ __privateGet(this, _select).addEventListener("touchstart", (event) => {
711
+ if (__privateMethod(this, _LanguageControl_instances, isMobileDevice_fn).call(this)) {
712
+ previousLanguage = __privateMethod(this, _LanguageControl_instances, getLanguageFromEvent_fn).call(this, event);
713
+ }
714
+ });
715
+ __privateGet(this, _select).addEventListener("blur", (event) => {
716
+ if (__privateMethod(this, _LanguageControl_instances, isMobileDevice_fn).call(this)) {
717
+ if (previousLanguage === __privateMethod(this, _LanguageControl_instances, getLanguageFromEvent_fn).call(this, event)) {
718
+ __privateMethod(this, _LanguageControl_instances, toggleDropdown_fn).call(this);
719
+ }
720
+ }
721
+ });
722
+ __privateGet(this, _options2).selectedLanguages.forEach((lang) => {
723
+ if (__privateMethod(this, _LanguageControl_instances, validateLanguage_fn).call(this, lang)) {
724
+ const langOption = DOM.create("option");
725
+ langOption.value = lang;
726
+ langOption.selected = map.getMapLanguage() === "default" && lang === "local" || map.getMapLanguage() === lang;
727
+ langOption.textContent = translations[__privateMethod(this, _LanguageControl_instances, getControlLanguage_fn).call(this)][lang];
728
+ __privateGet(this, _select).appendChild(langOption);
729
+ }
730
+ });
731
+ map.on("click", () => {
732
+ if (__privateGet(this, _showDropdown)) __privateMethod(this, _LanguageControl_instances, closeDropdown_fn).call(this);
733
+ });
734
+ map.on("move", () => {
735
+ if (__privateGet(this, _showDropdown)) __privateMethod(this, _LanguageControl_instances, closeDropdown_fn).call(this);
736
+ });
737
+ __privateGet(this, _dropdown).appendChild(__privateGet(this, _select));
738
+ __privateGet(this, _container2).appendChild(__privateGet(this, _button));
739
+ __privateGet(this, _container2).appendChild(__privateGet(this, _dropdown));
740
+ return __privateGet(this, _container2);
741
+ }
742
+ onRemove() {
743
+ DOM.remove(__privateGet(this, _container2));
744
+ }
745
+ /**
746
+ * Optionally provide a default position for this control. If this method
747
+ * is implemented and {@link Map#addControl} is called without the `position`
748
+ * parameter, the value returned by getDefaultPosition will be used as the
749
+ * control's position.
750
+ *
751
+ * @returns a control position, one of the values valid in addControl.
752
+ */
753
+ getDefaultPosition() {
754
+ return "top-right";
755
+ }
756
+ }
757
+ _map2 = new WeakMap();
758
+ _options2 = new WeakMap();
759
+ _showDropdown = new WeakMap();
760
+ _dropdown = new WeakMap();
761
+ _select = new WeakMap();
762
+ _container2 = new WeakMap();
763
+ _button = new WeakMap();
764
+ _LanguageControl_instances = new WeakSet();
765
+ createControlButton_fn = function() {
766
+ const button = DOM.create("button", "smartmapsgl-ctrl-language");
767
+ button.type = "button";
768
+ button.title = "Switch language";
769
+ button.setAttribute("aria-label", "Switch language");
770
+ button.addEventListener("click", () => __privateMethod(this, _LanguageControl_instances, toggleDropdown_fn).call(this));
771
+ const icon = DOM.create("span", "smartmapsgl-ctrl-language-icon maplibregl-ctrl-icon");
772
+ icon.setAttribute("aria-hidden", "true");
773
+ button.appendChild(icon);
774
+ return button;
775
+ };
776
+ createDropdown_fn = function() {
777
+ const dropdown = DOM.create("div", "languages-dropdown");
778
+ dropdown.style.display = "none";
779
+ return dropdown;
780
+ };
781
+ changeLanguage_fn = function(lang) {
782
+ assertNotNull(__privateGet(this, _map2), "The map instance must exist in order to be able to change the language!");
783
+ __privateGet(this, _map2).setMapLanguage(lang);
784
+ };
785
+ closeDropdown_fn = function() {
786
+ __privateSet(this, _showDropdown, false);
787
+ __privateGet(this, _dropdown).style.display = "none";
788
+ __privateGet(this, _button).style.display = "block";
789
+ };
790
+ toggleDropdown_fn = function() {
791
+ var _a;
792
+ __privateSet(this, _showDropdown, !__privateGet(this, _showDropdown));
793
+ __privateGet(this, _dropdown).style.display = __privateGet(this, _showDropdown) ? "block" : "none";
794
+ __privateGet(this, _button).style.display = !__privateGet(this, _showDropdown) ? "block" : "none";
795
+ if (__privateGet(this, _showDropdown) && "showPicker" in HTMLSelectElement.prototype) {
796
+ (_a = __privateGet(this, _select)) == null ? void 0 : _a.showPicker();
797
+ }
798
+ };
799
+ validateLanguage_fn = function(language) {
800
+ const validLanguages = Object.values(SupportedLanguages);
801
+ const mapLanguage = validLanguages.find((v) => v === language.toLowerCase());
802
+ if (mapLanguage) {
803
+ return mapLanguage;
804
+ }
805
+ console.warn(`'${language}' is not supported as language`);
806
+ return void 0;
807
+ };
808
+ getControlLanguage_fn = function() {
809
+ return Object.keys(translations).find((key) => key === __privateGet(this, _options2).controlLanguage.toLowerCase()) ?? defaultOptions.controlLanguage;
810
+ };
811
+ getLanguageFromEvent_fn = function(event) {
812
+ const target = event.target;
813
+ const language = target.value;
814
+ return language;
815
+ };
816
+ isMobileDevice_fn = function() {
817
+ const regex = /Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
818
+ return regex.test(navigator.userAgent) || window.matchMedia("(pointer: coarse)").matches;
819
+ };
820
+ isFirefox_fn = function() {
821
+ return navigator.userAgent.toLowerCase().indexOf("firefox") > -1;
822
+ };
823
+ class ColorSchemeManager {
824
+ constructor(map, apiKey) {
825
+ __publicField(this, "map");
826
+ __publicField(this, "apiKey");
827
+ __publicField(this, "mediaQueryList", window.matchMedia("(prefers-color-scheme: dark)"));
828
+ __publicField(this, "colorSchemeChangeListener", (event) => {
829
+ if (event.matches) {
830
+ this.map.setStyle(createStyleURL("dark", this.apiKey), { diff: false });
831
+ } else {
832
+ this.map.setStyle(createStyleURL("light", this.apiKey), { diff: false });
833
+ }
834
+ });
835
+ this.map = map;
836
+ this.apiKey = apiKey;
837
+ }
838
+ initialize(style) {
839
+ if (typeof style !== "string") return;
840
+ if (style.toLowerCase() === "auto") {
841
+ this.mediaQueryList.addEventListener("change", this.colorSchemeChangeListener);
842
+ }
843
+ }
844
+ }
845
+ class Logger {
846
+ constructor(apiKey) {
847
+ this.apiKey = apiKey;
848
+ }
849
+ sessionInterval(provider, channel) {
850
+ this.session(provider, channel).catch(console.error);
851
+ setTimeout(() => this.sessionInterval(provider, channel), 6e5);
852
+ }
853
+ async session(provider, channel) {
854
+ const rootUrl = getLoggerUrl();
855
+ const url = new URL(`${rootUrl}/api_rst/api/mapsessiongl?apiKey=${encodeString(this.apiKey)}`);
856
+ url.searchParams.set("provider", provider);
857
+ if (channel) {
858
+ url.searchParams.set("channel", channel);
859
+ }
860
+ try {
861
+ await fetch(url.toString());
862
+ } catch (message) {
863
+ console.error(message);
864
+ throw message;
865
+ }
866
+ }
867
+ }
868
+ class SmartmapsGlMap extends Map {
869
+ constructor(options) {
870
+ super(mapOptions(options));
871
+ __privateAdd(this, _logger);
872
+ __privateAdd(this, _languageManager);
873
+ __privateAdd(this, _terrainManager);
874
+ __privateAdd(this, _colorSchemeManager);
875
+ __privateAdd(this, _contextmenu);
876
+ const o = applyDefaults$1(options);
877
+ __privateSet(this, _logger, new Logger(o.apiKey));
878
+ __privateSet(this, _languageManager, new LanguageManager(this, o.language, o.fallbackLanguage));
879
+ __privateSet(this, _terrainManager, new TerrainManager(this, o.apiKey));
880
+ __privateSet(this, _colorSchemeManager, new ColorSchemeManager(this, o.apiKey));
881
+ this.on("load", () => {
882
+ __privateGet(this, _logger).sessionInterval("smartmaps", o.channel);
883
+ });
884
+ if (o.fullscreenControl) {
885
+ if (o.fullscreenControl === true) {
886
+ this.addControl(new FullscreenControl());
887
+ } else {
888
+ this.addControl(new FullscreenControl(o.fullscreenControl));
889
+ }
890
+ }
891
+ if (o.smartmapsLogo === true) {
892
+ this.addControl(new SmartmapsLogoControl());
893
+ }
894
+ if (o.zoomControl === true) {
895
+ this.addControl(new NavigationControl({ showCompass: false }));
896
+ }
897
+ if (o.navigationControl) {
898
+ if (o.navigationControl === true) {
899
+ this.addControl(new NavigationControl());
900
+ } else {
901
+ this.addControl(new NavigationControl(o.navigationControl));
902
+ }
903
+ }
904
+ if (o.geolocateControl) {
905
+ if (o.geolocateControl === true) {
906
+ this.addControl(new GeolocateControl({}));
907
+ } else {
908
+ this.addControl(new GeolocateControl(o.geolocateControl));
909
+ }
910
+ }
911
+ if (o.languageControl) {
912
+ if (o.languageControl === true) {
913
+ this.addControl(new LanguageControl());
914
+ } else {
915
+ this.addControl(new LanguageControl(o.languageControl));
916
+ }
917
+ }
918
+ if (o.contextmenu) {
919
+ if (o.contextmenu === true) {
920
+ __privateSet(this, _contextmenu, new ContextMenu(this));
921
+ } else {
922
+ __privateSet(this, _contextmenu, new ContextMenu(this, o.contextmenu));
923
+ }
924
+ }
925
+ __privateGet(this, _terrainManager).initialize(o.terrain);
926
+ __privateGet(this, _colorSchemeManager).initialize(o.style);
927
+ }
928
+ setMapLanguage(language) {
929
+ __privateGet(this, _languageManager).setMapLanguage(language);
930
+ }
931
+ getMapLanguage() {
932
+ return __privateGet(this, _languageManager).getMapLanguage();
933
+ }
934
+ setFallbackMapLanguage(language) {
935
+ __privateGet(this, _languageManager).setFallbackLanguage(language);
936
+ }
937
+ getFallbackMapLanguage() {
938
+ return __privateGet(this, _languageManager).getFallbackLanguage();
939
+ }
940
+ getMapAllowedLanguages() {
941
+ return __privateGet(this, _languageManager).getMapAllowedLanguages();
942
+ }
943
+ setMapAllowedLanguages(languages) {
944
+ __privateGet(this, _languageManager).setMapAllowedLanguages(languages);
945
+ }
946
+ getContextmenu() {
947
+ return __privateGet(this, _contextmenu);
948
+ }
949
+ }
950
+ _logger = new WeakMap();
951
+ _languageManager = new WeakMap();
952
+ _terrainManager = new WeakMap();
953
+ _colorSchemeManager = new WeakMap();
954
+ _contextmenu = new WeakMap();
955
+ const DEFAULT_MARKER_OPTIONS = () => ({
956
+ color: "#18345c",
957
+ scale: 1.25,
958
+ className: "smartmaps-gl-marker"
959
+ });
960
+ class Marker extends Marker$1 {
961
+ constructor(options) {
962
+ super({ ...DEFAULT_MARKER_OPTIONS(), ...options });
963
+ }
964
+ }
965
+ const icons = {
966
+ zoomIn: `<svg class="smartmaps-gl-context-menu-icon" stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" xmlns="http://www.w3.org/2000/svg"><path d="M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"></path></svg>`,
967
+ zoomOut: `<svg class="smartmaps-gl-context-menu-icon" stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" xmlns="http://www.w3.org/2000/svg"><path d="M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"></path></svg>`
968
+ };
969
+ const defaultContextmenuItems = [
970
+ {
971
+ action: "zoomIn",
972
+ label: `${icons.zoomIn} Zoom in`,
973
+ handler: (_, map) => map.zoomIn()
974
+ },
975
+ {
976
+ action: "zoomOut",
977
+ label: `${icons.zoomOut} Zoom out`,
978
+ handler: (_, map) => map.zoomOut()
979
+ },
980
+ {
981
+ action: "centerMap",
982
+ label: "Center map here",
983
+ handler: (coords, map) => map.setCenter(coords)
984
+ },
985
+ {
986
+ action: "addMarker",
987
+ label: "Add Marker",
988
+ handler: (coords, map) => new Marker().setLngLat(coords).addTo(map)
989
+ }
990
+ ];
991
+ class ContextMenu {
992
+ /**
993
+ * @param options - the control's options
994
+ */
995
+ constructor(map, options) {
996
+ __privateAdd(this, _ContextMenu_instances);
997
+ __privateAdd(this, _map3);
998
+ __privateAdd(this, _contextmenuItems, []);
999
+ __privateAdd(this, _contextMenuContainer);
1000
+ __privateAdd(this, _currentCoords);
1001
+ var _a;
1002
+ __privateSet(this, _map3, map);
1003
+ __privateSet(this, _contextMenuContainer, __privateMethod(this, _ContextMenu_instances, createMenuContainer_fn).call(this));
1004
+ const initialItems = ((_a = options == null ? void 0 : options.contextmenuItems) == null ? void 0 : _a.length) ? options.contextmenuItems : defaultContextmenuItems;
1005
+ initialItems.forEach((item) => this.addItem(item));
1006
+ __privateMethod(this, _ContextMenu_instances, attachEventListeners_fn).call(this);
1007
+ }
1008
+ addItem(options) {
1009
+ const menuItem = __privateMethod(this, _ContextMenu_instances, createMenuItem_fn).call(this, options);
1010
+ __privateGet(this, _contextMenuContainer).appendChild(menuItem);
1011
+ __privateGet(this, _contextmenuItems).push(options);
1012
+ }
1013
+ removeItem(action) {
1014
+ var _a;
1015
+ const itemIndex = __privateGet(this, _contextmenuItems).findIndex((item) => item.action === action);
1016
+ if (itemIndex !== -1) {
1017
+ __privateGet(this, _contextmenuItems).splice(itemIndex, 1);
1018
+ const menuItemElements = __privateGet(this, _contextMenuContainer).querySelectorAll(".smartmaps-gl-context-menu-item");
1019
+ (_a = menuItemElements[itemIndex]) == null ? void 0 : _a.remove();
1020
+ }
1021
+ }
1022
+ hide() {
1023
+ __privateGet(this, _contextMenuContainer).style.display = "none";
1024
+ }
1025
+ removeAllItems() {
1026
+ __privateSet(this, _contextmenuItems, []);
1027
+ __privateGet(this, _contextMenuContainer).innerHTML = "";
1028
+ }
1029
+ }
1030
+ _map3 = new WeakMap();
1031
+ _contextmenuItems = new WeakMap();
1032
+ _contextMenuContainer = new WeakMap();
1033
+ _currentCoords = new WeakMap();
1034
+ _ContextMenu_instances = new WeakSet();
1035
+ createMenuContainer_fn = function() {
1036
+ const container = document.createElement("div");
1037
+ container.className = "smartmaps-gl-context-menu";
1038
+ __privateGet(this, _map3).getContainer().appendChild(container);
1039
+ return container;
1040
+ };
1041
+ attachEventListeners_fn = function() {
1042
+ __privateGet(this, _map3).on("contextmenu", (event) => __privateMethod(this, _ContextMenu_instances, showMenu_fn).call(this, event));
1043
+ __privateGet(this, _map3).on("click", () => this.hide());
1044
+ __privateGet(this, _map3).on("mousedown", () => this.hide());
1045
+ document.addEventListener("click", (e) => {
1046
+ if (!__privateGet(this, _contextMenuContainer).contains(e.target)) {
1047
+ this.hide();
1048
+ }
1049
+ });
1050
+ };
1051
+ showMenu_fn = function(event) {
1052
+ const { point, lngLat } = event;
1053
+ __privateSet(this, _currentCoords, lngLat);
1054
+ const { left, top } = __privateMethod(this, _ContextMenu_instances, calculateMenuPosition_fn).call(this, point.x, point.y);
1055
+ __privateGet(this, _contextMenuContainer).style.left = `${left}px`;
1056
+ __privateGet(this, _contextMenuContainer).style.top = `${top}px`;
1057
+ __privateGet(this, _contextMenuContainer).style.display = "block";
1058
+ };
1059
+ createMenuItem_fn = function(options) {
1060
+ const menuItem = document.createElement("div");
1061
+ menuItem.className = "smartmaps-gl-context-menu-item";
1062
+ menuItem.innerHTML = options.label;
1063
+ menuItem.addEventListener("click", () => {
1064
+ if (__privateGet(this, _currentCoords) && options.handler) {
1065
+ options.handler(__privateGet(this, _currentCoords), __privateGet(this, _map3));
1066
+ }
1067
+ this.hide();
1068
+ });
1069
+ return menuItem;
1070
+ };
1071
+ calculateMenuPosition_fn = function(x, y) {
1072
+ const menuWidth = 160;
1073
+ const menuHeight = 140;
1074
+ const windowWidth = window.innerWidth;
1075
+ const windowHeight = window.innerHeight;
1076
+ let left = x;
1077
+ let top = y;
1078
+ if (x + menuWidth > windowWidth) {
1079
+ left = windowWidth - menuWidth - 10;
1080
+ }
1081
+ if (y + menuHeight > windowHeight) {
1082
+ top = windowHeight - menuHeight - 10;
1083
+ }
1084
+ return { left, top };
1085
+ };
1086
+ class SmartmapsLogoControl {
1087
+ constructor() {
1088
+ __privateAdd(this, _container3);
1089
+ }
1090
+ onAdd(map) {
1091
+ __privateSet(this, _container3, DOM.create("div", "smartmaps-gl-ctrl"));
1092
+ const anchor = DOM.create("a", "smartmaps-gl-ctrl-logo");
1093
+ anchor.target = "_blank";
1094
+ anchor.rel = "noopener nofollow";
1095
+ anchor.href = "https://smartmaps.net/";
1096
+ anchor.setAttribute("aria-label", "Smartmaps Logo");
1097
+ anchor.setAttribute("rel", "noopener nofollow");
1098
+ __privateGet(this, _container3).appendChild(anchor);
1099
+ __privateGet(this, _container3).style.display = "block";
1100
+ return __privateGet(this, _container3);
1101
+ }
1102
+ onRemove() {
1103
+ if (__privateGet(this, _container3)) {
1104
+ DOM.remove(__privateGet(this, _container3));
1105
+ }
1106
+ }
1107
+ getDefaultPosition() {
1108
+ return "bottom-left";
1109
+ }
1110
+ }
1111
+ _container3 = new WeakMap();
1112
+ export {
1113
+ BrandControl,
1114
+ ContextMenu,
1115
+ GeolocateControl,
1116
+ LanguageControl,
1117
+ LngLat,
1118
+ SmartmapsGlMap as Map,
1119
+ MapLanguage,
1120
+ MapStyle,
1121
+ Marker,
1122
+ Point,
1123
+ SmartmapsLogoControl,
1124
+ applyDefaults,
1125
+ assertNotNull,
1126
+ encodeString,
1127
+ getLoggerUrl,
1128
+ getTilesUrl,
1129
+ toLatLngLiteral,
1130
+ useProductionUrls,
1131
+ useStagingUrls
1132
+ };