@yappkit/front-module-map 0.1.1 → 0.1.3
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/lib/mapbox-gl.js +1030 -1027
- package/lib/providers/mapbox.js +57 -57
- package/lib/providers/maplibre.js +59 -59
- package/lib/yappkit-map.js +61 -61
- package/package.json +3 -5
- package/lib/_commonjsHelpers.js +0 -8
- package/lib/mapbox-sdk/browser-client.js +0 -500
- package/lib/mapbox-sdk/create-service-factory.js +0 -237
- package/lib/mapbox-sdk/datasets.js +0 -123
- package/lib/mapbox-sdk/directions.js +0 -155
- package/lib/mapbox-sdk/geocoding-v6.js +0 -129
- package/lib/mapbox-sdk/geocoding.js +0 -113
- package/lib/mapbox-sdk/isochrone.js +0 -82
- package/lib/mapbox-sdk/map-matching.js +0 -110
- package/lib/mapbox-sdk/matrix.js +0 -72
- package/lib/mapbox-sdk/object-clean.js +0 -11
- package/lib/mapbox-sdk/optimization.js +0 -106
- package/lib/mapbox-sdk/static.js +0 -197
- package/lib/mapbox-sdk/stringify-booleans.js +0 -15
- package/lib/mapbox-sdk/styles.js +0 -181
- package/lib/mapbox-sdk/tilequery.js +0 -46
- package/lib/mapbox-sdk/tilesets.js +0 -214
- package/lib/mapbox-sdk/tokens.js +0 -111
- package/lib/mapbox-sdk/uploads.js +0 -77
- package/lib/mapbox-sdk.js +0 -29
package/lib/providers/mapbox.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
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
|
|
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
2
|
class S {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.overlay = null, this.watching = { layers: !1 };
|
|
5
5
|
}
|
|
6
|
-
watchLayers(
|
|
6
|
+
watchLayers(t, s = {}) {
|
|
7
7
|
if (!this.overlay)
|
|
8
8
|
throw new Error("overlay should be set");
|
|
9
9
|
if (this.watching.layers) {
|
|
10
10
|
console.warn("No need to call MapboxDeckGLOverlay.watchLayers(). layers are already being watched");
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
-
this.watching.layers = !0,
|
|
14
|
-
this.overlay.setProps({ layers:
|
|
13
|
+
this.watching.layers = !0, d(t, () => {
|
|
14
|
+
this.overlay.setProps({ layers: t.value });
|
|
15
15
|
}, s);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -19,62 +19,62 @@ class k {
|
|
|
19
19
|
constructor() {
|
|
20
20
|
this.map = null, this.watching = { sources: !1, layers: !1 };
|
|
21
21
|
}
|
|
22
|
-
watchSources(
|
|
22
|
+
watchSources(t, s = {}) {
|
|
23
23
|
if (!this.map)
|
|
24
24
|
throw new Error("map should be set");
|
|
25
25
|
if (this.watching.sources) {
|
|
26
26
|
console.warn("No need to call MapboxMap.watchSources(). sources are already being watched");
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
this.watching.sources = !0,
|
|
30
|
-
const
|
|
31
|
-
for (const
|
|
29
|
+
this.watching.sources = !0, d(t, (a, r) => {
|
|
30
|
+
const o = [...r || []], i = [...a || []], n = i.map((e) => e.id), l = o.map((e) => e.id), c = i.filter((e) => !l.includes(e.id)), p = o.filter((e) => !n.includes(e.id));
|
|
31
|
+
for (const e of p)
|
|
32
32
|
w(() => {
|
|
33
|
-
this.map.removeSource(
|
|
33
|
+
this.map.removeSource(e.id);
|
|
34
34
|
});
|
|
35
|
-
for (const
|
|
36
|
-
const u = { ...
|
|
37
|
-
delete u.id, this.map.addSource(
|
|
35
|
+
for (const e of c) {
|
|
36
|
+
const u = { ...e };
|
|
37
|
+
delete u.id, this.map.addSource(e.id, u);
|
|
38
38
|
}
|
|
39
39
|
}, s);
|
|
40
40
|
}
|
|
41
|
-
watchLayers(
|
|
41
|
+
watchLayers(t, s = {}) {
|
|
42
42
|
if (!this.map)
|
|
43
43
|
throw new Error("map should be set");
|
|
44
44
|
if (this.watching.layers) {
|
|
45
45
|
console.warn("No need to call MapboxMap.watchLayers(). layers are already being watched");
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
this.watching.layers = !0,
|
|
49
|
-
const
|
|
50
|
-
for (const
|
|
51
|
-
this.map.removeLayer(
|
|
52
|
-
for (const
|
|
48
|
+
this.watching.layers = !0, d(t, (a, r) => {
|
|
49
|
+
const o = [...r || []], i = [...a || []], n = i.map((e) => e.id), l = o.map((e) => e.id), c = i.filter((e) => !l.includes(e.id)), p = o.filter((e) => !n.includes(e.id));
|
|
50
|
+
for (const e of p)
|
|
51
|
+
this.map.removeLayer(e.id);
|
|
52
|
+
for (const e of c)
|
|
53
53
|
w(() => {
|
|
54
|
-
this.map.addLayer(
|
|
54
|
+
this.map.addLayer(e);
|
|
55
55
|
});
|
|
56
56
|
}, s);
|
|
57
57
|
}
|
|
58
|
-
async setDeckGLOverlay(
|
|
58
|
+
async setDeckGLOverlay(t = {}) {
|
|
59
59
|
if (!this.map)
|
|
60
60
|
throw new Error("map should be set");
|
|
61
61
|
const { MapboxOverlay: s } = await import("@deck.gl/mapbox"), a = new S();
|
|
62
|
-
return a.overlay = new s(
|
|
62
|
+
return a.overlay = new s(t), this.map.addControl(a.overlay), a;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
class D {
|
|
66
|
-
constructor(
|
|
67
|
-
if (this.apiKey =
|
|
66
|
+
constructor(t) {
|
|
67
|
+
if (this.apiKey = t.apiKey, !this.apiKey)
|
|
68
68
|
throw new Error("apiKey is required");
|
|
69
|
-
this.services =
|
|
69
|
+
this.services = t.services || [], this.sdk = {}, this.mapboxgl = null, this.services.length && this.loadMapboxSDK();
|
|
70
70
|
}
|
|
71
71
|
get Map() {
|
|
72
72
|
return m(
|
|
73
|
-
(
|
|
74
|
-
const
|
|
75
|
-
return b("mapboxMap", l), this.createMap(
|
|
76
|
-
l.value = c, c.watchSources(n,
|
|
77
|
-
}), () => g("div", { ref:
|
|
73
|
+
(t, { emit: s, slots: a }) => {
|
|
74
|
+
const r = f(null), { options: o, layers: i, sources: n } = y(t), l = v(null);
|
|
75
|
+
return b("mapboxMap", l), this.createMap(r, o.value).then((c) => {
|
|
76
|
+
l.value = c, c.watchSources(n, o.value.watchSourcesOptions || { immediate: !0 }), c.watchLayers(i, o.value.watchLayersOptions || { immediate: !0 }), s("loaded", c);
|
|
77
|
+
}), () => g("div", { ref: r }, l.value ? a : []);
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
props: {
|
|
@@ -96,12 +96,12 @@ class D {
|
|
|
96
96
|
}
|
|
97
97
|
get DeckGLOverlay() {
|
|
98
98
|
return m(
|
|
99
|
-
(
|
|
100
|
-
const { options:
|
|
99
|
+
(t, { emit: s, slots: a }) => {
|
|
100
|
+
const { options: r, layers: o } = y(t), i = x("mapboxMap");
|
|
101
101
|
if (!i || !i.value)
|
|
102
102
|
throw new Error("map should exist");
|
|
103
|
-
return i.value.setDeckGLOverlay(
|
|
104
|
-
n.watchLayers(
|
|
103
|
+
return i.value.setDeckGLOverlay(r.value).then((n) => {
|
|
104
|
+
n.watchLayers(o, r.value.watchLayersOptions || { immediate: !0 }), s("loaded", n);
|
|
105
105
|
}), () => {
|
|
106
106
|
};
|
|
107
107
|
},
|
|
@@ -120,49 +120,49 @@ class D {
|
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
122
|
async loadMapbox() {
|
|
123
|
-
const
|
|
124
|
-
this.mapboxgl =
|
|
123
|
+
const t = await import("../mapbox-gl.js").then((s) => s.mapboxGl);
|
|
124
|
+
this.mapboxgl = t;
|
|
125
125
|
}
|
|
126
126
|
get servicesLoader() {
|
|
127
127
|
return {
|
|
128
|
-
datasets: () => import("
|
|
129
|
-
directions: () => import("
|
|
130
|
-
geocoding: () => import("
|
|
131
|
-
geocodingV6: () => import("
|
|
132
|
-
mapMatching: () => import("
|
|
133
|
-
matrix: () => import("
|
|
134
|
-
optimization: () => import("
|
|
135
|
-
static: () => import("
|
|
136
|
-
styles: () => import("
|
|
137
|
-
tilequery: () => import("
|
|
138
|
-
tilesets: () => import("
|
|
139
|
-
tokens: () => import("
|
|
140
|
-
uploads: () => import("
|
|
141
|
-
isochrone: () => import("
|
|
128
|
+
datasets: () => import("@mapbox/mapbox-sdk/services/datasets.js"),
|
|
129
|
+
directions: () => import("@mapbox/mapbox-sdk/services/directions.js"),
|
|
130
|
+
geocoding: () => import("@mapbox/mapbox-sdk/services/geocoding.js"),
|
|
131
|
+
geocodingV6: () => import("@mapbox/mapbox-sdk/services/geocoding-v6.js"),
|
|
132
|
+
mapMatching: () => import("@mapbox/mapbox-sdk/services/map-matching.js"),
|
|
133
|
+
matrix: () => import("@mapbox/mapbox-sdk/services/matrix.js"),
|
|
134
|
+
optimization: () => import("@mapbox/mapbox-sdk/services/optimization.js"),
|
|
135
|
+
static: () => import("@mapbox/mapbox-sdk/services/static.js"),
|
|
136
|
+
styles: () => import("@mapbox/mapbox-sdk/services/styles.js"),
|
|
137
|
+
tilequery: () => import("@mapbox/mapbox-sdk/services/tilequery.js"),
|
|
138
|
+
tilesets: () => import("@mapbox/mapbox-sdk/services/tilesets.js"),
|
|
139
|
+
tokens: () => import("@mapbox/mapbox-sdk/services/tokens.js"),
|
|
140
|
+
uploads: () => import("@mapbox/mapbox-sdk/services/uploads.js"),
|
|
141
|
+
isochrone: () => import("@mapbox/mapbox-sdk/services/isochrone.js")
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
144
|
async loadMapboxSDK() {
|
|
145
|
-
const s = (await import("
|
|
146
|
-
for (const [
|
|
147
|
-
this.sdk[
|
|
145
|
+
const s = (await import("@mapbox/mapbox-sdk")).default({ accessToken: this.apiKey }), a = await Promise.all(this.services.map((r) => this.servicesLoader[r]().then((o) => o.default(s))));
|
|
146
|
+
for (const [r, o] of this.services.entries())
|
|
147
|
+
this.sdk[o] = a[r];
|
|
148
148
|
}
|
|
149
149
|
async getSDK() {
|
|
150
150
|
return await (Object.keys(this.sdk).length ? Promise.resolve() : this.loadMapboxSDK()), this.sdk;
|
|
151
151
|
}
|
|
152
|
-
async createMap(
|
|
152
|
+
async createMap(t, s = {}) {
|
|
153
153
|
const a = new k();
|
|
154
|
-
return new Promise((
|
|
154
|
+
return new Promise((r, o) => {
|
|
155
155
|
M(async () => {
|
|
156
156
|
await (this.mapboxgl ? Promise.resolve() : this.loadMapbox());
|
|
157
157
|
const i = () => {
|
|
158
|
-
if (!
|
|
158
|
+
if (!t.value)
|
|
159
159
|
throw new Error("Missing HTML element");
|
|
160
160
|
a.map = new this.mapboxgl.Map({
|
|
161
|
-
container:
|
|
161
|
+
container: t.value,
|
|
162
162
|
accessToken: this.apiKey,
|
|
163
163
|
...s
|
|
164
164
|
}), a.map.on("load", () => {
|
|
165
|
-
|
|
165
|
+
r(a);
|
|
166
166
|
});
|
|
167
167
|
};
|
|
168
168
|
s.onMounted ? s.onMounted(i) : i();
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as m, ref as f, toRefs as y, shallowRef as v, provide as b, h as
|
|
1
|
+
import { defineComponent as m, ref as f, toRefs as y, shallowRef as v, provide as b, h as x, inject as g, onMounted as M, onUnmounted as L, watch as h, nextTick as w } from "vue";
|
|
2
2
|
class S {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.overlay = null, this.watching = { layers: !1 };
|
|
5
5
|
}
|
|
6
|
-
watchLayers(
|
|
6
|
+
watchLayers(t, s = {}) {
|
|
7
7
|
if (!this.overlay)
|
|
8
8
|
throw new Error("overlay should be set");
|
|
9
9
|
if (this.watching.layers) {
|
|
10
10
|
console.warn("No need to call MapboxDeckGLOverlay.watchLayers(). layers are already being watched");
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
-
this.watching.layers = !0,
|
|
14
|
-
this.overlay.setProps({ layers:
|
|
13
|
+
this.watching.layers = !0, h(t, () => {
|
|
14
|
+
this.overlay.setProps({ layers: t.value });
|
|
15
15
|
}, s);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -19,62 +19,62 @@ class k {
|
|
|
19
19
|
constructor() {
|
|
20
20
|
this.map = null, this.watching = { sources: !1, layers: !1 };
|
|
21
21
|
}
|
|
22
|
-
watchSources(
|
|
22
|
+
watchSources(t, s = {}) {
|
|
23
23
|
if (!this.map)
|
|
24
24
|
throw new Error("map should be set");
|
|
25
25
|
if (this.watching.sources) {
|
|
26
26
|
console.warn("No need to call MapboxMap.watchSources(). sources are already being watched");
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
this.watching.sources = !0,
|
|
30
|
-
const
|
|
31
|
-
for (const
|
|
29
|
+
this.watching.sources = !0, h(t, (a, r) => {
|
|
30
|
+
const o = [...r || []], i = [...a || []], n = i.map((e) => e.id), l = o.map((e) => e.id), c = i.filter((e) => !l.includes(e.id)), d = o.filter((e) => !n.includes(e.id));
|
|
31
|
+
for (const e of d)
|
|
32
32
|
w(() => {
|
|
33
|
-
this.map.removeSource(
|
|
33
|
+
this.map.removeSource(e.id);
|
|
34
34
|
});
|
|
35
|
-
for (const
|
|
36
|
-
const u = { ...
|
|
37
|
-
delete u.id, this.map.addSource(
|
|
35
|
+
for (const e of c) {
|
|
36
|
+
const u = { ...e };
|
|
37
|
+
delete u.id, this.map.addSource(e.id, u);
|
|
38
38
|
}
|
|
39
39
|
}, s);
|
|
40
40
|
}
|
|
41
|
-
watchLayers(
|
|
41
|
+
watchLayers(t, s = {}) {
|
|
42
42
|
if (!this.map)
|
|
43
43
|
throw new Error("map should be set");
|
|
44
44
|
if (this.watching.layers) {
|
|
45
45
|
console.warn("No need to call MapboxMap.watchLayers(). layers are already being watched");
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
this.watching.layers = !0,
|
|
49
|
-
const
|
|
50
|
-
for (const
|
|
51
|
-
this.map.removeLayer(
|
|
52
|
-
for (const
|
|
48
|
+
this.watching.layers = !0, h(t, (a, r) => {
|
|
49
|
+
const o = [...r || []], i = [...a || []], n = i.map((e) => e.id), l = o.map((e) => e.id), c = i.filter((e) => !l.includes(e.id)), d = o.filter((e) => !n.includes(e.id));
|
|
50
|
+
for (const e of d)
|
|
51
|
+
this.map.removeLayer(e.id);
|
|
52
|
+
for (const e of c)
|
|
53
53
|
w(() => {
|
|
54
|
-
this.map.addLayer(
|
|
54
|
+
this.map.addLayer(e);
|
|
55
55
|
});
|
|
56
56
|
}, s);
|
|
57
57
|
}
|
|
58
|
-
async setDeckGLOverlay(
|
|
58
|
+
async setDeckGLOverlay(t = {}) {
|
|
59
59
|
if (!this.map)
|
|
60
60
|
throw new Error("map should be set");
|
|
61
61
|
const { MapboxOverlay: s } = await import("@deck.gl/mapbox"), a = new S();
|
|
62
|
-
return a.overlay = new s(
|
|
62
|
+
return a.overlay = new s(t), this.map.addControl(a.overlay), a;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
class O {
|
|
66
|
-
constructor(
|
|
67
|
-
if (this.apiKey =
|
|
66
|
+
constructor(t) {
|
|
67
|
+
if (this.apiKey = t.apiKey, !this.apiKey)
|
|
68
68
|
throw new Error("apiKey is required");
|
|
69
|
-
this.services =
|
|
69
|
+
this.services = t.services || [], this.sdk = {}, this.mapboxgl = null, this.services.length && this.loadMapboxSDK();
|
|
70
70
|
}
|
|
71
71
|
get Map() {
|
|
72
72
|
return m(
|
|
73
|
-
(
|
|
74
|
-
const
|
|
75
|
-
return b("mapboxMap", l), this.createMap(
|
|
76
|
-
l.value = c, c.watchSources(n,
|
|
77
|
-
}), () =>
|
|
73
|
+
(t, { emit: s, slots: a }) => {
|
|
74
|
+
const r = f(null), { options: o, layers: i, sources: n } = y(t), l = v(null);
|
|
75
|
+
return b("mapboxMap", l), this.createMap(r, o.value).then((c) => {
|
|
76
|
+
l.value = c, c.watchSources(n, o.value.watchSourcesOptions || { immediate: !0 }), c.watchLayers(i, o.value.watchLayersOptions || { immediate: !0 }), s("loaded", c);
|
|
77
|
+
}), () => x("div", { ref: r }, l.value ? a : []);
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
props: {
|
|
@@ -96,12 +96,12 @@ class O {
|
|
|
96
96
|
}
|
|
97
97
|
get DeckGLOverlay() {
|
|
98
98
|
return m(
|
|
99
|
-
(
|
|
100
|
-
const { options:
|
|
99
|
+
(t, { emit: s, slots: a }) => {
|
|
100
|
+
const { options: r, layers: o } = y(t), i = g("mapboxMap");
|
|
101
101
|
if (!i || !i.value)
|
|
102
102
|
throw new Error("map should exist");
|
|
103
|
-
return i.value.setDeckGLOverlay(
|
|
104
|
-
n.watchLayers(
|
|
103
|
+
return i.value.setDeckGLOverlay(r.value).then((n) => {
|
|
104
|
+
n.watchLayers(o, r.value.watchLayersOptions || { immediate: !0 }), s("loaded", n);
|
|
105
105
|
}), () => {
|
|
106
106
|
};
|
|
107
107
|
},
|
|
@@ -120,49 +120,49 @@ class O {
|
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
122
|
async loadMapbox() {
|
|
123
|
-
const
|
|
124
|
-
this.mapboxgl =
|
|
123
|
+
const t = await import("../mapbox-gl.js").then((s) => s.mapboxGl);
|
|
124
|
+
this.mapboxgl = t;
|
|
125
125
|
}
|
|
126
126
|
get servicesLoader() {
|
|
127
127
|
return {
|
|
128
|
-
datasets: () => import("
|
|
129
|
-
directions: () => import("
|
|
130
|
-
geocoding: () => import("
|
|
131
|
-
geocodingV6: () => import("
|
|
132
|
-
mapMatching: () => import("
|
|
133
|
-
matrix: () => import("
|
|
134
|
-
optimization: () => import("
|
|
135
|
-
static: () => import("
|
|
136
|
-
styles: () => import("
|
|
137
|
-
tilequery: () => import("
|
|
138
|
-
tilesets: () => import("
|
|
139
|
-
tokens: () => import("
|
|
140
|
-
uploads: () => import("
|
|
141
|
-
isochrone: () => import("
|
|
128
|
+
datasets: () => import("@mapbox/mapbox-sdk/services/datasets.js"),
|
|
129
|
+
directions: () => import("@mapbox/mapbox-sdk/services/directions.js"),
|
|
130
|
+
geocoding: () => import("@mapbox/mapbox-sdk/services/geocoding.js"),
|
|
131
|
+
geocodingV6: () => import("@mapbox/mapbox-sdk/services/geocoding-v6.js"),
|
|
132
|
+
mapMatching: () => import("@mapbox/mapbox-sdk/services/map-matching.js"),
|
|
133
|
+
matrix: () => import("@mapbox/mapbox-sdk/services/matrix.js"),
|
|
134
|
+
optimization: () => import("@mapbox/mapbox-sdk/services/optimization.js"),
|
|
135
|
+
static: () => import("@mapbox/mapbox-sdk/services/static.js"),
|
|
136
|
+
styles: () => import("@mapbox/mapbox-sdk/services/styles.js"),
|
|
137
|
+
tilequery: () => import("@mapbox/mapbox-sdk/services/tilequery.js"),
|
|
138
|
+
tilesets: () => import("@mapbox/mapbox-sdk/services/tilesets.js"),
|
|
139
|
+
tokens: () => import("@mapbox/mapbox-sdk/services/tokens.js"),
|
|
140
|
+
uploads: () => import("@mapbox/mapbox-sdk/services/uploads.js"),
|
|
141
|
+
isochrone: () => import("@mapbox/mapbox-sdk/services/isochrone.js")
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
144
|
async loadMapboxSDK() {
|
|
145
|
-
const s = (await import("
|
|
146
|
-
for (const [
|
|
147
|
-
this.sdk[
|
|
145
|
+
const s = (await import("@mapbox/mapbox-sdk")).default({ accessToken: this.apiKey }), a = await Promise.all(this.services.map((r) => this.servicesLoader[r]().then((o) => o.default(s))));
|
|
146
|
+
for (const [r, o] of this.services.entries())
|
|
147
|
+
this.sdk[o] = a[r];
|
|
148
148
|
}
|
|
149
149
|
async getSDK() {
|
|
150
150
|
return await (Object.keys(this.sdk).length ? Promise.resolve() : this.loadMapboxSDK()), this.sdk;
|
|
151
151
|
}
|
|
152
|
-
async createMap(
|
|
152
|
+
async createMap(t, s = {}) {
|
|
153
153
|
const a = new k();
|
|
154
|
-
return new Promise((
|
|
154
|
+
return new Promise((r, o) => {
|
|
155
155
|
M(async () => {
|
|
156
156
|
await (this.mapboxgl ? Promise.resolve() : this.loadMapbox());
|
|
157
157
|
const i = () => {
|
|
158
|
-
if (!
|
|
158
|
+
if (!t.value)
|
|
159
159
|
throw new Error("Missing HTML element");
|
|
160
160
|
a.map = new this.mapboxgl.Map({
|
|
161
|
-
container:
|
|
161
|
+
container: t.value,
|
|
162
162
|
accessToken: this.apiKey,
|
|
163
163
|
...s
|
|
164
164
|
}), a.map.on("load", () => {
|
|
165
|
-
|
|
165
|
+
r(a);
|
|
166
166
|
});
|
|
167
167
|
};
|
|
168
168
|
s.onMounted ? s.onMounted(i) : i();
|
|
@@ -174,8 +174,8 @@ class O {
|
|
|
174
174
|
}
|
|
175
175
|
class K extends O {
|
|
176
176
|
async loadMapbox() {
|
|
177
|
-
const
|
|
178
|
-
this.mapboxgl =
|
|
177
|
+
const t = await import("maplibre-gl");
|
|
178
|
+
this.mapboxgl = t;
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
export {
|