proximiio-js-library 1.12.76 → 1.12.78

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.
@@ -132,6 +132,7 @@ export interface Options {
132
132
  dashKeepOriginalRouteLayer?: boolean;
133
133
  cityRouteSpeedMultiplier?: number;
134
134
  cityPointIconUrl?: string;
135
+ cityRouteMaxDuration?: number;
135
136
  };
136
137
  useRasterTiles?: boolean;
137
138
  rasterTilesOptions?: {
@@ -193,6 +193,7 @@ export class Map {
193
193
  autoRestart: true,
194
194
  dashKeepOriginalRouteLayer: false,
195
195
  cityRouteSpeedMultiplier: 5,
196
+ cityRouteMaxDuration: 5,
196
197
  },
197
198
  useRasterTiles: false,
198
199
  handleUrlParams: false,
@@ -2767,16 +2768,18 @@ export class Map {
2767
2768
  // @ts-ignore;
2768
2769
  this.map.fitBounds(boundingBox, {
2769
2770
  padding: this.defaultOptions.fitBoundsPadding,
2770
- bearing: this.map.getBearing(),
2771
+ bearing: 0,
2771
2772
  pitch: this.map.getPitch(),
2772
2773
  animate: false,
2774
+ maxZoom: 15,
2773
2775
  });
2774
2776
  }
2775
2777
  else {
2776
2778
  // @ts-ignore
2777
2779
  this.map.flyTo({
2778
2780
  center: center(routeToCenter).geometry.coordinates,
2779
- zoom: this.defaultOptions.minFitBoundsDistance < 10 ? 22 : this.map.getZoom(),
2781
+ zoom: this.defaultOptions.minFitBoundsDistance < 10 ? 15 : this.map.getZoom(),
2782
+ bearing: 0,
2780
2783
  });
2781
2784
  }
2782
2785
  return;
@@ -2911,7 +2914,11 @@ export class Map {
2911
2914
  if (this.routingSource.navigationType === 'city') {
2912
2915
  baseSpeed = baseSpeed / this.defaultOptions.routeAnimation.cityRouteSpeedMultiplier;
2913
2916
  }
2914
- const totalDuration = totalDistance * baseSpeed; // Total animation duration based on route length
2917
+ let totalDuration = totalDistance * baseSpeed; // Total animation duration based on route length
2918
+ if (this.routingSource.navigationType === 'city' &&
2919
+ totalDuration > this.defaultOptions.routeAnimation.cityRouteMaxDuration * 1000) {
2920
+ totalDuration = this.defaultOptions.routeAnimation.cityRouteMaxDuration * 1000;
2921
+ }
2915
2922
  let startTime;
2916
2923
  this.map.setCenter(route.geometry.coordinates[0]);
2917
2924
  const animate = (currentTime) => {
@@ -2995,6 +3002,9 @@ export class Map {
2995
3002
  this.lerp(cameraCoords[1], targetCoords[1], this.defaultOptions.routeAnimation.cameraLerpTolerance),
2996
3003
  ];
2997
3004
  if (!this.defaultOptions.routeAnimation.followRouteAngle) {
3005
+ if (this.routingSource.navigationType === 'city') {
3006
+ this.map.setBearing(0);
3007
+ }
2998
3008
  this.map.easeTo({
2999
3009
  center: this.defaultOptions.routeAnimation.cameraUseLerp
3000
3010
  ? interpolatedCoords
@@ -3573,10 +3583,12 @@ export class Map {
3573
3583
  }
3574
3584
  if (this.routingSource && this.routingSource.route && this.routingSource.route[`path-part-${newStep}`]) {
3575
3585
  this.currentStep = newStep;
3576
- this.centerOnRoute(this.routingSource.route[`path-part-${newStep}`]);
3577
3586
  if (this.routingSource.navigationType === 'city') {
3578
3587
  this.animateRoute();
3579
3588
  }
3589
+ else {
3590
+ this.centerOnRoute(this.routingSource.route[`path-part-${newStep}`]);
3591
+ }
3580
3592
  this.onStepSetListener.next(this.currentStep);
3581
3593
  return step;
3582
3594
  }