proximiio-js-library 1.16.0 → 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, _c;
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
- (_c = t[(_b = step.levelChangerType) === null || _b === void 0 ? void 0 : _b.toUpperCase()]) === null || _c === void 0 ? void 0 : _c.toLowerCase(),
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.toUpperCase()].toLowerCase(),
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, _e, _f, _g;
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
- ((_c = t[(_b = step.levelChangerType) === null || _b === void 0 ? void 0 : _b.toUpperCase()]) === null || _c === void 0 ? void 0 : _c.toLowerCase()) + ',',
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
- (_e = t[(_d = step.levelChangerType) === null || _d === void 0 ? void 0 : _d.toUpperCase()]) === null || _e === void 0 ? void 0 : _e.toLowerCase(),
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
- ((_g = t[(_f = step.levelChangerType) === null || _f === void 0 ? void 0 : _f.toUpperCase()]) === null || _g === void 0 ? void 0 : _g.toLowerCase()) + ',',
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 + '.',
@@ -112,6 +112,7 @@ export interface Options {
112
112
  pointColor?: string;
113
113
  pointOutline?: boolean;
114
114
  labelFont?: string | string[];
115
+ parkingKiosk?: boolean;
115
116
  };
116
117
  initPolygons?: boolean;
117
118
  polygonsOptions?: PolygonOptions;
@@ -1131,7 +1132,7 @@ export declare class Map {
1131
1132
  * map.setKiosk(48.606703739771774, 17.833092384506614, 0);
1132
1133
  * });
1133
1134
  */
1134
- setKiosk(lat: number, lng: number, level: number): void;
1135
+ setKiosk(lat: number, lng: number, level: number, parkingKiosk?: boolean): void;
1135
1136
  /**
1136
1137
  * This method will stop kiosk behaviour.
1137
1138
  * @memberof Map
@@ -1129,9 +1129,10 @@ export class Map {
1129
1129
  }
1130
1130
  }
1131
1131
  }
1132
- onSetKiosk(lat, lng, level) {
1132
+ onSetKiosk(lat, lng, level, parkingKiosk = false) {
1133
1133
  if (this.map && this.defaultOptions.isKiosk) {
1134
- this.defaultOptions.kioskSettings = Object.assign(Object.assign({}, this.defaultOptions.kioskSettings), { coordinates: [lng, lat], level });
1134
+ this.defaultOptions.kioskSettings = Object.assign(Object.assign({}, this.defaultOptions.kioskSettings), { coordinates: [lng, lat], level,
1135
+ parkingKiosk });
1135
1136
  this.startPoint = point(this.defaultOptions.kioskSettings.coordinates, {
1136
1137
  level: this.defaultOptions.kioskSettings.level,
1137
1138
  });
@@ -1894,6 +1895,9 @@ export class Map {
1894
1895
  }
1895
1896
  onShopClick(e) {
1896
1897
  var _a, _b, _c;
1898
+ if (this.defaultOptions.isKiosk && this.defaultOptions.kioskSettings.parkingKiosk) {
1899
+ return;
1900
+ }
1897
1901
  if (!this.defaultOptions.blockFeatureClickWhileRouting ||
1898
1902
  (this.defaultOptions.blockFeatureClickWhileRouting &&
1899
1903
  !this.routingSource.route &&
@@ -3593,8 +3597,6 @@ export class Map {
3593
3597
  this.routingSource.route &&
3594
3598
  this.routingSource.route[`path-part-${this.currentStep}`] &&
3595
3599
  this.routingSource.levelPoints[this.state.floor.level] &&
3596
- JSON.stringify(this.routingSource.route[`path-part-${this.currentStep}`].geometry.coordinates[0]) !==
3597
- JSON.stringify(this.routingSource.route[`path-part-${this.currentStep}`].geometry.coordinates[1]) &&
3598
3600
  !this.routingSource.preview &&
3599
3601
  !this.useCustomPosition) {
3600
3602
  const route = this.routingSource.route[`path-part-${this.currentStep}`] &&
@@ -3701,8 +3703,10 @@ export class Map {
3701
3703
  if (!startTime)
3702
3704
  startTime = currentTime;
3703
3705
  const elapsedTime = currentTime - startTime;
3704
- const t = elapsedTime / totalDuration;
3706
+ const t = elapsedTime / (totalDuration > 0 ? totalDuration : 3);
3707
+ console.log('animate the position', t, elapsedTime, totalDuration);
3705
3708
  if (t >= 1) {
3709
+ console.log('t >= 1, should continue on next step');
3706
3710
  if (!this.useCustomPosition) {
3707
3711
  // Stop the animation if we reached the end
3708
3712
  if (this.defaultOptions.routeAnimation.looping &&
@@ -5447,13 +5451,13 @@ export class Map {
5447
5451
  * map.setKiosk(48.606703739771774, 17.833092384506614, 0);
5448
5452
  * });
5449
5453
  */
5450
- setKiosk(lat, lng, level) {
5454
+ setKiosk(lat, lng, level, parkingKiosk = false) {
5451
5455
  if (!this.defaultOptions.isKiosk) {
5452
5456
  this.defaultOptions.isKiosk = true;
5453
5457
  this.initKiosk();
5454
5458
  }
5455
5459
  if (this.defaultOptions.isKiosk) {
5456
- this.onSetKiosk(lat, lng, level);
5460
+ this.onSetKiosk(lat, lng, level, parkingKiosk);
5457
5461
  }
5458
5462
  else {
5459
5463
  throw new Error(`Map is not initiated as kiosk`);