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
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const segmentBadges = {
|
|
4
|
-
START:
|
|
5
|
-
END:
|
|
6
|
-
ELEVATOR:
|
|
7
|
-
ELEVATOR_UP:
|
|
8
|
-
ELEVATOR_DOWN:
|
|
9
|
-
STAIRS:
|
|
10
|
-
STAIRS_UP:
|
|
11
|
-
STAIRS_DOWN:
|
|
12
|
-
ACCESSIBLE_STAIRS:
|
|
13
|
-
ACCESSIBLE_STAIRS_UP:
|
|
14
|
-
ACCESSIBLE_STAIRS_DOWN:
|
|
15
|
-
ESCALATOR:
|
|
16
|
-
ESCALATOR_UP:
|
|
17
|
-
ESCALATOR_DOWN:
|
|
18
|
-
WALK:
|
|
19
|
-
TRAIN:
|
|
20
|
-
TRAIN_UP:
|
|
21
|
-
TRAIN_DOWN:
|
|
22
|
-
BUS:
|
|
23
|
-
BUS_UP:
|
|
24
|
-
BUS_DOWN:
|
|
25
|
-
SECURITY_CHECKPOINT:
|
|
26
|
-
RAMP:
|
|
27
|
-
RAMP_UP:
|
|
28
|
-
RAMP_DOWN:
|
|
4
|
+
START: "wayfinding.start",
|
|
5
|
+
END: "wayfinding.end",
|
|
6
|
+
ELEVATOR: "wayfinding.elevator",
|
|
7
|
+
ELEVATOR_UP: "wayfinding.elevator.up",
|
|
8
|
+
ELEVATOR_DOWN: "wayfinding.elevator.down",
|
|
9
|
+
STAIRS: "wayfinding.stairs",
|
|
10
|
+
STAIRS_UP: "wayfinding.stairs.up",
|
|
11
|
+
STAIRS_DOWN: "wayfinding.stairs.down",
|
|
12
|
+
ACCESSIBLE_STAIRS: "wayfinding.accessiblestairs",
|
|
13
|
+
ACCESSIBLE_STAIRS_UP: "wayfinding.accessiblestairs.up",
|
|
14
|
+
ACCESSIBLE_STAIRS_DOWN: "wayfinding.accessiblestairs.down",
|
|
15
|
+
ESCALATOR: "wayfinding.escalator",
|
|
16
|
+
ESCALATOR_UP: "wayfinding.escalator.up",
|
|
17
|
+
ESCALATOR_DOWN: "wayfinding.escalator.down",
|
|
18
|
+
WALK: "wayfinding.movingwalkway",
|
|
19
|
+
TRAIN: "wayfinding.train",
|
|
20
|
+
TRAIN_UP: "wayfinding.train.up",
|
|
21
|
+
TRAIN_DOWN: "wayfinding.train.down",
|
|
22
|
+
BUS: "wayfinding.bus",
|
|
23
|
+
BUS_UP: "wayfinding.bus.up",
|
|
24
|
+
BUS_DOWN: "wayfinding.bus.down",
|
|
25
|
+
SECURITY_CHECKPOINT: "wayfinding.security",
|
|
26
|
+
RAMP: "wayfinding.ramp",
|
|
27
|
+
RAMP_UP: "wayfinding.ramp.up",
|
|
28
|
+
RAMP_DOWN: "wayfinding.ramp.down"
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
module.exports = segmentBadges;
|
|
@@ -24,21 +24,19 @@ function _interopNamespaceDefault(e) {
|
|
|
24
24
|
|
|
25
25
|
var R__namespace = /*#__PURE__*/_interopNamespaceDefault(R);
|
|
26
26
|
|
|
27
|
-
const setSegmentCategory = segments => {
|
|
28
|
-
// Set the category of each segment based on the type of the current segment or the type of the next segment in case we are walking
|
|
29
|
-
// to a portal or to a security checkpoint
|
|
27
|
+
const setSegmentCategory = (segments) => {
|
|
30
28
|
segments.forEach((segment, index) => {
|
|
31
29
|
if (index === 0) {
|
|
32
30
|
segment.segmentCategory = segmentCategories.START;
|
|
33
31
|
} else if (segment.waypoints[segment.waypoints.length - 1].isDestination) {
|
|
34
32
|
segment.segmentCategory = segmentCategories.WALKING_TO_END;
|
|
35
|
-
} else if (segment.type ===
|
|
33
|
+
} else if (segment.type === "Security Checkpoint") {
|
|
36
34
|
segment.segmentCategory = segmentCategories.SECURITY_CHECKPOINT;
|
|
37
|
-
} else if (segment.type ===
|
|
35
|
+
} else if (segment.type === "Bus") {
|
|
38
36
|
segment.segmentCategory = segmentCategories.BUS;
|
|
39
|
-
} else if (segment.type ===
|
|
37
|
+
} else if (segment.type === "Train") {
|
|
40
38
|
segment.segmentCategory = segmentCategories.TRAIN;
|
|
41
|
-
} else if (segment.type ===
|
|
39
|
+
} else if (segment.type === "Stairs") {
|
|
42
40
|
if (segment.levelDifference > 0) {
|
|
43
41
|
segment.segmentCategory = segmentCategories.STAIRS_UP;
|
|
44
42
|
} else if (segment.levelDifference < 0) {
|
|
@@ -46,7 +44,7 @@ const setSegmentCategory = segments => {
|
|
|
46
44
|
} else {
|
|
47
45
|
segment.segmentCategory = segmentCategories.STAIRS;
|
|
48
46
|
}
|
|
49
|
-
} else if (segment.type ===
|
|
47
|
+
} else if (segment.type === "AccessibleStairs") {
|
|
50
48
|
if (segment.levelDifference > 0) {
|
|
51
49
|
segment.segmentCategory = segmentCategories.ACCESSIBLE_STAIRS_UP;
|
|
52
50
|
} else if (segment.levelDifference < 0) {
|
|
@@ -54,7 +52,7 @@ const setSegmentCategory = segments => {
|
|
|
54
52
|
} else {
|
|
55
53
|
segment.segmentCategory = segmentCategories.ACCESSIBLE_STAIRS;
|
|
56
54
|
}
|
|
57
|
-
} else if (segment.type ===
|
|
55
|
+
} else if (segment.type === "Elevator") {
|
|
58
56
|
if (segment.levelDifference > 0) {
|
|
59
57
|
segment.segmentCategory = segmentCategories.ELEVATOR_UP;
|
|
60
58
|
} else if (segment.levelDifference < 0) {
|
|
@@ -62,7 +60,7 @@ const setSegmentCategory = segments => {
|
|
|
62
60
|
} else {
|
|
63
61
|
segment.segmentCategory = segmentCategories.ELEVATOR;
|
|
64
62
|
}
|
|
65
|
-
} else if (segment.type ===
|
|
63
|
+
} else if (segment.type === "Escalator") {
|
|
66
64
|
if (segment.levelDifference > 0) {
|
|
67
65
|
segment.segmentCategory = segmentCategories.ESCALATOR_UP;
|
|
68
66
|
} else if (segment.levelDifference < 0) {
|
|
@@ -70,7 +68,7 @@ const setSegmentCategory = segments => {
|
|
|
70
68
|
} else {
|
|
71
69
|
segment.segmentCategory = segmentCategories.ESCALATOR;
|
|
72
70
|
}
|
|
73
|
-
} else if (segment.type ===
|
|
71
|
+
} else if (segment.type === "Ramp") {
|
|
74
72
|
if (segment.levelDifference > 0) {
|
|
75
73
|
segment.segmentCategory = segmentCategories.RAMP_UP;
|
|
76
74
|
} else if (segment.levelDifference < 0) {
|
|
@@ -78,28 +76,23 @@ const setSegmentCategory = segments => {
|
|
|
78
76
|
} else {
|
|
79
77
|
segment.segmentCategory = segmentCategories.RAMP;
|
|
80
78
|
}
|
|
81
|
-
} else if (segments[index + 1].type ===
|
|
79
|
+
} else if (segments[index + 1].type === "Security Checkpoint") {
|
|
82
80
|
segment.segmentCategory = segmentCategories.WALKING_TO_SECURITY_CHECKPOINT;
|
|
83
|
-
} else if (segments[index + 1].type !==
|
|
81
|
+
} else if (segments[index + 1].type !== "Walk") {
|
|
84
82
|
segment.segmentCategory = segmentCategories.WALKING_TO_PORTAL;
|
|
85
83
|
}
|
|
86
84
|
});
|
|
87
85
|
};
|
|
88
|
-
|
|
89
86
|
const existsEnd = (segments, lastWaypoint) => {
|
|
90
|
-
// if we have only one segment, add an extra segment with only the last point to simulate the end,
|
|
91
|
-
// that way we can draw separate markers for the start and the end of the navigation
|
|
92
87
|
if (segments.length === 1) {
|
|
93
|
-
const segment = { segmentCategory:
|
|
88
|
+
const segment = { segmentCategory: void 0, waypoints: [] };
|
|
94
89
|
segment.segmentCategory = segmentCategories.WALKING_TO_END;
|
|
95
|
-
segment.type =
|
|
90
|
+
segment.type = "Walk";
|
|
96
91
|
segment.waypoints = [lastWaypoint];
|
|
97
92
|
segments.push(segment);
|
|
98
93
|
}
|
|
99
94
|
};
|
|
100
|
-
|
|
101
|
-
// todo refactor to not affect step builder
|
|
102
|
-
const joinSegments = segments => {
|
|
95
|
+
const joinSegments = (segments) => {
|
|
103
96
|
segments.forEach((segment, index) => {
|
|
104
97
|
if (index > 1) {
|
|
105
98
|
const firstWaypointOfSegment = R__namespace.head(segment.waypoints);
|
|
@@ -110,63 +103,40 @@ const joinSegments = segments => {
|
|
|
110
103
|
}
|
|
111
104
|
});
|
|
112
105
|
};
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return [[waypoint.position.lng, waypoint.position.lat]];
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
const addCurveLineCoordinates = R__namespace.map(R__namespace.converge(R__namespace.assoc('coordinates'), [calculateCurveLineCoordinates, R__namespace.identity]));
|
|
129
|
-
|
|
130
|
-
// todo refactor
|
|
131
|
-
const createSegments = waypoints => {
|
|
106
|
+
const calculateCurveLineCoordinates = (segment) => segment.waypoints.flatMap((waypoint, index) => {
|
|
107
|
+
if (index > 0 && waypoint.curvedPathForward && waypoint.curvedPathForward.length > 0) {
|
|
108
|
+
return waypoint.curvedPathForward.flatMap(
|
|
109
|
+
(p) => geom.bezierCurveTo(p.start.lng, p.start.lat, p.in.lng, p.in.lat, p.out.lng, p.out.lat, p.end.lng, p.end.lat)
|
|
110
|
+
).map((el) => [el.x, el.y]);
|
|
111
|
+
} else {
|
|
112
|
+
return [[waypoint.position.lng, waypoint.position.lat]];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
const addCurveLineCoordinates = R__namespace.map(R__namespace.converge(R__namespace.assoc("coordinates"), [calculateCurveLineCoordinates, R__namespace.identity]));
|
|
116
|
+
const createSegments = (waypoints) => {
|
|
132
117
|
const segments = [];
|
|
133
|
-
let segment = { segmentCategory:
|
|
118
|
+
let segment = { segmentCategory: void 0, waypoints: [] };
|
|
134
119
|
let lastWaypoint = null;
|
|
135
120
|
let segmentWaypoints = [];
|
|
136
|
-
|
|
137
|
-
// Always add the first point to be the start of the route
|
|
138
121
|
segment.waypoints = [waypoints[0]];
|
|
139
|
-
segment.type = waypoints[0].isPortal ? waypoints[0].portalType :
|
|
122
|
+
segment.type = waypoints[0].isPortal ? waypoints[0].portalType : "Walk";
|
|
140
123
|
segments.push(segment);
|
|
141
|
-
segment = { segmentCategory:
|
|
142
|
-
|
|
143
|
-
waypoints.forEach(waypoint => {
|
|
124
|
+
segment = { segmentCategory: void 0, waypoints: [] };
|
|
125
|
+
waypoints.forEach((waypoint) => {
|
|
144
126
|
segmentWaypoints.push(waypoint);
|
|
145
|
-
|
|
146
127
|
if (!lastWaypoint) {
|
|
147
|
-
|
|
148
|
-
segment.type = waypoint.isPortal ? waypoint.portalType : 'Walk';
|
|
128
|
+
segment.type = waypoint.isPortal ? waypoint.portalType : "Walk";
|
|
149
129
|
lastWaypoint = waypoint;
|
|
150
130
|
} else {
|
|
151
|
-
if (
|
|
152
|
-
lastWaypoint.isPortal === waypoint.isPortal &&
|
|
153
|
-
lastWaypoint.isSecurityCheckpoint === waypoint.isSecurityCheckpoint
|
|
154
|
-
) {
|
|
155
|
-
// todo not sure if this can happen
|
|
131
|
+
if (lastWaypoint.isPortal === waypoint.isPortal && lastWaypoint.isSecurityCheckpoint === waypoint.isSecurityCheckpoint) {
|
|
156
132
|
segment.levelDifference = waypoint.levelDifference;
|
|
157
133
|
} else {
|
|
158
134
|
segment.waypoints = segmentWaypoints;
|
|
159
|
-
|
|
160
135
|
if (waypoint.isPortal || lastWaypoint.isPortal) {
|
|
161
136
|
if (segmentWaypoints.length > 1) {
|
|
162
137
|
segmentWaypoints.pop();
|
|
163
138
|
}
|
|
164
|
-
|
|
165
|
-
// if the portal is not train or bus, we only want it to be one point segment
|
|
166
|
-
if (
|
|
167
|
-
waypoint.isPortal &&
|
|
168
|
-
(waypoint.portalType.toLowerCase() === 'train' || waypoint.portalType.toLowerCase() === 'bus')
|
|
169
|
-
) {
|
|
139
|
+
if (waypoint.isPortal && (waypoint.portalType.toLowerCase() === "train" || waypoint.portalType.toLowerCase() === "bus")) {
|
|
170
140
|
segmentWaypoints = [segmentWaypoints[segmentWaypoints.length - 1], waypoint];
|
|
171
141
|
} else {
|
|
172
142
|
segmentWaypoints = [waypoint];
|
|
@@ -174,120 +144,69 @@ const createSegments = waypoints => {
|
|
|
174
144
|
} else {
|
|
175
145
|
segmentWaypoints = [];
|
|
176
146
|
}
|
|
177
|
-
|
|
178
147
|
if (lastWaypoint.poiId) {
|
|
179
148
|
segment.poiId = lastWaypoint.poiId;
|
|
180
149
|
}
|
|
181
150
|
segments.push(segment);
|
|
182
|
-
|
|
183
|
-
segment =
|
|
184
|
-
|
|
185
|
-
segment.type = waypoint.isPortal ? waypoint.portalType : 'Walk';
|
|
151
|
+
segment = { segmentCategory: void 0, waypoints: [] };
|
|
152
|
+
segment.type = waypoint.isPortal ? waypoint.portalType : "Walk";
|
|
186
153
|
segment.levelDifference = waypoint.levelDifference;
|
|
187
154
|
}
|
|
188
|
-
|
|
189
155
|
lastWaypoint = waypoint;
|
|
190
156
|
}
|
|
191
157
|
});
|
|
192
|
-
|
|
193
158
|
segment.waypoints = segmentWaypoints;
|
|
194
|
-
|
|
195
159
|
if (segmentWaypoints.length === 0) {
|
|
196
160
|
segment.waypoints = [lastWaypoint];
|
|
197
161
|
}
|
|
198
|
-
|
|
199
162
|
segments.push(segment);
|
|
200
|
-
|
|
201
163
|
setSegmentCategory(segments);
|
|
202
|
-
|
|
203
164
|
existsEnd(segments, lastWaypoint);
|
|
204
|
-
|
|
205
165
|
joinSegments(segments);
|
|
206
|
-
|
|
207
166
|
return segments;
|
|
208
167
|
};
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
return 'nav.train';
|
|
168
|
+
const getSegmentType = (segment) => {
|
|
169
|
+
if (segment.type === "Train") {
|
|
170
|
+
return "nav.train";
|
|
213
171
|
}
|
|
214
|
-
if (segment.type ===
|
|
215
|
-
return
|
|
172
|
+
if (segment.type === "Bus") {
|
|
173
|
+
return "nav.transit";
|
|
216
174
|
}
|
|
217
|
-
if (segment.type ===
|
|
218
|
-
return
|
|
175
|
+
if (segment.type === "Security Checkpoint") {
|
|
176
|
+
return "nav.secure";
|
|
219
177
|
}
|
|
220
|
-
return
|
|
178
|
+
return "nav.primary";
|
|
221
179
|
};
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
*
|
|
225
|
-
* @typedef Badge
|
|
226
|
-
* @property {string} canonicalName
|
|
227
|
-
* @property {Coordinate} coordinates
|
|
228
|
-
*
|
|
229
|
-
* @typedef Segment
|
|
230
|
-
* @property {string} levelId
|
|
231
|
-
* @property {string} ordinalId
|
|
232
|
-
* @property {string} segmentType
|
|
233
|
-
* @property {Boolean} shouldDrawSegment - to not show edges like stairs or elevator
|
|
234
|
-
* @property {Array.<Coordinate>} coordinates - list of coordinate pairs [lng, lat]
|
|
235
|
-
* @property {Array<Badge>} badges
|
|
236
|
-
*
|
|
237
|
-
* @param {Waypoint} waypoints
|
|
238
|
-
* @param {Endpoint} fromEndpoint
|
|
239
|
-
* @param {Endpoint} toEndpoint
|
|
240
|
-
* @param {Object.<string, string>} floorIdToNameMap - dictionary of floor id to floor name
|
|
241
|
-
* @param T - i18n translations function
|
|
242
|
-
* @param {QueueTypes} queueTypes
|
|
243
|
-
* @param {boolean} requiresAccessibility
|
|
244
|
-
* @return {{steps: Step[], segments: Segment[]}}
|
|
245
|
-
*/
|
|
246
|
-
const buildSegments = (
|
|
247
|
-
waypoints,
|
|
248
|
-
fromEndpoint,
|
|
249
|
-
toEndpoint,
|
|
250
|
-
floorIdToNameMap,
|
|
251
|
-
T,
|
|
252
|
-
queueTypes,
|
|
253
|
-
requiresAccessibility,
|
|
254
|
-
securityPois,
|
|
255
|
-
currentUnits,
|
|
256
|
-
) => {
|
|
180
|
+
const buildSegments = (waypoints, fromEndpoint, toEndpoint, floorIdToNameMap, T, queueTypes, requiresAccessibility, securityPois, currentUnits) => {
|
|
257
181
|
let rawSegments = createSegments(waypoints);
|
|
258
182
|
rawSegments = addCurveLineCoordinates(rawSegments);
|
|
259
|
-
|
|
260
|
-
// add start location (kiosk) as first coordinate to link it with the navline
|
|
261
183
|
if (fromEndpoint) {
|
|
262
184
|
rawSegments[0].coordinates.unshift([fromEndpoint.lng, fromEndpoint.lat]);
|
|
263
185
|
}
|
|
264
|
-
|
|
265
186
|
if (toEndpoint) {
|
|
266
187
|
R__namespace.last(rawSegments).coordinates.push([toEndpoint.lng, toEndpoint.lat]);
|
|
267
188
|
}
|
|
268
|
-
|
|
269
189
|
const segments = rawSegments.map((segment, index) => {
|
|
270
190
|
const startWaypoint = R__namespace.last(segment.waypoints);
|
|
271
191
|
const coordinates = segment.coordinates;
|
|
272
|
-
const shouldDrawSegment = !(segment.levelDifference && segment.waypoints.every(R__namespace.prop(
|
|
192
|
+
const shouldDrawSegment = !(segment.levelDifference && segment.waypoints.every(R__namespace.prop("isPortal")));
|
|
273
193
|
const cookedSegment = {
|
|
274
194
|
levelId: startWaypoint.position.structureId,
|
|
275
195
|
ordinalId: `ordinal: ${startWaypoint.position.ordinal}`,
|
|
276
196
|
coordinates,
|
|
277
|
-
shouldDrawSegment
|
|
197
|
+
shouldDrawSegment
|
|
278
198
|
};
|
|
279
|
-
|
|
280
199
|
const badges = [];
|
|
281
200
|
if (segmentCategories.WALKING_TO_PORTAL === segment.segmentCategory) {
|
|
282
201
|
const nextSegment = rawSegments[index + 1];
|
|
283
202
|
badges.push({
|
|
284
203
|
canonicalName: `wayfinding.${nextSegment.segmentCategory}`,
|
|
285
|
-
coordinates: R__namespace.last(coordinates)
|
|
204
|
+
coordinates: R__namespace.last(coordinates)
|
|
286
205
|
});
|
|
287
206
|
} else if (segmentCategories.START !== segment.segmentCategory) {
|
|
288
207
|
badges.push({
|
|
289
208
|
canonicalName: `wayfinding.${segment.segmentCategory}`,
|
|
290
|
-
coordinates: R__namespace.last(coordinates)
|
|
209
|
+
coordinates: R__namespace.last(coordinates)
|
|
291
210
|
});
|
|
292
211
|
}
|
|
293
212
|
cookedSegment.badges = badges;
|
|
@@ -297,19 +216,17 @@ const buildSegments = (
|
|
|
297
216
|
}
|
|
298
217
|
return cookedSegment;
|
|
299
218
|
});
|
|
300
|
-
|
|
301
219
|
const steps = stepBuilder(
|
|
302
220
|
rawSegments,
|
|
303
|
-
R__namespace.prop(
|
|
304
|
-
R__namespace.prop(
|
|
221
|
+
R__namespace.prop("title", fromEndpoint),
|
|
222
|
+
R__namespace.prop("title", toEndpoint),
|
|
305
223
|
floorIdToNameMap,
|
|
306
224
|
T,
|
|
307
225
|
queueTypes,
|
|
308
226
|
requiresAccessibility,
|
|
309
227
|
securityPois,
|
|
310
|
-
currentUnits
|
|
228
|
+
currentUnits
|
|
311
229
|
);
|
|
312
|
-
|
|
313
230
|
return { segments, steps };
|
|
314
231
|
};
|
|
315
232
|
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const segmentCategories = {
|
|
4
|
-
START:
|
|
5
|
-
WALKING_TO_SECURITY_CHECKPOINT:
|
|
6
|
-
WALKING_TO_PORTAL:
|
|
7
|
-
WALKING_TO_END:
|
|
8
|
-
ELEVATOR:
|
|
9
|
-
ELEVATOR_UP:
|
|
10
|
-
ELEVATOR_DOWN:
|
|
11
|
-
STAIRS:
|
|
12
|
-
STAIRS_UP:
|
|
13
|
-
STAIRS_DOWN:
|
|
14
|
-
ACCESSIBLE_STAIRS:
|
|
15
|
-
ACCESSIBLE_STAIRS_UP:
|
|
16
|
-
ACCESSIBLE_STAIRS_DOWN:
|
|
17
|
-
ESCALATOR:
|
|
18
|
-
ESCALATOR_UP:
|
|
19
|
-
ESCALATOR_DOWN:
|
|
20
|
-
WALK:
|
|
21
|
-
WALK_DOWN:
|
|
22
|
-
WALK_UP:
|
|
23
|
-
TRAIN:
|
|
24
|
-
TRAIN_UP:
|
|
25
|
-
TRAIN_DOWN:
|
|
26
|
-
BUS:
|
|
27
|
-
BUS_UP:
|
|
28
|
-
BUS_DOWN:
|
|
29
|
-
SECURITY_CHECKPOINT:
|
|
30
|
-
RAMP:
|
|
31
|
-
RAMP_UP:
|
|
32
|
-
RAMP_DOWN:
|
|
4
|
+
START: "start",
|
|
5
|
+
WALKING_TO_SECURITY_CHECKPOINT: "walking to security checkpoint",
|
|
6
|
+
WALKING_TO_PORTAL: "walking to portal",
|
|
7
|
+
WALKING_TO_END: "walking to end",
|
|
8
|
+
ELEVATOR: "elevator",
|
|
9
|
+
ELEVATOR_UP: "elevator.up",
|
|
10
|
+
ELEVATOR_DOWN: "elevator.down",
|
|
11
|
+
STAIRS: "stairs",
|
|
12
|
+
STAIRS_UP: "stairs.up",
|
|
13
|
+
STAIRS_DOWN: "stairs.down",
|
|
14
|
+
ACCESSIBLE_STAIRS: "accessiblestairs",
|
|
15
|
+
ACCESSIBLE_STAIRS_UP: "accessiblestairs.up",
|
|
16
|
+
ACCESSIBLE_STAIRS_DOWN: "accessiblestairs.down",
|
|
17
|
+
ESCALATOR: "escalator",
|
|
18
|
+
ESCALATOR_UP: "escalator.up",
|
|
19
|
+
ESCALATOR_DOWN: "escalator.down",
|
|
20
|
+
WALK: "walk",
|
|
21
|
+
WALK_DOWN: "walk.down",
|
|
22
|
+
WALK_UP: "walk.up",
|
|
23
|
+
TRAIN: "train",
|
|
24
|
+
TRAIN_UP: "train.up",
|
|
25
|
+
TRAIN_DOWN: "train.down",
|
|
26
|
+
BUS: "bus",
|
|
27
|
+
BUS_UP: "bus.up",
|
|
28
|
+
BUS_DOWN: "bus.down",
|
|
29
|
+
SECURITY_CHECKPOINT: "enduring security checkpoint",
|
|
30
|
+
RAMP: "ramp",
|
|
31
|
+
RAMP_UP: "ramp.up",
|
|
32
|
+
RAMP_DOWN: "ramp.down"
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
module.exports = segmentCategories;
|