@wemap/core 14.6.0-beta.4 → 14.6.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/README.md +46 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +421 -338
- package/dist/src/CoreConfig.d.ts +44 -0
- package/dist/src/CoreConfig.d.ts.map +1 -1
- package/dist/src/helpers/SnippetParser.d.ts +2 -0
- package/dist/src/helpers/SnippetParser.d.ts.map +1 -1
- package/dist/src/services/BuildingService.d.ts +4 -2
- package/dist/src/services/BuildingService.d.ts.map +1 -1
- package/dist/src/services/GeocodingService.d.ts +49 -0
- package/dist/src/services/GeocodingService.d.ts.map +1 -0
- package/dist/src/services/HttpClient.d.ts.map +1 -1
- package/dist/src/services/PinpointManager.d.ts +3 -0
- package/dist/src/services/PinpointManager.d.ts.map +1 -1
- package/dist/src/services/PinpointService.d.ts.map +1 -1
- package/dist/src/types/geocoding.d.ts +44 -0
- package/dist/src/types/geocoding.d.ts.map +1 -0
- package/dist/src/types/pinpoint.d.ts +1 -0
- package/dist/src/types/pinpoint.d.ts.map +1 -1
- package/dist/src/types/tags.d.ts +41 -0
- package/dist/src/types/tags.d.ts.map +1 -0
- package/dist/src/utils/map.d.ts +1 -1
- package/dist/src/utils/map.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/vitest.config.d.ts +0 -3
- package/dist/vitest.config.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,270 +1,267 @@
|
|
|
1
|
-
import { BoundingBox, Coordinates } from "@wemap/geo";
|
|
2
|
-
|
|
1
|
+
import { BoundingBox as e, Coordinates as t } from "@wemap/geo";
|
|
2
|
+
//#region src/services/HttpClient.ts
|
|
3
|
+
var n = class extends Error {
|
|
3
4
|
status;
|
|
4
5
|
statusText;
|
|
5
6
|
data;
|
|
6
|
-
constructor(
|
|
7
|
-
super(
|
|
7
|
+
constructor(e, t, n, r) {
|
|
8
|
+
super(r || `HTTP Error ${e}: ${t}`), this.name = "HttpError", this.status = e, this.statusText = t, this.data = n;
|
|
8
9
|
}
|
|
9
|
-
},
|
|
10
|
+
}, r = class {
|
|
10
11
|
config;
|
|
11
|
-
constructor(
|
|
12
|
+
constructor(e) {
|
|
12
13
|
this.config = {
|
|
13
|
-
defaultHeaders: {
|
|
14
|
-
...
|
|
14
|
+
defaultHeaders: {},
|
|
15
|
+
...e
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
|
-
setBaseUrl(
|
|
18
|
-
this.config.baseUrl =
|
|
18
|
+
setBaseUrl(e) {
|
|
19
|
+
this.config.baseUrl = e;
|
|
19
20
|
}
|
|
20
|
-
setDefaultHeaders(
|
|
21
|
+
setDefaultHeaders(e) {
|
|
21
22
|
this.config.defaultHeaders = {
|
|
22
23
|
...this.config.defaultHeaders,
|
|
23
|
-
...
|
|
24
|
+
...e
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
|
-
buildUrl(
|
|
27
|
-
let
|
|
28
|
-
if (!
|
|
29
|
-
let
|
|
30
|
-
return Object.entries(
|
|
31
|
-
|
|
32
|
-
}), `${
|
|
33
|
-
}
|
|
34
|
-
mergeHeaders(
|
|
35
|
-
let
|
|
36
|
-
return this.config.defaultHeaders && Object.entries(this.config.defaultHeaders).forEach(([
|
|
37
|
-
|
|
38
|
-
}),
|
|
39
|
-
|
|
40
|
-
}),
|
|
41
|
-
}
|
|
42
|
-
async parseResponse(
|
|
43
|
-
let
|
|
44
|
-
if (
|
|
45
|
-
if (
|
|
46
|
-
if (
|
|
27
|
+
buildUrl(e, t) {
|
|
28
|
+
let n = e.startsWith("http") ? e : `${this.config.baseUrl}${e.startsWith("/") ? e : `/${e}`}`;
|
|
29
|
+
if (!t || Object.keys(t).length === 0) return n;
|
|
30
|
+
let r = new URLSearchParams();
|
|
31
|
+
return Object.entries(t).forEach(([e, t]) => {
|
|
32
|
+
t != null && r.append(e, String(t));
|
|
33
|
+
}), `${n}${n.includes("?") ? "&" : "?"}${r.toString()}`;
|
|
34
|
+
}
|
|
35
|
+
mergeHeaders(e) {
|
|
36
|
+
let t = new Headers();
|
|
37
|
+
return this.config.defaultHeaders && Object.entries(this.config.defaultHeaders).forEach(([e, n]) => {
|
|
38
|
+
t.set(e, n);
|
|
39
|
+
}), e && Object.entries(e).forEach(([e, n]) => {
|
|
40
|
+
t.set(e, n);
|
|
41
|
+
}), t;
|
|
42
|
+
}
|
|
43
|
+
async parseResponse(e) {
|
|
44
|
+
let t = e.headers.get("content-type") || "";
|
|
45
|
+
if (t.includes("application/json")) return await e.json();
|
|
46
|
+
if (t.includes("text/")) return await e.text();
|
|
47
|
+
if (t.includes("application/octet-stream") || t.includes("application/pdf")) return await e.blob();
|
|
47
48
|
try {
|
|
48
|
-
return await
|
|
49
|
+
return await e.json();
|
|
49
50
|
} catch {
|
|
50
|
-
return await
|
|
51
|
+
return await e.text();
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
async handleError(
|
|
54
|
-
let
|
|
54
|
+
async handleError(e) {
|
|
55
|
+
let t;
|
|
55
56
|
try {
|
|
56
|
-
|
|
57
|
+
t = await this.parseResponse(e);
|
|
57
58
|
} catch {
|
|
58
|
-
|
|
59
|
+
t = await e.text().catch(() => null);
|
|
59
60
|
}
|
|
60
|
-
throw new
|
|
61
|
+
throw new n(e.status, e.statusText, t, `HTTP ${e.status}: ${e.statusText}`);
|
|
61
62
|
}
|
|
62
|
-
createAbortController(
|
|
63
|
-
if (!
|
|
64
|
-
let
|
|
63
|
+
createAbortController(e) {
|
|
64
|
+
if (!e && !this.config.timeout) return null;
|
|
65
|
+
let t = new AbortController(), n = e || this.config.timeout || 3e4;
|
|
65
66
|
return setTimeout(() => {
|
|
66
|
-
|
|
67
|
-
},
|
|
67
|
+
t.abort();
|
|
68
|
+
}, n), t;
|
|
68
69
|
}
|
|
69
|
-
async request(
|
|
70
|
-
let { method:
|
|
70
|
+
async request(e, t = {}) {
|
|
71
|
+
let { method: r = "GET", headers: i, body: a, params: o, timeout: s } = t, c = this.buildUrl(e, o), l = new Headers(this.mergeHeaders(i)), u = this.createAbortController(s);
|
|
71
72
|
try {
|
|
72
|
-
let
|
|
73
|
-
method:
|
|
74
|
-
headers:
|
|
75
|
-
signal:
|
|
73
|
+
let e = {
|
|
74
|
+
method: r,
|
|
75
|
+
headers: l,
|
|
76
|
+
signal: u?.signal
|
|
76
77
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
let E = await fetch(N, s);
|
|
85
|
-
return E.ok || await this.handleError(E), {
|
|
86
|
-
data: await this.parseResponse(E),
|
|
87
|
-
status: E.status,
|
|
88
|
-
statusText: E.statusText,
|
|
89
|
-
headers: E.headers
|
|
78
|
+
a !== void 0 && r !== "GET" ? typeof a == "string" ? (e.body = a, l.has("Content-Type") || l.set("Content-Type", "application/json")) : a instanceof FormData ? (e.body = a, l.delete("Content-Type")) : a instanceof Blob ? (e.body = a, !l.has("Content-Type") && a.type && l.set("Content-Type", a.type)) : (e.body = JSON.stringify(a), l.has("Content-Type") || l.set("Content-Type", "application/json")) : l.delete("Content-Type");
|
|
79
|
+
let t = await fetch(c, e);
|
|
80
|
+
return t.ok || await this.handleError(t), {
|
|
81
|
+
data: await this.parseResponse(t),
|
|
82
|
+
status: t.status,
|
|
83
|
+
statusText: t.statusText,
|
|
84
|
+
headers: t.headers
|
|
90
85
|
};
|
|
91
|
-
} catch (
|
|
92
|
-
throw
|
|
86
|
+
} catch (e) {
|
|
87
|
+
throw e instanceof n ? e : e instanceof Error && e.name === "AbortError" ? new n(408, "Request Timeout", null, `Request timeout after ${s || this.config.timeout || 3e4}ms`) : new n(0, "Network Error", null, e instanceof Error ? e.message : "Unknown error occurred");
|
|
93
88
|
}
|
|
94
89
|
}
|
|
95
|
-
async get(
|
|
96
|
-
return this.request(
|
|
97
|
-
...
|
|
90
|
+
async get(e, t) {
|
|
91
|
+
return this.request(e, {
|
|
92
|
+
...t,
|
|
98
93
|
method: "GET"
|
|
99
94
|
});
|
|
100
95
|
}
|
|
101
|
-
async post(
|
|
102
|
-
return this.request(
|
|
103
|
-
...
|
|
96
|
+
async post(e, t, n) {
|
|
97
|
+
return this.request(e, {
|
|
98
|
+
...n,
|
|
104
99
|
method: "POST",
|
|
105
|
-
body:
|
|
100
|
+
body: t
|
|
106
101
|
});
|
|
107
102
|
}
|
|
108
|
-
async put(
|
|
109
|
-
return this.request(
|
|
110
|
-
...
|
|
103
|
+
async put(e, t, n) {
|
|
104
|
+
return this.request(e, {
|
|
105
|
+
...n,
|
|
111
106
|
method: "PUT",
|
|
112
|
-
body:
|
|
107
|
+
body: t
|
|
113
108
|
});
|
|
114
109
|
}
|
|
115
|
-
async patch(
|
|
116
|
-
return this.request(
|
|
117
|
-
...
|
|
110
|
+
async patch(e, t, n) {
|
|
111
|
+
return this.request(e, {
|
|
112
|
+
...n,
|
|
118
113
|
method: "PATCH",
|
|
119
|
-
body:
|
|
114
|
+
body: t
|
|
120
115
|
});
|
|
121
116
|
}
|
|
122
|
-
async delete(
|
|
123
|
-
return this.request(
|
|
124
|
-
...
|
|
117
|
+
async delete(e, t) {
|
|
118
|
+
return this.request(e, {
|
|
119
|
+
...t,
|
|
125
120
|
method: "DELETE"
|
|
126
121
|
});
|
|
127
122
|
}
|
|
128
|
-
},
|
|
123
|
+
}, i = class {
|
|
129
124
|
httpClient;
|
|
130
|
-
constructor(
|
|
131
|
-
this.httpClient = new
|
|
125
|
+
constructor(e) {
|
|
126
|
+
this.httpClient = new r({ baseUrl: e });
|
|
132
127
|
}
|
|
133
|
-
async fetchLivemap(
|
|
134
|
-
return (await this.httpClient.get(`/livemaps/${
|
|
128
|
+
async fetchLivemap(e) {
|
|
129
|
+
return (await this.httpClient.get(`/livemaps/${e}`)).data;
|
|
135
130
|
}
|
|
136
|
-
},
|
|
131
|
+
}, a = class e {
|
|
137
132
|
static MIN_BBOX_SIZE = 3e3;
|
|
138
133
|
static PAGE_SIZE = 20;
|
|
139
134
|
http;
|
|
140
135
|
emmid;
|
|
141
136
|
buildings = /* @__PURE__ */ new Map();
|
|
142
137
|
cachedBbox = null;
|
|
143
|
-
constructor(
|
|
144
|
-
this.http = new
|
|
145
|
-
}
|
|
146
|
-
async getBuildingsFromBbox(
|
|
147
|
-
if (!(this.cachedBbox?.contains(
|
|
148
|
-
let
|
|
149
|
-
for (let
|
|
150
|
-
this.cachedBbox =
|
|
138
|
+
constructor(e, t) {
|
|
139
|
+
this.http = new r({ baseUrl: e }), this.emmid = String(t);
|
|
140
|
+
}
|
|
141
|
+
async getBuildingsFromBbox(t) {
|
|
142
|
+
if (!(this.cachedBbox?.contains(t.getNorthWest()) && this.cachedBbox?.contains(t.getSouthEast()))) {
|
|
143
|
+
let n = e.MIN_BBOX_SIZE / 2, r = t.extend(t.center.destinationPoint(n, 0)).extend(t.center.destinationPoint(n, Math.PI / 2)).extend(t.center.destinationPoint(n, Math.PI)).extend(t.center.destinationPoint(n, 3 * Math.PI / 2));
|
|
144
|
+
for (let e of await this.fetchAll()) e.id != null && this.buildings.set(Number(e.id), e);
|
|
145
|
+
this.cachedBbox = r;
|
|
151
146
|
}
|
|
152
|
-
return this.intersecting(
|
|
147
|
+
return this.intersecting(t);
|
|
153
148
|
}
|
|
154
|
-
intersecting(
|
|
155
|
-
let
|
|
156
|
-
for (let
|
|
157
|
-
return
|
|
149
|
+
intersecting(e) {
|
|
150
|
+
let t = e.toArray(), n = [];
|
|
151
|
+
for (let e of this.buildings.values()) e.bbox && o(t, e.bbox) && n.push(e);
|
|
152
|
+
return n;
|
|
158
153
|
}
|
|
159
154
|
async fetchAll() {
|
|
160
|
-
let
|
|
155
|
+
let t = [], n = 0, r = 0;
|
|
161
156
|
do {
|
|
162
|
-
let { data:
|
|
157
|
+
let { data: i } = await this.http.get("/buildings/search", { params: {
|
|
163
158
|
livemap: this.emmid,
|
|
164
|
-
limit:
|
|
165
|
-
offset:
|
|
159
|
+
limit: e.PAGE_SIZE,
|
|
160
|
+
offset: r
|
|
166
161
|
} });
|
|
167
|
-
|
|
168
|
-
} while (
|
|
169
|
-
return
|
|
162
|
+
n ||= i.count, t.push(...i.results), r += e.PAGE_SIZE;
|
|
163
|
+
} while (t.length < n);
|
|
164
|
+
return t;
|
|
170
165
|
}
|
|
171
166
|
};
|
|
172
|
-
function
|
|
173
|
-
return
|
|
167
|
+
function o(e, t) {
|
|
168
|
+
return e[0] <= t[2] && e[2] >= t[0] && e[1] <= t[3] && e[3] >= t[1];
|
|
174
169
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
let
|
|
179
|
-
|
|
180
|
-
let
|
|
181
|
-
|
|
182
|
-
let
|
|
183
|
-
return
|
|
184
|
-
},
|
|
185
|
-
if (!
|
|
186
|
-
let
|
|
187
|
-
return
|
|
188
|
-
},
|
|
189
|
-
let
|
|
190
|
-
return
|
|
191
|
-
center_latitude: parseFloat(
|
|
192
|
-
center_longitude: parseFloat(
|
|
193
|
-
latitude_delta: parseFloat(
|
|
194
|
-
longitude_delta: parseFloat(
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region src/utils/validators.ts
|
|
172
|
+
var s = (e) => typeof e == "string", c = (e) => typeof e == "number", l = (e) => e != null, u = (e) => typeof e == "object" && !!e, d = new e(new t(85, 170), new t(-85, -170)), f = 5, p = (n) => {
|
|
173
|
+
let r = n.getSouthWest(), i = n.getNorthEast(), a = r.lat, o = r.lng, s = i.lat, c = i.lng;
|
|
174
|
+
o > c && (o = -(180 - o + 180));
|
|
175
|
+
let l = new t(0, 0);
|
|
176
|
+
l.autoWrap = !1, l.lat = s, l.lng = c;
|
|
177
|
+
let u = new t(0, 0);
|
|
178
|
+
return u.autoWrap = !1, u.lat = a, u.lng = o, new e(l, u);
|
|
179
|
+
}, m = (n) => {
|
|
180
|
+
if (!n) return d;
|
|
181
|
+
let r = new t(Number(n.latitude) - Number(n.latitude_delta), Number(n.longitude) - Number(n.longitude_delta));
|
|
182
|
+
return p(new e(new t(Number(n.latitude) + Number(n.latitude_delta), Number(n.longitude) + Number(n.longitude_delta)), r));
|
|
183
|
+
}, h = (e) => {
|
|
184
|
+
let t, n, r, i, a = f;
|
|
185
|
+
return t = Math.max(e.center.lat, -180), t = Math.min(t, 180).toFixed(a), n = Math.max(e.center.lng, -180), n = Math.min(n, 180).toFixed(a), r = Math.abs(e.getNorth() - e.getSouth()), r /= 2, r = Math.min(r, 90).toFixed(a), i = Math.abs(e.getEast() - e.getWest()), i /= 2, i = Math.min(i, 180).toFixed(a), {
|
|
186
|
+
center_latitude: parseFloat(t),
|
|
187
|
+
center_longitude: parseFloat(n),
|
|
188
|
+
latitude_delta: parseFloat(r),
|
|
189
|
+
longitude_delta: parseFloat(i)
|
|
195
190
|
};
|
|
196
|
-
},
|
|
197
|
-
if (
|
|
198
|
-
if (Array.isArray(
|
|
199
|
-
let [
|
|
200
|
-
return new
|
|
201
|
-
}
|
|
202
|
-
let
|
|
203
|
-
if ("altitude" in
|
|
204
|
-
return new
|
|
205
|
-
}
|
|
206
|
-
var PinpointService = class s {
|
|
191
|
+
}, g = (e) => {
|
|
192
|
+
if (e instanceof t) return e;
|
|
193
|
+
if (Array.isArray(e)) {
|
|
194
|
+
let [n, r, i] = e;
|
|
195
|
+
return new t(n, r, null, i);
|
|
196
|
+
}
|
|
197
|
+
let n = "lat" in e ? e.lat : e.latitude, r = "lng" in e ? e.lng : e.longitude, i = "level" in e ? e.level : null, a = "alt" in e ? e.alt : null;
|
|
198
|
+
if ("altitude" in e && (a = e.altitude), !c(n) || !c(r)) throw Error("Cannot parse lat/lng in" + JSON.stringify(e));
|
|
199
|
+
return new t(n, r, c(a) ? a : null, c(i) ? i : null);
|
|
200
|
+
}, _ = class e {
|
|
207
201
|
static PAGE_SIZE = 400;
|
|
208
202
|
http;
|
|
209
203
|
emmid;
|
|
210
|
-
constructor(
|
|
211
|
-
this.http = new
|
|
204
|
+
constructor(e, t) {
|
|
205
|
+
this.http = new r({ baseUrl: e }), this.emmid = String(t);
|
|
212
206
|
}
|
|
213
|
-
async search(
|
|
214
|
-
let
|
|
207
|
+
async search(e) {
|
|
208
|
+
let t = this.buildSearchParams(e), { data: n } = await this.http.get("/pinpoints/search", { params: t });
|
|
215
209
|
return {
|
|
216
|
-
count:
|
|
217
|
-
items:
|
|
218
|
-
next:
|
|
219
|
-
previous:
|
|
220
|
-
query:
|
|
210
|
+
count: n.count,
|
|
211
|
+
items: n.results.map(v),
|
|
212
|
+
next: n.next,
|
|
213
|
+
previous: n.previous,
|
|
214
|
+
query: t
|
|
221
215
|
};
|
|
222
216
|
}
|
|
223
|
-
async getById(
|
|
224
|
-
let { data:
|
|
225
|
-
return
|
|
217
|
+
async getById(e) {
|
|
218
|
+
let { data: t } = await this.http.get(`/pinpoints/${e}`);
|
|
219
|
+
return v(t);
|
|
226
220
|
}
|
|
227
221
|
async getAll() {
|
|
228
|
-
let
|
|
222
|
+
let t = [], n = 0, r = 0;
|
|
229
223
|
do {
|
|
230
|
-
let { data:
|
|
224
|
+
let { data: i } = await this.http.get("/pinpoints/search", { params: {
|
|
231
225
|
livemap: this.emmid,
|
|
232
|
-
limit:
|
|
233
|
-
offset:
|
|
226
|
+
limit: e.PAGE_SIZE,
|
|
227
|
+
offset: r
|
|
234
228
|
} });
|
|
235
|
-
|
|
236
|
-
} while (
|
|
237
|
-
return
|
|
229
|
+
n ||= i.count, t.push(...i.results.map(v)), r += e.PAGE_SIZE;
|
|
230
|
+
} while (r < n);
|
|
231
|
+
return t;
|
|
238
232
|
}
|
|
239
|
-
buildSearchParams(
|
|
240
|
-
let
|
|
233
|
+
buildSearchParams(e) {
|
|
234
|
+
let t = {
|
|
241
235
|
livemap: this.emmid,
|
|
242
236
|
query_mode: "phrase",
|
|
243
|
-
center_latitude:
|
|
244
|
-
center_longitude:
|
|
245
|
-
latitude_delta:
|
|
246
|
-
longitude_delta:
|
|
237
|
+
center_latitude: e.center_latitude,
|
|
238
|
+
center_longitude: e.center_longitude,
|
|
239
|
+
latitude_delta: e.latitude_delta,
|
|
240
|
+
longitude_delta: e.longitude_delta
|
|
247
241
|
};
|
|
248
|
-
return
|
|
242
|
+
return e.query && (t.query = e.query), e.tags !== void 0 && (t.tags = Array.isArray(e.tags) ? e.tags.join(",") : e.tags), e.levels === void 0 ? e.level !== void 0 && (t.levels = `null,${e.level}`) : t.levels = e.levels, e.limit !== void 0 && (t.limit = e.limit), e.offset !== void 0 && (t.offset = e.offset), t;
|
|
249
243
|
}
|
|
250
244
|
};
|
|
251
|
-
function
|
|
245
|
+
function v(e) {
|
|
252
246
|
return {
|
|
253
|
-
id:
|
|
254
|
-
name:
|
|
255
|
-
...
|
|
256
|
-
latitude:
|
|
257
|
-
longitude:
|
|
258
|
-
...
|
|
259
|
-
...
|
|
260
|
-
...
|
|
261
|
-
...
|
|
262
|
-
...
|
|
263
|
-
...
|
|
264
|
-
|
|
247
|
+
id: e.id,
|
|
248
|
+
name: e.name,
|
|
249
|
+
...e.description ? { description: e.description } : {},
|
|
250
|
+
latitude: e.latitude,
|
|
251
|
+
longitude: e.longitude,
|
|
252
|
+
...e.level === void 0 ? {} : { level: e.level },
|
|
253
|
+
...e.altitude === void 0 ? {} : { altitude: e.altitude },
|
|
254
|
+
...e.tags ? { tags: e.tags } : {},
|
|
255
|
+
...e.category === void 0 ? {} : { category: e.category },
|
|
256
|
+
...e.image_url ? { image_url: e.image_url } : {},
|
|
257
|
+
...e.media_url ? { media_url: e.media_url } : {},
|
|
258
|
+
...e.address ? { address: e.address } : {},
|
|
259
|
+
external_data: e.external_data ?? null
|
|
265
260
|
};
|
|
266
261
|
}
|
|
267
|
-
|
|
262
|
+
//#endregion
|
|
263
|
+
//#region src/services/PinpointCache.ts
|
|
264
|
+
var y = class e {
|
|
268
265
|
static MIN_BBOX_SIZE = 3e3;
|
|
269
266
|
static PAGE_SIZE = 400;
|
|
270
267
|
static instances = /* @__PURE__ */ new Map();
|
|
@@ -272,85 +269,85 @@ var PinpointCache = class s {
|
|
|
272
269
|
service;
|
|
273
270
|
pinpoints = /* @__PURE__ */ new Map();
|
|
274
271
|
cachedBboxByLevel = /* @__PURE__ */ new Map();
|
|
275
|
-
constructor(
|
|
276
|
-
this.service =
|
|
272
|
+
constructor(e) {
|
|
273
|
+
this.service = e;
|
|
277
274
|
}
|
|
278
|
-
static forLivemap(
|
|
279
|
-
let
|
|
280
|
-
|
|
281
|
-
let
|
|
282
|
-
return
|
|
275
|
+
static forLivemap(t, n) {
|
|
276
|
+
let r = `${t}:${n}`;
|
|
277
|
+
e.refCounts.set(r, (e.refCounts.get(r) ?? 0) + 1);
|
|
278
|
+
let i = e.instances.get(r);
|
|
279
|
+
return i || (i = new e(new _(t, n)), e.instances.set(r, i)), i;
|
|
283
280
|
}
|
|
284
|
-
static release(
|
|
285
|
-
let
|
|
286
|
-
|
|
281
|
+
static release(t, n) {
|
|
282
|
+
let r = `${t}:${n}`, i = (e.refCounts.get(r) ?? 1) - 1;
|
|
283
|
+
i <= 0 ? (e.refCounts.delete(r), e.instances.delete(r)) : e.refCounts.set(r, i);
|
|
287
284
|
}
|
|
288
|
-
upsert(
|
|
289
|
-
for (let
|
|
285
|
+
upsert(e) {
|
|
286
|
+
for (let t of e) this.pinpoints.set(t.id, t);
|
|
290
287
|
}
|
|
291
|
-
search(
|
|
292
|
-
return this.service.search(
|
|
288
|
+
search(e) {
|
|
289
|
+
return this.service.search(e);
|
|
293
290
|
}
|
|
294
291
|
async getAll() {
|
|
295
|
-
let
|
|
296
|
-
return this.upsert(
|
|
292
|
+
let e = await this.service.getAll();
|
|
293
|
+
return this.upsert(e), e;
|
|
297
294
|
}
|
|
298
|
-
getCachedById(
|
|
299
|
-
return this.pinpoints.get(
|
|
295
|
+
getCachedById(e) {
|
|
296
|
+
return this.pinpoints.get(e);
|
|
300
297
|
}
|
|
301
298
|
getLoaded() {
|
|
302
299
|
return [...this.pinpoints.values()];
|
|
303
300
|
}
|
|
304
301
|
getCachedBbox() {
|
|
305
|
-
let
|
|
306
|
-
return
|
|
302
|
+
let e = [...this.cachedBboxByLevel.values()];
|
|
303
|
+
return e.length === 0 ? null : e.slice(1).reduce((e, t) => e.extend(t), e[0]);
|
|
307
304
|
}
|
|
308
|
-
async getById(
|
|
309
|
-
let
|
|
310
|
-
if (
|
|
305
|
+
async getById(e) {
|
|
306
|
+
let t = this.pinpoints.get(e);
|
|
307
|
+
if (t) return t;
|
|
311
308
|
try {
|
|
312
|
-
let
|
|
313
|
-
return this.pinpoints.set(
|
|
309
|
+
let t = await this.service.getById(e);
|
|
310
|
+
return this.pinpoints.set(t.id, t), t;
|
|
314
311
|
} catch {
|
|
315
312
|
return null;
|
|
316
313
|
}
|
|
317
314
|
}
|
|
318
|
-
async preloadViewport(
|
|
319
|
-
let
|
|
320
|
-
if (
|
|
321
|
-
let
|
|
322
|
-
...
|
|
323
|
-
...
|
|
324
|
-
},
|
|
315
|
+
async preloadViewport(t, n) {
|
|
316
|
+
let r = n ?? null, i = this.cachedBboxByLevel.get(r);
|
|
317
|
+
if (i?.contains(t.getNorthWest()) && i?.contains(t.getSouthEast())) return;
|
|
318
|
+
let a = e.MIN_BBOX_SIZE / 2, o = t.extend(t.center.destinationPoint(a, 0)).extend(t.center.destinationPoint(a, Math.PI / 2)).extend(t.center.destinationPoint(a, Math.PI)).extend(t.center.destinationPoint(a, 3 * Math.PI / 2)), s = {
|
|
319
|
+
...h(o),
|
|
320
|
+
...n == null ? {} : { level: n }
|
|
321
|
+
}, c = 0, l = 0;
|
|
325
322
|
do {
|
|
326
|
-
let
|
|
327
|
-
...
|
|
328
|
-
limit:
|
|
329
|
-
offset:
|
|
323
|
+
let t = await this.service.search({
|
|
324
|
+
...s,
|
|
325
|
+
limit: e.PAGE_SIZE,
|
|
326
|
+
offset: c
|
|
330
327
|
});
|
|
331
|
-
|
|
332
|
-
} while (
|
|
333
|
-
this.cachedBboxByLevel.set(
|
|
328
|
+
l ||= t.count, this.upsert(t.items), c += e.PAGE_SIZE;
|
|
329
|
+
} while (c < l);
|
|
330
|
+
this.cachedBboxByLevel.set(r, o);
|
|
334
331
|
}
|
|
335
|
-
},
|
|
332
|
+
}, b = class {
|
|
336
333
|
cache;
|
|
337
334
|
baseUrl;
|
|
338
335
|
emmid;
|
|
339
|
-
constructor(
|
|
340
|
-
this.baseUrl =
|
|
336
|
+
constructor(e, t) {
|
|
337
|
+
this.baseUrl = e, this.emmid = t, this.cache = y.forLivemap(e, t);
|
|
341
338
|
}
|
|
342
|
-
async search(
|
|
343
|
-
let
|
|
344
|
-
return this.cache.upsert(
|
|
339
|
+
async search(e) {
|
|
340
|
+
let t = await this.cache.search(e);
|
|
341
|
+
return this.cache.upsert(t.items), t;
|
|
345
342
|
}
|
|
346
343
|
getAll() {
|
|
347
344
|
return this.cache.getAll();
|
|
348
345
|
}
|
|
349
|
-
getById(
|
|
350
|
-
return this.cache.getById(
|
|
346
|
+
getById(e) {
|
|
347
|
+
return this.cache.getById(e);
|
|
351
348
|
}
|
|
352
|
-
preloadViewport(
|
|
353
|
-
return this.cache.preloadViewport(
|
|
349
|
+
preloadViewport(e, t) {
|
|
350
|
+
return this.cache.preloadViewport(e, t);
|
|
354
351
|
}
|
|
355
352
|
getLoadedPinpoints() {
|
|
356
353
|
return this.cache.getLoaded();
|
|
@@ -359,164 +356,250 @@ var PinpointCache = class s {
|
|
|
359
356
|
return this.cache.getCachedBbox();
|
|
360
357
|
}
|
|
361
358
|
release() {
|
|
362
|
-
|
|
359
|
+
y.release(this.baseUrl, this.emmid);
|
|
360
|
+
}
|
|
361
|
+
}, x = "https://geocoding.getwemap.workers.dev", S = class {
|
|
362
|
+
http;
|
|
363
|
+
defaults;
|
|
364
|
+
constructor(e = {}) {
|
|
365
|
+
let { baseUrl: t = x, language: n, region: i, bbox: a } = e;
|
|
366
|
+
this.http = new r({ baseUrl: t }), this.defaults = {
|
|
367
|
+
...n === void 0 ? {} : { language: n },
|
|
368
|
+
...i === void 0 ? {} : { region: i },
|
|
369
|
+
...a === void 0 ? {} : { bbox: a }
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
async search(e, t) {
|
|
373
|
+
let n = await this.fetchFeatures(this.buildSearchParams(e, t));
|
|
374
|
+
return n.length > 0 ? C(n[0]) : null;
|
|
375
|
+
}
|
|
376
|
+
async searchMultiple(e, t) {
|
|
377
|
+
return (await this.fetchFeatures(this.buildSearchParams(e, t))).map(C);
|
|
363
378
|
}
|
|
364
|
-
|
|
379
|
+
async reverseGeocode(e, t, n) {
|
|
380
|
+
let r = {
|
|
381
|
+
latitude: e,
|
|
382
|
+
longitude: t
|
|
383
|
+
}, i = n?.language ?? this.defaults.language;
|
|
384
|
+
i !== void 0 && (r.language = i);
|
|
385
|
+
let a = await this.fetchFeatures(r);
|
|
386
|
+
return a.length > 0 ? C(a[0]) : null;
|
|
387
|
+
}
|
|
388
|
+
buildSearchParams(e, t) {
|
|
389
|
+
let n = t?.language ?? this.defaults.language, r = t?.region ?? this.defaults.region, i = t?.bbox ?? this.defaults.bbox, a = { query: e };
|
|
390
|
+
return n !== void 0 && (a.language = n), r !== void 0 && (a.region = r), i !== void 0 && (a.bbox = i.join(",")), a;
|
|
391
|
+
}
|
|
392
|
+
async fetchFeatures(e) {
|
|
393
|
+
let { data: t } = await this.http.get("/", { params: e });
|
|
394
|
+
return t.features ?? [];
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
function C(e) {
|
|
398
|
+
let [t, n] = e.center;
|
|
399
|
+
return {
|
|
400
|
+
id: e.id,
|
|
401
|
+
placeType: e.place_type,
|
|
402
|
+
relevance: e.relevance,
|
|
403
|
+
text: e.text,
|
|
404
|
+
placeName: e.place_name,
|
|
405
|
+
...e.language === void 0 ? {} : { language: e.language },
|
|
406
|
+
latitude: n,
|
|
407
|
+
longitude: t,
|
|
408
|
+
...e.bbox === void 0 ? {} : { bbox: e.bbox }
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
var w = {
|
|
365
412
|
properties: /* @__PURE__ */ JSON.parse("{\"actionbuttons\":{\"default\":{\"withlabel\":false},\"description\":\"Configuration relative to the action buttons\",\"properties\":{\"withlabel\":{\"default\":false,\"description\":\"Enable label on action buttons\",\"type\":\"boolean\"}},\"type\":\"object\"},\"analytics\":{\"default\":null,\"description\":\"Parameters relative to analytics\",\"type\":\"object\",\"properties\":{\"gtagIDs\":{\"default\":[],\"description\":\"Gtag IDs to configure\",\"type\":\"array\",\"items\":{\"type\":\"string\"}}}},\"arnavigationdata\":{\"default\":{\"arRadius\":1000,\"audio\":false,\"maxDistanceNavigation\":10000,\"default\":\"outdoor\",\"cursorVisible\":true,\"cursorTimeout\":1000,\"mapFooter\":false,\"indoor\":{\"accuracyThreshold\":8,\"end\":{\"geofence\":5,\"visibleDistance\":200},\"instructions\":{\"geofence\":3,\"maxDistance\":10,\"minAlt\":1,\"opacityDistanceStart\":10,\"realSizeScale\":1,\"scale\":0.06,\"audioDistance\":10},\"itinerary\":{\"sampling\":1.6,\"opacityDistanceEnd\":15,\"arrowTargetDistance\":5},\"mapmatching\":{\"network\":null,\"maxAngleBearing\":30,\"maxDistance\":15,\"minDistance\":1,\"useItineraryStartAsPosition\":false,\"useOrientationMatching\":true,\"useStrict\":false,\"hugeJumpDistance\":3,\"minStepsBetweenOrientationMatching\":3,\"minStepsForOrientationMatching\":5,\"lastProjectionsWindowSize\":3,\"lastProjectionsEdgeAngleThreshold\":3,\"disableMMCloseToATurnDistance\":2},\"multilevel\":{\"geofenceDisableNav\":3},\"pinpoints\":{\"scale\":0.09,\"updateDistance\":30,\"minDistance\":1,\"overlap\":false,\"label\":true}},\"outdoor\":{\"accuracyThreshold\":25,\"end\":{\"geofence\":15,\"visibleDistance\":200},\"instructions\":{\"geofence\":10,\"maxDistance\":40,\"minAlt\":1.5,\"opacityDistanceStart\":20,\"realSizeScale\":3,\"scale\":0.03,\"audioDistance\":30},\"itinerary\":{\"sampling\":1.6,\"opacityDistanceEnd\":30,\"arrowTargetDistance\":10},\"mapmatching\":{\"network\":null,\"maxAngleBearing\":30,\"maxDistance\":50,\"minDistance\":0,\"useItineraryStartAsPosition\":false,\"useOrientationMatching\":true,\"useStrict\":false,\"hugeJumpDistance\":3,\"minStepsBetweenOrientationMatching\":3,\"minStepsForOrientationMatching\":5,\"lastProjectionsWindowSize\":3,\"lastProjectionsEdgeAngleThreshold\":3,\"disableMMCloseToATurnDistance\":2},\"multilevel\":{\"geofenceDisableNav\":3},\"pinpoints\":{\"scale\":0.09,\"updateDistance\":30,\"minDistance\":1,\"overlap\":false,\"label\":true}},\"providers\":{\"blacklist\":[],\"gnssWifi\":{\"discardPositionsAbove\":50,\"enableHighAccuracy\":true},\"polestarkey\":null,\"straightLineDetector\":{\"stepsConsideredForStraightLine\":2},\"stepDetector\":{\"algorithm\":\"minMaxPeaks2\",\"stepSizeMultiplier\":1,\"minMaxPeaks2\":null,\"minMaxPeaks3\":null},\"useMapMatching\":true,\"usePositionSmoother\":true,\"useAllAbsolutePositions\":false,\"vps\":null,\"whitelist\":[]},\"visibleTags\":[]},\"description\":\"Configuration relative to the AR navigation \",\"properties\":{\"arRadius\":{\"default\":1000,\"description\":\"Maximum distance for the displayed pinpoints in AR view (in meters)\",\"type\":\"integer\"},\"default\":{\"default\":\"outdoor\",\"description\":\"The default value for the ar navigation parameters\",\"type\":\"string\"},\"audio\":{\"default\":false,\"description\":\"If the user should be guided with audio\",\"type\":\"boolean\"},\"cursorVisible\":{\"default\":true,\"description\":\"If the cursor should be visible\",\"type\":\"boolean\"},\"cursorTimeout\":{\"default\":1000,\"description\":\"The timeout to open a pinpoint with the cursor\",\"type\":\"number\"},\"maxDistanceNavigation\":{\"default\":10000,\"description\":\"The max distance where the navigation is started directly\",\"type\":\"number\"},\"mapFooter\":{\"default\":false,\"description\":\"If the map should be shown at footer on navigation\",\"type\":\"boolean\"},\"indoor\":{\"default\":{\"accuracyThreshold\":8,\"end\":{\"geofence\":5,\"visibleDistance\":200},\"instructions\":{\"geofence\":3,\"maxDistance\":10,\"minAlt\":1,\"opacityDistanceStart\":10,\"realSizeScale\":1,\"scale\":0.06,\"audioDistance\":10},\"itinerary\":{\"sampling\":1.6,\"opacityDistanceEnd\":15,\"arrowTargetDistance\":5},\"mapmatching\":{\"network\":null,\"maxAngleBearing\":30,\"maxDistance\":15,\"minDistance\":1,\"useItineraryStartAsPosition\":false,\"useOrientationMatching\":true,\"useStrict\":false,\"hugeJumpDistance\":3,\"minStepsBetweenOrientationMatching\":3,\"minStepsForOrientationMatching\":5,\"lastProjectionsWindowSize\":3,\"lastProjectionsEdgeAngleThreshold\":3,\"disableMMCloseToATurnDistance\":2},\"multilevel\":{\"geofenceDisableNav\":3},\"pinpoints\":{\"scale\":0.09,\"updateDistance\":30,\"minDistance\":1,\"overlap\":false,\"label\":true}},\"properties\":{\"accuracyThreshold\":{\"default\":8,\"type\":\"integer\"},\"end\":{\"default\":{\"geofence\":5,\"visibleDistance\":200},\"type\":\"object\",\"properties\":{\"geofence\":{\"type\":\"integer\",\"default\":5},\"visibleDistance\":{\"type\":\"integer\",\"default\":200}}},\"instructions\":{\"default\":{\"geofence\":3,\"maxDistance\":10,\"minAlt\":1,\"opacityDistanceStart\":10,\"realSizeScale\":1,\"scale\":0.06,\"audioDistance\":10},\"type\":\"object\",\"properties\":{\"geofence\":{\"type\":\"integer\",\"default\":3},\"maxDistance\":{\"type\":\"integer\",\"description\":\"Distance from which the instruction will be display instead of banner with meters\",\"default\":10},\"minAlt\":{\"type\":\"integer\",\"default\":1},\"opacityDistanceStart\":{\"type\":\"integer\",\"default\":10},\"realSizeScale\":{\"type\":\"integer\",\"default\":1},\"scale\":{\"type\":\"number\",\"default\":0.06},\"audioDistance\":{\"type\":\"integer\",\"description\":\"Distance from which the audio will be triggered between 2 steps\",\"default\":10}}},\"itinerary\":{\"default\":{\"sampling\":1.6,\"opacityDistanceEnd\":15,\"arrowTargetDistance\":5},\"type\":\"object\",\"properties\":{\"sampling\":{\"type\":\"integer\",\"default\":1.6},\"opacityDistanceEnd\":{\"type\":\"integer\",\"default\":15},\"arrowTargetDistance\":{\"type\":\"integer\",\"default\":5}}},\"mapmatching\":{\"default\":{\"network\":null,\"maxAngleBearing\":30,\"maxDistance\":15,\"minDistance\":1,\"useItineraryStartAsPosition\":false,\"useOrientationMatching\":true,\"useStrict\":false,\"hugeJumpDistance\":3,\"minStepsBetweenOrientationMatching\":3,\"minStepsForOrientationMatching\":5,\"lastProjectionsWindowSize\":3,\"lastProjectionsEdgeAngleThreshold\":3,\"disableMMCloseToATurnDistance\":2},\"type\":\"object\",\"properties\":{\"network\":{\"type\":\"string\",\"description\":\"Network to use outside a navigation\",\"default\":null},\"maxAngleBearing\":{\"type\":\"integer\",\"default\":30},\"maxDistance\":{\"type\":\"integer\",\"default\":15},\"minDistance\":{\"type\":\"integer\",\"default\":1},\"useItineraryStartAsPosition\":{\"type\":\"boolean\",\"default\":false},\"useOrientationMatching\":{\"type\":\"boolean\",\"default\":true},\"useStrict\":{\"type\":\"boolean\",\"default\":false},\"hugeJumpDistance\":{\"type\":\"number\",\"default\":3},\"minStepsBetweenOrientationMatching\":{\"type\":\"number\",\"default\":3},\"minStepsForOrientationMatching\":{\"type\":\"number\",\"default\":5},\"lastProjectionsWindowSize\":{\"type\":\"number\",\"default\":3},\"lastProjectionsEdgeAngleThreshold\":{\"type\":\"number\",\"default\":3},\"disableMMCloseToATurnDistance\":{\"type\":\"number\",\"default\":2}}},\"multilevel\":{\"default\":{\"geofenceDisableNav\":3},\"type\":\"object\",\"properties\":{\"geofenceDisableNav\":{\"type\":\"integer\",\"default\":3}}},\"pinpoints\":{\"default\":{\"scale\":0.09,\"updateDistance\":30,\"minDistance\":1,\"overlap\":false,\"label\":true},\"type\":\"object\",\"properties\":{\"scale\":{\"type\":\"number\",\"default\":0.09},\"updateDistance\":{\"type\":\"integer\",\"default\":30},\"minDistance\":{\"type\":\"integer\",\"default\":1},\"overlap\":{\"default\":false,\"description\":\"If pinpoint shape in AR should overlap between each other\",\"type\":\"boolean\"},\"label\":{\"default\":true,\"description\":\"If pinpoint shape in AR should have label\",\"type\":\"boolean\"}}}},\"description\":\"The indoor set of parameters\",\"type\":\"object\"},\"outdoor\":{\"default\":{\"accuracyThreshold\":25,\"end\":{\"geofence\":15,\"visibleDistance\":200},\"instructions\":{\"maxDistance\":40,\"geofence\":10,\"minAlt\":1.5,\"opacityDistanceStart\":20,\"realSizeScale\":3,\"scale\":0.03,\"audioDistance\":30},\"itinerary\":{\"sampling\":1.6,\"opacityDistanceEnd\":30,\"arrowTargetDistance\":10},\"mapmatching\":{\"network\":null,\"maxAngleBearing\":30,\"maxDistance\":50,\"minDistance\":0,\"useItineraryStartAsPosition\":false,\"useOrientationMatching\":true,\"useStrict\":false,\"hugeJumpDistance\":3,\"minStepsBetweenOrientationMatching\":3,\"minStepsForOrientationMatching\":5,\"lastProjectionsWindowSize\":3,\"lastProjectionsEdgeAngleThreshold\":3,\"disableMMCloseToATurnDistance\":2},\"multilevel\":{\"geofenceDisableNav\":3},\"pinpoints\":{\"scale\":0.09,\"updateDistance\":30,\"minDistance\":1,\"overlap\":false,\"label\":true}},\"properties\":{\"accuracyThreshold\":{\"default\":25,\"type\":\"integer\"},\"end\":{\"default\":{\"geofence\":15,\"visibleDistance\":200},\"type\":\"object\",\"properties\":{\"geofence\":{\"type\":\"integer\",\"default\":15},\"visibleDistance\":{\"type\":\"integer\",\"default\":200}}},\"instructions\":{\"default\":{\"geofence\":10,\"maxDistance\":40,\"minAlt\":1.5,\"opacityDistanceStart\":20,\"realSizeScale\":3,\"scale\":0.03,\"audioDistance\":30},\"type\":\"object\",\"properties\":{\"geofence\":{\"type\":\"integer\",\"default\":10},\"maxDistance\":{\"type\":\"integer\",\"description\":\"Distance from which the instruction will be display instead of banner with meters\",\"default\":40},\"minAlt\":{\"type\":\"integer\",\"default\":1.5},\"opacityDistanceStart\":{\"type\":\"integer\",\"default\":20},\"realSizeScale\":{\"type\":\"integer\",\"default\":3},\"scale\":{\"type\":\"number\",\"default\":0.03},\"audioDistance\":{\"type\":\"integer\",\"description\":\"Distance from which the audio will be triggered between 2 instructions\",\"default\":30}}},\"itinerary\":{\"default\":{\"sampling\":1.6,\"opacityDistanceEnd\":30,\"arrowTargetDistance\":10},\"type\":\"object\",\"properties\":{\"sampling\":{\"type\":\"integer\",\"default\":1.6},\"opacityDistanceEnd\":{\"type\":\"integer\",\"default\":30},\"arrowTargetDistance\":{\"type\":\"integer\",\"default\":10}}},\"mapmatching\":{\"default\":{\"network\":null,\"maxAngleBearing\":30,\"maxDistance\":50,\"minDistance\":0,\"useItineraryStartAsPosition\":false,\"useOrientationMatching\":true,\"useStrict\":false,\"hugeJumpDistance\":3,\"minStepsBetweenOrientationMatching\":3,\"minStepsForOrientationMatching\":5,\"lastProjectionsWindowSize\":3,\"lastProjectionsEdgeAngleThreshold\":3,\"disableMMCloseToATurnDistance\":2},\"type\":\"object\",\"properties\":{\"useItineraryStartAsPosition\":{\"type\":\"boolean\",\"default\":false},\"network\":{\"type\":\"string\",\"description\":\"Network to use outside a navigation\",\"default\":null},\"maxAngleBearing\":{\"type\":\"number\",\"default\":30},\"maxDistance\":{\"type\":\"integer\",\"default\":50},\"minDistance\":{\"type\":\"integer\",\"default\":0},\"useOrientationMatching\":{\"type\":\"boolean\",\"default\":true},\"useStrict\":{\"type\":\"boolean\",\"default\":false},\"hugeJumpDistance\":{\"type\":\"number\",\"default\":3},\"minStepsBetweenOrientationMatching\":{\"type\":\"number\",\"default\":3},\"minStepsForOrientationMatching\":{\"type\":\"number\",\"default\":5},\"lastProjectionsWindowSize\":{\"type\":\"number\",\"default\":3},\"lastProjectionsEdgeAngleThreshold\":{\"type\":\"number\",\"default\":3},\"disableMMCloseToATurnDistance\":{\"type\":\"number\",\"default\":2}}},\"multilevel\":{\"default\":{\"geofenceDisableNav\":3},\"type\":\"object\",\"properties\":{\"geofenceDisableNav\":{\"type\":\"integer\",\"default\":3}}},\"pinpoints\":{\"default\":{\"scale\":0.09,\"updateDistance\":30,\"minDistance\":1,\"overlap\":false,\"label\":true},\"type\":\"object\",\"properties\":{\"scale\":{\"type\":\"number\",\"default\":0.09},\"updateDistance\":{\"type\":\"integer\",\"default\":30},\"minDistance\":{\"type\":\"integer\",\"default\":1},\"overlap\":{\"default\":false,\"description\":\"If pinpoint shape in AR should overlap between each other\",\"type\":\"boolean\"},\"label\":{\"default\":true,\"description\":\"If pinpoint shape in AR should have label\",\"type\":\"boolean\"}}}},\"description\":\"The outdoor set of parameters\",\"type\":\"object\"},\"providers\":{\"default\":{\"blacklist\":[],\"gnssWifi\":{\"discardPositionsAbove\":50,\"enableHighAccuracy\":true},\"polestarkey\":null,\"straightLineDetector\":{\"stepsConsideredForStraightLine\":2},\"stepDetector\":{\"algorithm\":\"minMaxPeaks2\",\"stepSizeMultiplier\":1,\"minMaxPeaks2\":null,\"minMaxPeaks3\":null},\"useMapMatching\":true,\"usePositionSmoother\":true,\"useAllAbsolutePositions\":false,\"vps\":null,\"whitelist\":[]},\"properties\":{\"blacklist\":{\"default\":[],\"type\":\"array\"},\"gnssWifi\":{\"default\":{\"discardPositionsAbove\":50,\"enableHighAccuracy\":true},\"properties\":{\"discardPositionsAbove\":{\"default\":50,\"type\":\"number\"},\"enableHighAccuracy\":{\"default\":true,\"type\":\"boolean\"}}},\"polestarkey\":{\"default\":null,\"type\":\"string\"},\"straightLineDetector\":{\"default\":{\"stepsConsideredForStraightLine\":2},\"properties\":{\"stepsConsideredForStraightLine\":{\"default\":2,\"type\":\"number\"}},\"type\":\"object\"},\"stepDetector\":{\"default\":{\"algorithm\":\"minMaxPeaks2\",\"stepSizeMultiplier\":1,\"minMaxPeaks2\":null,\"minMaxPeaks3\":null},\"properties\":{\"algorithm\":{\"default\":\"minMaxPeaks2\",\"enum\":[\"ladetto\",\"minMaxPeaks\",\"minMaxPeaks2\",\"minMaxPeaks3\"],\"type\":\"string\"},\"stepSizeMultiplier\":{\"default\":1,\"type\":\"number\"},\"minMaxPeaks2\":{\"default\":null,\"properties\":{\"windowTime\":{\"default\":0.3,\"type\":\"number\"},\"minTimeBetweenSteps\":{\"default\":0.4,\"type\":\"number\"},\"maxFrequency\":{\"default\":4,\"type\":\"number\"},\"minFrequency\":{\"default\":1,\"type\":\"number\"},\"verticalAccPositivePeakThreshold\":{\"default\":0.75,\"type\":\"number\"},\"verticalAccNegativePeakThreshold\":{\"default\":-0.3,\"type\":\"number\"}},\"type\":\"object\"},\"minMaxPeaks3\":{\"default\":null,\"properties\":{\"windowTime\":{\"default\":0.6,\"type\":\"number\"},\"minTimeBetweenSteps\":{\"default\":0.6,\"type\":\"number\"},\"maxFrequency\":{\"default\":4,\"type\":\"number\"},\"minFrequency\":{\"default\":1,\"type\":\"number\"},\"verticalAccPositivePeakThreshold\":{\"default\":0.2,\"type\":\"number\"},\"verticalAccNegativePeakThreshold\":{\"default\":-0.1,\"type\":\"number\"}},\"type\":\"object\"}},\"type\":\"object\"},\"useMapMatching\":{\"default\":true,\"type\":\"boolean\"},\"usePositionSmoother\":{\"default\":true,\"type\":\"boolean\"},\"useAllAbsolutePositions\":{\"default\":false,\"type\":\"boolean\"},\"vps\":{\"default\":null,\"properties\":{\"endpoint\":{\"default\":null,\"type\":\"string\"},\"minInclinationForRequest\":{\"default\":60,\"type\":\"number\"},\"useInclination\":{\"default\":true,\"type\":\"boolean\"},\"requestInterval\":{\"default\":null,\"type\":\"number\"},\"useCoarsePose\":{\"default\":true,\"type\":\"boolean\"},\"waitTimeMinInclinationForRequest\":{\"default\":200,\"type\":\"number\"}},\"type\":\"object\"},\"whitelist\":{\"default\":[],\"type\":\"array\"}},\"description\":\"Providers to use or not\",\"type\":\"object\"},\"visibleTags\":{\"default\":[],\"type\":\"array\",\"items\":{\"type\":\"string\"}}},\"type\":\"object\"},\"addcid\":{\"default\":false,\"description\":\"Double Click Publisher ID\",\"type\":\"string\"},\"addcslot\":{\"default\":false,\"description\":\"Double Click Ad Slot\",\"type\":\"string\"},\"addcsize\":{\"default\":false,\"description\":\"Double Click Size\",\"items\":{\"items\":{\"type\":\"integer\"},\"maxItems\":2,\"minItems\":2,\"type\":\"array\"},\"type\":\"array\"},\"addctarget\":{\"default\":false,\"description\":\"Double Click Target\",\"items\":{\"items\":{\"type\":\"string\"},\"maxItems\":2,\"minItems\":2,\"type\":\"array\"},\"type\":\"array\"},\"adheight\":{\"default\":false,\"description\":\"Ad display height options.\",\"type\":\"string\"},\"adsenseid\":{\"default\":false,\"description\":\"Adsense\",\"type\":\"integer\"},\"adsenseslot\":{\"default\":false,\"description\":\"Adsense\",\"type\":\"integer\"},\"adwidth\":{\"default\":false,\"description\":\"Ad display width options.\",\"type\":\"string\"},\"aroundme\":{\"default\":true,\"description\":\"Show around button in livemap.\",\"type\":\"boolean\"},\"arviewenabled\":{\"default\":false,\"description\":\"Enable the Wemap-AR view on compatible mobile devices.\",\"type\":\"boolean\"},\"arswitcherbutton\":{\"default\":false,\"description\":\"Use button instead of device inclination for switching AR/map\",\"type\":\"boolean\"},\"autocenter\":{\"default\":0,\"description\":\"Automatic centering on landing area when idle (in milliseconds).\",\"type\":\"integer\"},\"autologin\":{\"default\":true,\"description\":\"Use localStorage to login.\",\"type\":\"boolean\"},\"autoplay\":{\"default\":false,\"description\":\"Slideshow of pinpoints when map is idle.\",\"type\":[\"boolean\",\"object\"]},\"autoplayoverlay\":{\"default\":false,\"description\":\"If true, the autoplay will be locked with an overlay and no interaction will be available\",\"type\":\"boolean\"},\"autoplaytimeout\":{\"default\":5000,\"description\":\"How long until considering the map as idle (in milliseconds).\",\"type\":\"integer\"},\"bodyfullscreen\":{\"default\":false,\"description\":\"If body parent to livemap should be showned in fullscreen mode instead of livemap's container.\",\"type\":\"boolean\"},\"calendarfilterenabled\":{\"default\":false,\"description\":\"Force to enable calendar filter even if useevents is false.\",\"type\":\"boolean\"},\"calendarfiltermindate\":{\"default\":\"\",\"description\":\"Min date at ISO format for calendar filter (filters view & welcome card)\",\"type\":\"string\"},\"calendarfiltermaxdate\":{\"default\":\"\",\"description\":\"Max date at ISO format for calendar filter (filters view & welcome card)\",\"type\":\"string\"},\"cancomment\":{\"default\":true,\"description\":\"Ability to comment/contribute on pinpoints.\",\"type\":\"boolean\"},\"canopenpinpoint\":{\"default\":true,\"description\":\"Ability to open a marker on click.\",\"type\":\"boolean\"},\"clicktofullscreen\":{\"default\":false,\"description\":\"Click on the map to unlock and go fullscreen.\",\"type\":\"boolean\"},\"clicktofullscreendevices\":{\"default\":\"mobile\",\"description\":\"Click on the map to unlock and go fullscreen. Only for specified devices.\",\"enum\":[\"all\",\"mobile\"],\"type\":\"string\"},\"clicktonavigate\":{\"default\":false,\"description\":\"Click on the map to navigate to coordinates\",\"type\":\"boolean\"},\"clientname\":{\"default\":\"\",\"description\":\"Add an additional css class wemap-livemap-<clientname> to the main livemap's container Value can also describe a sub-client: client:sub-client. Eg: allow mcc components customization\",\"type\":\"string\"},\"clustercircle\":{\"default\":false,\"description\":\"Displays a simple circle instead of a cluster icon.\",\"type\":\"boolean\"},\"clustercolor\":{\"default\":\"#015697\",\"description\":\"Clusters icons color (requires clustercircle).\",\"type\":\"string\"},\"clustericon\":{\"default\":null,\"description\":\"Cluster icon image (ignored if clustercircle is set).\",\"type\":\"string\"},\"clustering\":{\"default\":true,\"description\":\"Enables front-end side clustering of pinpoints.\",\"type\":\"boolean\"},\"clustermethod\":{\"default\":\"supercluster\",\"description\":\"Algorithm used to group pinpoints into clusters.\",\"enum\":[\"hierarchy\",\"supercluster\"],\"type\":\"string\"},\"clusterplussign\":{\"default\":false,\"description\":\"Replaces the cluster count by a plus sign (requires clustercircle).\",\"type\":\"boolean\"},\"clusterradius\":{\"default\":80,\"description\":\"Configure the radius of the clustering algorithm (and multipoint search area).\",\"type\":\"integer\"},\"custompetals\":{\"type\":\"array\",\"description\":\"List of custom petals that will replace the classic ones.\",\"items\":{\"type\":\"object\",\"description\":\"A custom petal.\",\"properties\":{\"position\":{\"type\":\"integer\",\"description\":\"The position of the custom petal (between 1 and 5).\"},\"iconurl\":{\"type\":\"string\",\"description\":\"The url of the petal icon.\"},\"text\":{\"type\":\"string\",\"description\":\"The text that will be displayed when the petal is hovered.\"},\"actionname\":{\"type\":\"string\",\"description\":\"The action realized when the petal is clicked. The available actions are described in the documentation.\"},\"actionparameters\":{\"type\":\"object\",\"default\":{}}}},\"default\":[]},\"customshareurl\":{\"default\":null,\"description\":\"Custom url for pinpoint sharing.\",\"type\":\"string\"},\"dateonly\":{\"default\":false,\"description\":\"Do not display event hours\",\"type\":\"boolean\"},\"deeplinkingenabled\":{\"description\":\"Enable the update of the url hash when navigate through the application\",\"type\":\"boolean\",\"default\":true},\"displaypoorevent\":{\"default\":true,\"description\":\"Display event as poor event if they don't have description\",\"type\":\"boolean\"},\"dragging\":{\"default\":true,\"description\":\"Enable map dragging with mouse/touch.\",\"type\":\"boolean\"},\"enabledcontrols\":{\"default\":true,\"description\":\"Enable map controls.\",\"type\":\"boolean\"},\"enableembedshare\":{\"default\":true,\"description\":\"Enable/Disable EMBED share on the livemap.\",\"type\":\"boolean\"},\"enablelogin\":{\"default\":true,\"description\":\"Are users allowed to login.\",\"type\":\"boolean\"},\"enablepetals\":{\"default\":true,\"description\":\"Enable/Disable petals components on the livemap.\",\"type\":\"boolean\"},\"enablesidebar\":{\"default\":true,\"description\":\"Enable/Disable sidebar on the livemap.\",\"type\":\"boolean\"},\"expanddescription\":{\"default\":false,\"description\":\"Shows a Read more button at the bottom of pinpoint description.\",\"type\":\"boolean\"},\"externalcontent\":{\"default\":false,\"description\":\"Add HTML content to main container, permits to user to customize its map.\",\"items\":{\"type\":\"string\"},\"type\":\"array\"},\"externalscripts\":{\"default\":false,\"description\":\"External JavaScript defined by user, added as script tags into livemap's document header\",\"items\":{\"properties\":{\"content\":{\"description\":\"JavaScript code.\",\"type\":\"string\"},\"url\":{\"description\":\"The URL from which to fetch the JavaScript code.\",\"type\":\"string\"}},\"type\":\"object\"},\"type\":\"array\"},\"externalstyles\":{\"default\":false,\"description\":\"External stylesheets defined by user, added as style tags into livemap's document header. Could be used to override existent css rule\",\"items\":{\"properties\":{\"content\":{\"description\":\"CSS code.\",\"type\":[\"object\",\"string\"]},\"url\":{\"description\":\"The URL from which to fetch the CSS code.\",\"type\":\"string\"}},\"type\":\"object\"},\"type\":\"array\"},\"featuredlists\":{\"default\":false,\"description\":\"Add a new button with the livemap's title, on click it will open the right sidebar containing all the lists for this map.\",\"type\":\"boolean\"},\"featuretilesenabled\":{\"default\":false,\"description\":\"Enables server-side clustering.\",\"type\":\"boolean\"},\"floors\":{\"default\":[],\"description\":\"Floors for multi-levels maps.\",\"items\":{\"properties\":{\"maxaltitude\":{\"description\":\"The maximum altitude for the floor (exclusive).\",\"title\":\"Maximum altitude\",\"type\":\"number\"},\"minaltitude\":{\"description\":\"The minimum altitude for the floor (inclusive).\",\"title\":\"Minimum altitude\",\"type\":\"number\"},\"name\":{\"title\":\"Name\",\"type\":\"string\"}},\"required\":[\"name\",\"minaltitude\",\"maxaltitude\"],\"type\":\"object\"},\"type\":\"array\"},\"floorsminzoom\":{\"default\":null,\"description\":\"Min zoom to display the floors switcher\",\"type\":\"number\"},\"forcelittlescreenview\":{\"default\":false,\"description\":\"Force to use the 'little screen' display mode if not in mobile view.\",\"type\":\"boolean\"},\"forcemobileview\":{\"default\":false,\"description\":\"Force to add class 'mobile-view' to livemap container and add a class forced-mobileview to livemap container it will also force livemap state.\",\"type\":\"boolean\"},\"fullscreencontrol\":{\"default\":false,\"description\":\"Show/Hide burger menu item 'Goto Fullscreen'.\",\"type\":\"boolean\"},\"geoentities\":{\"default\":{\"hideOthersOnSelect\":true,\"strokeHighlightScale\":1.5},\"properties\":{\"hideOthersOnSelect\":{\"default\":true,\"description\":\"Hide other geoentities when one is selected.\",\"type\":\"boolean\"},\"strokeHighlightScale\":{\"default\":1.5,\"description\":\"Scale factor of stroke width on highlight\",\"type\":\"number\"}},\"description\":\"Enable/Disable geoentities components on the livemap.\",\"type\":\"object\"},\"handlebearing\":{\"default\":false,\"description\":\"Allow map to rotate depending on the device orientation.\",\"type\":\"boolean\"},\"hereandnowcontrol\":{\"default\":false,\"description\":\"Replace geolocate button by a button 'here and now' which also filter on current day.\",\"type\":\"boolean\"},\"homecontrol\":{\"default\":true,\"description\":\"Show/Hide menu item 'Back to first view'.\",\"type\":\"boolean\"},\"howtocontrol\":{\"default\":false,\"description\":\"Show/Hide menu item 'How to use this map'.\",\"type\":\"boolean\"},\"indoor\":{\"default\":{\"enable\":false,\"usePinpoints\":false,\"useLevelSearch\":false,\"limitOutdoorAtLevel\":null,\"highlightEnabled\":true,\"highlightColor\":null,\"highlightOnSearch\":false,\"minZoom\":17,\"enableInteraction\":true},\"properties\":{\"enable\":{\"default\":false,\"description\":\"Enable indoor mode.\",\"type\":\"boolean\"},\"enableInteraction\":{\"default\":true,\"description\":\"Enable/disable interaction with indoor features (hover, click)\",\"type\":\"boolean\"},\"highlightColor\":{\"default\":null,\"description\":\"Color for highlight feature\",\"type\":\"string\"},\"selectedColor\":{\"default\":null,\"description\":\"Color for selected feature\",\"type\":\"string\"},\"highlightEnabled\":{\"default\":true,\"description\":\"Enable/disable highlight feature on click\",\"type\":\"boolean\"},\"highlightOnSearch\":{\"default\":false,\"description\":\"Enable/disable highlight feature on search\",\"type\":\"boolean\"},\"limitOutdoorAtLevel\":{\"default\":null,\"description\":\"Define which level should show outdoor pinpoint. If null all levels will show outdoor pinpoint.\",\"type\":\"number\"},\"minZoom\":{\"default\":17,\"description\":\"Define the zoom level at which indoor mode will be enabled\",\"type\":\"number\"},\"usePinpoints\":{\"default\":false,\"description\":\"If pinpoint are linked to indoor feature. It will automatically open pinpoint on feature click and highlight feature on pinpoint open.\",\"type\":\"boolean\"},\"useLevelSearch\":{\"default\":false,\"description\":\"If pinpoint search is made on the current level. If not, it will search on all levels.\",\"type\":\"boolean\"}},\"description\":\"Configuration relative to indoor\",\"type\":\"object\"},\"initialbearing\":{\"default\":0,\"description\":\"Initial bearing of the map.\",\"type\":\"number\"},\"introcard\":{\"default\":null,\"description\":\"Shows an information popin on map load.\",\"properties\":{\"active\":{\"default\":true,\"description\":\"If not true, the welcomeCard won't be displayed.\",\"title\":\"Active\",\"type\":\"boolean\"},\"avatar\":{\"description\":\"Custom user's avatar image.\",\"title\":\"Avatar URL\",\"type\":\"string\"},\"background\":{\"description\":\"URL background image shown behind the user's avatar, default is user's background image.\",\"title\":\"Background URL\",\"type\":\"string\"},\"class\":{\"description\":\"Custom classnames for the popin.\",\"title\":\"CSS classname\",\"type\":\"string\"},\"enableAroundMe\":{\"default\":false,\"description\":\"Display the 'around me' button on welcome card.\",\"title\":\"Display 'Around me' button\",\"type\":\"boolean\"},\"aroundMeTitle\":{\"title\":\"Title of the around me filter.\",\"description\":\"Title of the around me filter.\",\"type\":\"string\"},\"aroundMeSubtitle\":{\"title\":\"Subtitle of the around me filter.\",\"description\":\"Subtitle of the around me filter.\",\"type\":\"string\"},\"filters\":{\"description\":\"Enable filters on WelcomeCard.\",\"items\":{\"properties\":{\"type\":{\"description\":\"Type of filter.\",\"enum\":[\"tag\",\"when\",\"where\"],\"title\":\"Type of filter\",\"type\":\"string\"},\"title\":{\"description\":\"Title of the filter.\",\"title\":\"Title of the filter.\",\"type\":\"string\"},\"subtitle\":{\"description\":\"Subtitle of the filter.\",\"title\":\"Subtitle of the filter.\",\"type\":\"string\"}},\"type\":\"object\"},\"required\":[\"type\"],\"type\":\"array\"},\"noBackground\":{\"default\":false,\"description\":\"Hide the user's background image.\",\"title\":\"Hide Backround\",\"type\":\"boolean\"},\"permanent\":{\"default\":true,\"description\":\"Show WelcomeCard everytime.\",\"title\":\"Permanent WelcomeCard\",\"type\":\"boolean\"},\"text\":{\"description\":\"Displayed under the title as HTML.\",\"title\":\"HTML Text\",\"type\":\"string\"},\"title\":{\"description\":\"Displayed under the user's avatar with bold font.\",\"title\":\"Title\",\"type\":\"string\"}},\"type\":\"object\"},\"iscontributive\":{\"default\":false,\"description\":\"Tell if the map is contributive or not.\",\"type\":\"boolean\"},\"kiosk\":{\"default\":null,\"description\":\"Kiosk parameters like the photosphere image or position\",\"properties\":{\"list\":{\"type\":\"array\",\"default\":[],\"items\":{\"type\":\"object\",\"default\":null,\"properties\":{\"photosphere\":{\"type\":\"object\",\"default\":null,\"properties\":{\"day\":{\"type\":\"string\"},\"night\":{\"type\":\"string\"}}},\"kioskid\":{\"type\":\"string\",\"default\":\"\"},\"accessibleheight\":{\"type\":\"string\",\"description\":\"Kiosk mode has a max height for interactive button for accessibility purpose\",\"default\":50},\"heading\":{\"description\":\"Heading is used to orient the photosphere according to the map (in degrees)\",\"type\":\"number\",\"default\":0},\"initialorientation\":{\"description\":\"Initial orientation of the view (in degrees)\",\"type\":\"number\",\"default\":0},\"position\":{\"properties\":{\"lat\":{\"description\":\"Latitude of position for photosphere.\",\"title\":\"Latitude\",\"type\":\"number\"},\"lng\":{\"description\":\"Longitude of position for photosphere.\",\"title\":\"Longitude\",\"type\":\"number\"},\"alt\":{\"description\":\"Altitude of position for photosphere.\",\"title\":\"Altitude\",\"type\":\"number\"},\"level\":{\"description\":\"Level of position for photosphere.\",\"title\":\"Level\",\"type\":\"number\"}},\"required\":[\"lat\",\"lng\"],\"type\":\"object\"},\"rotationduration\":{\"description\":\"Rotation of sphere. Number of seconds for a complete loop\",\"type\":\"number\",\"default\":35}}}},\"screensavertype\":{\"type\":\"string\",\"enum\":[\"auto\",null],\"default\":\"auto\"},\"timeoutscreensaver\":{\"type\":\"number\",\"default\":30000},\"type\":{\"type\":\"string\",\"default\":\"default\",\"enum\":[\"default\",\"desktop\"]},\"intro\":{\"type\":\"object\",\"default\":null,\"properties\":{\"text\":{\"type\":\"string\"},\"title\":{\"type\":\"string\"}}}},\"type\":\"object\"},\"kioskid\":{\"default\":null,\"type\":\"string\"},\"kiosk_viewer\":{\"default\":null,\"description\":\"Id of kiosk viewer map\",\"type\":\"string\"},\"layers\":{\"default\":[],\"description\":\"Additional feature layers.\",\"items\":{\"properties\":{\"altitude\":{\"description\":\"The altitude (in meters) of this layer, for multi-floor maps.\",\"title\":\"Altitude\",\"type\":\"number\"},\"clustering\":{\"default\":false,\"description\":\"Use this layer for front-end hierarchy clustering.\",\"title\":\"Clustering\",\"type\":\"boolean\"},\"coordinates\":{\"default\":null,\"description\":\"Coordinates of each corner of the image. It can only be used with layer type image. Represented by an array of coordinates array [lng, lat]\",\"items\":{\"items\":{\"type\":\"number\"},\"type\":\"array\"},\"type\":\"array\"},\"maxzoom\":{\"default\":18,\"description\":\"The maximum zoom at which the layer is visible (exclusive).\",\"minimum\":0,\"title\":\"Maximum zoom\",\"type\":\"integer\"},\"minzoom\":{\"default\":2,\"description\":\"The minimum zoom at which the layer is visible (inclusive).\",\"minimum\":0,\"title\":\"Minimum zoom\",\"type\":\"integer\"},\"onclick\":{\"default\":\"zoom\",\"enum\":[\"ignore\",\"popup\",\"tooltip\",\"zoom\"],\"title\":\"Action on click\",\"type\":\"string\"},\"onhover\":{\"default\":\"highlight\",\"enum\":[\"ignore\",\"highlight\"],\"title\":\"Action on hover\",\"type\":\"string\"},\"type\":{\"description\":\"The type of layer format (GeoJSON, vector tiles or image).\",\"enum\":[\"geojson\",\"image\",\"vector\"],\"title\":\"Type\",\"type\":\"string\"},\"url\":{\"description\":\"The URL from which to fetch the layer's data.\",\"title\":\"URL\",\"type\":\"string\"}},\"required\":[\"type\",\"url\"],\"type\":\"object\"},\"type\":\"array\"},\"limitperpage\":{\"default\":10,\"description\":\"Number of items per page in the livebar.\",\"type\":\"integer\"},\"linksenabled\":{\"default\":true,\"description\":\"Enable clicking on links (in pinpoint description or comments).\",\"type\":\"boolean\"},\"littlescreenthresholdwidth\":{\"default\":1030,\"description\":\"Max width before going to littleScreen mode.\",\"type\":\"integer\"},\"locked\":{\"default\":false,\"description\":\"Lock map, need to click it to unlock and use (no hover).\",\"type\":\"boolean\"},\"mapviewenabled\":{\"default\":true,\"description\":\"If false, hide the map and keep only the UI.\",\"type\":\"boolean\"},\"markersize\":{\"default\":100,\"type\":\"integer\",\"description\":\"Size of the map markers.\"},\"maxbounds\":{\"default\":null,\"description\":\"Restricts the map view to the given bounds.\",\"properties\":{\"_northEast\":{\"properties\":{\"lat\":{\"description\":\"Latitude of upper-right's corner (northEast).\",\"title\":\"NorthEast latitude\",\"type\":\"number\"},\"lng\":{\"description\":\"Longitude of upper-right's corner (northEast).\",\"title\":\"NorthEast longitude\",\"type\":\"number\"}},\"required\":[\"lat\",\"lng\"],\"type\":\"object\"},\"_southWest\":{\"properties\":{\"lat\":{\"description\":\"Latitude of bottom-left's corner (southWest).\",\"title\":\"SouthWest latitude\",\"type\":\"number\"},\"lng\":{\"description\":\"Longitude of bottom-left's corner (southWest).\",\"title\":\"SouthWest longitude\",\"type\":\"number\"}},\"required\":[\"lat\",\"lng\"],\"type\":\"object\"}},\"required\":[\"_northEast\",\"_southWest\"],\"type\":\"object\"},\"maximagewidth\":{\"default\":500,\"description\":\"Sets the maximum image width in sidebar. (in px)\",\"type\":\"integer\"},\"maxzoom\":{\"default\":18,\"description\":\"Maximum zoom level of the map.\",\"maximum\":24,\"minimum\":0,\"type\":\"integer\"},\"maxzoomcluster\":{\"default\":null,\"description\":\"Maximum zoom for clustering. Default will be maxzoom\",\"maximum\":24,\"minimum\":0,\"type\":\"integer\"},\"menuextensions\":{\"default\":false,\"description\":\"Add options to the livemap menu.\",\"items\":{\"properties\":{\"icon\":{\"description\":\"Name of Font-Awesome Icon.\",\"title\":\"Icon\",\"type\":\"string\"},\"text\":{\"description\":\"Label for custom button.\",\"title\":\"Button's Label\",\"type\":\"string\"},\"url\":{\"description\":\"URL to redirect from.\",\"title\":\"URL\",\"type\":\"string\"}},\"type\":\"object\"},\"type\":\"array\"},\"minzoom\":{\"default\":2,\"description\":\"Minimum zoom level of the map.\",\"maximum\":24,\"minimum\":0,\"type\":\"integer\"},\"mobilethresholdwidth\":{\"default\":630,\"description\":\"When to consider the map as small/mobile. (main application container will be prefixed by 'mobile-view' class)\",\"type\":\"integer\"},\"mode\":{\"default\":\"default\",\"description\":\"Define the mode of the livemap if it should be with AR, for navigation or kiosk. This will change the UI and features\",\"enum\":[\"default\",\"kiosk_map\",\"kiosk_viewer\",\"kiosk_screensaver_map\"],\"type\":\"string\"},\"models\":{\"default\":null,\"description\":\"Define the URL of the 3d models to load in the map.\",\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"visible\":{\"default\":\"always\",\"enum\":[\"always\",\"3d\"]},\"url\":{\"type\":\"string\"},\"minzoom\":{\"default\":0,\"type\":\"number\"},\"maxzoom\":{\"default\":24,\"type\":\"number\"}}}},\"navigatefromposition\":{\"default\":true,\"description\":\"If it should use user location for itineraries\",\"type\":\"boolean\"},\"offline\":{\"default\":{\"blacklist\":[],\"enable\":false,\"tiles\":null},\"description\":\"Configuration relative to the offline.\",\"properties\":{\"blacklist\":{\"default\":[],\"description\":\"Array of list to not use for offline\",\"type\":\"array\"},\"enable\":{\"default\":false,\"description\":\"Enable the offline feature\",\"type\":\"boolean\"},\"tiles\":{\"default\":null,\"description\":\"Mbtiles file to load for offline tiles\",\"type\":\"string\"}},\"type\":\"object\"},\"openedsearch\":{\"default\":false,\"description\":\"Open search bar at startup (if not opened at startup it can opened on click on search button).\",\"type\":\"boolean\"},\"openeventinpinpoint\":{\"default\":false,\"description\":\"Open event inside the pinpoint view instead of opening new view\",\"type\":\"boolean\"},\"imageoperation\":{\"default\":{\"thumbnail\":\"fit\",\"sidebar\":\"fit\"},\"description\":\"Operation applied to the image by the backend\",\"properties\":{\"thumbnail\":{\"default\":\"fit\",\"description\":\"operation applied for images used in map thumbnails\",\"type\":\"string\",\"enum\":[\"contain\",\"fit\"]},\"sidebar\":{\"default\":\"fit\",\"description\":\"operation applied for images used in sidebar\",\"type\":\"string\",\"enum\":[\"contain\",\"fit\"]}},\"type\":\"object\"},\"openedsidebar\":{\"description\":\"Open sidebar by default on featured list or sources ('featured' or 'sources').\",\"enum\":[\"\",\"featured\",\"sources\"],\"default\":\"\",\"type\":\"string\"},\"pinpointopentype\":{\"description\":\"Defined how the pinpoint should be opened, if it opens from the sidebar or with a popin\",\"default\":\"sidebar\",\"enum\":[\"sidebar\",\"popin\"],\"type\":\"string\"},\"pitchenabled\":{\"description\":\"Allow user to pitching and bearing map\",\"type\":\"boolean\",\"default\":false},\"pitchstart\":{\"description\":\"initial pitch (tilt) of the map, measured in degrees away from the plane of the screen (0-60)\",\"type\":\"integer\",\"default\":0},\"pitchswitcherbutton\":{\"description\":\"Show a button to switch pitch\",\"type\":\"boolean\",\"default\":false},\"providersenabled\":{\"description\":\"Use providers to locate the user\",\"type\":\"boolean\",\"default\":true},\"metarouterurl\":{\"default\":null,\"description\":\"The meta router url to use\",\"type\":\"string\"},\"routingtype\":{\"default\":\"google\",\"description\":\"The provider to use for routing.\",\"enum\":[\"google\",\"deutsche-bahn\",\"osrm\",\"otp\",\"cityway\",\"idfm\",\"navitia\",\"tictactrip\"],\"type\":\"string\"},\"routingurl\":{\"default\":\"https://routing-osrm.getwemap.com\",\"description\":\"The root URL for the OSRM routing server.\",\"type\":\"string\"},\"routingmode\":{\"default\":\"driving\",\"description\":\"Mode of routing.\",\"enum\":[\"driving\",\"walking\",\"bike\",\"bus\",\"multi\"],\"type\":\"string\"},\"samewindow\":{\"default\":false,\"description\":\"Open links (from pinpoints descriptions or comments) in the same page.\",\"type\":\"boolean\"},\"scaninstructions\":{\"default\":\"\",\"description\":\"Instruction message displayed when the scan view is open.\",\"type\":\"string\"},\"scrollwheelzoom\":{\"default\":true,\"description\":\"Enable zoom using the scrollwheel.\",\"type\":\"boolean\"},\"searchcontrol\":{\"default\":true,\"description\":\"Show/hide search button.\",\"type\":\"boolean\"},\"searchparameters\":{\"default\":{\"geocoding\":true,\"region\":null,\"multilevel\":false,\"boundingbox\":null,\"extended\":false,\"sortbyname\":null,\"query_fields\":null,\"sortbydistance\":null},\"description\":\"Configuration relative to the search engine\",\"properties\":{\"extended\":{\"default\":false,\"description\":\"Extend search will search on bigger bounds even if results not empty\",\"type\":\"boolean\"},\"geocoding\":{\"default\":true,\"description\":\"Enable geocoding for search\",\"type\":\"boolean\"},\"multilevel\":{\"default\":false,\"description\":\"Enable search on all level instead of current level\",\"type\":\"boolean\"},\"region\":{\"default\":null,\"description\":\"Specify the region (country) in which the geocoding search should be done\",\"type\":\"string\"},\"sortbyname\":{\"default\":null,\"description\":\"Specify the sorting results method\",\"type\":\"string\",\"enum\":[\"ASC\",\"DESC\"]},\"query_fields\":{\"default\":null,\"description\":\"Specify fields to search on\",\"type\":\"string\"},\"sortbydistance\":{\"default\":false,\"description\":\"Specify the sorting results by distance\",\"type\":\"boolean\"},\"boundingbox\":{\"default\":null,\"description\":\"Limit results to only those contained within the supplied bounding box.\",\"properties\":{\"_northEast\":{\"properties\":{\"lat\":{\"description\":\"Latitude of upper-right's corner (northEast).\",\"title\":\"NorthEast latitude\",\"type\":\"number\"},\"lng\":{\"description\":\"Longitude of upper-right's corner (northEast).\",\"title\":\"NorthEast longitude\",\"type\":\"number\"}},\"required\":[\"lat\",\"lng\"],\"type\":\"object\"},\"_southWest\":{\"properties\":{\"lat\":{\"description\":\"Latitude of bottom-left's corner (southWest).\",\"title\":\"SouthWest latitude\",\"type\":\"number\"},\"lng\":{\"description\":\"Longitude of bottom-left's corner (southWest).\",\"title\":\"SouthWest longitude\",\"type\":\"number\"}},\"required\":[\"lat\",\"lng\"],\"type\":\"object\"}},\"required\":[\"_northEast\",\"_southWest\"],\"type\":\"object\"}},\"type\":\"object\"},\"searchplaceholder\":{\"default\":null,\"description\":\"Override search input placeholder.\",\"type\":\"object\"},\"searchclustertiles\":{\"default\":false,\"description\":\"If the search request should return clusters\",\"type\":\"boolean\"},\"seo\":{\"default\":null,\"description\":\"Configuration relative to the SEO.\",\"properties\":{\"bindPageTitleToOpenedEntity\":{\"default\":true,\"description\":\"Replace the page title by the name of the opened entity.\",\"type\":\"boolean\"},\"pageTitleBindingPrefix\":{\"default\":\"\",\"description\":\"When the page title is binded to the content, you can configure the base of the title with this parameter. The final page title will be the concatenation of this parameter and the opened entity name.\",\"type\":\"string\"},\"baseUrl\":{\"default\":\"\",\"description\":\"Base url for the SEO.\",\"type\":\"string\"},\"bindPageDescriptionToOpenedEntity\":{\"default\":true,\"description\":\"Replace the page description by the description of the opened entity.\",\"type\":\"boolean\"},\"bindSchemaToOpenedEntity\":{\"default\":true,\"description\":\"Generate the schema.org structure based on the opened content.\",\"type\":\"boolean\"}},\"type\":\"object\"},\"services\":{\"default\":{\"g7\":false,\"uber\":false,\"velib\":false},\"description\":\"Configuration relative to the external services.\",\"properties\":{\"g7\":{\"default\":false,\"description\":\"Use G7 services\",\"type\":\"boolean\"},\"uber\":{\"default\":false,\"description\":\"Use Uber services\",\"type\":\"boolean\"},\"velib\":{\"default\":false,\"description\":\"Use velib services\",\"type\":\"boolean\"}},\"type\":\"object\"},\"sharesnippet\":{\"default\":false,\"description\":\"Enables the sharing of livemaps (shows a button).\",\"type\":\"boolean\"},\"showaddress\":{\"default\":true,\"description\":\"Show pinpoint's address.\",\"type\":\"boolean\"},\"showauthor\":{\"default\":true,\"description\":\"Show pinpoint's author.\",\"type\":\"boolean\"},\"showfinishedeventscontrol\":{\"default\":true,\"description\":\"Display a checkbox to hide/show the finished events.\",\"type\":\"boolean\"},\"showmediainresults\":{\"default\":false,\"description\":\"Show/hide media in result list\",\"type\":\"boolean\"},\"showmultilevel\":{\"default\":{\"position\":false,\"itinerary\":false},\"description\":\"Show/hide element depending on current floor for a multilevel map\",\"properties\":{\"position\":{\"type\":\"boolean\",\"default\":false},\"itinerary\":{\"type\":\"boolean\",\"default\":false}},\"type\":\"object\"},\"showpinpointmedia\":{\"default\":true,\"description\":\"Show/hide media (picture or video) in pinpoint detailed description\",\"type\":\"boolean\"},\"showrelatedlists\":{\"default\":true,\"description\":\"Show the lists pinpoints belong to.\",\"type\":\"boolean\"},\"showrelativedate\":{\"default\":true,\"description\":\"Show pinpoint's relative creation date.\",\"type\":\"boolean\"},\"sidebarsforceopen\":{\"default\":[\"navigation\",\"direction\"],\"description\":\"Force sidebar to be opened even if parameter enablesidebar is set to false\",\"type\":\"array\",\"items\":{\"type\":\"string\",\"enum\":[\"pinpoint\",\"event\",\"lists\",\"multipoint\",\"sources\",\"navigation\"]}},\"stillswitch\":{\"default\":false,\"description\":\"Should the map stay still (in location) when switching emm ?\",\"type\":\"boolean\"},\"switcher\":{\"default\":null,\"description\":\"Switch between livemaps via theirs emmid.\",\"properties\":{\"direction\":{\"type\":\"string\"},\"items\":{\"items\":{\"properties\":{\"action\":{\"properties\":{\"type\":{\"emmid\":\"string\"}},\"type\":\"object\"},\"icon\":{\"properties\":{\"content\":{\"type\":\"string\"},\"place\":{\"type\":\"string\"},\"style\":{\"type\":\"object\"},\"type\":{\"type\":\"string\"}},\"type\":\"object\"},\"text\":{\"type\":\"string\"}},\"type\":\"object\"},\"type\":\"array\"},\"itemsStyle\":{\"type\":\"object\"},\"itemsStyleActive\":{\"type\":\"object\"},\"itemsStyleHover\":{\"type\":\"object\"},\"style\":{\"type\":\"object\"}},\"type\":\"object\"},\"tagsoverlap\":{\"default\":false,\"description\":\"Enable/disable OR/AND logic for tags filtering\",\"type\":\"boolean\"},\"tilesstyle\":{\"default\":\"https://tiles.getwemap.com/styles/wemap-v2-en/style.json\",\"description\":\"URL for the vector tiles style.\",\"type\":\"string\"},\"tilestoken\":{\"default\":null,\"description\":\"Token for the vector tiles style. (ex : using Mapbox Terrain, or Mapbox Satellite)\",\"type\":\"string\"},\"timecircle\":{\"default\":null,\"description\":\"Circle of distance to go in given time\",\"properties\":{\"type\":{\"type\":\"string\",\"default\":\"walk\"},\"time\":{\"type\":\"integer\",\"default\":300}},\"type\":\"object\"},\"uber\":{\"default\":false,\"description\":\"Add Uber to pinpoint petals.\",\"type\":\"boolean\"},\"useevents\":{\"default\":false,\"description\":\"Current map should use entities events or not.\",\"type\":\"boolean\"},\"usertour\":{\"type\":\"object\",\"default\":null,\"description\":\"Display a user tour at first start if enabled.\",\"properties\":{\"active\":{\"type\":\"boolean\",\"default\":true,\"description\":\"Enable or disable the user tour.\"},\"steps\":{\"type\":\"array\",\"default\":[],\"description\":\"Steps of the user tour.\",\"items\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"description\":\"Type of the step\",\"enum\":[\"filterButton\",\"menuButton\",\"livebarButton\",\"pinpointPetals\",\"shareViewButton\",\"custom\"]},\"body\":{\"type\":\"string\",\"description\":\"Text of the step\"},\"selector\":{\"type\":\"string\",\"description\":\"Selector to get the element to point with this step.\"},\"routename\":{\"type\":\"string\",\"description\":\"Name of the route to navigate before displaying the step tooltip.\"},\"routeparams\":{\"type\":\"object\",\"description\":\"Parameters of the route to navigate before displaying the step tooltip.\",\"default\":{}},\"routequery\":{\"type\":\"object\",\"description\":\"Query of the route to navigate before displaying the step tooltip.\",\"default\":{}},\"maskstyle\":{\"type\":\"object\",\"description\":\"Inline CSS style to apply to the user tour mask when displaying this step.\"},\"visibility\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"enum\":[\"mobile\",\"desktop\",\"littlescreen\"]},\"default\":[\"mobile\",\"desktop\",\"littlescreen\"]}},\"required\":[\"type\"]}}}},\"tagrules\":{\"default\":[],\"description\":\"Rules to apply for tags\",\"items\":{\"type\":\"object\",\"properties\":{\"type\":{\"description\":\"Type of rule\",\"enum\":[\"search\",\"size\",\"featured-direction\"],\"type\":\"string\"},\"tags\":{\"description\":\"List of tags to apply the rule\",\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"filteringLogic\":{\"description\":\"Logic to apply when filtering tags (OR or AND)\",\"type\":\"string\",\"enum\":[\"OR\",\"AND\"],\"default\":\"AND\"},\"minzoom\":{\"default\":null,\"description\":\"Min zoom to apply the rule\",\"type\":\"number\"},\"scale\":{\"default\":null,\"description\":\"Scale of pinpoint marker, use it with type 'size'\",\"type\":\"number\"},\"maxzoom\":{\"default\":null,\"description\":\"Max zoom to apply the rule\",\"type\":\"number\"}}},\"type\":\"array\"},\"usetags\":{\"anyOf\":[{\"type\":\"boolean\"},{\"properties\":{\"active\":{\"type\":\"boolean\"},\"filteringLogic\":{\"type\":\"string\",\"default\":\"DEFAULT\",\"enum\":[\"AND\",\"OR\",\"DEFAULT\"]},\"categories\":{\"items\":{\"properties\":{\"name\":{\"type\":\"string\"},\"slug\":{\"type\":\"string\"}},\"required\":[\"name\",\"slug\"],\"type\":\"object\"},\"type\":\"array\"},\"clickable\":{\"type\":\"boolean\"},\"tags\":{\"items\":{\"properties\":{\"category\":{\"type\":[\"boolean\",\"string\"]},\"name\":{\"type\":\"string\"},\"slug\":{\"type\":\"string\"},\"visibility\":{\"type\":\"string\"}},\"required\":[\"name\",\"slug\"],\"type\":\"object\"},\"type\":\"array\"}},\"type\":\"object\"}],\"description\":\"Show tags button in search bar, enable search by tags.\",\"type\":\"object\",\"default\":false},\"webgl\":{\"default\":true,\"description\":\"Force WEBGL livemap's rendering.\",\"type\":\"boolean\"},\"webworkerclustering\":{\"default\":false,\"description\":\"Process superclustering in a webworker\",\"type\":\"boolean\"},\"welcomebuttonlabel\":{\"default\":\"OK !\",\"description\":\"Welcome card button label.\",\"type\":\"string\"},\"zoomcontrol\":{\"default\":true,\"description\":\"Enable zoom control.\",\"type\":\"boolean\"}}"),
|
|
366
413
|
type: "object"
|
|
367
|
-
},
|
|
368
|
-
let
|
|
369
|
-
return
|
|
370
|
-
},
|
|
371
|
-
return
|
|
372
|
-
},
|
|
373
|
-
let
|
|
374
|
-
return isNaN(
|
|
375
|
-
},
|
|
376
|
-
let
|
|
377
|
-
return isNaN(
|
|
378
|
-
},
|
|
379
|
-
let
|
|
380
|
-
return
|
|
414
|
+
}, T = function(e, t) {
|
|
415
|
+
let n = e;
|
|
416
|
+
return s(n) && (n = j(n)), Array.isArray(n) ? n : t;
|
|
417
|
+
}, E = function(e, t) {
|
|
418
|
+
return l(e) ? s(e) ? (e = e.toLowerCase(), e === "true") : typeof e == "boolean" ? e : t : t;
|
|
419
|
+
}, D = function(e, t) {
|
|
420
|
+
let n = Number(e);
|
|
421
|
+
return isNaN(n) ? t : n;
|
|
422
|
+
}, O = function(e, t) {
|
|
423
|
+
let n = Number(e);
|
|
424
|
+
return isNaN(n) ? t : n;
|
|
425
|
+
}, k = function(e) {
|
|
426
|
+
let t = w.properties[e], n = P.snippet[e];
|
|
427
|
+
return l(n) ? (s(n) && (n = j(n)), u(n) || (n = {}), n = P.fillEmptyByDefault(n, "properties" in t ? t.properties : {}), n) : t.default;
|
|
381
428
|
};
|
|
382
|
-
function
|
|
383
|
-
let
|
|
384
|
-
return
|
|
429
|
+
function A(t, n) {
|
|
430
|
+
let r = j(t);
|
|
431
|
+
return r ? new e(g(r._northEast), g(r._southWest)) : n;
|
|
385
432
|
}
|
|
386
|
-
var
|
|
387
|
-
if (!
|
|
433
|
+
var j = function(e) {
|
|
434
|
+
if (!s(e) || e === null) return e;
|
|
388
435
|
try {
|
|
389
436
|
try {
|
|
390
|
-
return JSON.parse(decodeURI(
|
|
437
|
+
return JSON.parse(decodeURI(e));
|
|
391
438
|
} catch {
|
|
392
|
-
return JSON.parse(decodeURIComponent(
|
|
439
|
+
return JSON.parse(decodeURIComponent(e));
|
|
393
440
|
}
|
|
394
441
|
} catch {
|
|
395
442
|
return null;
|
|
396
443
|
}
|
|
397
|
-
},
|
|
398
|
-
|
|
399
|
-
|
|
444
|
+
}, M = function(e) {
|
|
445
|
+
let t = e;
|
|
446
|
+
if (s(t) && (t = j(t)), !u(t)) return {
|
|
447
|
+
tags: [],
|
|
448
|
+
categories: []
|
|
449
|
+
};
|
|
450
|
+
let n = Array.isArray(t.tags) ? t.tags : [], r = Array.isArray(t.categories) ? t.categories : [];
|
|
451
|
+
return {
|
|
452
|
+
tags: n.filter((e) => u(e) && s(e.name) && s(e.slug)).map((e) => {
|
|
453
|
+
let t = {
|
|
454
|
+
name: e.name,
|
|
455
|
+
slug: e.slug
|
|
456
|
+
};
|
|
457
|
+
return s(e.category) && (t.category = e.category), s(e.color) && (t.color = e.color), (e.icon === null || s(e.icon)) && (t.icon = e.icon), t;
|
|
458
|
+
}),
|
|
459
|
+
categories: r.filter((e) => u(e) && s(e.name) && s(e.slug)).map((e) => ({
|
|
460
|
+
name: e.name,
|
|
461
|
+
slug: e.slug
|
|
462
|
+
}))
|
|
463
|
+
};
|
|
464
|
+
}, N = function(e, t) {
|
|
465
|
+
return e == null || typeof e != "string" ? t : e;
|
|
466
|
+
}, P = class e {
|
|
400
467
|
static snippet = {};
|
|
401
468
|
static mapObject;
|
|
402
|
-
static getProperty(
|
|
403
|
-
let
|
|
404
|
-
return
|
|
405
|
-
}
|
|
406
|
-
static fillEmptyByDefault(
|
|
407
|
-
let
|
|
408
|
-
return
|
|
409
|
-
let
|
|
410
|
-
|
|
411
|
-
}),
|
|
412
|
-
}
|
|
413
|
-
static parse(
|
|
414
|
-
return
|
|
415
|
-
arNavigationData:
|
|
416
|
-
aroundme: !!
|
|
417
|
-
deepLinkingEnabled:
|
|
418
|
-
dragging:
|
|
419
|
-
emmid: Number(
|
|
420
|
-
handleBearing:
|
|
421
|
-
indoor:
|
|
422
|
-
initialBounds:
|
|
423
|
-
initialBearing:
|
|
424
|
-
limit: Number(
|
|
425
|
-
locked:
|
|
426
|
-
maxBounds:
|
|
427
|
-
maxZoom:
|
|
428
|
-
minZoom:
|
|
429
|
-
name:
|
|
430
|
-
pitchEnabled:
|
|
431
|
-
pitchStart:
|
|
432
|
-
providersEnabled:
|
|
433
|
-
routingMode:
|
|
434
|
-
routingType:
|
|
435
|
-
routingUrl:
|
|
436
|
-
scrollWheelZoom:
|
|
437
|
-
|
|
469
|
+
static getProperty(t) {
|
|
470
|
+
let n = w.properties[t];
|
|
471
|
+
return n.type === "array" ? T(e.snippet[t], n.default) : n.type === "boolean" ? E(e.snippet[t], n.default) : n.type === "integer" ? D(e.snippet[t], n.default) : n.type === "number" ? O(e.snippet[t], n.default) : n.type === "string" ? N(e.snippet[t], n.default) : n.type === "object" ? k(t) : null;
|
|
472
|
+
}
|
|
473
|
+
static fillEmptyByDefault(t, n) {
|
|
474
|
+
let r = { ...t };
|
|
475
|
+
return n && Object.keys(n).forEach((t) => {
|
|
476
|
+
let i = n[t];
|
|
477
|
+
r.hasOwnProperty(t) ? i.type === "object" ? r[t] = e.fillEmptyByDefault(r[t], i.properties) : i.type === "array" && i.hasOwnProperty("items") && i.items.hasOwnProperty("properties") && (r[t] = r[t].map((t) => e.fillEmptyByDefault(t, i.items.properties))) : i.hasOwnProperty("default") ? r[t] = i.default : i.type === "object" && (r[t] = e.fillEmptyByDefault(r[t], i.properties));
|
|
478
|
+
}), r;
|
|
479
|
+
}
|
|
480
|
+
static parse(t) {
|
|
481
|
+
return e.mapObject = t, e.snippet = t.snippet, {
|
|
482
|
+
arNavigationData: e.getProperty("arnavigationdata"),
|
|
483
|
+
aroundme: !!e.getProperty("aroundme"),
|
|
484
|
+
deepLinkingEnabled: e.getProperty("deeplinkingenabled"),
|
|
485
|
+
dragging: e.getProperty("dragging"),
|
|
486
|
+
emmid: Number(e.mapObject.id),
|
|
487
|
+
handleBearing: e.getProperty("handlebearing"),
|
|
488
|
+
indoor: e.getProperty("indoor"),
|
|
489
|
+
initialBounds: m(t),
|
|
490
|
+
initialBearing: e.getProperty("initialbearing"),
|
|
491
|
+
limit: Number(e.mapObject.count),
|
|
492
|
+
locked: e.getProperty("locked"),
|
|
493
|
+
maxBounds: A(e.snippet.maxbounds, d),
|
|
494
|
+
maxZoom: e.getProperty("maxzoom"),
|
|
495
|
+
minZoom: e.getProperty("minzoom"),
|
|
496
|
+
name: e.mapObject.name,
|
|
497
|
+
pitchEnabled: e.getProperty("pitchenabled"),
|
|
498
|
+
pitchStart: e.getProperty("pitchstart"),
|
|
499
|
+
providersEnabled: e.getProperty("providersenabled"),
|
|
500
|
+
routingMode: e.getProperty("routingmode"),
|
|
501
|
+
routingType: e.getProperty("routingtype"),
|
|
502
|
+
routingUrl: e.getProperty("routingurl"),
|
|
503
|
+
scrollWheelZoom: e.getProperty("scrollwheelzoom"),
|
|
504
|
+
tags: M(e.snippet.usetags),
|
|
505
|
+
tilesStyle: e.getProperty("tilesstyle")
|
|
438
506
|
};
|
|
439
507
|
}
|
|
440
|
-
}
|
|
441
|
-
const DEFAULT_THEME = {
|
|
508
|
+
}, F = {
|
|
442
509
|
colorPrimary: "#2f7de1",
|
|
443
510
|
colorOnPrimary: "#ffffff",
|
|
444
511
|
colorSurface: "#ffffff",
|
|
445
512
|
colorOnSurface: "#1a1a1a"
|
|
446
513
|
};
|
|
447
|
-
function
|
|
514
|
+
function I(e) {
|
|
448
515
|
return {
|
|
449
|
-
...
|
|
450
|
-
...
|
|
516
|
+
...F,
|
|
517
|
+
...e ?? {}
|
|
451
518
|
};
|
|
452
519
|
}
|
|
453
|
-
function
|
|
520
|
+
function L(e) {
|
|
454
521
|
return {
|
|
455
|
-
"--wemap-color-primary":
|
|
456
|
-
"--wemap-color-on-primary":
|
|
457
|
-
"--wemap-color-surface":
|
|
458
|
-
"--wemap-color-on-surface":
|
|
522
|
+
"--wemap-color-primary": e.colorPrimary,
|
|
523
|
+
"--wemap-color-on-primary": e.colorOnPrimary,
|
|
524
|
+
"--wemap-color-surface": e.colorSurface,
|
|
525
|
+
"--wemap-color-on-surface": e.colorOnSurface
|
|
459
526
|
};
|
|
460
527
|
}
|
|
461
|
-
|
|
528
|
+
//#endregion
|
|
529
|
+
//#region src/CoreConfig.ts
|
|
530
|
+
var R = class e {
|
|
462
531
|
static snippet;
|
|
463
|
-
static theme =
|
|
532
|
+
static theme = I();
|
|
464
533
|
livemapService = null;
|
|
465
534
|
env = "production";
|
|
466
535
|
constructor() {}
|
|
467
536
|
getBaseUrl() {
|
|
468
537
|
return this.env === "production" ? "https://api.getwemap.com/v3.0" : "https://apidev.maaap.it/v3.0";
|
|
469
538
|
}
|
|
470
|
-
async init(
|
|
471
|
-
if (!
|
|
472
|
-
this.env =
|
|
539
|
+
async init(t) {
|
|
540
|
+
if (!t.emmid || !t.token) throw Error("emmid and token are required");
|
|
541
|
+
this.env = t.env || "production", e.theme = I(t.theme);
|
|
542
|
+
let n = this.getBaseUrl();
|
|
543
|
+
this.livemapService = new i(n);
|
|
473
544
|
try {
|
|
474
|
-
let
|
|
475
|
-
|
|
476
|
-
} catch (
|
|
477
|
-
throw console.error("Failed to initialize Core SDK:",
|
|
545
|
+
let n = await this.livemapService.fetchLivemap(t.emmid);
|
|
546
|
+
e.snippet = P.parse(n);
|
|
547
|
+
} catch (e) {
|
|
548
|
+
throw console.error("Failed to initialize Core SDK:", e), e;
|
|
478
549
|
}
|
|
479
550
|
}
|
|
480
551
|
static getConfig() {
|
|
481
|
-
return
|
|
552
|
+
return e.snippet || {};
|
|
482
553
|
}
|
|
483
554
|
static getIndoorOptions() {
|
|
484
|
-
let
|
|
555
|
+
let t = e.getConfig().indoor;
|
|
485
556
|
return {
|
|
486
|
-
enabled:
|
|
487
|
-
minZoom:
|
|
557
|
+
enabled: t?.enable ?? !1,
|
|
558
|
+
minZoom: t?.minZoom ?? 17
|
|
488
559
|
};
|
|
489
560
|
}
|
|
490
561
|
static getMapOptions() {
|
|
491
|
-
let
|
|
562
|
+
let t = e.getConfig();
|
|
492
563
|
return {
|
|
493
|
-
style:
|
|
494
|
-
bounds:
|
|
495
|
-
maxBounds:
|
|
496
|
-
minZoom:
|
|
497
|
-
maxZoom:
|
|
498
|
-
bearing:
|
|
499
|
-
pitch:
|
|
500
|
-
dragPan:
|
|
501
|
-
dragRotate:
|
|
502
|
-
pitchWithRotate:
|
|
503
|
-
scrollZoom:
|
|
504
|
-
interactive: !
|
|
564
|
+
style: t.tilesStyle,
|
|
565
|
+
bounds: t.initialBounds,
|
|
566
|
+
maxBounds: t.maxBounds,
|
|
567
|
+
minZoom: t.minZoom,
|
|
568
|
+
maxZoom: t.maxZoom,
|
|
569
|
+
bearing: t.initialBearing,
|
|
570
|
+
pitch: t.pitchStart,
|
|
571
|
+
dragPan: t.dragging,
|
|
572
|
+
dragRotate: t.pitchEnabled,
|
|
573
|
+
pitchWithRotate: t.pitchEnabled,
|
|
574
|
+
scrollZoom: t.scrollWheelZoom,
|
|
575
|
+
interactive: !t.locked
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
static getTagsConfig() {
|
|
579
|
+
return e.getConfig().tags ?? {
|
|
580
|
+
tags: [],
|
|
581
|
+
categories: []
|
|
505
582
|
};
|
|
506
583
|
}
|
|
507
584
|
static getTheme() {
|
|
508
|
-
return
|
|
585
|
+
return e.theme;
|
|
509
586
|
}
|
|
510
587
|
static getThemeCssVariables() {
|
|
511
|
-
return
|
|
588
|
+
return L(e.theme);
|
|
512
589
|
}
|
|
513
590
|
createBuildingProvider() {
|
|
514
|
-
let
|
|
515
|
-
return (
|
|
591
|
+
let t = new a(this.getBaseUrl(), e.getConfig().emmid);
|
|
592
|
+
return (e) => t.getBuildingsFromBbox(e);
|
|
593
|
+
}
|
|
594
|
+
createBuildingService() {
|
|
595
|
+
return new a(this.getBaseUrl(), e.getConfig().emmid);
|
|
516
596
|
}
|
|
517
597
|
createPinpointManager() {
|
|
518
|
-
return new
|
|
598
|
+
return new b(this.getBaseUrl(), e.getConfig().emmid);
|
|
519
599
|
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
600
|
+
createGeocodingService(e) {
|
|
601
|
+
return new S(e);
|
|
602
|
+
}
|
|
603
|
+
}, z = new R();
|
|
604
|
+
//#endregion
|
|
605
|
+
export { a as BuildingService, R as CoreConfig, F as DEFAULT_THEME, x as GEOCODING_BASE_URL, S as GeocodingService, r as HttpClient, n as HttpError, i as LivemapService, b as PinpointManager, h as boundsToDelta, z as core, g as latLngLikeToCoordinates, I as resolveTheme, L as themeToCssVariables };
|