@aibee/crc-bmap 0.8.37 → 0.8.39

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.
@@ -1,6 +1,3 @@
1
- declare let ParkingTypeIconMap: Record<string, string>;
2
- export { ParkingTypeIconMap };
3
- declare let ManGlb: string;
4
- export { ManGlb };
5
- declare let Arrow: string;
6
- export { Arrow };
1
+ export declare const ParkingTypeIconMap: Record<string, string>;
2
+ export declare const ManGlb: string;
3
+ export declare const Arrow: string;
@@ -1,23 +1,7 @@
1
+ import { ParkingTypeIconMap as OnlineParkingTypeIconMap, ManGlb as OnlineManGlb, Arrow as OnlineArrow } from './online';
2
+ import { ParkingTypeIconMap as OfflineParkingTypeIconMap, ManGlb as OfflineManGlb, Arrow as OfflineArrow } from './offline';
1
3
  // 默认不使用online在明确是公网服务的时候,用online模式优化SDK文件大小
2
4
  const isOnline = process.env.CRC_BMAP_MODE === "online";
3
- let ParkingTypeIconMap;
4
- if (isOnline) {
5
- ParkingTypeIconMap = require("./online").ParkingTypeIconMap;
6
- } else {
7
- ParkingTypeIconMap = require("./offline").ParkingTypeIconMap;
8
- }
9
- export { ParkingTypeIconMap };
10
- let ManGlb;
11
- if (isOnline) {
12
- ManGlb = require("./online").ManGlb;
13
- } else {
14
- ManGlb = require("./offline").ManGlb;
15
- }
16
- export { ManGlb };
17
- let Arrow;
18
- if (isOnline) {
19
- Arrow = require("./online").Arrow;
20
- } else {
21
- Arrow = require("./offline").Arrow;
22
- }
23
- export { Arrow };
5
+ export const ParkingTypeIconMap = isOnline ? OnlineParkingTypeIconMap : OfflineParkingTypeIconMap;
6
+ export const ManGlb = isOnline ? OnlineManGlb : OfflineManGlb;
7
+ export const Arrow = isOnline ? OnlineArrow : OfflineArrow;
@@ -97,7 +97,7 @@ export class Navigation extends Plugin {
97
97
  }
98
98
  continueAnimation() {
99
99
  this.tweenUtil.continue();
100
- this.positionNavigation.tweenUtil.continue();
100
+ this.positionNavigation.continue();
101
101
  }
102
102
  clearTween() {
103
103
  this.tweenUtil.clear();
@@ -39,6 +39,7 @@ export declare class PositionNavigation extends EventDispatcher<PositionNavigati
39
39
  simulationTween?: Tween<any>;
40
40
  throttleUpdatePosition?: DebouncedFuncLeading<(...args: any[]) => void>;
41
41
  roadData: RoadData2[];
42
+ paused: boolean;
42
43
  constructor(navigation: Navigation, options: Partial<PositionNavigationConfig>, roadData: RoadData2[]);
43
44
  get curRoutePath(): PathData[0] | null;
44
45
  get curRoutePathPoints(): [number, number][];
@@ -59,6 +60,7 @@ export declare class PositionNavigation extends EventDispatcher<PositionNavigati
59
60
  toPosition(floor: string, pos: [number, number]): void;
60
61
  startSimulation(): void;
61
62
  pause(): void;
63
+ continue(): void;
62
64
  startCurRouteSimulation(): Promise<unknown>;
63
65
  changeSimulationSpeed(speed: number): void;
64
66
  getCurRouteRemainDistance(): number;
@@ -149,8 +149,13 @@ export class PositionNavigation extends EventDispatcher {
149
149
  }
150
150
  pause() {
151
151
  var _this_throttleUpdatePosition;
152
- this.tweenUtil.pause();
152
+ this.tweenUtil.clear();
153
153
  (_this_throttleUpdatePosition = this.throttleUpdatePosition) == null ? void 0 : _this_throttleUpdatePosition.cancel();
154
+ this.paused = true;
155
+ }
156
+ continue() {
157
+ this.paused = false;
158
+ this.startCurRouteSimulation();
154
159
  }
155
160
  startCurRouteSimulation() {
156
161
  var _this = this;
@@ -206,7 +211,9 @@ export class PositionNavigation extends EventDispatcher {
206
211
  }
207
212
  changeSimulationSpeed(speed) {
208
213
  this.options.simulationSpeed = speed;
209
- this.startCurRouteSimulation();
214
+ if (!this.paused) {
215
+ this.startCurRouteSimulation();
216
+ }
210
217
  }
211
218
  getCurRouteRemainDistance() {
212
219
  const { curRoutePathPoints, pointIndex, position } = this;
@@ -339,7 +346,7 @@ export class PositionNavigation extends EventDispatcher {
339
346
  ] // 当前吸附后的位置
340
347
  , this.routeIndex = 0 // 当前位置所在路线下标
341
348
  , this.pointIndex = 0 // 当前位置在当前路线段所在的下标
342
- , this.paths = [], this.timer = new Timer(), this.resetTimer = null, this.tweenUtil = new TweenUtil(), this.onAddPaths = ({ paths })=>{
349
+ , this.paths = [], this.timer = new Timer(), this.resetTimer = null, this.tweenUtil = new TweenUtil(), this.paused = false, this.onAddPaths = ({ paths })=>{
343
350
  this.paths = paths;
344
351
  this.resetStatus(paths);
345
352
  // this.emitNavigationStatus()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aibee/crc-bmap",
3
- "version": "0.8.37",
3
+ "version": "0.8.39",
4
4
  "description": "",
5
5
  "main": "lib/bmap.min.js",
6
6
  "module": "lib/bmap.esm.js",