@aibee/crc-bmap 0.8.62 → 0.8.64

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/lib/bmap.esm.js CHANGED
@@ -19977,7 +19977,8 @@ var defaultConfig4 = {
19977
19977
  disablePathAnimation: false,
19978
19978
  speed: 1,
19979
19979
  roadData: [],
19980
- runAnimationMaxTime: 1
19980
+ runAnimationMaxTime: 1,
19981
+ navigationCameraBasic: 45
19981
19982
  };
19982
19983
  var Navigation = class extends Plugin {
19983
19984
  get curFloorPathLength() {
@@ -20394,7 +20395,7 @@ var Navigation = class extends Plugin {
20394
20395
  const { clientSize: { width, height }, currentFloor } = this.bmap.context;
20395
20396
  const { max, min } = currentFloor.box;
20396
20397
  const baseScale = Math.min(width / (max.x - min.x), height / (max.y - min.y));
20397
- const zoom = baseScale * (max.x - min.x) / 45;
20398
+ const zoom = baseScale * (max.x - min.x) / this.options.navigationCameraBasic;
20398
20399
  return this.bmap.context.setZoom(zoom, this.startPoi.position, duration).finally(() => {
20399
20400
  this.bmap.context.control.enabled = true;
20400
20401
  });
@@ -20488,12 +20489,15 @@ var Navigation = class extends Plugin {
20488
20489
  }
20489
20490
  setStartPoiRotate(rotate) {
20490
20491
  this.startPoiRotate = rotate;
20492
+ const azimuthalAngle = this.bmap.context.control.getAzimuthalAngle();
20493
+ const azimuthal = (azimuthalAngle * 180 / Math.PI + 360) % 360;
20494
+ const angle = (360 - rotate - azimuthal) % 360;
20495
+ if (this.detachStartPoi) {
20496
+ this.detachStartPoi.options.icon_rotate = angle;
20497
+ }
20491
20498
  if (this.startPoi) {
20492
- const azimuthalAngle = this.bmap.context.control.getAzimuthalAngle();
20493
- const azimuthal = (azimuthalAngle * 180 / Math.PI + 360) % 360;
20494
- this.startPoi.options.icon_rotate = (360 - rotate - azimuthal) % 360;
20495
20499
  if (this.startRotateHelperPoi) {
20496
- this.startRotateHelperPoi.setAngle((360 - rotate - azimuthal) % 360);
20500
+ this.startRotateHelperPoi.setAngle(angle);
20497
20501
  }
20498
20502
  }
20499
20503
  }