@mapsindoors/map-template 1.81.6 → 1.82.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GoogleMapsMap-bd0926e3.mjs +290 -0
- package/dist/MapboxMap-301e877e.mjs +33634 -0
- package/dist/{combo-box-item.entry-e4d2d981.mjs → combo-box-item.entry-e0d8d05e.mjs} +2 -2
- package/dist/mapsindoors-react.es.js +2 -2
- package/dist/mapsindoors-react.umd.js +2435 -2435
- package/dist/mapsindoors-webcomponent.es.js +44367 -44303
- package/dist/mapsindoors-webcomponent.umd.js +2435 -2435
- package/dist/{mi-card_2.entry-0e19fee5.mjs → mi-card_2.entry-2922ef9a.mjs} +2 -2
- package/dist/{mi-chip.entry-03344627.mjs → mi-chip.entry-98d45c35.mjs} +2 -2
- package/dist/{mi-column.entry-a7086241.mjs → mi-column.entry-aaa5c9bc.mjs} +2 -2
- package/dist/{mi-combo-box.entry-f0f95481.mjs → mi-combo-box.entry-5eab6c4c.mjs} +2 -2
- package/dist/{mi-data-table.entry-41de8a06.mjs → mi-data-table.entry-469fec85.mjs} +2 -2
- package/dist/{mi-distance_2.entry-ea59dc56.mjs → mi-distance_2.entry-9ef6210f.mjs} +2 -2
- package/dist/{mi-dropdown-item.entry-07b750c6.mjs → mi-dropdown-item.entry-3347c647.mjs} +2 -2
- package/dist/{mi-dropdown.entry-3d16a788.mjs → mi-dropdown.entry-31078355.mjs} +2 -2
- package/dist/{mi-floor-selector.entry-c3b0f92a.mjs → mi-floor-selector.entry-636d1775.mjs} +2 -2
- package/dist/{mi-keyboard.entry-c2f3e2d3.mjs → mi-keyboard.entry-f8e06eac.mjs} +2 -2
- package/dist/{mi-list-item-category.entry-11428401.mjs → mi-list-item-category.entry-d1c88b71.mjs} +2 -2
- package/dist/{mi-list-item-location.entry-2090309b.mjs → mi-list-item-location.entry-026ba8f9.mjs} +2 -2
- package/dist/{mi-list.entry-eea46b64.mjs → mi-list.entry-bb71a4c8.mjs} +2 -2
- package/dist/{mi-location-booking.entry-2d2f222b.mjs → mi-location-booking.entry-88a2a8d5.mjs} +2 -2
- package/dist/{mi-location-info.entry-5f8bb801.mjs → mi-location-info.entry-45182141.mjs} +2 -2
- package/dist/{mi-map-googlemaps.entry-756a56ee.mjs → mi-map-googlemaps.entry-53c4891c.mjs} +2 -2
- package/dist/{mi-map-mapbox.entry-c0fd8524.mjs → mi-map-mapbox.entry-e3d8170e.mjs} +2 -2
- package/dist/{mi-metric-card.entry-c0737d77.mjs → mi-metric-card.entry-a01c1e26.mjs} +2 -2
- package/dist/mi-my-position.entry-ae9f2375.mjs +528 -0
- package/dist/{mi-notification.entry-b8ec5fb2.mjs → mi-notification.entry-be61e0ec.mjs} +2 -2
- package/dist/{mi-route-instructions-heading.entry-59b1bf8b.mjs → mi-route-instructions-heading.entry-78f07235.mjs} +2 -2
- package/dist/{mi-route-instructions-maneuver-legacy.entry-0811c038.mjs → mi-route-instructions-maneuver-legacy.entry-90510954.mjs} +2 -2
- package/dist/{mi-route-instructions-maneuver.entry-c3669c3b.mjs → mi-route-instructions-maneuver.entry-ff65f781.mjs} +2 -2
- package/dist/{mi-route-instructions-step-legacy.entry-d2e5b89f.mjs → mi-route-instructions-step-legacy.entry-cf17eafa.mjs} +2 -2
- package/dist/{mi-route-instructions-step.entry-9b29f2a9.mjs → mi-route-instructions-step.entry-12e0014a.mjs} +2 -2
- package/dist/{mi-route-instructions.entry-a4a8cc65.mjs → mi-route-instructions.entry-ecb11774.mjs} +2 -2
- package/dist/{mi-scroll-buttons.entry-00003ac2.mjs → mi-scroll-buttons.entry-076521e8.mjs} +2 -2
- package/dist/{mi-search.entry-30b72287.mjs → mi-search.entry-7243cff0.mjs} +2 -2
- package/dist/{mi-share-sms.entry-7ffb83e6.mjs → mi-share-sms.entry-7ddfcbd4.mjs} +2 -2
- package/dist/{mi-step-switcher.entry-7249da65.mjs → mi-step-switcher.entry-22f3c1ca.mjs} +2 -2
- package/dist/{mi-tab-panel.entry-871a4087.mjs → mi-tab-panel.entry-a5c0adb7.mjs} +2 -2
- package/dist/{mi-tab.entry-e7604b93.mjs → mi-tab.entry-14fdc4cb.mjs} +2 -2
- package/dist/{mi-tabs.entry-541f0050.mjs → mi-tabs.entry-c6a88ed3.mjs} +2 -2
- package/dist/{mi-time.entry-c1c06389.mjs → mi-time.entry-379ce304.mjs} +2 -2
- package/dist/reactcomponent-ce886291.mjs +15405 -0
- package/package.json +1 -1
- package/dist/mi-my-position.entry-c8b10564.mjs +0 -472
- package/dist/reactcomponent-276345e6.mjs +0 -49308
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import { P as f, u as _, i as d, j as A } from "./reactcomponent-ce886291.mjs";
|
|
2
|
+
import { useState as j, useEffect as C } from "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
function D(o, e, t, r) {
|
|
5
|
+
function s(i) {
|
|
6
|
+
return i instanceof t ? i : new t(function(n) {
|
|
7
|
+
n(i);
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
return new (t || (t = Promise))(function(i, n) {
|
|
11
|
+
function c(a) {
|
|
12
|
+
try {
|
|
13
|
+
p(r.next(a));
|
|
14
|
+
} catch (u) {
|
|
15
|
+
n(u);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function l(a) {
|
|
19
|
+
try {
|
|
20
|
+
p(r.throw(a));
|
|
21
|
+
} catch (u) {
|
|
22
|
+
n(u);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function p(a) {
|
|
26
|
+
a.done ? i(a.value) : s(a.value).then(c, l);
|
|
27
|
+
}
|
|
28
|
+
p((r = r.apply(o, e || [])).next());
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function T(o) {
|
|
32
|
+
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
33
|
+
}
|
|
34
|
+
var O = function o(e, t) {
|
|
35
|
+
if (e === t)
|
|
36
|
+
return !0;
|
|
37
|
+
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
38
|
+
if (e.constructor !== t.constructor)
|
|
39
|
+
return !1;
|
|
40
|
+
var r, s, i;
|
|
41
|
+
if (Array.isArray(e)) {
|
|
42
|
+
if (r = e.length, r != t.length)
|
|
43
|
+
return !1;
|
|
44
|
+
for (s = r; s-- !== 0; )
|
|
45
|
+
if (!o(e[s], t[s]))
|
|
46
|
+
return !1;
|
|
47
|
+
return !0;
|
|
48
|
+
}
|
|
49
|
+
if (e.constructor === RegExp)
|
|
50
|
+
return e.source === t.source && e.flags === t.flags;
|
|
51
|
+
if (e.valueOf !== Object.prototype.valueOf)
|
|
52
|
+
return e.valueOf() === t.valueOf();
|
|
53
|
+
if (e.toString !== Object.prototype.toString)
|
|
54
|
+
return e.toString() === t.toString();
|
|
55
|
+
if (i = Object.keys(e), r = i.length, r !== Object.keys(t).length)
|
|
56
|
+
return !1;
|
|
57
|
+
for (s = r; s-- !== 0; )
|
|
58
|
+
if (!Object.prototype.hasOwnProperty.call(t, i[s]))
|
|
59
|
+
return !1;
|
|
60
|
+
for (s = r; s-- !== 0; ) {
|
|
61
|
+
var n = i[s];
|
|
62
|
+
if (!o(e[n], t[n]))
|
|
63
|
+
return !1;
|
|
64
|
+
}
|
|
65
|
+
return !0;
|
|
66
|
+
}
|
|
67
|
+
return e !== e && t !== t;
|
|
68
|
+
}, $ = /* @__PURE__ */ T(O);
|
|
69
|
+
const P = "__googleMapsScriptId";
|
|
70
|
+
var I;
|
|
71
|
+
(function(o) {
|
|
72
|
+
o[o.INITIALIZED = 0] = "INITIALIZED", o[o.LOADING = 1] = "LOADING", o[o.SUCCESS = 2] = "SUCCESS", o[o.FAILURE = 3] = "FAILURE";
|
|
73
|
+
})(I || (I = {}));
|
|
74
|
+
class w {
|
|
75
|
+
/**
|
|
76
|
+
* Creates an instance of Loader using [[LoaderOptions]]. No defaults are set
|
|
77
|
+
* using this library, instead the defaults are set by the Google Maps
|
|
78
|
+
* JavaScript API server.
|
|
79
|
+
*
|
|
80
|
+
* ```
|
|
81
|
+
* const loader = Loader({apiKey, version: 'weekly', libraries: ['places']});
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
constructor({ apiKey: e, authReferrerPolicy: t, channel: r, client: s, id: i = P, language: n, libraries: c = [], mapIds: l, nonce: p, region: a, retries: u = 3, url: h = "https://maps.googleapis.com/maps/api/js", version: g }) {
|
|
85
|
+
if (this.callbacks = [], this.done = !1, this.loading = !1, this.errors = [], this.apiKey = e, this.authReferrerPolicy = t, this.channel = r, this.client = s, this.id = i || P, this.language = n, this.libraries = c, this.mapIds = l, this.nonce = p, this.region = a, this.retries = u, this.url = h, this.version = g, w.instance) {
|
|
86
|
+
if (!$(this.options, w.instance.options))
|
|
87
|
+
throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(w.instance.options)}`);
|
|
88
|
+
return w.instance;
|
|
89
|
+
}
|
|
90
|
+
w.instance = this;
|
|
91
|
+
}
|
|
92
|
+
get options() {
|
|
93
|
+
return {
|
|
94
|
+
version: this.version,
|
|
95
|
+
apiKey: this.apiKey,
|
|
96
|
+
channel: this.channel,
|
|
97
|
+
client: this.client,
|
|
98
|
+
id: this.id,
|
|
99
|
+
libraries: this.libraries,
|
|
100
|
+
language: this.language,
|
|
101
|
+
region: this.region,
|
|
102
|
+
mapIds: this.mapIds,
|
|
103
|
+
nonce: this.nonce,
|
|
104
|
+
url: this.url,
|
|
105
|
+
authReferrerPolicy: this.authReferrerPolicy
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
get status() {
|
|
109
|
+
return this.errors.length ? I.FAILURE : this.done ? I.SUCCESS : this.loading ? I.LOADING : I.INITIALIZED;
|
|
110
|
+
}
|
|
111
|
+
get failed() {
|
|
112
|
+
return this.done && !this.loading && this.errors.length >= this.retries + 1;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]].
|
|
116
|
+
*
|
|
117
|
+
* @ignore
|
|
118
|
+
* @deprecated
|
|
119
|
+
*/
|
|
120
|
+
createUrl() {
|
|
121
|
+
let e = this.url;
|
|
122
|
+
return e += "?callback=__googleMapsCallback&loading=async", this.apiKey && (e += `&key=${this.apiKey}`), this.channel && (e += `&channel=${this.channel}`), this.client && (e += `&client=${this.client}`), this.libraries.length > 0 && (e += `&libraries=${this.libraries.join(",")}`), this.language && (e += `&language=${this.language}`), this.region && (e += `®ion=${this.region}`), this.version && (e += `&v=${this.version}`), this.mapIds && (e += `&map_ids=${this.mapIds.join(",")}`), this.authReferrerPolicy && (e += `&auth_referrer_policy=${this.authReferrerPolicy}`), e;
|
|
123
|
+
}
|
|
124
|
+
deleteScript() {
|
|
125
|
+
const e = document.getElementById(this.id);
|
|
126
|
+
e && e.remove();
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Load the Google Maps JavaScript API script and return a Promise.
|
|
130
|
+
* @deprecated, use importLibrary() instead.
|
|
131
|
+
*/
|
|
132
|
+
load() {
|
|
133
|
+
return this.loadPromise();
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Load the Google Maps JavaScript API script and return a Promise.
|
|
137
|
+
*
|
|
138
|
+
* @ignore
|
|
139
|
+
* @deprecated, use importLibrary() instead.
|
|
140
|
+
*/
|
|
141
|
+
loadPromise() {
|
|
142
|
+
return new Promise((e, t) => {
|
|
143
|
+
this.loadCallback((r) => {
|
|
144
|
+
r ? t(r.error) : e(window.google);
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
importLibrary(e) {
|
|
149
|
+
return this.execute(), google.maps.importLibrary(e);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Load the Google Maps JavaScript API script with a callback.
|
|
153
|
+
* @deprecated, use importLibrary() instead.
|
|
154
|
+
*/
|
|
155
|
+
loadCallback(e) {
|
|
156
|
+
this.callbacks.push(e), this.execute();
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Set the script on document.
|
|
160
|
+
*/
|
|
161
|
+
setScript() {
|
|
162
|
+
var e, t;
|
|
163
|
+
if (document.getElementById(this.id)) {
|
|
164
|
+
this.callback();
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const r = {
|
|
168
|
+
key: this.apiKey,
|
|
169
|
+
channel: this.channel,
|
|
170
|
+
client: this.client,
|
|
171
|
+
libraries: this.libraries.length && this.libraries,
|
|
172
|
+
v: this.version,
|
|
173
|
+
mapIds: this.mapIds,
|
|
174
|
+
language: this.language,
|
|
175
|
+
region: this.region,
|
|
176
|
+
authReferrerPolicy: this.authReferrerPolicy
|
|
177
|
+
};
|
|
178
|
+
Object.keys(r).forEach(
|
|
179
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
180
|
+
(i) => !r[i] && delete r[i]
|
|
181
|
+
), !((t = (e = window == null ? void 0 : window.google) === null || e === void 0 ? void 0 : e.maps) === null || t === void 0) && t.importLibrary || ((i) => {
|
|
182
|
+
let n, c, l, p = "The Google Maps JavaScript API", a = "google", u = "importLibrary", h = "__ib__", g = document, m = window;
|
|
183
|
+
m = m[a] || (m[a] = {});
|
|
184
|
+
const b = m.maps || (m.maps = {}), M = /* @__PURE__ */ new Set(), E = new URLSearchParams(), S = () => (
|
|
185
|
+
// @ts-ignore
|
|
186
|
+
n || (n = new Promise((y, v) => D(this, void 0, void 0, function* () {
|
|
187
|
+
var k;
|
|
188
|
+
yield c = g.createElement("script"), c.id = this.id, E.set("libraries", [...M] + "");
|
|
189
|
+
for (l in i)
|
|
190
|
+
E.set(l.replace(/[A-Z]/g, (R) => "_" + R[0].toLowerCase()), i[l]);
|
|
191
|
+
E.set("callback", a + ".maps." + h), c.src = this.url + "?" + E, b[h] = y, c.onerror = () => n = v(Error(p + " could not load.")), c.nonce = this.nonce || ((k = g.querySelector("script[nonce]")) === null || k === void 0 ? void 0 : k.nonce) || "", g.head.append(c);
|
|
192
|
+
})))
|
|
193
|
+
);
|
|
194
|
+
b[u] ? console.warn(p + " only loads once. Ignoring:", i) : b[u] = (y, ...v) => M.add(y) && S().then(() => b[u](y, ...v));
|
|
195
|
+
})(r);
|
|
196
|
+
const s = this.libraries.map((i) => this.importLibrary(i));
|
|
197
|
+
s.length || s.push(this.importLibrary("core")), Promise.all(s).then(() => this.callback(), (i) => {
|
|
198
|
+
const n = new ErrorEvent("error", { error: i });
|
|
199
|
+
this.loadErrorCallback(n);
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Reset the loader state.
|
|
204
|
+
*/
|
|
205
|
+
reset() {
|
|
206
|
+
this.deleteScript(), this.done = !1, this.loading = !1, this.errors = [], this.onerrorEvent = null;
|
|
207
|
+
}
|
|
208
|
+
resetIfRetryingFailed() {
|
|
209
|
+
this.failed && this.reset();
|
|
210
|
+
}
|
|
211
|
+
loadErrorCallback(e) {
|
|
212
|
+
if (this.errors.push(e), this.errors.length <= this.retries) {
|
|
213
|
+
const t = this.errors.length * Math.pow(2, this.errors.length);
|
|
214
|
+
console.error(`Failed to load Google Maps script, retrying in ${t} ms.`), setTimeout(() => {
|
|
215
|
+
this.deleteScript(), this.setScript();
|
|
216
|
+
}, t);
|
|
217
|
+
} else
|
|
218
|
+
this.onerrorEvent = e, this.callback();
|
|
219
|
+
}
|
|
220
|
+
callback() {
|
|
221
|
+
this.done = !0, this.loading = !1, this.callbacks.forEach((e) => {
|
|
222
|
+
e(this.onerrorEvent);
|
|
223
|
+
}), this.callbacks = [];
|
|
224
|
+
}
|
|
225
|
+
execute() {
|
|
226
|
+
if (this.resetIfRetryingFailed(), !this.loading)
|
|
227
|
+
if (this.done)
|
|
228
|
+
this.callback();
|
|
229
|
+
else {
|
|
230
|
+
if (window.google && window.google.maps && window.google.maps.version) {
|
|
231
|
+
console.warn("Google Maps already loaded outside @googlemaps/js-api-loader. This may result in undesirable behavior as options and script parameters may not match."), this.callback();
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
this.loading = !0, this.setScript();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
U.propTypes = {
|
|
239
|
+
apiKey: f.string.isRequired,
|
|
240
|
+
onInitialized: f.func.isRequired,
|
|
241
|
+
center: f.object,
|
|
242
|
+
zoom: f.number,
|
|
243
|
+
bounds: f.object,
|
|
244
|
+
heading: f.number,
|
|
245
|
+
tilt: f.number,
|
|
246
|
+
mapsIndoorsInstance: f.object,
|
|
247
|
+
mapOptions: f.object,
|
|
248
|
+
gmMapId: f.string
|
|
249
|
+
};
|
|
250
|
+
function U({ apiKey: o, onInitialized: e, center: t, zoom: r, bounds: s, heading: i, tilt: n, mapsIndoorsInstance: c, mapOptions: l, gmMapId: p }) {
|
|
251
|
+
const [a, u] = j(), [h, g] = j(), [m, b] = j(!1), M = _();
|
|
252
|
+
return C(() => {
|
|
253
|
+
h && (d(s) || c.getMapView().fitBounds(s, l == null ? void 0 : l.fitBoundsPadding), !d(t) && d(s) && h.getMap().setCenter(t), !d(r) && d(s) && h.getMap().setZoom(r), d(i) || h.getMap().setHeading(i), d(n) || h.getMap().setTilt(n));
|
|
254
|
+
}, [h, t, r, i, n, s, l]), C(() => {
|
|
255
|
+
c && h && a && !m && M && (h.getMap().setOptions({
|
|
256
|
+
zoomControl: !0,
|
|
257
|
+
zoomControlOptions: {
|
|
258
|
+
style: a.maps.ZoomControlStyle.DEFAULT,
|
|
259
|
+
position: a.maps.ControlPosition.RIGHT_BOTTOM
|
|
260
|
+
}
|
|
261
|
+
}), b(!0));
|
|
262
|
+
}, [c, h, a]), C(() => {
|
|
263
|
+
new w({
|
|
264
|
+
apiKey: o,
|
|
265
|
+
version: "quarterly",
|
|
266
|
+
libraries: ["geometry", "places"]
|
|
267
|
+
}).load().then((S) => {
|
|
268
|
+
u(S);
|
|
269
|
+
const y = {
|
|
270
|
+
element: document.getElementById("map"),
|
|
271
|
+
disableDefaultUI: !0,
|
|
272
|
+
// Disable Map Type control, Street view control and Zoom controls.
|
|
273
|
+
center: t ?? { lat: 0, lng: 0 },
|
|
274
|
+
// The MapsIndoors SDK needs a starting point and a zoom level to avoid timing issues when setting a venue.
|
|
275
|
+
zoom: r ?? 21,
|
|
276
|
+
heading: i ?? 0,
|
|
277
|
+
tilt: n ?? 0,
|
|
278
|
+
mapId: p,
|
|
279
|
+
...l
|
|
280
|
+
};
|
|
281
|
+
d(l == null ? void 0 : l.showMapMarkers) || (y.showMapMarkers = l.showMapMarkers);
|
|
282
|
+
const v = new window.mapsindoors.mapView.GoogleMapsView(y);
|
|
283
|
+
g(v), e(v);
|
|
284
|
+
});
|
|
285
|
+
}, []), /* @__PURE__ */ A.jsx("div", { className: "mapsindoors-map google-maps-map-container", id: "map" });
|
|
286
|
+
}
|
|
287
|
+
export {
|
|
288
|
+
U as default
|
|
289
|
+
};
|
|
290
|
+
//# sourceMappingURL=GoogleMapsMap-bd0926e3.mjs.map
|