@mapsindoors/map-template 1.0.0-rc.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/README.md +123 -0
- package/dist/_commonjsHelpers-ba3f0406-b96e6d6a.mjs +21 -0
- package/dist/combo-box-item.entry-92232c29.mjs +12 -0
- package/dist/combo-box-item.entry-f244c01a.mjs +14 -0
- package/dist/icon-b8d01d6f-ddfa2c17.mjs +24 -0
- package/dist/mapsindoors-react.es.js +7 -0
- package/dist/mapsindoors-react.umd.js +1391 -0
- package/dist/mapsindoors-webcomponent.es.js +5 -0
- package/dist/mapsindoors-webcomponent.umd.js +1385 -0
- package/dist/mi-card_2.entry-508f65b2.mjs +23 -0
- package/dist/mi-card_2.entry-d24478d0.mjs +25 -0
- package/dist/mi-chip.entry-74b3118c.mjs +15 -0
- package/dist/mi-chip.entry-8bfee95c.mjs +13 -0
- package/dist/mi-column.entry-f66623b9.mjs +20 -0
- package/dist/mi-column.entry-f901d5d1.mjs +18 -0
- package/dist/mi-combo-box.entry-0e6d9797.mjs +262 -0
- package/dist/mi-combo-box.entry-69a04955.mjs +260 -0
- package/dist/mi-data-table.entry-6cae08b0.mjs +215 -0
- package/dist/mi-data-table.entry-7fe09cbe.mjs +213 -0
- package/dist/mi-distance_2.entry-dca308c3.mjs +54 -0
- package/dist/mi-distance_2.entry-dffb2e64.mjs +56 -0
- package/dist/mi-dropdown-item.entry-508c6605.mjs +12 -0
- package/dist/mi-dropdown-item.entry-b6aa9d36.mjs +14 -0
- package/dist/mi-dropdown.entry-43258637.mjs +296 -0
- package/dist/mi-dropdown.entry-e1325610.mjs +298 -0
- package/dist/mi-keyboard.entry-60e47fb9.mjs +2962 -0
- package/dist/mi-keyboard.entry-c97c80e8.mjs +2960 -0
- package/dist/mi-list-item-category.entry-b0f61751.mjs +38 -0
- package/dist/mi-list-item-category.entry-bcac342a.mjs +36 -0
- package/dist/mi-list-item-location.entry-15ec9c7e.mjs +125 -0
- package/dist/mi-list-item-location.entry-ee56967a.mjs +127 -0
- package/dist/mi-list.entry-656130ea.mjs +41 -0
- package/dist/mi-list.entry-c8f1f377.mjs +39 -0
- package/dist/mi-location-booking.entry-a5b9b331.mjs +4863 -0
- package/dist/mi-location-booking.entry-ea841d6e.mjs +4865 -0
- package/dist/mi-location-info.entry-89b37774.mjs +22 -0
- package/dist/mi-location-info.entry-fe2c6c32.mjs +24 -0
- package/dist/mi-map-googlemaps.entry-6cb264de.mjs +398 -0
- package/dist/mi-map-googlemaps.entry-8877f16d.mjs +396 -0
- package/dist/mi-map-mapbox.entry-7a41963d.mjs +298 -0
- package/dist/mi-map-mapbox.entry-928da21a.mjs +300 -0
- package/dist/mi-metric-card.entry-51daca25.mjs +28 -0
- package/dist/mi-metric-card.entry-95dbb9f1.mjs +26 -0
- package/dist/mi-notification.entry-29b28ba8.mjs +81 -0
- package/dist/mi-notification.entry-f7677761.mjs +83 -0
- package/dist/mi-route-instructions-heading.entry-79c22cdd.mjs +72 -0
- package/dist/mi-route-instructions-heading.entry-a4c7f18f.mjs +74 -0
- package/dist/mi-route-instructions-maneuver_2.entry-383704ad.mjs +115 -0
- package/dist/mi-route-instructions-maneuver_2.entry-80c51e6a.mjs +113 -0
- package/dist/mi-route-instructions-step-legacy.entry-785cb60b.mjs +199 -0
- package/dist/mi-route-instructions-step-legacy.entry-eff068ed.mjs +201 -0
- package/dist/mi-route-instructions-step.entry-272e3c84.mjs +199 -0
- package/dist/mi-route-instructions-step.entry-95f5dc43.mjs +201 -0
- package/dist/mi-route-instructions.entry-0628d220.mjs +139 -0
- package/dist/mi-route-instructions.entry-1b4fb352.mjs +141 -0
- package/dist/mi-scroll-buttons.entry-274b003f.mjs +48 -0
- package/dist/mi-scroll-buttons.entry-6132935b.mjs +46 -0
- package/dist/mi-search.entry-994c0189.mjs +206 -0
- package/dist/mi-search.entry-d0e582d1.mjs +208 -0
- package/dist/mi-share-sms.entry-ae15cf77.mjs +53 -0
- package/dist/mi-share-sms.entry-ced7f275.mjs +55 -0
- package/dist/mi-step-switcher.entry-812a5096.mjs +24 -0
- package/dist/mi-step-switcher.entry-c9e28e79.mjs +26 -0
- package/dist/mi-tab-panel.entry-63c34f28.mjs +19 -0
- package/dist/mi-tab-panel.entry-bde9bd39.mjs +21 -0
- package/dist/mi-tab.entry-1767468e.mjs +13 -0
- package/dist/mi-tab.entry-b5ac50ac.mjs +11 -0
- package/dist/mi-tabs.entry-1b8327bf.mjs +34 -0
- package/dist/mi-tabs.entry-bd190e21.mjs +36 -0
- package/dist/mi-variables-9a6c8d4d-e06eec88.mjs +7 -0
- package/dist/reactcomponent-2f9f051f.mjs +27190 -0
- package/dist/route-travel-mode.enum-7f4ce9c7-a9c95a83.mjs +7 -0
- package/dist/sort-order.enum-64ce8998-b75ac596.mjs +317 -0
- package/dist/unit-system.enum-eaefb53e-0f424da4.mjs +7 -0
- package/dist/utils-ae714467-b07fc3be.mjs +36 -0
- package/dist/webcomponent-a10be1e6.mjs +31969 -0
- package/package.json +53 -0
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { r as f, c as I, h as C } from "./webcomponent-a10be1e6.mjs";
|
|
2
|
+
import { m as E } from "./mi-variables-9a6c8d4d-e06eec88.mjs";
|
|
3
|
+
var b = function o(e, t) {
|
|
4
|
+
if (e === t)
|
|
5
|
+
return !0;
|
|
6
|
+
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
7
|
+
if (e.constructor !== t.constructor)
|
|
8
|
+
return !1;
|
|
9
|
+
var i, s, r;
|
|
10
|
+
if (Array.isArray(e)) {
|
|
11
|
+
if (i = e.length, i != t.length)
|
|
12
|
+
return !1;
|
|
13
|
+
for (s = i; s-- !== 0; )
|
|
14
|
+
if (!o(e[s], t[s]))
|
|
15
|
+
return !1;
|
|
16
|
+
return !0;
|
|
17
|
+
}
|
|
18
|
+
if (e.constructor === RegExp)
|
|
19
|
+
return e.source === t.source && e.flags === t.flags;
|
|
20
|
+
if (e.valueOf !== Object.prototype.valueOf)
|
|
21
|
+
return e.valueOf() === t.valueOf();
|
|
22
|
+
if (e.toString !== Object.prototype.toString)
|
|
23
|
+
return e.toString() === t.toString();
|
|
24
|
+
if (r = Object.keys(e), i = r.length, i !== Object.keys(t).length)
|
|
25
|
+
return !1;
|
|
26
|
+
for (s = i; s-- !== 0; )
|
|
27
|
+
if (!Object.prototype.hasOwnProperty.call(t, r[s]))
|
|
28
|
+
return !1;
|
|
29
|
+
for (s = i; s-- !== 0; ) {
|
|
30
|
+
var a = r[s];
|
|
31
|
+
if (!o(e[a], t[a]))
|
|
32
|
+
return !1;
|
|
33
|
+
}
|
|
34
|
+
return !0;
|
|
35
|
+
}
|
|
36
|
+
return e !== e && t !== t;
|
|
37
|
+
};
|
|
38
|
+
const h = "__googleMapsScriptId";
|
|
39
|
+
var l;
|
|
40
|
+
(function(o) {
|
|
41
|
+
o[o.INITIALIZED = 0] = "INITIALIZED", o[o.LOADING = 1] = "LOADING", o[o.SUCCESS = 2] = "SUCCESS", o[o.FAILURE = 3] = "FAILURE";
|
|
42
|
+
})(l || (l = {}));
|
|
43
|
+
class n {
|
|
44
|
+
/**
|
|
45
|
+
* Creates an instance of Loader using [[LoaderOptions]]. No defaults are set
|
|
46
|
+
* using this library, instead the defaults are set by the Google Maps
|
|
47
|
+
* JavaScript API server.
|
|
48
|
+
*
|
|
49
|
+
* ```
|
|
50
|
+
* const loader = Loader({apiKey, version: 'weekly', libraries: ['places']});
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
constructor({ apiKey: e, authReferrerPolicy: t, channel: i, client: s, id: r = h, language: a, libraries: c = [], mapIds: g, nonce: A, region: p, retries: d = 3, url: m = "https://maps.googleapis.com/maps/api/js", version: u }) {
|
|
54
|
+
if (this.CALLBACK = "__googleMapsCallback", this.callbacks = [], this.done = !1, this.loading = !1, this.errors = [], this.apiKey = e, this.authReferrerPolicy = t, this.channel = i, this.client = s, this.id = r || h, this.language = a, this.libraries = c, this.mapIds = g, this.nonce = A, this.region = p, this.retries = d, this.url = m, this.version = u, n.instance) {
|
|
55
|
+
if (!b(this.options, n.instance.options))
|
|
56
|
+
throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(n.instance.options)}`);
|
|
57
|
+
return n.instance;
|
|
58
|
+
}
|
|
59
|
+
n.instance = this;
|
|
60
|
+
}
|
|
61
|
+
get options() {
|
|
62
|
+
return {
|
|
63
|
+
version: this.version,
|
|
64
|
+
apiKey: this.apiKey,
|
|
65
|
+
channel: this.channel,
|
|
66
|
+
client: this.client,
|
|
67
|
+
id: this.id,
|
|
68
|
+
libraries: this.libraries,
|
|
69
|
+
language: this.language,
|
|
70
|
+
region: this.region,
|
|
71
|
+
mapIds: this.mapIds,
|
|
72
|
+
nonce: this.nonce,
|
|
73
|
+
url: this.url,
|
|
74
|
+
authReferrerPolicy: this.authReferrerPolicy
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
get status() {
|
|
78
|
+
return this.errors.length ? l.FAILURE : this.done ? l.SUCCESS : this.loading ? l.LOADING : l.INITIALIZED;
|
|
79
|
+
}
|
|
80
|
+
get failed() {
|
|
81
|
+
return this.done && !this.loading && this.errors.length >= this.retries + 1;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]].
|
|
85
|
+
*
|
|
86
|
+
* @ignore
|
|
87
|
+
*/
|
|
88
|
+
createUrl() {
|
|
89
|
+
let e = this.url;
|
|
90
|
+
return e += `?callback=${this.CALLBACK}`, 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;
|
|
91
|
+
}
|
|
92
|
+
deleteScript() {
|
|
93
|
+
const e = document.getElementById(this.id);
|
|
94
|
+
e && e.remove();
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Load the Google Maps JavaScript API script and return a Promise.
|
|
98
|
+
*/
|
|
99
|
+
load() {
|
|
100
|
+
return this.loadPromise();
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Load the Google Maps JavaScript API script and return a Promise.
|
|
104
|
+
*
|
|
105
|
+
* @ignore
|
|
106
|
+
*/
|
|
107
|
+
loadPromise() {
|
|
108
|
+
return new Promise((e, t) => {
|
|
109
|
+
this.loadCallback((i) => {
|
|
110
|
+
i ? t(i.error) : e(window.google);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Load the Google Maps JavaScript API script with a callback.
|
|
116
|
+
*/
|
|
117
|
+
loadCallback(e) {
|
|
118
|
+
this.callbacks.push(e), this.execute();
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Set the script on document.
|
|
122
|
+
*/
|
|
123
|
+
setScript() {
|
|
124
|
+
if (document.getElementById(this.id)) {
|
|
125
|
+
this.callback();
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const e = this.createUrl(), t = document.createElement("script");
|
|
129
|
+
t.id = this.id, t.type = "text/javascript", t.src = e, t.onerror = this.loadErrorCallback.bind(this), t.defer = !0, t.async = !0, this.nonce && (t.nonce = this.nonce), document.head.appendChild(t);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Reset the loader state.
|
|
133
|
+
*/
|
|
134
|
+
reset() {
|
|
135
|
+
this.deleteScript(), this.done = !1, this.loading = !1, this.errors = [], this.onerrorEvent = null;
|
|
136
|
+
}
|
|
137
|
+
resetIfRetryingFailed() {
|
|
138
|
+
this.failed && this.reset();
|
|
139
|
+
}
|
|
140
|
+
loadErrorCallback(e) {
|
|
141
|
+
if (this.errors.push(e), this.errors.length <= this.retries) {
|
|
142
|
+
const t = this.errors.length * Math.pow(2, this.errors.length);
|
|
143
|
+
console.log(`Failed to load Google Maps script, retrying in ${t} ms.`), setTimeout(() => {
|
|
144
|
+
this.deleteScript(), this.setScript();
|
|
145
|
+
}, t);
|
|
146
|
+
} else
|
|
147
|
+
this.onerrorEvent = e, this.callback();
|
|
148
|
+
}
|
|
149
|
+
setCallback() {
|
|
150
|
+
window.__googleMapsCallback = this.callback.bind(this);
|
|
151
|
+
}
|
|
152
|
+
callback() {
|
|
153
|
+
this.done = !0, this.loading = !1, this.callbacks.forEach((e) => {
|
|
154
|
+
e(this.onerrorEvent);
|
|
155
|
+
}), this.callbacks = [];
|
|
156
|
+
}
|
|
157
|
+
execute() {
|
|
158
|
+
if (this.resetIfRetryingFailed(), this.done)
|
|
159
|
+
this.callback();
|
|
160
|
+
else {
|
|
161
|
+
if (window.google && window.google.maps && window.google.maps.version) {
|
|
162
|
+
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();
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
this.loading || (this.loading = !0, this.setCallback(), this.setScript());
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
const y = ':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:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAdMSURBVHgB7Z1Lb9RWFMfPRKVI5RVaEgkKwoiISokoj5ZKpAs8CwSq1BLUx6ISUpAqddFFab8A8AVKWXTRFUjsaCsIbEAsZrposqBAWppIhaC5CJpKoSkBSivKwpz/2A72tT1je+71eDLzk2481+N47P+c+zr3XE+BmohlWd28MTkZnLY4W8N525AOn+MkPNvbnMqcxguFwhw1iQJliEewXZyGKChSWgTZYo5g20xBtcDCmZzOcLpvZcMJTkPUysDaOB3OULQwKpyGORnUKlj5EE6mwukw5R3L/rYrVn6pcBqmvMEXZXAqWa0D6mOD8gBfyOdWvoprXHDNw9QsLLuuO2a1PseoAVL1Ay3b/M9w2koLg3FO+7n/KCghiQV0xCuRuk5wXhCciklFTCTgAhbPRVBCEWML2AbiuQhKIGIsAdtIPBdBMUWMK+A1WjgNRlzQsBTrOSa6qA5OM99u4gHcc93hX00LtOyO5glqb75gK/w66s1IA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omqBt0kDfdJFNzKkSipicXCLz72FKQJNVC1wnDQQNqS68tsNSktSEd2JqrAhpEJuayvCYCDEyTkzm35UkEZEc1BraGMZApZJExBQvtlzF0cbmq9IKmLSlj8h411OmIIgTcAKvKBLgjncRshJZ1t4Z+VGSBNruQ4KODnZ0drozFkORCzjT5c3owt0fOWihG7NqR8uNeTsjPrfjESsGp13Yh0jEm0VRtSoAqC1HOSRRdzWEucYvTJZN56mkcn7GKxEEfaGdmgP6a0lIkCXA45X+A57Xu72hXY8/OdxdTQzxZabJJJLk4gnWbyDeOEV0CQ7NlArGOijiF29nr5PGAbqWcQhjnArrzKMJAIsTKw6HOXwNgwiM4nKx4zdGBfDKGuMCxoRtPRorECYlVcjGNiZEMcnGQO0vhvcjCzgEco4PhpCIiWNIsAoZ/vrmwJhHcArooZgo4Ms4Ek3IwuovTGJAjeL8fItnox6wK1rWIgvPDxwUvQZa+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,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAABEZVhJZ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BiUsv5VcsPL9YoozAfHOCvGO4I5XQJPstYFaQaKPMMU78RMH8HnotgktLrJWJeCOvLwN4Uwiq/LhtzBnHMfyNoz0QfFhzGD03ehuyAIep4TXR1sLLEULu4oAWQ5G2RQWWB4RAp51N2QBtQ8mfsASkS/fE5NRj8XIrFrim7cm2FeJPHtdWkt8GUnn0FWcJ5KGFarI2HkiLmXLe4GqHniKNGYmdQyTxQMVAjqp3QlqIqPURFmRdpxkgZq4XPAOHF6aJxtWJ/BkQ985EecJza5sn+7K/P4ZOKnknCd7mhqX035d16XqKf9ObIgUT9tCzIyCCzvuqLZT1WlNZ1TGORGMGgdG9jFXpXnZk0oYxX3ZE5fmhXcqaV766SWMIlz6KfTSDucNcP0ALfPJKeFeI4ZRSCKtjcEbOSPUUghxcAyRxIsFbl/2s14vwHiUsgC3LwE6xOuHEZ7FK/vy5kVo40F8yOM8W0Kiu+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+9POiNolI9sY1RryTRmybYv6AfbY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TveDQmCcvBAEbDzZCcxYUJAkxhQe9um4hdysrnld5wR5WbC6oGHxMC5wbO+Y+YlVY6gJaTqF0aI1QP3iYGgJdW3yyvEjRpIZV5CHrINYXBxxJ9qRCaOcVll9b5Uyp+ZGB0ZJkZ2Giigmp930RJQdcoUTGLii88/8x3jAuc/+ZSiZubqR3k2Fgl3Rkxo57oxLE4SgA3KC3LKYYb8cBTONf4GKhw2lZAV4oLM1Qo7+EdTWjNrpR+9jjWoNocLe4oPIihdymEmFKy0pjexjiwTWzlvocT66OiwVZZRTmIdM3pQeYjG6oSOXGIdCA0lvYVEBHB7EAw9LZdeiUTCV9qB8jesZuAkh1VyYcmGxJIG8VakeOPY8QqYJLs2kBUMZ5RlLC1HW1wEm4dJQ1PYzBq+2FHL2+DOaKnKR8pzYfF6JOVtmOn7+FYbKph9u9wDVcA50lwfbRdYrodWXIWBSi7YzhgKLMelgCvugSog+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,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAABYlAAAWJQFJUiTw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CDk+cV95xpUKjDCQJGuOtDIGWMDT3gtRQO3BRIXt4zCpfu2h/VycCNrI/g0+rqu9hXp40kgs2yeEScI1dHnXiVTCCmVU2XUiHoHTe4HM4+KyJpMaiJiieCBPQHdoN0gNRKSaSGO+6ySz1MBjzB84/DQuNixM6MWGyqzT/UCjKzuXu5qqN0PTdvc62eNUvxxXdV2Pgpf8u7khhnh1d8k/i7e10D8VHDi6URnXRJhUP5jk7HNBGrc9ycekuG974tG48U4+jVs/PcekEm79FLl45q4A9w/QMp9cIbx7xJgUkZKqj1iRG6HmQ4qDfShJvFiwnNt+1uoNGA9QNWA5twAdtWqHjFWNd/a1GjehjQfeyCNWdQmJ7optqp3CiOV060pbZO0JJ4N3oJfbaSsZIBr8cYoSoKSb0JaK9fzHCDCBjx8kMCgeTHJ/iIAS/jGCRAUUcQVFlSdFzjV7BjkFXO/Rj+l7RPvZfazorzf8DzVpOVIMfwU5AAAAAElFTkSuQmCC)}', S = class {
|
|
170
|
+
constructor(o) {
|
|
171
|
+
f(this, o), this.mapsIndoorsReady = I(this, "mapsIndoorsReady", 7), this.directionsRendererInstance = null, this.gmApiKey = "", this.miApiKey = "", this.gmOptions = {
|
|
172
|
+
zoom: 17,
|
|
173
|
+
maxZoom: 21,
|
|
174
|
+
center: { lat: 0, lng: 0 },
|
|
175
|
+
mapTypeControl: !1,
|
|
176
|
+
streetViewControl: !1
|
|
177
|
+
}, this.disableExternalLinks = !1, this.floorSelectorControlPosition = void 0, this.floorIndex = void 0, this.myPositionControlPosition = void 0, this.polygonHighlightOptions = {
|
|
178
|
+
strokeColor: "#EF6CCE",
|
|
179
|
+
strokeOpacity: 1,
|
|
180
|
+
strokeWeight: 2,
|
|
181
|
+
fillColor: "#EF6CCE",
|
|
182
|
+
fillOpacity: 0.2
|
|
183
|
+
}, this.language = "en", this.polylineOptions = {
|
|
184
|
+
color: "#3071d9",
|
|
185
|
+
opacity: 1,
|
|
186
|
+
weight: 4
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
apiKeyChange(o) {
|
|
190
|
+
mapsindoors.MapsIndoors.setMapsIndoorsApiKey(o);
|
|
191
|
+
}
|
|
192
|
+
gmOptionsChange(o) {
|
|
193
|
+
this.googleMapsInstance.setOptions(o);
|
|
194
|
+
}
|
|
195
|
+
setExternalLinkBehavior(o) {
|
|
196
|
+
o === !0 ? this.mapElement.addEventListener("click", this.preventExternalLink) : this.mapElement.removeEventListener("click", this.preventExternalLink);
|
|
197
|
+
}
|
|
198
|
+
floorSelectorControlPositionChange(o, e) {
|
|
199
|
+
this.floorSelectorInstance && this.setFloorSelectorControl(o, e);
|
|
200
|
+
}
|
|
201
|
+
floorIndexChange(o, e) {
|
|
202
|
+
o === null && (o = "0"), o !== e && o !== this.mapsIndoorsInstance.getFloor() && this.mapsIndoorsInstance.setFloor(o);
|
|
203
|
+
}
|
|
204
|
+
myPositionControlPositionChange(o, e) {
|
|
205
|
+
this.setMyPositionControl(o, e);
|
|
206
|
+
}
|
|
207
|
+
polylineOptionsChange(o) {
|
|
208
|
+
this.directionsRendererInstance && this.directionsRendererInstance.setOptions({
|
|
209
|
+
strokeColor: o.color ? o.color : "#3071d9",
|
|
210
|
+
strokeOpacity: o.opacity ? o.opacity : 1,
|
|
211
|
+
strokeWeight: o.weight ? o.weight : 4
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Get the map instance.
|
|
216
|
+
* @returns {Promise<any>}
|
|
217
|
+
*/
|
|
218
|
+
async getMapInstance() {
|
|
219
|
+
return Promise.resolve(this.googleMapsInstance);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Get the MapsIndoors instance.
|
|
223
|
+
* @returns {Promise<any>}
|
|
224
|
+
*/
|
|
225
|
+
async getMapsIndoorsInstance() {
|
|
226
|
+
return Promise.resolve(this.mapsIndoorsInstance);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Get the MapsIndoors Directions Service Instance.
|
|
230
|
+
* @returns {Promise<any>}
|
|
231
|
+
*/
|
|
232
|
+
async getDirectionsServiceInstance() {
|
|
233
|
+
return Promise.resolve(this.directionsServiceInstance);
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Get the MapsIndoors Directions Renderer Instance.
|
|
237
|
+
* @returns {Promise<any>}
|
|
238
|
+
*/
|
|
239
|
+
async getDirectionsRendererInstance() {
|
|
240
|
+
return Promise.resolve(this.directionsRendererInstance);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Highlight a MapsIndoors location. Only a single location can be highlighted at the time.
|
|
244
|
+
* @param {Location} location
|
|
245
|
+
* @returns {Promise<void>}
|
|
246
|
+
*/
|
|
247
|
+
async highlightLocation(o) {
|
|
248
|
+
this.polygonHighlightOptions && (this.highlightedLocationId && this.highlightedLocationId === o.id || (this.highlightedLocationId && this.mapsIndoorsInstance.setDisplayRule(this.highlightedLocationId, null), this.mapsIndoorsInstance.setDisplayRule(o.id, {
|
|
249
|
+
polygonVisible: !0,
|
|
250
|
+
polygonZoomFrom: "0",
|
|
251
|
+
polygonZoomTo: "22",
|
|
252
|
+
zIndex: 1e3,
|
|
253
|
+
polygonFillColor: this.polygonHighlightOptions.fillColor,
|
|
254
|
+
polygonFillOpacity: this.polygonHighlightOptions.fillOpacity,
|
|
255
|
+
polygonStrokeColor: this.polygonHighlightOptions.strokeColor,
|
|
256
|
+
polygonStrokeOpacity: this.polygonHighlightOptions.strokeOpacity,
|
|
257
|
+
polygonStrokeWeight: this.polygonHighlightOptions.strokeWeight
|
|
258
|
+
}), this.highlightedLocationId = o.id));
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Clear existing MapsIndoors location highlight.
|
|
262
|
+
* @returns {Promise<void>}
|
|
263
|
+
*/
|
|
264
|
+
async clearHighlightLocation() {
|
|
265
|
+
this.highlightedLocationId && (this.mapsIndoorsInstance.setDisplayRule(this.highlightedLocationId, null), this.highlightedLocationId = null);
|
|
266
|
+
}
|
|
267
|
+
async componentDidLoad() {
|
|
268
|
+
await this.loadGoogleMapsApi(), await this.initializeMapsIndoorsSDK(), await this.setupMap(), this.setExternalLinkBehavior(this.disableExternalLinks), this.addEventListeners(), this.floorSelectorControlPosition && this.showFloorSelector(), this.myPositionControlPosition && this.setMyPositionControl(this.myPositionControlPosition);
|
|
269
|
+
}
|
|
270
|
+
disconnectedCallback() {
|
|
271
|
+
this.mapsIndoorsInstance.deallocate(), this.mapElement.remove(), this.mapElement = null;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Load the Google Maps API.
|
|
275
|
+
*
|
|
276
|
+
* @returns {Promise<void>}
|
|
277
|
+
*/
|
|
278
|
+
loadGoogleMapsApi() {
|
|
279
|
+
if (typeof google > "u")
|
|
280
|
+
return new n({
|
|
281
|
+
apiKey: this.gmApiKey,
|
|
282
|
+
version: "quarterly",
|
|
283
|
+
libraries: ["geometry", "places"]
|
|
284
|
+
}).load();
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Ensure that MapsIndoors Web SDK is available.
|
|
288
|
+
*
|
|
289
|
+
* @returns {Promise<void>}
|
|
290
|
+
*/
|
|
291
|
+
initializeMapsIndoorsSDK() {
|
|
292
|
+
return new Promise((o) => {
|
|
293
|
+
if (typeof mapsindoors < "u")
|
|
294
|
+
return mapsindoors.MapsIndoors.setMapsIndoorsApiKey(this.miApiKey), mapsindoors.MapsIndoors.setLanguage(this.language), o();
|
|
295
|
+
const e = document.createElement("script");
|
|
296
|
+
e.setAttribute("type", "text/javascript"), e.setAttribute("src", `${E.miSDKUrlV4}?apikey=${this.miApiKey}`), document.body.appendChild(e), e.onload = () => o();
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Start Google Maps and MapsIndoors.
|
|
301
|
+
*/
|
|
302
|
+
setupMap() {
|
|
303
|
+
return new Promise((o) => {
|
|
304
|
+
const e = Object.assign({ element: this.mapElement }, this.gmOptions), t = new mapsindoors.mapView.GoogleMapsView(e);
|
|
305
|
+
this.googleMapsInstance = t.getMap(), this.mapsIndoorsInstance = new mapsindoors.MapsIndoors({ mapView: t }), this.mapsIndoorsInstance.on("ready", async () => {
|
|
306
|
+
this.floorIndex !== void 0 ? this.mapsIndoorsInstance.setFloor(this.floorIndex) : this.floorIndex = this.mapsIndoorsInstance.getFloor(), this.initializeDirectionsService(), this.initializeDirectionsRenderer(), this.mapsIndoorsReady.emit(), o();
|
|
307
|
+
});
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Initialize MapsIndoors Directions Service.
|
|
312
|
+
*/
|
|
313
|
+
initializeDirectionsService() {
|
|
314
|
+
const o = new mapsindoors.directions.GoogleMapsProvider();
|
|
315
|
+
this.directionsServiceInstance = new mapsindoors.services.DirectionsService(o);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Initialize MapsIndoors Directions Renderer with render options set.
|
|
319
|
+
*/
|
|
320
|
+
initializeDirectionsRenderer() {
|
|
321
|
+
this.directionsRendererInstance = new mapsindoors.directions.DirectionsRenderer({
|
|
322
|
+
mapsIndoors: this.mapsIndoorsInstance,
|
|
323
|
+
fitBounds: !0,
|
|
324
|
+
strokeColor: this.polylineOptions.color,
|
|
325
|
+
strokeOpacity: this.polylineOptions.opacity,
|
|
326
|
+
strokeWeight: this.polylineOptions.weight,
|
|
327
|
+
visible: !0
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Add event listeners and keep properties in sync.
|
|
332
|
+
*/
|
|
333
|
+
addEventListeners() {
|
|
334
|
+
this.mapsIndoorsInstance.on("click", (o) => {
|
|
335
|
+
this.highlightLocation(o);
|
|
336
|
+
}), this.mapsIndoorsInstance.on("floor_changed", (o) => {
|
|
337
|
+
this.floorIndex = o;
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Prevent external links from opening.
|
|
342
|
+
* @param {MouseEvent} event
|
|
343
|
+
*/
|
|
344
|
+
preventExternalLink(o) {
|
|
345
|
+
o.target.closest('a[target="_blank"]') && o.preventDefault();
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Show the floor selector.
|
|
349
|
+
*/
|
|
350
|
+
showFloorSelector() {
|
|
351
|
+
this.setFloorSelectorControl(this.floorSelectorControlPosition);
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Remove a Google Map Control from the map based on class name of the control.
|
|
355
|
+
* @param {string} controlPosition - the position from where to remove the control
|
|
356
|
+
* @param {string} className - the class name of the control to remove
|
|
357
|
+
*/
|
|
358
|
+
removeGoogleMapControl(o, e) {
|
|
359
|
+
const i = this.googleMapsInstance.controls[google.maps.ControlPosition[o]].getArray().findIndex((s) => s.classList.contains(e));
|
|
360
|
+
this.googleMapsInstance.controls[google.maps.ControlPosition[o]].removeAt(i);
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Set, update or unset floor selector on the map.
|
|
364
|
+
* @param {string} controlPosition
|
|
365
|
+
* @param {string} [oldControlPosition=undefined]
|
|
366
|
+
*/
|
|
367
|
+
setFloorSelectorControl(o, e = void 0) {
|
|
368
|
+
o === null ? (this.removeGoogleMapControl(e, "floor-selector"), this.floorSelectorElement = null, this.floorSelectorInstance = null) : this.floorSelectorInstance ? (this.removeGoogleMapControl(e, "floor-selector"), this.googleMapsInstance.controls[google.maps.ControlPosition[o]].push(this.floorSelectorElement)) : (this.floorSelectorElement = document.createElement("div"), this.floorSelectorInstance = new mapsindoors.FloorSelector(this.floorSelectorElement, this.mapsIndoorsInstance), this.googleMapsInstance.controls[google.maps.ControlPosition[o]].push(this.floorSelectorElement));
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Set, update or unset position control on the map.
|
|
372
|
+
* @param {string} controlPosition
|
|
373
|
+
* @param {string} oldControlPosition
|
|
374
|
+
*/
|
|
375
|
+
setMyPositionControl(o, e = void 0) {
|
|
376
|
+
o === null ? (this.removeGoogleMapControl(google.maps.ControlPosition[e], "position-control"), this.positionControlElement = null, this.positionControlInstance = null) : this.positionControlInstance ? (this.removeGoogleMapControl(e, "position-control"), this.googleMapsInstance.controls[google.maps.ControlPosition[o]].push(this.positionControlElement)) : (this.positionControlElement = document.createElement("div"), this.positionControlInstance = new mapsindoors.PositionControl(this.positionControlElement, { mapsIndoors: this.mapsIndoorsInstance, positionOptions: { enableHighAccuracy: !1, maximumAge: 3e5, timeout: 1e4 } }), this.googleMapsInstance.controls[google.maps.ControlPosition[o]].push(this.positionControlElement));
|
|
377
|
+
}
|
|
378
|
+
render() {
|
|
379
|
+
return C("div", { ref: (o) => this.mapElement = o });
|
|
380
|
+
}
|
|
381
|
+
static get watchers() {
|
|
382
|
+
return {
|
|
383
|
+
miApiKey: ["apiKeyChange"],
|
|
384
|
+
gmOptions: ["gmOptionsChange"],
|
|
385
|
+
disableExternalLinks: ["setExternalLinkBehavior"],
|
|
386
|
+
floorSelectorControlPosition: ["floorSelectorControlPositionChange"],
|
|
387
|
+
floorIndex: ["floorIndexChange"],
|
|
388
|
+
myPositionControlPosition: ["myPositionControlPositionChange"],
|
|
389
|
+
polylineOptions: ["polylineOptionsChange"]
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
S.style = y;
|
|
394
|
+
export {
|
|
395
|
+
S as mi_map_googlemaps
|
|
396
|
+
};
|