atriusmaps-node-sdk 3.3.898 → 3.3.900
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/nodesdk/nodeEntry.js +36 -58
- package/dist/cjs/package.json.js +8 -4
- package/dist/cjs/plugins/clientAPI/src/clientAPI.js +8 -6
- package/dist/cjs/plugins/dynamicPois/src/dynamicPois.js +50 -142
- package/dist/cjs/plugins/dynamicPois/src/processors.js +31 -53
- package/dist/cjs/plugins/flightStatus/src/flightDetailsMapper.js +47 -116
- package/dist/cjs/plugins/flightStatus/src/flightStatus.js +48 -82
- package/dist/cjs/plugins/flightStatus/src/utils.js +4 -14
- package/dist/cjs/plugins/poiDataManager/src/poiDataManager.js +77 -154
- package/dist/cjs/plugins/sdkServer/src/prepareSDKConfig.js +45 -76
- package/dist/cjs/plugins/sdkServer/src/sdkHeadless.js +70 -79
- package/dist/cjs/plugins/sdkServer/src/sdkServer.js +97 -147
- package/dist/cjs/plugins/searchService/src/flexsearchExports/lang.js +16 -190
- package/dist/cjs/plugins/searchService/src/flexsearchExports/simple.js +28 -35
- package/dist/cjs/plugins/searchService/src/poiSearch.js +10 -21
- package/dist/cjs/plugins/searchService/src/searchService.js +45 -147
- package/dist/cjs/plugins/searchService/src/searchTypeahead.js +17 -28
- package/dist/cjs/plugins/searchService/src/utils.js +9 -13
- package/dist/cjs/plugins/venueDataLoader/src/venueDataLoader.js +148 -304
- package/dist/cjs/plugins/venueDataLoader/src/venueLoadingUtils.js +47 -126
- package/dist/cjs/plugins/wayfinder/src/findRoute.js +6 -73
- package/dist/cjs/plugins/wayfinder/src/minPriorityQueue.js +7 -27
- package/dist/cjs/plugins/wayfinder/src/navGraph.js +78 -259
- package/dist/cjs/plugins/wayfinder/src/navGraphDebug.js +26 -57
- package/dist/cjs/plugins/wayfinder/src/segmentBadges.js +25 -25
- package/dist/cjs/plugins/wayfinder/src/segmentBuilder.js +50 -133
- package/dist/cjs/plugins/wayfinder/src/segmentCategories.js +29 -29
- package/dist/cjs/plugins/wayfinder/src/stepBuilder.js +53 -145
- package/dist/cjs/plugins/wayfinder/src/wayfinder.js +105 -349
- package/dist/cjs/src/app.js +53 -91
- package/dist/cjs/src/configs/postproc-mol-url-parms.js +34 -43
- package/dist/cjs/src/configs/postproc-stateTracking.js +1 -19
- package/dist/cjs/src/controller.js +4 -26
- package/dist/cjs/src/debugTools.js +55 -94
- package/dist/cjs/src/env.js +8 -19
- package/dist/cjs/src/extModules/bustle.js +15 -71
- package/dist/cjs/src/extModules/flexapi/src/help.js +7 -22
- package/dist/cjs/src/extModules/flexapi/src/index.js +15 -29
- package/dist/cjs/src/extModules/flexapi/src/validate.js +45 -93
- package/dist/cjs/src/extModules/geohasher.js +13 -31
- package/dist/cjs/src/extModules/log.js +18 -29
- package/dist/cjs/src/historyManager.js +4 -6
- package/dist/cjs/src/utils/bounds.js +2 -4
- package/dist/cjs/src/utils/buildStructureLookup.js +7 -7
- package/dist/cjs/src/utils/configUtils.js +7 -43
- package/dist/cjs/src/utils/date.js +5 -17
- package/dist/cjs/src/utils/distance.js +2 -2
- package/dist/cjs/src/utils/dom.js +9 -24
- package/dist/cjs/src/utils/funcs.js +15 -30
- package/dist/cjs/src/utils/geodesy.js +24 -39
- package/dist/cjs/src/utils/geom.js +32 -148
- package/dist/cjs/src/utils/i18n.js +39 -70
- package/dist/cjs/src/utils/isInitialState.js +7 -13
- package/dist/cjs/src/utils/location.js +10 -29
- package/dist/cjs/src/utils/observable.js +4 -29
- package/dist/cjs/src/utils/rand.js +9 -80
- package/dist/cjs/utils/constants.js +1 -1
- package/dist/package.json.js +1 -1
- package/dist/plugins/sdkServer/src/prepareSDKConfig.js +1 -1
- package/dist/src/utils/buildStructureLookup.js +1 -1
- package/dist/src/utils/date.js +1 -1
- package/package.json +1 -1
|
@@ -9,76 +9,23 @@ var geodesy = require('../../../src/utils/geodesy.js');
|
|
|
9
9
|
var segmentBadges = require('./segmentBadges.js');
|
|
10
10
|
var segmentCategories = require('./segmentCategories.js');
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* Calculate the general direction of a segment based on its waypoints.
|
|
14
|
-
* @param {Object} segment - The segment object.
|
|
15
|
-
* @param {Array} segment.waypoints - An array of waypoints.
|
|
16
|
-
* waypoint {
|
|
17
|
-
* position: { lat, lng, floorId, ordinal, structureId },
|
|
18
|
-
* }
|
|
19
|
-
* @returns {string} - The general direction of the segment.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
12
|
const calculateSegmentGeneralDirection = ({ waypoints }, T) => {
|
|
23
13
|
const [firstWaypoint] = waypoints;
|
|
24
14
|
const lastWaypoint = waypoints[waypoints.length - 1];
|
|
25
15
|
const from = helpers.point([firstWaypoint.position.lng, firstWaypoint.position.lat]);
|
|
26
16
|
const to = helpers.point([lastWaypoint.position.lng, lastWaypoint.position.lat]);
|
|
27
17
|
const bearingDegrees = bearing.bearing(from, to);
|
|
28
|
-
|
|
29
|
-
return geodesy.bearingToDirection(bearingDegrees, T); // returns cardinal direction 'north', 'northeast' etc as a string
|
|
18
|
+
return geodesy.bearingToDirection(bearingDegrees, T);
|
|
30
19
|
};
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @typedef Step
|
|
34
|
-
* @property {string} primaryText
|
|
35
|
-
* @property {string} secondaryText
|
|
36
|
-
* @property {string} icon
|
|
37
|
-
* @property {Position} animationAnchor
|
|
38
|
-
* @property {number} eta
|
|
39
|
-
* @property {number} distance
|
|
40
|
-
* @property {boolean} isAccessible
|
|
41
|
-
* @property {Bounds} bounds
|
|
42
|
-
* @property {SecurityWaitTime} securityWaitTimes
|
|
43
|
-
*
|
|
44
|
-
* @typedef Position
|
|
45
|
-
* @property {number} lat
|
|
46
|
-
* @property {number} lng
|
|
47
|
-
* @property {string} floorId
|
|
48
|
-
* @property {number} ordinal
|
|
49
|
-
* @property {string} structureId
|
|
50
|
-
*
|
|
51
|
-
* @param {Segment[]} segments
|
|
52
|
-
* @param {string} startName
|
|
53
|
-
* @param {string} destinationName
|
|
54
|
-
* @param floorIdToNameMap
|
|
55
|
-
* @param {function} T - translate function
|
|
56
|
-
* @param {QueueTypes} queueTypes
|
|
57
|
-
* @param {boolean} requiresAccessibility
|
|
58
|
-
* @return {Step[]} steps - list of navigation steps
|
|
59
|
-
*/
|
|
60
|
-
function getSteps(
|
|
61
|
-
segments,
|
|
62
|
-
startName = '',
|
|
63
|
-
destinationName = '',
|
|
64
|
-
floorIdToNameMap,
|
|
65
|
-
T,
|
|
66
|
-
queueTypes = {},
|
|
67
|
-
requiresAccessibility,
|
|
68
|
-
securityPois = [],
|
|
69
|
-
currentUnits,
|
|
70
|
-
) {
|
|
20
|
+
function getSteps(segments, startName = "", destinationName = "", floorIdToNameMap, T, queueTypes = {}, requiresAccessibility, securityPois = [], currentUnits) {
|
|
71
21
|
return segments.map((segment, index) => {
|
|
72
|
-
const securityWaitTimes = findPropWaypoints(
|
|
73
|
-
const eta =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
: Math.round(calculateSegmentEta(segment.waypoints));
|
|
77
|
-
const distance$1 = Math.round(calculateSegmentDistance(segment.waypoints)); // this is meters
|
|
78
|
-
const currentUnitsDistance = currentUnits === 'yards' ? distance.metersToYards(distance$1) : distance$1;
|
|
22
|
+
const securityWaitTimes = findPropWaypoints("securityWaitTimes")(segment.waypoints);
|
|
23
|
+
const eta = securityWaitTimes && !securityWaitTimes.isTemporarilyClosed ? securityWaitTimes.queueTime : Math.round(calculateSegmentEta(segment.waypoints));
|
|
24
|
+
const distance$1 = Math.round(calculateSegmentDistance(segment.waypoints));
|
|
25
|
+
const currentUnitsDistance = currentUnits === "yards" ? distance.metersToYards(distance$1) : distance$1;
|
|
79
26
|
const icon = getIcon(segment.segmentCategory);
|
|
80
27
|
const animationAnchor = getAnimationAnchor(segment.segmentCategory, segment.waypoints);
|
|
81
|
-
const direction = calculateSegmentGeneralDirection(segment, T);
|
|
28
|
+
const direction = calculateSegmentGeneralDirection(segment, T);
|
|
82
29
|
const primaryText = getPrimaryText(
|
|
83
30
|
segments,
|
|
84
31
|
index,
|
|
@@ -87,13 +34,12 @@ function getSteps(
|
|
|
87
34
|
floorIdToNameMap,
|
|
88
35
|
T,
|
|
89
36
|
securityPois,
|
|
90
|
-
queueTypes
|
|
37
|
+
queueTypes
|
|
91
38
|
);
|
|
92
|
-
const secondaryText = getSecondaryText(segment, eta, T, false);
|
|
93
|
-
const secondaryTextUI = getSecondaryText(segment, eta, T, true, direction, currentUnits, currentUnitsDistance);
|
|
39
|
+
const secondaryText = getSecondaryText(segment, eta, T, false);
|
|
40
|
+
const secondaryTextUI = getSecondaryText(segment, eta, T, true, direction, currentUnits, currentUnitsDistance);
|
|
94
41
|
const bounds$1 = bounds.findBoundsOfWaypoints(segment.waypoints);
|
|
95
42
|
const isAccessible = checkIfAccessible(segment);
|
|
96
|
-
|
|
97
43
|
const step = {
|
|
98
44
|
primaryText,
|
|
99
45
|
secondaryText,
|
|
@@ -104,37 +50,26 @@ function getSteps(
|
|
|
104
50
|
distance: distance$1,
|
|
105
51
|
bounds: bounds$1,
|
|
106
52
|
isAccessible,
|
|
107
|
-
securityWaitTimes
|
|
53
|
+
securityWaitTimes
|
|
108
54
|
};
|
|
109
|
-
|
|
110
55
|
if (segment.poiId) {
|
|
111
56
|
step.poiId = segment.poiId;
|
|
112
57
|
}
|
|
113
|
-
|
|
114
58
|
return step;
|
|
115
59
|
});
|
|
116
60
|
}
|
|
117
|
-
|
|
118
61
|
function calculateSegmentEta(waypoints) {
|
|
119
62
|
if (waypoints.length === 1) {
|
|
120
63
|
return waypoints[0].eta;
|
|
121
|
-
}
|
|
122
|
-
return waypoints
|
|
123
|
-
.map(R.prop('eta'))
|
|
124
|
-
.slice(1) // first waypoint is end of previous segment and is added only to connect segments for navline calculation
|
|
125
|
-
.reduce((segmentEta, eta) => segmentEta + eta, 0.0);
|
|
64
|
+
}
|
|
65
|
+
return waypoints.map(R.prop("eta")).slice(1).reduce((segmentEta, eta) => segmentEta + eta, 0);
|
|
126
66
|
}
|
|
127
|
-
|
|
128
67
|
function calculateSegmentDistance(waypoints) {
|
|
129
68
|
if (waypoints.length === 1) {
|
|
130
69
|
return waypoints[0].distance;
|
|
131
|
-
}
|
|
132
|
-
return waypoints
|
|
133
|
-
.map(waypoint => waypoint.distance)
|
|
134
|
-
.slice(1) // first waypoint is end of previous segment and is added only to connect segments for navline calculation
|
|
135
|
-
.reduce((segmentDistance, distance) => segmentDistance + distance, 0.0);
|
|
70
|
+
}
|
|
71
|
+
return waypoints.map((waypoint) => waypoint.distance).slice(1).reduce((segmentDistance, distance) => segmentDistance + distance, 0);
|
|
136
72
|
}
|
|
137
|
-
|
|
138
73
|
function getIcon(segmentCategory) {
|
|
139
74
|
switch (segmentCategory) {
|
|
140
75
|
case segmentCategories.START:
|
|
@@ -194,7 +129,6 @@ function getIcon(segmentCategory) {
|
|
|
194
129
|
return segmentBadges.WALK;
|
|
195
130
|
}
|
|
196
131
|
}
|
|
197
|
-
|
|
198
132
|
function getAnimationAnchor(segmentCategory, waypoints) {
|
|
199
133
|
let index;
|
|
200
134
|
switch (segmentCategory) {
|
|
@@ -212,7 +146,6 @@ function getAnimationAnchor(segmentCategory, waypoints) {
|
|
|
212
146
|
}
|
|
213
147
|
return waypoints[index].position;
|
|
214
148
|
}
|
|
215
|
-
|
|
216
149
|
function getPrimaryText(segments, index, startName, destinationName, floorIdToNameMap, T, securityPois, queueTypes) {
|
|
217
150
|
const segment = segments[index];
|
|
218
151
|
switch (segment.segmentCategory) {
|
|
@@ -224,9 +157,8 @@ function getPrimaryText(segments, index, startName, destinationName, floorIdToNa
|
|
|
224
157
|
const lookAheadWaypoints = segments[index + 1].waypoints;
|
|
225
158
|
const laneName = getSecurityLaneName(queueTypes, lookAheadWaypoints);
|
|
226
159
|
const securityLane = laneName ? T(`wayfinder:Security Lane`, { laneName }) : null;
|
|
227
|
-
|
|
228
160
|
const poiTitle = getClosestSecurityPoiTitle(lookAheadWaypoints, securityPois);
|
|
229
|
-
const displayName = securityLane || poiTitle;
|
|
161
|
+
const displayName = securityLane || poiTitle;
|
|
230
162
|
return displayName || T(`wayfinder:${segment.type}`);
|
|
231
163
|
}
|
|
232
164
|
case segmentCategories.WALKING_TO_PORTAL:
|
|
@@ -235,7 +167,7 @@ function getPrimaryText(segments, index, startName, destinationName, floorIdToNa
|
|
|
235
167
|
const laneName = getSecurityLaneName(queueTypes, segment.waypoints);
|
|
236
168
|
const securityLane = laneName ? T(`wayfinder:Security Lane`, { laneName }) : null;
|
|
237
169
|
const poiTitle = getClosestSecurityPoiTitle(segment.waypoints, securityPois);
|
|
238
|
-
const displayName = securityLane || poiTitle;
|
|
170
|
+
const displayName = securityLane || poiTitle;
|
|
239
171
|
return displayName || getLevelName(segment, floorIdToNameMap);
|
|
240
172
|
}
|
|
241
173
|
case segmentCategories.ELEVATOR:
|
|
@@ -255,49 +187,45 @@ function getPrimaryText(segments, index, startName, destinationName, floorIdToNa
|
|
|
255
187
|
return T(`wayfinder:${segment.type}`);
|
|
256
188
|
}
|
|
257
189
|
}
|
|
258
|
-
|
|
259
190
|
function getPositionName(position, poiName) {
|
|
260
191
|
if (position.name) {
|
|
261
192
|
return position.name;
|
|
262
193
|
}
|
|
263
194
|
return poiName;
|
|
264
195
|
}
|
|
265
|
-
|
|
266
196
|
function getLevelName(segment, floorIdToNameMap) {
|
|
267
197
|
return floorIdToNameMap[R.last(segment.waypoints).position.floorId];
|
|
268
198
|
}
|
|
269
|
-
|
|
270
199
|
function getSecondaryText(segment, minutes, T, ui, direction, currentUnits, currentUnitsDistance) {
|
|
271
200
|
const zeroOrOtherKeys = translateZeroOrOther(minutes, T);
|
|
272
|
-
|
|
273
|
-
const travelVerb = 'Proceed';
|
|
201
|
+
const travelVerb = "Proceed";
|
|
274
202
|
switch (segment.segmentCategory) {
|
|
275
203
|
case segmentCategories.START:
|
|
276
|
-
return T(
|
|
204
|
+
return T("wayfinder:Begin route at");
|
|
277
205
|
case segmentCategories.ELEVATOR:
|
|
278
|
-
return T(
|
|
206
|
+
return T("wayfinder:Take elevator to");
|
|
279
207
|
case segmentCategories.ELEVATOR_UP:
|
|
280
|
-
return T(
|
|
208
|
+
return T("wayfinder:Take elevator up to");
|
|
281
209
|
case segmentCategories.ELEVATOR_DOWN:
|
|
282
|
-
return T(
|
|
210
|
+
return T("wayfinder:Take elevator down to");
|
|
283
211
|
case segmentCategories.STAIRS:
|
|
284
|
-
return T(
|
|
212
|
+
return T("wayfinder:Take stairs to");
|
|
285
213
|
case segmentCategories.STAIRS_UP:
|
|
286
|
-
return T(
|
|
214
|
+
return T("wayfinder:Take stairs up to");
|
|
287
215
|
case segmentCategories.STAIRS_DOWN:
|
|
288
|
-
return T(
|
|
216
|
+
return T("wayfinder:Take stairs down to");
|
|
289
217
|
case segmentCategories.ACCESSIBLE_STAIRS:
|
|
290
|
-
return T(
|
|
218
|
+
return T("wayfinder:Take accessible stairs to");
|
|
291
219
|
case segmentCategories.ACCESSIBLE_STAIRS_UP:
|
|
292
|
-
return T(
|
|
220
|
+
return T("wayfinder:Take accessible stairs up to");
|
|
293
221
|
case segmentCategories.ACCESSIBLE_STAIRS_DOWN:
|
|
294
|
-
return T(
|
|
222
|
+
return T("wayfinder:Take accessible stairs down to");
|
|
295
223
|
case segmentCategories.ESCALATOR:
|
|
296
|
-
return T(
|
|
224
|
+
return T("wayfinder:Take escalator to");
|
|
297
225
|
case segmentCategories.ESCALATOR_UP:
|
|
298
|
-
return T(
|
|
226
|
+
return T("wayfinder:Take escalator up to");
|
|
299
227
|
case segmentCategories.ESCALATOR_DOWN:
|
|
300
|
-
return T(
|
|
228
|
+
return T("wayfinder:Take escalator down to");
|
|
301
229
|
case segmentCategories.WALK:
|
|
302
230
|
case segmentCategories.WALKING_TO_SECURITY_CHECKPOINT:
|
|
303
231
|
case segmentCategories.WALKING_TO_PORTAL:
|
|
@@ -313,73 +241,53 @@ function getSecondaryText(segment, minutes, T, ui, direction, currentUnits, curr
|
|
|
313
241
|
case segmentCategories.WALK_UP:
|
|
314
242
|
return zeroOrOtherKeys(`${travelVerb} <1 minute up to`, `${travelVerb} xx minute up to`);
|
|
315
243
|
case segmentCategories.TRAIN:
|
|
316
|
-
return zeroOrOtherKeys(
|
|
244
|
+
return zeroOrOtherKeys("Take train <1 minute", "Take train xx minute");
|
|
317
245
|
case segmentCategories.BUS:
|
|
318
|
-
return zeroOrOtherKeys(
|
|
246
|
+
return zeroOrOtherKeys("Take bus <1 minute", "Take bus xx minute");
|
|
319
247
|
case segmentCategories.SECURITY_CHECKPOINT: {
|
|
320
|
-
return T(
|
|
248
|
+
return T("wayfinder:Through");
|
|
321
249
|
}
|
|
322
250
|
case segmentCategories.RAMP:
|
|
323
|
-
return T(
|
|
251
|
+
return T("wayfinder:Take ramp to");
|
|
324
252
|
case segmentCategories.RAMP_UP:
|
|
325
|
-
return T(
|
|
253
|
+
return T("wayfinder:Take ramp up to");
|
|
326
254
|
case segmentCategories.RAMP_DOWN:
|
|
327
|
-
return T(
|
|
255
|
+
return T("wayfinder:Take ramp down to");
|
|
328
256
|
default:
|
|
329
|
-
return
|
|
257
|
+
return "";
|
|
330
258
|
}
|
|
331
259
|
}
|
|
332
|
-
|
|
333
260
|
const createSecondaryTextWithHeading = (currentUnitsDistance, currentUnits, direction, T) => {
|
|
334
|
-
return currentUnits ===
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
:
|
|
340
|
-
|
|
341
|
-
count: currentUnitsDistance,
|
|
342
|
-
});
|
|
261
|
+
return currentUnits === "meters" ? T(`wayfinder:Proceed __direction__ __count__ meter to`, {
|
|
262
|
+
direction,
|
|
263
|
+
count: currentUnitsDistance
|
|
264
|
+
}) : T(`wayfinder:Proceed __direction__ __count__ yard to`, {
|
|
265
|
+
direction,
|
|
266
|
+
count: currentUnitsDistance
|
|
267
|
+
});
|
|
343
268
|
};
|
|
344
|
-
|
|
345
|
-
const
|
|
346
|
-
count === 0 ? T('wayfinder:' + zeroKey) : T('wayfinder:' + otherKey, { count });
|
|
347
|
-
|
|
348
|
-
const checkIfAccessible = R.compose(R.not, R.includes(R.__, ['escalator', 'stairs']), R.toLower, R.prop('type'));
|
|
349
|
-
|
|
269
|
+
const translateZeroOrOther = (count, T) => (zeroKey, otherKey) => count === 0 ? T("wayfinder:" + zeroKey) : T("wayfinder:" + otherKey, { count });
|
|
270
|
+
const checkIfAccessible = R.compose(R.not, R.includes(R.__, ["escalator", "stairs"]), R.toLower, R.prop("type"));
|
|
350
271
|
const getSecurityLaneName = (queueTypes, waypoints) => {
|
|
351
|
-
const lane = findPropWaypoints(
|
|
272
|
+
const lane = findPropWaypoints("securityLane")(waypoints);
|
|
352
273
|
if (!lane) {
|
|
353
274
|
return;
|
|
354
275
|
}
|
|
355
276
|
const types = R.prop(lane.type, queueTypes);
|
|
356
|
-
const laneType = R.find(R.propEq(lane.id,
|
|
357
|
-
return R.prop(
|
|
277
|
+
const laneType = R.find(R.propEq(lane.id, "id"), types);
|
|
278
|
+
return R.prop("displayText", laneType);
|
|
358
279
|
};
|
|
359
|
-
|
|
360
|
-
const findPropWaypoints = propName => R.compose(R.prop(propName), R.find(R.prop(propName)), R.drop(1)); // because first waypoint is the end of previous segment and can be security checkpoint
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* Given an array of waypoints (with exactly one having portalType "Security Checkpoint")
|
|
364
|
-
* and an array of securityPois, this function uses the checkpoint's position
|
|
365
|
-
* to determine the closest security POI.
|
|
366
|
-
*
|
|
367
|
-
* @param {Array} waypoints - Array of waypoint objects.
|
|
368
|
-
* @param {Array} securityPois - Array of security POI objects.
|
|
369
|
-
* @returns {string|null} - The name of the closest security POI, or null if none found.
|
|
370
|
-
*/
|
|
280
|
+
const findPropWaypoints = (propName) => R.compose(R.prop(propName), R.find(R.prop(propName)), R.drop(1));
|
|
371
281
|
const getClosestSecurityPoiTitle = (waypoints, securityPois) => {
|
|
372
282
|
if (!waypoints || waypoints.length === 0) {
|
|
373
283
|
return null;
|
|
374
284
|
}
|
|
375
|
-
|
|
376
285
|
const checkpointWaypoint = waypoints[0];
|
|
377
286
|
const { lat, lng, floorId } = checkpointWaypoint.position;
|
|
378
|
-
|
|
379
|
-
const sameFloorCandidates = securityPois.filter(poi => poi.position && poi.position.floorId === floorId);
|
|
287
|
+
const sameFloorCandidates = securityPois.filter((poi) => poi.position && poi.position.floorId === floorId);
|
|
380
288
|
let closest = null;
|
|
381
289
|
let minDistance = Infinity;
|
|
382
|
-
sameFloorCandidates.forEach(poi => {
|
|
290
|
+
sameFloorCandidates.forEach((poi) => {
|
|
383
291
|
const d = geodesy.distance(lat, lng, poi.position.latitude, poi.position.longitude);
|
|
384
292
|
if (d < minDistance) {
|
|
385
293
|
minDistance = d;
|