@mapsindoors/map-template 1.93.2 → 1.94.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.
- package/dist/{GoogleMapsMap-982405ad.mjs → GoogleMapsMap-BqYRaFgc.mjs} +51 -62
- package/dist/MapboxMap-CUYrfLHY.mjs +34732 -0
- package/dist/_commonjsHelpers-ba3f0406.js +21 -0
- package/dist/combo-box-item.entry.js +15 -0
- package/dist/icon-b8d01d6f.js +24 -0
- package/dist/index-7e9696f3.js +1678 -0
- package/dist/index.js +1 -0
- package/dist/loader.js +18 -0
- package/dist/mapsindoors-react.es.js +3 -5
- package/dist/mapsindoors-react.umd.js +197 -582
- package/dist/mapsindoors-webcomponent.es.js +58512 -75790
- package/dist/mi-card_2.entry.js +28 -0
- package/dist/mi-chip.entry.js +22 -0
- package/dist/mi-column.entry.js +28 -0
- package/dist/mi-combo-box.entry.js +416 -0
- package/dist/mi-components.js +18 -0
- package/dist/mi-data-table.entry.js +302 -0
- package/dist/mi-distance_2.entry.js +67 -0
- package/dist/mi-dropdown-item.entry.js +15 -0
- package/dist/mi-dropdown.entry.js +610 -0
- package/dist/mi-floor-selector.entry.js +202 -0
- package/dist/mi-keyboard.entry.js +238 -0
- package/dist/mi-list-item-category.entry.js +48 -0
- package/dist/mi-list-item-location.entry.js +171 -0
- package/dist/mi-list.entry.js +56 -0
- package/dist/mi-location-booking.entry.js +5193 -0
- package/dist/mi-location-info.entry.js +63 -0
- package/dist/mi-map-googlemaps.entry.js +750 -0
- package/dist/mi-map-mapbox.entry.js +467 -0
- package/dist/mi-metric-card.entry.js +48 -0
- package/dist/mi-my-position.entry.js +986 -0
- package/dist/mi-notification.entry.js +127 -0
- package/dist/mi-route-instructions-heading.entry.js +73 -0
- package/dist/mi-route-instructions-maneuver-legacy.entry.js +82 -0
- package/dist/mi-route-instructions-maneuver.entry.js +82 -0
- package/dist/mi-route-instructions-step-legacy.entry.js +308 -0
- package/dist/mi-route-instructions-step.entry.js +321 -0
- package/dist/mi-route-instructions.entry.js +157 -0
- package/dist/mi-scroll-buttons.entry.js +112 -0
- package/dist/mi-search.entry.js +376 -0
- package/dist/mi-share-sms.entry.js +80 -0
- package/dist/mi-step-switcher.entry.js +31 -0
- package/dist/mi-tab-panel.entry.js +25 -0
- package/dist/mi-tab.entry.js +12 -0
- package/dist/mi-tabs.entry.js +47 -0
- package/dist/mi-time.entry.js +57 -0
- package/dist/mi-variables-9a6c8d4d.js +6 -0
- package/dist/polyfills/core-js.js +11 -0
- package/dist/polyfills/css-shim.js +1 -0
- package/dist/polyfills/dom.js +79 -0
- package/dist/polyfills/es5-html-element.js +1 -0
- package/dist/polyfills/index.js +34 -0
- package/dist/polyfills/system.js +6 -0
- package/dist/{reactcomponent-7fbbd9b2.mjs → reactcomponent-DTepe7hB.mjs} +14121 -14626
- package/dist/route-travel-mode.enum-7f4ce9c7.js +9 -0
- package/dist/sort-order.enum-64ce8998.js +552 -0
- package/dist/unit-system.enum-eaefb53e.js +7 -0
- package/dist/utils-ae714467.js +61 -0
- package/package.json +10 -6
- package/dist/MapboxMap-06ef82a3.mjs +0 -37815
- package/dist/_commonjsHelpers-ba3f0406-b96e6d6a.mjs +0 -22
- package/dist/combo-box-item.entry-d35f3d51.mjs +0 -15
- package/dist/icon-b8d01d6f-ddfa2c17.mjs +0 -25
- package/dist/mapsindoors-webcomponent.umd.js +0 -3245
- package/dist/mi-card_2.entry-fc772c35.mjs +0 -26
- package/dist/mi-chip.entry-81c742a1.mjs +0 -19
- package/dist/mi-column.entry-3a083282.mjs +0 -21
- package/dist/mi-combo-box.entry-cae6401a.mjs +0 -263
- package/dist/mi-data-table.entry-d4c3f445.mjs +0 -224
- package/dist/mi-distance_2.entry-a33ed69a.mjs +0 -339
- package/dist/mi-dropdown-item.entry-974d1e4f.mjs +0 -15
- package/dist/mi-dropdown.entry-5317db65.mjs +0 -349
- package/dist/mi-floor-selector.entry-185fbd8b.mjs +0 -115
- package/dist/mi-keyboard.entry-eaf4b9ef.mjs +0 -3103
- package/dist/mi-list-item-category.entry-9c95008c.mjs +0 -39
- package/dist/mi-list-item-location.entry-8b41e8f0.mjs +0 -137
- package/dist/mi-list.entry-1218d29d.mjs +0 -42
- package/dist/mi-location-booking.entry-270aaf5a.mjs +0 -4866
- package/dist/mi-location-info.entry-e4f7fd04.mjs +0 -32
- package/dist/mi-map-googlemaps.entry-81fa28d2.mjs +0 -467
- package/dist/mi-map-mapbox.entry-31821da3.mjs +0 -301
- package/dist/mi-metric-card.entry-40407f04.mjs +0 -29
- package/dist/mi-my-position.entry-bc48fe6e.mjs +0 -703
- package/dist/mi-notification.entry-9a2bc53b.mjs +0 -84
- package/dist/mi-route-instructions-heading.entry-e5b1ff04.mjs +0 -75
- package/dist/mi-route-instructions-maneuver-legacy.entry-2c3d73ab.mjs +0 -76
- package/dist/mi-route-instructions-maneuver.entry-c6f01024.mjs +0 -76
- package/dist/mi-route-instructions-step-legacy.entry-80bcf097.mjs +0 -202
- package/dist/mi-route-instructions-step.entry-db802e13.mjs +0 -231
- package/dist/mi-route-instructions.entry-62416e29.mjs +0 -143
- package/dist/mi-scroll-buttons.entry-92b62b21.mjs +0 -83
- package/dist/mi-search.entry-87f1e64a.mjs +0 -251
- package/dist/mi-share-sms.entry-b6725edb.mjs +0 -56
- package/dist/mi-step-switcher.entry-f8f6c040.mjs +0 -27
- package/dist/mi-tab-panel.entry-a89213c2.mjs +0 -22
- package/dist/mi-tab.entry-a2fb3f8c.mjs +0 -14
- package/dist/mi-tabs.entry-cd638ea7.mjs +0 -37
- package/dist/mi-time.entry-0b02870d.mjs +0 -46
- package/dist/mi-variables-9a6c8d4d-e06eec88.mjs +0 -8
- package/dist/route-travel-mode.enum-7f4ce9c7-a9c95a83.mjs +0 -8
- package/dist/sort-order.enum-64ce8998-b75ac596.mjs +0 -318
- package/dist/unit-system.enum-eaefb53e-0f424da4.mjs +0 -8
- package/dist/utils-ae714467-b07fc3be.mjs +0 -37
|
@@ -0,0 +1,750 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-7e9696f3.js';
|
|
2
|
+
import { m as miVariables } from './mi-variables-9a6c8d4d.js';
|
|
3
|
+
|
|
4
|
+
/******************************************************************************
|
|
5
|
+
Copyright (c) Microsoft Corporation.
|
|
6
|
+
|
|
7
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
8
|
+
purpose with or without fee is hereby granted.
|
|
9
|
+
|
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
11
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
12
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
13
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
14
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
15
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
16
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
17
|
+
***************************************************************************** */
|
|
18
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
32
|
+
var e = new Error(message);
|
|
33
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
function getDefaultExportFromCjs (x) {
|
|
37
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// do not edit .js files directly - edit src/index.jst
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
var fastDeepEqual = function equal(a, b) {
|
|
45
|
+
if (a === b) return true;
|
|
46
|
+
|
|
47
|
+
if (a && b && typeof a == 'object' && typeof b == 'object') {
|
|
48
|
+
if (a.constructor !== b.constructor) return false;
|
|
49
|
+
|
|
50
|
+
var length, i, keys;
|
|
51
|
+
if (Array.isArray(a)) {
|
|
52
|
+
length = a.length;
|
|
53
|
+
if (length != b.length) return false;
|
|
54
|
+
for (i = length; i-- !== 0;)
|
|
55
|
+
if (!equal(a[i], b[i])) return false;
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
62
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
63
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
64
|
+
|
|
65
|
+
keys = Object.keys(a);
|
|
66
|
+
length = keys.length;
|
|
67
|
+
if (length !== Object.keys(b).length) return false;
|
|
68
|
+
|
|
69
|
+
for (i = length; i-- !== 0;)
|
|
70
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
71
|
+
|
|
72
|
+
for (i = length; i-- !== 0;) {
|
|
73
|
+
var key = keys[i];
|
|
74
|
+
|
|
75
|
+
if (!equal(a[key], b[key])) return false;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// true if both NaN, false otherwise
|
|
82
|
+
return a!==a && b!==b;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
var isEqual = /*@__PURE__*/getDefaultExportFromCjs(fastDeepEqual);
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Copyright 2019 Google LLC. All Rights Reserved.
|
|
89
|
+
*
|
|
90
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
91
|
+
* you may not use this file except in compliance with the License.
|
|
92
|
+
* You may obtain a copy of the License at.
|
|
93
|
+
*
|
|
94
|
+
* Http://www.apache.org/licenses/LICENSE-2.0.
|
|
95
|
+
*
|
|
96
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
97
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
98
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
99
|
+
* See the License for the specific language governing permissions and
|
|
100
|
+
* limitations under the License.
|
|
101
|
+
*/
|
|
102
|
+
const DEFAULT_ID = "__googleMapsScriptId";
|
|
103
|
+
/**
|
|
104
|
+
* The status of the [[Loader]].
|
|
105
|
+
*/
|
|
106
|
+
var LoaderStatus;
|
|
107
|
+
(function (LoaderStatus) {
|
|
108
|
+
LoaderStatus[LoaderStatus["INITIALIZED"] = 0] = "INITIALIZED";
|
|
109
|
+
LoaderStatus[LoaderStatus["LOADING"] = 1] = "LOADING";
|
|
110
|
+
LoaderStatus[LoaderStatus["SUCCESS"] = 2] = "SUCCESS";
|
|
111
|
+
LoaderStatus[LoaderStatus["FAILURE"] = 3] = "FAILURE";
|
|
112
|
+
})(LoaderStatus || (LoaderStatus = {}));
|
|
113
|
+
/**
|
|
114
|
+
* [[Loader]] makes it easier to add Google Maps JavaScript API to your application
|
|
115
|
+
* dynamically using
|
|
116
|
+
* [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
|
|
117
|
+
* It works by dynamically creating and appending a script node to the the
|
|
118
|
+
* document head and wrapping the callback function so as to return a promise.
|
|
119
|
+
*
|
|
120
|
+
* ```
|
|
121
|
+
* const loader = new Loader({
|
|
122
|
+
* apiKey: "",
|
|
123
|
+
* version: "weekly",
|
|
124
|
+
* libraries: ["places"]
|
|
125
|
+
* });
|
|
126
|
+
*
|
|
127
|
+
* loader.load().then((google) => {
|
|
128
|
+
* const map = new google.maps.Map(...)
|
|
129
|
+
* })
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
class Loader {
|
|
133
|
+
/**
|
|
134
|
+
* Creates an instance of Loader using [[LoaderOptions]]. No defaults are set
|
|
135
|
+
* using this library, instead the defaults are set by the Google Maps
|
|
136
|
+
* JavaScript API server.
|
|
137
|
+
*
|
|
138
|
+
* ```
|
|
139
|
+
* const loader = Loader({apiKey, version: 'weekly', libraries: ['places']});
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
constructor({ apiKey, authReferrerPolicy, channel, client, id = DEFAULT_ID, language, libraries = [], mapIds, nonce, region, retries = 3, url = "https://maps.googleapis.com/maps/api/js", version, }) {
|
|
143
|
+
this.callbacks = [];
|
|
144
|
+
this.done = false;
|
|
145
|
+
this.loading = false;
|
|
146
|
+
this.errors = [];
|
|
147
|
+
this.apiKey = apiKey;
|
|
148
|
+
this.authReferrerPolicy = authReferrerPolicy;
|
|
149
|
+
this.channel = channel;
|
|
150
|
+
this.client = client;
|
|
151
|
+
this.id = id || DEFAULT_ID; // Do not allow empty string
|
|
152
|
+
this.language = language;
|
|
153
|
+
this.libraries = libraries;
|
|
154
|
+
this.mapIds = mapIds;
|
|
155
|
+
this.nonce = nonce;
|
|
156
|
+
this.region = region;
|
|
157
|
+
this.retries = retries;
|
|
158
|
+
this.url = url;
|
|
159
|
+
this.version = version;
|
|
160
|
+
if (Loader.instance) {
|
|
161
|
+
if (!isEqual(this.options, Loader.instance.options)) {
|
|
162
|
+
throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(Loader.instance.options)}`);
|
|
163
|
+
}
|
|
164
|
+
return Loader.instance;
|
|
165
|
+
}
|
|
166
|
+
Loader.instance = this;
|
|
167
|
+
}
|
|
168
|
+
get options() {
|
|
169
|
+
return {
|
|
170
|
+
version: this.version,
|
|
171
|
+
apiKey: this.apiKey,
|
|
172
|
+
channel: this.channel,
|
|
173
|
+
client: this.client,
|
|
174
|
+
id: this.id,
|
|
175
|
+
libraries: this.libraries,
|
|
176
|
+
language: this.language,
|
|
177
|
+
region: this.region,
|
|
178
|
+
mapIds: this.mapIds,
|
|
179
|
+
nonce: this.nonce,
|
|
180
|
+
url: this.url,
|
|
181
|
+
authReferrerPolicy: this.authReferrerPolicy,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
get status() {
|
|
185
|
+
if (this.errors.length) {
|
|
186
|
+
return LoaderStatus.FAILURE;
|
|
187
|
+
}
|
|
188
|
+
if (this.done) {
|
|
189
|
+
return LoaderStatus.SUCCESS;
|
|
190
|
+
}
|
|
191
|
+
if (this.loading) {
|
|
192
|
+
return LoaderStatus.LOADING;
|
|
193
|
+
}
|
|
194
|
+
return LoaderStatus.INITIALIZED;
|
|
195
|
+
}
|
|
196
|
+
get failed() {
|
|
197
|
+
return this.done && !this.loading && this.errors.length >= this.retries + 1;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]].
|
|
201
|
+
*
|
|
202
|
+
* @ignore
|
|
203
|
+
* @deprecated
|
|
204
|
+
*/
|
|
205
|
+
createUrl() {
|
|
206
|
+
let url = this.url;
|
|
207
|
+
url += `?callback=__googleMapsCallback&loading=async`;
|
|
208
|
+
if (this.apiKey) {
|
|
209
|
+
url += `&key=${this.apiKey}`;
|
|
210
|
+
}
|
|
211
|
+
if (this.channel) {
|
|
212
|
+
url += `&channel=${this.channel}`;
|
|
213
|
+
}
|
|
214
|
+
if (this.client) {
|
|
215
|
+
url += `&client=${this.client}`;
|
|
216
|
+
}
|
|
217
|
+
if (this.libraries.length > 0) {
|
|
218
|
+
url += `&libraries=${this.libraries.join(",")}`;
|
|
219
|
+
}
|
|
220
|
+
if (this.language) {
|
|
221
|
+
url += `&language=${this.language}`;
|
|
222
|
+
}
|
|
223
|
+
if (this.region) {
|
|
224
|
+
url += `®ion=${this.region}`;
|
|
225
|
+
}
|
|
226
|
+
if (this.version) {
|
|
227
|
+
url += `&v=${this.version}`;
|
|
228
|
+
}
|
|
229
|
+
if (this.mapIds) {
|
|
230
|
+
url += `&map_ids=${this.mapIds.join(",")}`;
|
|
231
|
+
}
|
|
232
|
+
if (this.authReferrerPolicy) {
|
|
233
|
+
url += `&auth_referrer_policy=${this.authReferrerPolicy}`;
|
|
234
|
+
}
|
|
235
|
+
return url;
|
|
236
|
+
}
|
|
237
|
+
deleteScript() {
|
|
238
|
+
const script = document.getElementById(this.id);
|
|
239
|
+
if (script) {
|
|
240
|
+
script.remove();
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Load the Google Maps JavaScript API script and return a Promise.
|
|
245
|
+
* @deprecated, use importLibrary() instead.
|
|
246
|
+
*/
|
|
247
|
+
load() {
|
|
248
|
+
return this.loadPromise();
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Load the Google Maps JavaScript API script and return a Promise.
|
|
252
|
+
*
|
|
253
|
+
* @ignore
|
|
254
|
+
* @deprecated, use importLibrary() instead.
|
|
255
|
+
*/
|
|
256
|
+
loadPromise() {
|
|
257
|
+
return new Promise((resolve, reject) => {
|
|
258
|
+
this.loadCallback((err) => {
|
|
259
|
+
if (!err) {
|
|
260
|
+
resolve(window.google);
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
reject(err.error);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
importLibrary(name) {
|
|
269
|
+
this.execute();
|
|
270
|
+
return google.maps.importLibrary(name);
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Load the Google Maps JavaScript API script with a callback.
|
|
274
|
+
* @deprecated, use importLibrary() instead.
|
|
275
|
+
*/
|
|
276
|
+
loadCallback(fn) {
|
|
277
|
+
this.callbacks.push(fn);
|
|
278
|
+
this.execute();
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Set the script on document.
|
|
282
|
+
*/
|
|
283
|
+
setScript() {
|
|
284
|
+
var _a, _b;
|
|
285
|
+
if (document.getElementById(this.id)) {
|
|
286
|
+
// TODO wrap onerror callback for cases where the script was loaded elsewhere
|
|
287
|
+
this.callback();
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
const params = {
|
|
291
|
+
key: this.apiKey,
|
|
292
|
+
channel: this.channel,
|
|
293
|
+
client: this.client,
|
|
294
|
+
libraries: this.libraries.length && this.libraries,
|
|
295
|
+
v: this.version,
|
|
296
|
+
mapIds: this.mapIds,
|
|
297
|
+
language: this.language,
|
|
298
|
+
region: this.region,
|
|
299
|
+
authReferrerPolicy: this.authReferrerPolicy,
|
|
300
|
+
};
|
|
301
|
+
// keep the URL minimal:
|
|
302
|
+
Object.keys(params).forEach(
|
|
303
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
304
|
+
(key) => !params[key] && delete params[key]);
|
|
305
|
+
if (!((_b = (_a = window === null || window === void 0 ? void 0 : window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.importLibrary)) {
|
|
306
|
+
// tweaked copy of https://developers.google.com/maps/documentation/javascript/load-maps-js-api#dynamic-library-import
|
|
307
|
+
// which also sets the base url, the id, and the nonce
|
|
308
|
+
/* eslint-disable */
|
|
309
|
+
((g) => {
|
|
310
|
+
// @ts-ignore
|
|
311
|
+
let h, a, k, p = "The Google Maps JavaScript API", c = "google", l = "importLibrary", q = "__ib__", m = document, b = window;
|
|
312
|
+
// @ts-ignore
|
|
313
|
+
b = b[c] || (b[c] = {});
|
|
314
|
+
// @ts-ignore
|
|
315
|
+
const d = b.maps || (b.maps = {}), r = new Set(), e = new URLSearchParams(), u = () =>
|
|
316
|
+
// @ts-ignore
|
|
317
|
+
h || (h = new Promise((f, n) => __awaiter(this, void 0, void 0, function* () {
|
|
318
|
+
var _a;
|
|
319
|
+
yield (a = m.createElement("script"));
|
|
320
|
+
a.id = this.id;
|
|
321
|
+
e.set("libraries", [...r] + "");
|
|
322
|
+
// @ts-ignore
|
|
323
|
+
for (k in g)
|
|
324
|
+
e.set(k.replace(/[A-Z]/g, (t) => "_" + t[0].toLowerCase()), g[k]);
|
|
325
|
+
e.set("callback", c + ".maps." + q);
|
|
326
|
+
a.src = this.url + `?` + e;
|
|
327
|
+
d[q] = f;
|
|
328
|
+
a.onerror = () => (h = n(Error(p + " could not load.")));
|
|
329
|
+
// @ts-ignore
|
|
330
|
+
a.nonce = this.nonce || ((_a = m.querySelector("script[nonce]")) === null || _a === void 0 ? void 0 : _a.nonce) || "";
|
|
331
|
+
m.head.append(a);
|
|
332
|
+
})));
|
|
333
|
+
// @ts-ignore
|
|
334
|
+
d[l] ? console.warn(p + " only loads once. Ignoring:", g) : (d[l] = (f, ...n) => r.add(f) && u().then(() => d[l](f, ...n)));
|
|
335
|
+
})(params);
|
|
336
|
+
/* eslint-enable */
|
|
337
|
+
}
|
|
338
|
+
// While most libraries populate the global namespace when loaded via bootstrap params,
|
|
339
|
+
// this is not the case for "marker" when used with the inline bootstrap loader
|
|
340
|
+
// (and maybe others in the future). So ensure there is an importLibrary for each:
|
|
341
|
+
const libraryPromises = this.libraries.map((library) => this.importLibrary(library));
|
|
342
|
+
// ensure at least one library, to kick off loading...
|
|
343
|
+
if (!libraryPromises.length) {
|
|
344
|
+
libraryPromises.push(this.importLibrary("core"));
|
|
345
|
+
}
|
|
346
|
+
Promise.all(libraryPromises).then(() => this.callback(), (error) => {
|
|
347
|
+
const event = new ErrorEvent("error", { error }); // for backwards compat
|
|
348
|
+
this.loadErrorCallback(event);
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Reset the loader state.
|
|
353
|
+
*/
|
|
354
|
+
reset() {
|
|
355
|
+
this.deleteScript();
|
|
356
|
+
this.done = false;
|
|
357
|
+
this.loading = false;
|
|
358
|
+
this.errors = [];
|
|
359
|
+
this.onerrorEvent = null;
|
|
360
|
+
}
|
|
361
|
+
resetIfRetryingFailed() {
|
|
362
|
+
if (this.failed) {
|
|
363
|
+
this.reset();
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
loadErrorCallback(e) {
|
|
367
|
+
this.errors.push(e);
|
|
368
|
+
if (this.errors.length <= this.retries) {
|
|
369
|
+
const delay = this.errors.length * Math.pow(2, this.errors.length);
|
|
370
|
+
console.error(`Failed to load Google Maps script, retrying in ${delay} ms.`);
|
|
371
|
+
setTimeout(() => {
|
|
372
|
+
this.deleteScript();
|
|
373
|
+
this.setScript();
|
|
374
|
+
}, delay);
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
this.onerrorEvent = e;
|
|
378
|
+
this.callback();
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
callback() {
|
|
382
|
+
this.done = true;
|
|
383
|
+
this.loading = false;
|
|
384
|
+
this.callbacks.forEach((cb) => {
|
|
385
|
+
cb(this.onerrorEvent);
|
|
386
|
+
});
|
|
387
|
+
this.callbacks = [];
|
|
388
|
+
}
|
|
389
|
+
execute() {
|
|
390
|
+
this.resetIfRetryingFailed();
|
|
391
|
+
if (this.loading) {
|
|
392
|
+
// do nothing but wait
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
if (this.done) {
|
|
396
|
+
this.callback();
|
|
397
|
+
}
|
|
398
|
+
else {
|
|
399
|
+
// short circuit and warn if google.maps is already loaded
|
|
400
|
+
if (window.google && window.google.maps && window.google.maps.version) {
|
|
401
|
+
console.warn("Google Maps already loaded outside @googlemaps/js-api-loader. " +
|
|
402
|
+
"This may result in undesirable behavior as options and script parameters may not match.");
|
|
403
|
+
this.callback();
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
this.loading = true;
|
|
407
|
+
this.setScript();
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
const mapGooglemapsCss = ":host{display:block}:host>div{height:100%}.mapsindoors.floor-selector{margin:10px;position:absolute;border-radius:2px;box-shadow:0 1px 2px 0 rgba(0, 0, 0, 0.3);width:40px;font-family:Figtree, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:18px}.mapsindoors.floor-selector a{position:relative;display:block;float:none;margin-top:-1px;text-align:center;cursor:pointer;border-radius:2px;background:#fff;z-index:0;height:40px;line-height:40px}.mapsindoors.floor-selector a:hover{background:#ddd;border-color:#999;z-index:2}.mapsindoors.floor-selector a.active{background:#ddd;border-color:#00b1ff;z-index:2}.mapsindoors.floor-selector a:not(:first-child):not(:last-child){border-radius:0}.mapsindoors.floor-selector a:first-child:not(:last-child){border-top-right-radius:2px;border-bottom-right-radius:0;border-bottom-left-radius:0}.mapsindoors.floor-selector a:last-child:not(:first-child){border-top-right-radius:0;border-bottom-left-radius:2px;border-top-left-radius:0}.mapsindoors.position-control{margin:10px;position:absolute}.mapsindoors.position-control__button{border:none;margin:0;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;width:40px;height:40px;background-color:transparent;background-size:cover;outline:none;box-shadow:0px 4px 4px rgba(0, 0, 0, 0.16), 0px 2px 2px rgba(0, 0, 0, 0.18), 0px 1px 1px rgba(0, 0, 0, 0.2);border-radius:50%}.mapsindoors.position-control__button--unknown{background-image:url(data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K1rWIgvPDxwUvQZa+sKUo18LV2mvcW3VIonSFpDF1gn0gwrDCNn60RcfOG9IMwfiGVNgjrICFk8EBDQGdodpQ4yoZqEeqSdSrJMHVzOehsOL53FhvWpudgwck7E+YdOUbaXu4qoN2tOKjnrZI9T+3I8qui61F3y7/QNMcRruyX/LN62egfVndZ0WmWsiRDUPgiy77kunceeBBGk+rEnLp0H7wTpPPrpOYJSPPopcWiH8wF4foCW+eQm4T4jRlBCUsXG4IOcFmohdHFwD6nEU4JlP/azVR/AeIjygGU/AvSM1TqUrDw+2dfqPIRWDXyRR6x8CYniimtqHceIZRfrZltk6wkXBt/AEKeTVjZANNTHJmVAs36MABP4WMZukBoEOT9EQBn/GEGmAso4gsLLY5K9Zs8g24Hrbr0IzxbpF2fb1F9veAZMC2gSEGXysQAAAABJRU5ErkJggg==)}.mapsindoors.position-control__button--requesting{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAABEZVhJZk1NACoAAAAIAAIBEgADAAAAAQAGAACHaQAEAAAAAQAAACYAAAAAAAKgAgAEAAAAAQAAAFCgAwAEAAAAAQAAAFAAAAAA4foYGgAAB7RJREFUeAHtnd9rFFcUx09CbaBqTFp3wag4YrSQYP3ZgulDJw+SUqg/aOtDQYhQ6GNt/wH1H6j6WCgoCH2wLTEIRfEh60MN1PqjtQk0RvaKMYXENNHWgvXher/zY529e2d2ZzJ3Zja7H7jZnc3sj/nuueeec+6d2RZKEc55h7gxRTNE2+bcGs6/DWn3BdGY5/a+aAXRbre0tCxQSrRQgngEe0+0A1QpUlQY2WIO4zZNQbUghDNFGxJtnifDGdEOUD0DaxPtWIKiqSiKNiiaQfUCz4ZwMkXRjlHW4fa3XeTZpSjaIGUN8aEM0UZ4/QB/bFAWEB/kC56t7lor+MyDlBbc9nUnef1zkhZBpDiQ2+Y/JNp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8yOM8W0Kiu+Iz1U9hhNvdOm2LrD/hVIgDOCDaWZ4MEA3+2KQEiHQR2qjwlz9GgAl8/CCBQfHAyPkhAkr4xwgSFVDGERRVHpPsc/YMsgu47q0X5rlF+825TfXXG14AyVY46NplONUAAAAASUVORK5CYII=)}.mapsindoors.position-control__button--known{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAbXSURBVHgB7Z3faxxVFMdPxFdD89xgJw+K2SKxICYi4gbTFBFs0qSIIDSJFlGoSYhV35KgD4JIGguCiEkEQSTbJC2U0kRJQCSpIKZIN+LLTiA+N6x/wPV+58c6c3dmf865s78+cDsz3SSz8917zz33nDOzbRQjQogTcpOUzZCtx9kazsuG8uPHspme7aFsO7Ltt7W1HVNMtJFGPIK9JNsQ5YtUKSbZYt7ENk5BWZDCJWVbl+2h0MOybENUz6C3yTarUbQgMrKNyWZQvSBqQziVjGyzVOsI+9POiNolI9sY1RryTRmybYv6AfbYoFpAvpFJUVvDtVTwnscoLoRt6xZE/bNAVVCRHyjs7r8u2zPUGOzLNiz9R5PKpGwBHfG2KTonuFYwZesvV8SyBGxg8VxMKlPEkgVsAvFcTCpDxJIEbCLxXEwqUcRSBfyDGmfCKBVMLP3FAhOPUBGcab7ZxAO45qLLv4I9UNiO5jI1N9OyF14LezFUQMfuYeieoOYGQ/hMmD0sJCAc5dhiaqe6nvQdH2b+phhBkLY/6IVAG+gM3foOSEZLUoSsm8MmkdqPnelnVtgpCR95Ago78GhQCxVDtin1P302ME6H+ejoiO5u/kTpgwNKp/+S7cD3eiLRTZ2dJ2nw7AA939dr7ccAJpQur2+oCjhGmt2WVGqNVm+s0d7eb2X9Xl/fczQ6coEujl4gzcxLAefcA1XADGnqfXt792jm6sey5/1D1YCeODV5RaeQx1LADvcgJ6Cw04DrxEw2+y8tLH5JS0vfUZR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BSi7YzhgKLMelgCvugSog+2QShr2GvWdl0LCv5jES3d2WjUOQ4tzggFX+FgMmKffQ5d0nEkcvDKLG7hNx8ZX3gqB4IG5rMqmFiqmKB/IEdJZ289RCJVCTwIi0YyR3qIXLhnfi8NK62bA4BW82DM2JOL/QGsr27a5m2IsFk0rOfbKL1Lwshg1dl6K3/Du+IZZ4TXfLvxTvTLEfKprWdGZlxMVNah5Msq+5KK3HnuRjUtSPPXFpAhFN4nrwjksDi2hSBY9+Kru0wzkBnh/Akk+OCfcZMSaVSUW1MTiRM0M1gouDa6hIvEgQ9mM/6/UBjFNUCwj7EaDron7YFrX4ZF/ReghtNMg3OSdqS0gMV7yn+gmMCHtYx90j60+4IOQFDMm2IvQA0WCPk6SBsh3pahD/fxkBEvj4QgKDosEk54sISPOXEWgVUMURFFGeJNn37BlkB3DdrRfTs0W772xj/faG/wAnZe5yTgwtRAAAAABJRU5ErkJggg==)}.mapsindoors.position-control__button--centered{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAe3SURBVHgB7Z1PbBRVHMd/bYTy3xb8Q9sQhkDoQQgSC0fcXvRgwHIreGlNCEYPIoSbyVLjUYocNBIS4ULpraXEg152wxFrwACHNmCnEhY1CJU/AmIcf9/5U2bevje7sztvdre7n+R1d2e7OzPf+b3f7/d+b2a2iSqIZVmt/JDiZnDb4j4a7tuG8O+z3Ezf4wy3LLfLTU1Ns1QhmihBfIK9ya2X8kUqFZMcMc/hsZKCaoGFS3Eb5XbPSoZT3HqploG1cUsnKJqMaW793AyqFazqEE5kmluaqh3LOdrTVvUyza2fqg3eKINbxqod4I8NqgZ4Qz62qqu7Fgu2uZ8qheX4umNW7XOMyqCkPNByzH+U2+s0P7jMbTfnjyZFJLKArngZii8JrhZMbj1RRYwk4DwWz8OkiCIWLWAdiOdhUgQRixKw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j+l7RPvZfazorzf8DzVpOVIMfwU5AAAAAElFTkSuQmCC)}";
|
|
413
|
+
|
|
414
|
+
const MapGooglemaps = class {
|
|
415
|
+
constructor(hostRef) {
|
|
416
|
+
registerInstance(this, hostRef);
|
|
417
|
+
this.mapsIndoorsReady = createEvent(this, "mapsIndoorsReady", 7);
|
|
418
|
+
// Directions render and service instances
|
|
419
|
+
this.directionsRendererInstance = null;
|
|
420
|
+
this.gmApiKey = '';
|
|
421
|
+
this.miApiKey = '';
|
|
422
|
+
this.gmOptions = {
|
|
423
|
+
zoom: 17,
|
|
424
|
+
maxZoom: 21,
|
|
425
|
+
center: { lat: 0, lng: 0 },
|
|
426
|
+
mapTypeControl: false,
|
|
427
|
+
streetViewControl: false
|
|
428
|
+
};
|
|
429
|
+
this.disableExternalLinks = false;
|
|
430
|
+
this.floorSelectorControlPosition = undefined;
|
|
431
|
+
this.floorIndex = undefined;
|
|
432
|
+
this.myPositionControlPosition = undefined;
|
|
433
|
+
this.polygonHighlightOptions = {
|
|
434
|
+
strokeColor: '#EF6CCE',
|
|
435
|
+
strokeOpacity: 1,
|
|
436
|
+
strokeWeight: 2,
|
|
437
|
+
fillColor: '#EF6CCE',
|
|
438
|
+
fillOpacity: 0.2
|
|
439
|
+
};
|
|
440
|
+
this.language = 'en';
|
|
441
|
+
this.polylineOptions = {
|
|
442
|
+
color: '#3071d9',
|
|
443
|
+
opacity: 1,
|
|
444
|
+
weight: 4
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
apiKeyChange(newApiKey) {
|
|
448
|
+
mapsindoors.MapsIndoors.setMapsIndoorsApiKey(newApiKey);
|
|
449
|
+
}
|
|
450
|
+
gmOptionsChange(newControlOptions) {
|
|
451
|
+
this.googleMapsInstance.setOptions(newControlOptions);
|
|
452
|
+
}
|
|
453
|
+
setExternalLinkBehavior(shouldDisableLinks) {
|
|
454
|
+
if (shouldDisableLinks === true) {
|
|
455
|
+
this.mapElement.addEventListener('click', this.preventExternalLink);
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
this.mapElement.removeEventListener('click', this.preventExternalLink);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
floorSelectorControlPositionChange(newPosition, oldPosition) {
|
|
462
|
+
if (this.floorSelectorInstance) {
|
|
463
|
+
this.setFloorSelectorControl(newPosition, oldPosition);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
floorIndexChange(newFloor, oldFloor) {
|
|
467
|
+
if (newFloor === null) {
|
|
468
|
+
newFloor = '0'; // Setting the DOM attribute to "0" will be passed on here as null, so we need to circumvent that.
|
|
469
|
+
}
|
|
470
|
+
if (newFloor !== oldFloor && newFloor !== this.mapsIndoorsInstance.getFloor()) {
|
|
471
|
+
this.mapsIndoorsInstance.setFloor(newFloor);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
myPositionControlPositionChange(newPosition, oldPosition) {
|
|
475
|
+
this.setMyPositionControl(newPosition, oldPosition);
|
|
476
|
+
}
|
|
477
|
+
polylineOptionsChange(newPolylineOptions) {
|
|
478
|
+
if (this.directionsRendererInstance) {
|
|
479
|
+
this.directionsRendererInstance.setOptions({
|
|
480
|
+
strokeColor: newPolylineOptions.color ? newPolylineOptions.color : '#3071d9',
|
|
481
|
+
strokeOpacity: newPolylineOptions.opacity ? newPolylineOptions.opacity : 1,
|
|
482
|
+
strokeWeight: newPolylineOptions.weight ? newPolylineOptions.weight : 4
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Get the map instance.
|
|
488
|
+
* @returns {Promise<any>}
|
|
489
|
+
*/
|
|
490
|
+
async getMapInstance() {
|
|
491
|
+
return Promise.resolve(this.googleMapsInstance);
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* Get the MapsIndoors instance.
|
|
495
|
+
* @returns {Promise<any>}
|
|
496
|
+
*/
|
|
497
|
+
async getMapsIndoorsInstance() {
|
|
498
|
+
return Promise.resolve(this.mapsIndoorsInstance);
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Get the MapsIndoors Directions Service Instance.
|
|
502
|
+
* @returns {Promise<any>}
|
|
503
|
+
*/
|
|
504
|
+
async getDirectionsServiceInstance() {
|
|
505
|
+
return Promise.resolve(this.directionsServiceInstance);
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Get the MapsIndoors Directions Renderer Instance.
|
|
509
|
+
* @returns {Promise<any>}
|
|
510
|
+
*/
|
|
511
|
+
async getDirectionsRendererInstance() {
|
|
512
|
+
return Promise.resolve(this.directionsRendererInstance);
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Highlight a MapsIndoors location. Only a single location can be highlighted at the time.
|
|
516
|
+
* @param {Location} location
|
|
517
|
+
* @returns {Promise<void>}
|
|
518
|
+
*/
|
|
519
|
+
async highlightLocation(location) {
|
|
520
|
+
// Return if polygonHighlightOptions is undefined
|
|
521
|
+
if (!this.polygonHighlightOptions)
|
|
522
|
+
return;
|
|
523
|
+
// Return if already highlighted
|
|
524
|
+
if (this.highlightedLocationId && this.highlightedLocationId === location.id)
|
|
525
|
+
return;
|
|
526
|
+
// Remove previous highlight
|
|
527
|
+
if (this.highlightedLocationId) {
|
|
528
|
+
this.mapsIndoorsInstance.setDisplayRule(this.highlightedLocationId, null);
|
|
529
|
+
}
|
|
530
|
+
this.mapsIndoorsInstance.setDisplayRule(location.id, {
|
|
531
|
+
polygonVisible: true,
|
|
532
|
+
polygonZoomFrom: '0',
|
|
533
|
+
polygonZoomTo: '22',
|
|
534
|
+
zIndex: 1000,
|
|
535
|
+
polygonFillColor: this.polygonHighlightOptions.fillColor,
|
|
536
|
+
polygonFillOpacity: this.polygonHighlightOptions.fillOpacity,
|
|
537
|
+
polygonStrokeColor: this.polygonHighlightOptions.strokeColor,
|
|
538
|
+
polygonStrokeOpacity: this.polygonHighlightOptions.strokeOpacity,
|
|
539
|
+
polygonStrokeWeight: this.polygonHighlightOptions.strokeWeight
|
|
540
|
+
});
|
|
541
|
+
this.highlightedLocationId = location.id;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Clear existing MapsIndoors location highlight.
|
|
545
|
+
* @returns {Promise<void>}
|
|
546
|
+
*/
|
|
547
|
+
async clearHighlightLocation() {
|
|
548
|
+
if (this.highlightedLocationId) {
|
|
549
|
+
this.mapsIndoorsInstance.setDisplayRule(this.highlightedLocationId, null);
|
|
550
|
+
this.highlightedLocationId = null;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
async componentDidLoad() {
|
|
554
|
+
await this.loadGoogleMapsApi();
|
|
555
|
+
await this.initializeMapsIndoorsSDK();
|
|
556
|
+
await this.setupMap();
|
|
557
|
+
this.setExternalLinkBehavior(this.disableExternalLinks);
|
|
558
|
+
this.addEventListeners();
|
|
559
|
+
if (this.floorSelectorControlPosition) {
|
|
560
|
+
this.showFloorSelector();
|
|
561
|
+
}
|
|
562
|
+
if (this.myPositionControlPosition) {
|
|
563
|
+
this.setMyPositionControl(this.myPositionControlPosition);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
disconnectedCallback() {
|
|
567
|
+
this.mapsIndoorsInstance.deallocate();
|
|
568
|
+
this.mapElement.remove();
|
|
569
|
+
this.mapElement = null;
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Load the Google Maps API.
|
|
573
|
+
*
|
|
574
|
+
* @returns {Promise<void>}
|
|
575
|
+
*/
|
|
576
|
+
loadGoogleMapsApi() {
|
|
577
|
+
if (typeof (google) === 'undefined') {
|
|
578
|
+
const loader = new Loader({
|
|
579
|
+
apiKey: this.gmApiKey,
|
|
580
|
+
version: 'quarterly',
|
|
581
|
+
libraries: ['geometry', 'places']
|
|
582
|
+
});
|
|
583
|
+
return loader.load();
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Ensure that MapsIndoors Web SDK is available.
|
|
588
|
+
*
|
|
589
|
+
* @returns {Promise<void>}
|
|
590
|
+
*/
|
|
591
|
+
initializeMapsIndoorsSDK() {
|
|
592
|
+
return new Promise((resolve) => {
|
|
593
|
+
if (typeof (mapsindoors) !== 'undefined') {
|
|
594
|
+
mapsindoors.MapsIndoors.setMapsIndoorsApiKey(this.miApiKey);
|
|
595
|
+
mapsindoors.MapsIndoors.setLanguage(this.language);
|
|
596
|
+
return resolve();
|
|
597
|
+
}
|
|
598
|
+
const miSdkApiTag = document.createElement('script');
|
|
599
|
+
miSdkApiTag.setAttribute('type', 'text/javascript');
|
|
600
|
+
miSdkApiTag.setAttribute('src', `${miVariables.miSDKUrlV4}?apikey=${this.miApiKey}`);
|
|
601
|
+
document.body.appendChild(miSdkApiTag);
|
|
602
|
+
miSdkApiTag.onload = () => resolve();
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Start Google Maps and MapsIndoors.
|
|
607
|
+
*/
|
|
608
|
+
setupMap() {
|
|
609
|
+
return new Promise((resolve) => {
|
|
610
|
+
const mapViewOptions = Object.assign({ element: this.mapElement }, this.gmOptions);
|
|
611
|
+
const mapViewInstance = new mapsindoors.mapView.GoogleMapsView(mapViewOptions);
|
|
612
|
+
this.googleMapsInstance = mapViewInstance.getMap();
|
|
613
|
+
this.mapsIndoorsInstance = new mapsindoors.MapsIndoors({ mapView: mapViewInstance });
|
|
614
|
+
this.mapsIndoorsInstance.on('ready', async () => {
|
|
615
|
+
if (this.floorIndex !== undefined) {
|
|
616
|
+
// Set the floor if floor attribute was set in the DOM initially
|
|
617
|
+
this.mapsIndoorsInstance.setFloor(this.floorIndex);
|
|
618
|
+
}
|
|
619
|
+
else {
|
|
620
|
+
this.floorIndex = this.mapsIndoorsInstance.getFloor();
|
|
621
|
+
}
|
|
622
|
+
this.initializeDirectionsService();
|
|
623
|
+
this.initializeDirectionsRenderer();
|
|
624
|
+
this.mapsIndoorsReady.emit();
|
|
625
|
+
resolve();
|
|
626
|
+
});
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Initialize MapsIndoors Directions Service.
|
|
631
|
+
*/
|
|
632
|
+
initializeDirectionsService() {
|
|
633
|
+
const externalDirections = new mapsindoors.directions.GoogleMapsProvider();
|
|
634
|
+
this.directionsServiceInstance = new mapsindoors.services.DirectionsService(externalDirections);
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Initialize MapsIndoors Directions Renderer with render options set.
|
|
638
|
+
*/
|
|
639
|
+
initializeDirectionsRenderer() {
|
|
640
|
+
this.directionsRendererInstance = new mapsindoors.directions.DirectionsRenderer({
|
|
641
|
+
mapsIndoors: this.mapsIndoorsInstance,
|
|
642
|
+
fitBounds: true,
|
|
643
|
+
strokeColor: this.polylineOptions.color,
|
|
644
|
+
strokeOpacity: this.polylineOptions.opacity,
|
|
645
|
+
strokeWeight: this.polylineOptions.weight,
|
|
646
|
+
visible: true
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Add event listeners and keep properties in sync.
|
|
651
|
+
*/
|
|
652
|
+
addEventListeners() {
|
|
653
|
+
this.mapsIndoorsInstance.on('click', (location) => {
|
|
654
|
+
this.highlightLocation(location);
|
|
655
|
+
});
|
|
656
|
+
// Add floor changed event listener
|
|
657
|
+
this.mapsIndoorsInstance.on('floor_changed', (floorIndex) => {
|
|
658
|
+
this.floorIndex = floorIndex;
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Prevent external links from opening.
|
|
663
|
+
* @param {MouseEvent} event
|
|
664
|
+
*/
|
|
665
|
+
preventExternalLink(event) {
|
|
666
|
+
const externalLink = event.target.closest('a[target="_blank"]');
|
|
667
|
+
if (externalLink) {
|
|
668
|
+
event.preventDefault();
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
* Show the floor selector.
|
|
673
|
+
*/
|
|
674
|
+
showFloorSelector() {
|
|
675
|
+
this.setFloorSelectorControl(this.floorSelectorControlPosition);
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* Remove a Google Map Control from the map based on class name of the control.
|
|
679
|
+
* @param {string} controlPosition - the position from where to remove the control
|
|
680
|
+
* @param {string} className - the class name of the control to remove
|
|
681
|
+
*/
|
|
682
|
+
removeGoogleMapControl(controlPosition, className) {
|
|
683
|
+
const controls = this.googleMapsInstance.controls[google.maps.ControlPosition[controlPosition]].getArray();
|
|
684
|
+
const controlIndex = controls.findIndex(control => control.classList.contains(className));
|
|
685
|
+
this.googleMapsInstance.controls[google.maps.ControlPosition[controlPosition]].removeAt(controlIndex);
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* Set, update or unset floor selector on the map.
|
|
689
|
+
* @param {string} controlPosition
|
|
690
|
+
* @param {string} [oldControlPosition=undefined]
|
|
691
|
+
*/
|
|
692
|
+
setFloorSelectorControl(controlPosition, oldControlPosition = undefined) {
|
|
693
|
+
if (controlPosition === null) {
|
|
694
|
+
// If attribute is not set, clear control and unset floor selector.
|
|
695
|
+
this.removeGoogleMapControl(oldControlPosition, 'floor-selector');
|
|
696
|
+
this.floorSelectorElement = null;
|
|
697
|
+
this.floorSelectorInstance = null;
|
|
698
|
+
}
|
|
699
|
+
else if (!this.floorSelectorInstance) {
|
|
700
|
+
// Create new floor selector control
|
|
701
|
+
this.floorSelectorElement = document.createElement('div');
|
|
702
|
+
this.floorSelectorInstance = new mapsindoors.FloorSelector(this.floorSelectorElement, this.mapsIndoorsInstance);
|
|
703
|
+
this.googleMapsInstance.controls[google.maps.ControlPosition[controlPosition]].push(this.floorSelectorElement);
|
|
704
|
+
}
|
|
705
|
+
else {
|
|
706
|
+
// Update position of floor selector control
|
|
707
|
+
this.removeGoogleMapControl(oldControlPosition, 'floor-selector');
|
|
708
|
+
this.googleMapsInstance.controls[google.maps.ControlPosition[controlPosition]].push(this.floorSelectorElement);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Set, update or unset position control on the map.
|
|
713
|
+
* @param {string} controlPosition
|
|
714
|
+
* @param {string} oldControlPosition
|
|
715
|
+
*/
|
|
716
|
+
setMyPositionControl(controlPosition, oldControlPosition = undefined) {
|
|
717
|
+
if (controlPosition === null) {
|
|
718
|
+
// If attribute is not set, clear control and unset position control.
|
|
719
|
+
this.removeGoogleMapControl(google.maps.ControlPosition[oldControlPosition], 'position-control');
|
|
720
|
+
this.positionControlElement = null;
|
|
721
|
+
this.positionControlInstance = null;
|
|
722
|
+
}
|
|
723
|
+
else if (!this.positionControlInstance) {
|
|
724
|
+
// Create new my position control
|
|
725
|
+
this.positionControlElement = document.createElement('div');
|
|
726
|
+
this.positionControlInstance = new mapsindoors.PositionControl(this.positionControlElement, { mapsIndoors: this.mapsIndoorsInstance, positionOptions: { enableHighAccuracy: false, maximumAge: 300000, timeout: 10000 } });
|
|
727
|
+
this.googleMapsInstance.controls[google.maps.ControlPosition[controlPosition]].push(this.positionControlElement);
|
|
728
|
+
}
|
|
729
|
+
else {
|
|
730
|
+
// Update position of my position control
|
|
731
|
+
this.removeGoogleMapControl(oldControlPosition, 'position-control');
|
|
732
|
+
this.googleMapsInstance.controls[google.maps.ControlPosition[controlPosition]].push(this.positionControlElement);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
render() {
|
|
736
|
+
return (h("div", { ref: (el) => this.mapElement = el }));
|
|
737
|
+
}
|
|
738
|
+
static get watchers() { return {
|
|
739
|
+
"miApiKey": ["apiKeyChange"],
|
|
740
|
+
"gmOptions": ["gmOptionsChange"],
|
|
741
|
+
"disableExternalLinks": ["setExternalLinkBehavior"],
|
|
742
|
+
"floorSelectorControlPosition": ["floorSelectorControlPositionChange"],
|
|
743
|
+
"floorIndex": ["floorIndexChange"],
|
|
744
|
+
"myPositionControlPosition": ["myPositionControlPositionChange"],
|
|
745
|
+
"polylineOptions": ["polylineOptionsChange"]
|
|
746
|
+
}; }
|
|
747
|
+
};
|
|
748
|
+
MapGooglemaps.style = mapGooglemapsCss;
|
|
749
|
+
|
|
750
|
+
export { MapGooglemaps as mi_map_googlemaps };
|