@yappkit/front-module-map 0.1.0

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,79 @@
1
+ import { defineComponent as y, ref as d, toRefs as f, shallowRef as u, provide as c, computed as k, h as L, onMounted as g, onUnmounted as v, watch as M } from "vue";
2
+ class D {
3
+ constructor() {
4
+ this.deckgl = null, this.map = null, this.watching = { layers: !1 };
5
+ }
6
+ watchLayers(e, t = {}) {
7
+ if (!this.map)
8
+ throw new Error("map should be set");
9
+ if (this.watching.layers) {
10
+ console.warn("No need to call DeckGLMap.watchLayers(). layers are already being watched");
11
+ return;
12
+ }
13
+ this.watching.layers = !0, M(e, () => {
14
+ this.map.setProps({ layers: e.value });
15
+ }, t);
16
+ }
17
+ }
18
+ class P {
19
+ constructor(e) {
20
+ this.deckgl = null;
21
+ }
22
+ get Map() {
23
+ return y(
24
+ (e, { emit: t, attrs: a, slots: s }) => {
25
+ const l = d(null), { options: n, layers: m } = f(e), o = u(null);
26
+ c("deckGLMap", o);
27
+ const i = u([]);
28
+ c("deckGLPrependLayers", i);
29
+ const w = k(() => [
30
+ ...i.value,
31
+ ...m.value
32
+ ]);
33
+ this.createMap(l, n.value).then((r) => {
34
+ o.value = r, r.watchLayers(w, n.value.watchLayersOptions || { immediate: !0 }), t("loaded", r);
35
+ });
36
+ const p = d([]);
37
+ return c("deckGLAppendVNodeFn", p), () => [L("div", { ...a, ref: l }, o.value ? s : []), p.value.map((r) => r())];
38
+ },
39
+ {
40
+ props: {
41
+ options: {
42
+ type: Object,
43
+ default: () => ({})
44
+ },
45
+ layers: {
46
+ type: Array,
47
+ default: () => []
48
+ }
49
+ }
50
+ }
51
+ );
52
+ }
53
+ async loadDeckGL() {
54
+ const { Deck: e } = await import("deck.gl");
55
+ this.deckgl = { Deck: e };
56
+ }
57
+ async createMap(e, t = {}) {
58
+ const a = new D();
59
+ return new Promise((s, l) => {
60
+ g(async () => {
61
+ await (this.deckgl ? Promise.resolve() : this.loadDeckGL());
62
+ const n = () => {
63
+ if (!e.value)
64
+ throw new Error("Missing HTML element");
65
+ a.deckgl = this.deckgl, a.map = new this.deckgl.Deck({
66
+ parent: e.value,
67
+ ...t
68
+ }), s(a);
69
+ };
70
+ t.onMounted ? t.onMounted(n) : n();
71
+ }), v(() => {
72
+ a.map && (a.map.finalize(), a.map = null);
73
+ });
74
+ });
75
+ }
76
+ }
77
+ export {
78
+ P as default
79
+ };
@@ -0,0 +1,170 @@
1
+ import { defineComponent as l, ref as d, toRefs as n, shallowRef as u, provide as y, h as w, inject as p, onMounted as v, onUnmounted as L, watch as g } from "vue";
2
+ class m {
3
+ constructor() {
4
+ this.overlay = null, this.watching = { layers: !1 };
5
+ }
6
+ watchLayers(e, a = {}) {
7
+ if (!this.overlay)
8
+ throw new Error("overlay should be set");
9
+ if (this.watching.layers) {
10
+ console.warn("No need to call GoogleMapsDeckGLOverlay.watchLayers(). layers are already being watched");
11
+ return;
12
+ }
13
+ this.watching.layers = !0, g(e, () => {
14
+ this.overlay.setProps({ layers: e.value });
15
+ }, a);
16
+ }
17
+ }
18
+ class k {
19
+ constructor() {
20
+ this.map = null;
21
+ }
22
+ async setDeckGLOverlay(e = {}) {
23
+ if (!this.map)
24
+ throw new Error("map should be set");
25
+ const { GoogleMapsOverlay: a } = await import("@deck.gl/google-maps"), t = new m();
26
+ return t.overlay = new a(e), t.overlay.setMap(this.map), t;
27
+ }
28
+ }
29
+ class G {
30
+ constructor(e) {
31
+ if (this.apiKey = e.apiKey, !this.apiKey)
32
+ throw new Error("apiKey is required");
33
+ this.libraries = e.libraries || ["maps"], this.version = e.version || "weekly", this.loader = null, this.sdk = {}, this.deckgl = null;
34
+ }
35
+ get Map() {
36
+ return l(
37
+ (e, { emit: a, slots: t }) => {
38
+ const r = d(null), { options: o } = n(e), s = u(null);
39
+ return y("googleMapsMap", s), this.createMap(r, o.value).then((i) => {
40
+ s.value = i, a("loaded", i);
41
+ }), () => w("div", { ref: r }, s.value ? t : []);
42
+ },
43
+ {
44
+ props: {
45
+ options: {
46
+ type: Object,
47
+ default: () => ({})
48
+ }
49
+ }
50
+ }
51
+ );
52
+ }
53
+ get DeckGLOverlay() {
54
+ return l(
55
+ (e, { emit: a, slots: t }) => {
56
+ const { options: r, layers: o } = n(e), s = p("googleMapsMap");
57
+ if (!s || !s.value)
58
+ throw new Error("map should exist");
59
+ return s.value.setDeckGLOverlay(r.value).then((i) => {
60
+ i.watchLayers(o, r.value.watchLayersOptions || { immediate: !0 }), a("loaded", i);
61
+ }), () => {
62
+ };
63
+ },
64
+ {
65
+ props: {
66
+ options: {
67
+ type: Object,
68
+ default: () => ({})
69
+ },
70
+ layers: {
71
+ type: Array,
72
+ default: () => []
73
+ }
74
+ }
75
+ }
76
+ );
77
+ }
78
+ get DeckGL3DTileLayer() {
79
+ return l(
80
+ (e, { emit: a, slots: t }) => {
81
+ const { options: r } = n(e), o = p("deckGLPrependLayers");
82
+ if (!o || !o.value)
83
+ throw new Error("deckGLPrependLayers should exist");
84
+ const s = d("");
85
+ this.createDeckGL3DTileLayer(s, r).then((h) => {
86
+ o.value = [
87
+ ...o.value,
88
+ h
89
+ ];
90
+ });
91
+ const i = p("deckGLAppendVNodeFn");
92
+ if (!i)
93
+ throw new Error("deckGLAppendVNodeFn should exist");
94
+ return t.appendMap && i.value.push(() => t.appendMap({ credits: s.value })), () => {
95
+ };
96
+ },
97
+ {
98
+ props: {
99
+ options: {
100
+ type: Object,
101
+ default: () => ({})
102
+ }
103
+ }
104
+ }
105
+ );
106
+ }
107
+ async loadGoogleMaps() {
108
+ const { Loader: e } = await import("@googlemaps/js-api-loader");
109
+ this.loader = new e({
110
+ apiKey: this.apiKey,
111
+ version: this.version,
112
+ libraries: this.libraries
113
+ });
114
+ const a = await Promise.all(this.libraries.map((t) => this.loader.importLibrary(t)));
115
+ for (const [t, r] of this.libraries.entries())
116
+ this.sdk[r] = a[t];
117
+ }
118
+ async getSDK() {
119
+ return await (Object.keys(this.sdk).length ? Promise.resolve() : this.loadGoogleMaps()), this.sdk;
120
+ }
121
+ async createMap(e, a = {}) {
122
+ const t = new k();
123
+ return new Promise((r, o) => {
124
+ v(async () => {
125
+ await (this.sdk.maps ? Promise.resolve() : this.loadGoogleMaps());
126
+ const s = () => {
127
+ if (!e.value)
128
+ throw new Error("Missing HTML element");
129
+ t.map = new this.sdk.maps.Map(e.value, {
130
+ ...a
131
+ }), r(t);
132
+ };
133
+ a.onMounted ? a.onMounted(s) : s();
134
+ }), L(() => {
135
+ t.map && (t.map = null);
136
+ });
137
+ });
138
+ }
139
+ async loadDeckGL() {
140
+ const { Tile3DLayer: e } = await import("deck.gl");
141
+ this.deckgl = { Tile3DLayer: e };
142
+ }
143
+ async createDeckGL3DTileLayer(e, a = {}) {
144
+ return await (this.deckgl ? Promise.resolve() : this.loadDeckGL()), new this.deckgl.Tile3DLayer({
145
+ id: "google-3d-tiles",
146
+ data: "https://tile.googleapis.com/v1/3dtiles/root.json",
147
+ loadOptions: {
148
+ fetch: {
149
+ headers: {
150
+ "X-GOOG-API-KEY": this.apiKey
151
+ }
152
+ }
153
+ },
154
+ onTilesetLoad: (t) => {
155
+ e && (t.options.onTraversalComplete = (r) => {
156
+ const o = /* @__PURE__ */ new Set();
157
+ return r.forEach((s) => {
158
+ const { copyright: i } = s.content.gltf.asset;
159
+ i.split(";").forEach(o.add, o), e.value = [...o].join("; ");
160
+ }), r;
161
+ });
162
+ },
163
+ operation: "terrain+draw",
164
+ ...a
165
+ });
166
+ }
167
+ }
168
+ export {
169
+ G as default
170
+ };
@@ -0,0 +1,177 @@
1
+ import { defineComponent as m, ref as f, toRefs as y, shallowRef as v, provide as b, h as g, inject as x, onMounted as M, onUnmounted as L, watch as p, nextTick as w } from "vue";
2
+ class S {
3
+ constructor() {
4
+ this.overlay = null, this.watching = { layers: !1 };
5
+ }
6
+ watchLayers(e, s = {}) {
7
+ if (!this.overlay)
8
+ throw new Error("overlay should be set");
9
+ if (this.watching.layers) {
10
+ console.warn("No need to call MapboxDeckGLOverlay.watchLayers(). layers are already being watched");
11
+ return;
12
+ }
13
+ this.watching.layers = !0, p(e, () => {
14
+ this.overlay.setProps({ layers: e.value });
15
+ }, s);
16
+ }
17
+ }
18
+ class k {
19
+ constructor() {
20
+ this.map = null, this.watching = { sources: !1, layers: !1 };
21
+ }
22
+ watchSources(e, s = {}) {
23
+ if (!this.map)
24
+ throw new Error("map should be set");
25
+ if (this.watching.sources) {
26
+ console.warn("No need to call MapboxMap.watchSources(). sources are already being watched");
27
+ return;
28
+ }
29
+ this.watching.sources = !0, p(e, (a, o) => {
30
+ const r = [...o || []], i = [...a || []], n = i.map((t) => t.id), l = r.map((t) => t.id), c = i.filter((t) => !l.includes(t.id)), h = r.filter((t) => !n.includes(t.id));
31
+ for (const t of h)
32
+ w(() => {
33
+ this.map.removeSource(t.id);
34
+ });
35
+ for (const t of c) {
36
+ const u = { ...t };
37
+ delete u.id, this.map.addSource(t.id, u);
38
+ }
39
+ }, s);
40
+ }
41
+ watchLayers(e, s = {}) {
42
+ if (!this.map)
43
+ throw new Error("map should be set");
44
+ if (this.watching.layers) {
45
+ console.warn("No need to call MapboxMap.watchLayers(). layers are already being watched");
46
+ return;
47
+ }
48
+ this.watching.layers = !0, p(e, (a, o) => {
49
+ const r = [...o || []], i = [...a || []], n = i.map((t) => t.id), l = r.map((t) => t.id), c = i.filter((t) => !l.includes(t.id)), h = r.filter((t) => !n.includes(t.id));
50
+ for (const t of h)
51
+ this.map.removeLayer(t.id);
52
+ for (const t of c)
53
+ w(() => {
54
+ this.map.addLayer(t);
55
+ });
56
+ }, s);
57
+ }
58
+ async setDeckGLOverlay(e = {}) {
59
+ if (!this.map)
60
+ throw new Error("map should be set");
61
+ const { MapboxOverlay: s } = await import("@deck.gl/mapbox"), a = new S();
62
+ return a.overlay = new s(e), this.map.addControl(a.overlay), a;
63
+ }
64
+ }
65
+ class D {
66
+ constructor(e) {
67
+ if (this.apiKey = e.apiKey, !this.apiKey)
68
+ throw new Error("apiKey is required");
69
+ this.services = e.services || [], this.sdk = {}, this.mapboxgl = null, this.services.length && this.loadMapboxSDK();
70
+ }
71
+ get Map() {
72
+ return m(
73
+ (e, { emit: s, slots: a }) => {
74
+ const o = f(null), { options: r, layers: i, sources: n } = y(e), l = v(null);
75
+ return b("mapboxMap", l), this.createMap(o, r.value).then((c) => {
76
+ l.value = c, c.watchSources(n, r.value.watchSourcesOptions || { immediate: !0 }), c.watchLayers(i, r.value.watchLayersOptions || { immediate: !0 }), s("loaded", c);
77
+ }), () => g("div", { ref: o }, l.value ? a : []);
78
+ },
79
+ {
80
+ props: {
81
+ options: {
82
+ type: Object,
83
+ default: () => ({})
84
+ },
85
+ layers: {
86
+ type: Array,
87
+ default: () => []
88
+ },
89
+ sources: {
90
+ type: Array,
91
+ default: () => []
92
+ }
93
+ }
94
+ }
95
+ );
96
+ }
97
+ get DeckGLOverlay() {
98
+ return m(
99
+ (e, { emit: s, slots: a }) => {
100
+ const { options: o, layers: r } = y(e), i = x("mapboxMap");
101
+ if (!i || !i.value)
102
+ throw new Error("map should exist");
103
+ return i.value.setDeckGLOverlay(o.value).then((n) => {
104
+ n.watchLayers(r, o.value.watchLayersOptions || { immediate: !0 }), s("loaded", n);
105
+ }), () => {
106
+ };
107
+ },
108
+ {
109
+ props: {
110
+ options: {
111
+ type: Object,
112
+ default: () => ({})
113
+ },
114
+ layers: {
115
+ type: Array,
116
+ default: () => []
117
+ }
118
+ }
119
+ }
120
+ );
121
+ }
122
+ async loadMapbox() {
123
+ const e = await import("../mapbox-gl.js").then((s) => s.m);
124
+ this.mapboxgl = e;
125
+ }
126
+ get servicesLoader() {
127
+ return {
128
+ datasets: () => import("../mapbox-sdk/datasets.js").then((e) => e.d),
129
+ directions: () => import("../mapbox-sdk/directions.js").then((e) => e.d),
130
+ geocoding: () => import("../mapbox-sdk/geocoding.js").then((e) => e.g),
131
+ geocodingV6: () => import("../mapbox-sdk/geocoding-v6.js").then((e) => e.g),
132
+ mapMatching: () => import("../mapbox-sdk/map-matching.js").then((e) => e.m),
133
+ matrix: () => import("../mapbox-sdk/matrix.js").then((e) => e.m),
134
+ optimization: () => import("../mapbox-sdk/optimization.js").then((e) => e.o),
135
+ static: () => import("../mapbox-sdk/static.js").then((e) => e._),
136
+ styles: () => import("../mapbox-sdk/styles.js").then((e) => e.s),
137
+ tilequery: () => import("../mapbox-sdk/tilequery.js").then((e) => e.t),
138
+ tilesets: () => import("../mapbox-sdk/tilesets.js").then((e) => e.t),
139
+ tokens: () => import("../mapbox-sdk/tokens.js").then((e) => e.t),
140
+ uploads: () => import("../mapbox-sdk/uploads.js").then((e) => e.u),
141
+ isochrone: () => import("../mapbox-sdk/isochrone.js").then((e) => e.i)
142
+ };
143
+ }
144
+ async loadMapboxSDK() {
145
+ const s = (await import("../mapbox-sdk.js").then((o) => o.i)).default({ accessToken: this.apiKey }), a = await Promise.all(this.services.map((o) => this.servicesLoader[o]().then((r) => r.default(s))));
146
+ for (const [o, r] of this.services.entries())
147
+ this.sdk[r] = a[o];
148
+ }
149
+ async getSDK() {
150
+ return await (Object.keys(this.sdk).length ? Promise.resolve() : this.loadMapboxSDK()), this.sdk;
151
+ }
152
+ async createMap(e, s = {}) {
153
+ const a = new k();
154
+ return new Promise((o, r) => {
155
+ M(async () => {
156
+ await (this.mapboxgl ? Promise.resolve() : this.loadMapbox());
157
+ const i = () => {
158
+ if (!e.value)
159
+ throw new Error("Missing HTML element");
160
+ a.map = new this.mapboxgl.Map({
161
+ container: e.value,
162
+ accessToken: this.apiKey,
163
+ ...s
164
+ }), a.map.on("load", () => {
165
+ o(a);
166
+ });
167
+ };
168
+ s.onMounted ? s.onMounted(i) : i();
169
+ }), L(() => {
170
+ a.map && (a.map.remove(), a.map = null);
171
+ });
172
+ });
173
+ }
174
+ }
175
+ export {
176
+ D as default
177
+ };
@@ -0,0 +1,183 @@
1
+ import { defineComponent as m, ref as f, toRefs as y, shallowRef as v, provide as b, h as g, inject as x, onMounted as M, onUnmounted as L, watch as d, nextTick as w } from "vue";
2
+ class S {
3
+ constructor() {
4
+ this.overlay = null, this.watching = { layers: !1 };
5
+ }
6
+ watchLayers(e, s = {}) {
7
+ if (!this.overlay)
8
+ throw new Error("overlay should be set");
9
+ if (this.watching.layers) {
10
+ console.warn("No need to call MapboxDeckGLOverlay.watchLayers(). layers are already being watched");
11
+ return;
12
+ }
13
+ this.watching.layers = !0, d(e, () => {
14
+ this.overlay.setProps({ layers: e.value });
15
+ }, s);
16
+ }
17
+ }
18
+ class k {
19
+ constructor() {
20
+ this.map = null, this.watching = { sources: !1, layers: !1 };
21
+ }
22
+ watchSources(e, s = {}) {
23
+ if (!this.map)
24
+ throw new Error("map should be set");
25
+ if (this.watching.sources) {
26
+ console.warn("No need to call MapboxMap.watchSources(). sources are already being watched");
27
+ return;
28
+ }
29
+ this.watching.sources = !0, d(e, (a, o) => {
30
+ const r = [...o || []], i = [...a || []], n = i.map((t) => t.id), l = r.map((t) => t.id), c = i.filter((t) => !l.includes(t.id)), h = r.filter((t) => !n.includes(t.id));
31
+ for (const t of h)
32
+ w(() => {
33
+ this.map.removeSource(t.id);
34
+ });
35
+ for (const t of c) {
36
+ const u = { ...t };
37
+ delete u.id, this.map.addSource(t.id, u);
38
+ }
39
+ }, s);
40
+ }
41
+ watchLayers(e, s = {}) {
42
+ if (!this.map)
43
+ throw new Error("map should be set");
44
+ if (this.watching.layers) {
45
+ console.warn("No need to call MapboxMap.watchLayers(). layers are already being watched");
46
+ return;
47
+ }
48
+ this.watching.layers = !0, d(e, (a, o) => {
49
+ const r = [...o || []], i = [...a || []], n = i.map((t) => t.id), l = r.map((t) => t.id), c = i.filter((t) => !l.includes(t.id)), h = r.filter((t) => !n.includes(t.id));
50
+ for (const t of h)
51
+ this.map.removeLayer(t.id);
52
+ for (const t of c)
53
+ w(() => {
54
+ this.map.addLayer(t);
55
+ });
56
+ }, s);
57
+ }
58
+ async setDeckGLOverlay(e = {}) {
59
+ if (!this.map)
60
+ throw new Error("map should be set");
61
+ const { MapboxOverlay: s } = await import("@deck.gl/mapbox"), a = new S();
62
+ return a.overlay = new s(e), this.map.addControl(a.overlay), a;
63
+ }
64
+ }
65
+ class O {
66
+ constructor(e) {
67
+ if (this.apiKey = e.apiKey, !this.apiKey)
68
+ throw new Error("apiKey is required");
69
+ this.services = e.services || [], this.sdk = {}, this.mapboxgl = null, this.services.length && this.loadMapboxSDK();
70
+ }
71
+ get Map() {
72
+ return m(
73
+ (e, { emit: s, slots: a }) => {
74
+ const o = f(null), { options: r, layers: i, sources: n } = y(e), l = v(null);
75
+ return b("mapboxMap", l), this.createMap(o, r.value).then((c) => {
76
+ l.value = c, c.watchSources(n, r.value.watchSourcesOptions || { immediate: !0 }), c.watchLayers(i, r.value.watchLayersOptions || { immediate: !0 }), s("loaded", c);
77
+ }), () => g("div", { ref: o }, l.value ? a : []);
78
+ },
79
+ {
80
+ props: {
81
+ options: {
82
+ type: Object,
83
+ default: () => ({})
84
+ },
85
+ layers: {
86
+ type: Array,
87
+ default: () => []
88
+ },
89
+ sources: {
90
+ type: Array,
91
+ default: () => []
92
+ }
93
+ }
94
+ }
95
+ );
96
+ }
97
+ get DeckGLOverlay() {
98
+ return m(
99
+ (e, { emit: s, slots: a }) => {
100
+ const { options: o, layers: r } = y(e), i = x("mapboxMap");
101
+ if (!i || !i.value)
102
+ throw new Error("map should exist");
103
+ return i.value.setDeckGLOverlay(o.value).then((n) => {
104
+ n.watchLayers(r, o.value.watchLayersOptions || { immediate: !0 }), s("loaded", n);
105
+ }), () => {
106
+ };
107
+ },
108
+ {
109
+ props: {
110
+ options: {
111
+ type: Object,
112
+ default: () => ({})
113
+ },
114
+ layers: {
115
+ type: Array,
116
+ default: () => []
117
+ }
118
+ }
119
+ }
120
+ );
121
+ }
122
+ async loadMapbox() {
123
+ const e = await import("../mapbox-gl.js").then((s) => s.m);
124
+ this.mapboxgl = e;
125
+ }
126
+ get servicesLoader() {
127
+ return {
128
+ datasets: () => import("../mapbox-sdk/datasets.js").then((e) => e.d),
129
+ directions: () => import("../mapbox-sdk/directions.js").then((e) => e.d),
130
+ geocoding: () => import("../mapbox-sdk/geocoding.js").then((e) => e.g),
131
+ geocodingV6: () => import("../mapbox-sdk/geocoding-v6.js").then((e) => e.g),
132
+ mapMatching: () => import("../mapbox-sdk/map-matching.js").then((e) => e.m),
133
+ matrix: () => import("../mapbox-sdk/matrix.js").then((e) => e.m),
134
+ optimization: () => import("../mapbox-sdk/optimization.js").then((e) => e.o),
135
+ static: () => import("../mapbox-sdk/static.js").then((e) => e._),
136
+ styles: () => import("../mapbox-sdk/styles.js").then((e) => e.s),
137
+ tilequery: () => import("../mapbox-sdk/tilequery.js").then((e) => e.t),
138
+ tilesets: () => import("../mapbox-sdk/tilesets.js").then((e) => e.t),
139
+ tokens: () => import("../mapbox-sdk/tokens.js").then((e) => e.t),
140
+ uploads: () => import("../mapbox-sdk/uploads.js").then((e) => e.u),
141
+ isochrone: () => import("../mapbox-sdk/isochrone.js").then((e) => e.i)
142
+ };
143
+ }
144
+ async loadMapboxSDK() {
145
+ const s = (await import("../mapbox-sdk.js").then((o) => o.i)).default({ accessToken: this.apiKey }), a = await Promise.all(this.services.map((o) => this.servicesLoader[o]().then((r) => r.default(s))));
146
+ for (const [o, r] of this.services.entries())
147
+ this.sdk[r] = a[o];
148
+ }
149
+ async getSDK() {
150
+ return await (Object.keys(this.sdk).length ? Promise.resolve() : this.loadMapboxSDK()), this.sdk;
151
+ }
152
+ async createMap(e, s = {}) {
153
+ const a = new k();
154
+ return new Promise((o, r) => {
155
+ M(async () => {
156
+ await (this.mapboxgl ? Promise.resolve() : this.loadMapbox());
157
+ const i = () => {
158
+ if (!e.value)
159
+ throw new Error("Missing HTML element");
160
+ a.map = new this.mapboxgl.Map({
161
+ container: e.value,
162
+ accessToken: this.apiKey,
163
+ ...s
164
+ }), a.map.on("load", () => {
165
+ o(a);
166
+ });
167
+ };
168
+ s.onMounted ? s.onMounted(i) : i();
169
+ }), L(() => {
170
+ a.map && (a.map.remove(), a.map = null);
171
+ });
172
+ });
173
+ }
174
+ }
175
+ class K extends O {
176
+ async loadMapbox() {
177
+ const e = await import("maplibre-gl");
178
+ this.mapboxgl = e;
179
+ }
180
+ }
181
+ export {
182
+ K as default
183
+ };