proximiio-js-library 1.16.1 → 1.16.2
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.
|
@@ -198,7 +198,7 @@ export default class GuidanceStepsGenerator {
|
|
|
198
198
|
}
|
|
199
199
|
// ─── Simple ───────────────────────────────────────────────────────────────────
|
|
200
200
|
generateSimpleInstruction({ step, direction }) {
|
|
201
|
-
var _a, _b
|
|
201
|
+
var _a, _b;
|
|
202
202
|
if (!(step === null || step === void 0 ? void 0 : step.totalDistance) && !this.levelChangersSteps)
|
|
203
203
|
return '';
|
|
204
204
|
const t = translations[this.language];
|
|
@@ -221,7 +221,7 @@ export default class GuidanceStepsGenerator {
|
|
|
221
221
|
step.totalDistance ? step.totalDistance.toFixed(0) : 0,
|
|
222
222
|
t.METERS,
|
|
223
223
|
t.AND_TAKE_THE,
|
|
224
|
-
(
|
|
224
|
+
(_b = t[LevelChangerTypes[step.levelChangerType]]) === null || _b === void 0 ? void 0 : _b.toLowerCase(),
|
|
225
225
|
t[step.levelChangerDirection],
|
|
226
226
|
t.TO,
|
|
227
227
|
floorName,
|
|
@@ -260,7 +260,7 @@ export default class GuidanceStepsGenerator {
|
|
|
260
260
|
return this.capitalize(this.getDirectionInstruction(direction));
|
|
261
261
|
}
|
|
262
262
|
generateFullLevelChangerInstruction({ step, t, }) {
|
|
263
|
-
var _a;
|
|
263
|
+
var _a, _b;
|
|
264
264
|
const floorName = ((_a = step.destinationFloor) === null || _a === void 0 ? void 0 : _a.name)
|
|
265
265
|
? getFloorName({ floor: step.destinationFloor, language: this.language })
|
|
266
266
|
: String(step.destinationLevel);
|
|
@@ -269,7 +269,7 @@ export default class GuidanceStepsGenerator {
|
|
|
269
269
|
step.distanceFromLastStep.toFixed(0),
|
|
270
270
|
t.METERS + ',',
|
|
271
271
|
t.TAKE_THE,
|
|
272
|
-
t[step.levelChangerType
|
|
272
|
+
(_b = t[LevelChangerTypes[step.levelChangerType]]) === null || _b === void 0 ? void 0 : _b.toLowerCase(),
|
|
273
273
|
t[step.levelChangerDirection],
|
|
274
274
|
t.TO,
|
|
275
275
|
floorName,
|
|
@@ -277,7 +277,7 @@ export default class GuidanceStepsGenerator {
|
|
|
277
277
|
].join(' ');
|
|
278
278
|
}
|
|
279
279
|
generateLevelChangerStepInstruction({ step, t, }) {
|
|
280
|
-
var _a, _b, _c, _d
|
|
280
|
+
var _a, _b, _c, _d;
|
|
281
281
|
const floorName = ((_a = step.destinationFloor) === null || _a === void 0 ? void 0 : _a.name)
|
|
282
282
|
? getFloorName({ floor: step.destinationFloor, language: this.language })
|
|
283
283
|
: String(step.destinationLevel);
|
|
@@ -286,11 +286,11 @@ export default class GuidanceStepsGenerator {
|
|
|
286
286
|
if (stepDirection === 'UP' || stepDirection === 'DOWN') {
|
|
287
287
|
return [
|
|
288
288
|
this.capitalize(t.YOU_ARE_AT_THE),
|
|
289
|
-
((
|
|
289
|
+
((_b = t[LevelChangerTypes[step.levelChangerType]]) === null || _b === void 0 ? void 0 : _b.toLowerCase()) + ',',
|
|
290
290
|
t.GO,
|
|
291
291
|
t[step.levelChangerDirection],
|
|
292
292
|
t.VIA,
|
|
293
|
-
(
|
|
293
|
+
(_c = t[LevelChangerTypes[step.levelChangerType]]) === null || _c === void 0 ? void 0 : _c.toLowerCase(),
|
|
294
294
|
t.TO,
|
|
295
295
|
floorName,
|
|
296
296
|
t.FLOOR + '.',
|
|
@@ -300,7 +300,7 @@ export default class GuidanceStepsGenerator {
|
|
|
300
300
|
if (stepDirection === 'EXIT') {
|
|
301
301
|
return [
|
|
302
302
|
this.capitalize(t.EXIT_THE),
|
|
303
|
-
((
|
|
303
|
+
((_d = t[LevelChangerTypes[step.levelChangerType]]) === null || _d === void 0 ? void 0 : _d.toLowerCase()) + ',',
|
|
304
304
|
t.YOU_ARE_AT.toLowerCase(),
|
|
305
305
|
floorName,
|
|
306
306
|
t.FLOOR + '.',
|
|
@@ -3597,8 +3597,6 @@ export class Map {
|
|
|
3597
3597
|
this.routingSource.route &&
|
|
3598
3598
|
this.routingSource.route[`path-part-${this.currentStep}`] &&
|
|
3599
3599
|
this.routingSource.levelPoints[this.state.floor.level] &&
|
|
3600
|
-
JSON.stringify(this.routingSource.route[`path-part-${this.currentStep}`].geometry.coordinates[0]) !==
|
|
3601
|
-
JSON.stringify(this.routingSource.route[`path-part-${this.currentStep}`].geometry.coordinates[1]) &&
|
|
3602
3600
|
!this.routingSource.preview &&
|
|
3603
3601
|
!this.useCustomPosition) {
|
|
3604
3602
|
const route = this.routingSource.route[`path-part-${this.currentStep}`] &&
|
|
@@ -3705,8 +3703,10 @@ export class Map {
|
|
|
3705
3703
|
if (!startTime)
|
|
3706
3704
|
startTime = currentTime;
|
|
3707
3705
|
const elapsedTime = currentTime - startTime;
|
|
3708
|
-
const t = elapsedTime / totalDuration;
|
|
3706
|
+
const t = elapsedTime / (totalDuration > 0 ? totalDuration : 3);
|
|
3707
|
+
console.log('animate the position', t, elapsedTime, totalDuration);
|
|
3709
3708
|
if (t >= 1) {
|
|
3709
|
+
console.log('t >= 1, should continue on next step');
|
|
3710
3710
|
if (!this.useCustomPosition) {
|
|
3711
3711
|
// Stop the animation if we reached the end
|
|
3712
3712
|
if (this.defaultOptions.routeAnimation.looping &&
|