@aibee/crc-bmap 0.8.33 → 0.8.36

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.
@@ -63,7 +63,7 @@ export declare class AibeeLoader extends EventDispatcher<AibeeLoaderEventMap> {
63
63
  getOtherDataByFreeTime(): Promise<void>;
64
64
  getMulFloorsData(floors: string[]): Promise<Floor[]>;
65
65
  getDataByUrl(url: string): Promise<Floor>;
66
- getDataByJson(data: AibeeFloorData, floor?: Floor): Floor;
66
+ getDataByJson(data: AibeeFloorData, floor?: Floor): Promise<Floor>;
67
67
  changeFloorBox(data: AibeeFloorData, floor: Floor): void;
68
68
  switchFloor(data: string | AibeeFloorData): Promise<Floor | null>;
69
69
  _switchFloor(data: string | AibeeFloorData): Promise<Floor | null>;
@@ -198,10 +198,13 @@ export class AibeeLoader extends EventDispatcher {
198
198
  })();
199
199
  }
200
200
  getDataByJson(data, floor) {
201
- floor = this.getFloorBaseLayer(data, floor);
202
- this.getFloorContentLayer(data, floor);
203
- this.changeFloorBox(data, floor);
204
- return floor;
201
+ var _this = this;
202
+ return _async_to_generator(function*() {
203
+ floor = _this.getFloorBaseLayer(data, floor);
204
+ yield _this.getFloorContentLayer(data, floor);
205
+ _this.changeFloorBox(data, floor);
206
+ return floor;
207
+ })();
205
208
  }
206
209
  changeFloorBox(data, floor) {
207
210
  floor.updateBox();
@@ -47,7 +47,7 @@ export class MulFloors extends Plugin {
47
47
  context.camera.zoom = 1;
48
48
  context.setAzimuthalAngle(config.control.defaultAzimuthal, 0);
49
49
  context.setPolarAngle(config.control.defaultPolar, 0);
50
- context.fitCameraToObject(this.group, undefined, 0);
50
+ context.fitCameraToObject(this.group, config.defaultPadding, 0);
51
51
  const basicZoom = context.camera.zoom;
52
52
  // 设置zoom
53
53
  context.control.minZoom = basicZoom;
@@ -10,7 +10,7 @@ export interface RoadData2 {
10
10
  opacity: number;
11
11
  visible: boolean;
12
12
  userData: Record<string, string>;
13
- direction: "double" | "single" | "no" | "back";
13
+ direction: "double" | "single" | "noDir" | "back";
14
14
  }>;
15
15
  points: Array<{
16
16
  id: string;
@@ -168,7 +168,7 @@ export class RoadNetwork2 {
168
168
  this.parkingMap.set(`${floorRoadInfo.floor}${SPLIT_FLG}${point.name}`, point);
169
169
  }
170
170
  });
171
- (floorRoadInfo.lines || []).filter((item)=>item.direction !== "no").forEach((item)=>{
171
+ (floorRoadInfo.lines || []).forEach((item)=>{
172
172
  const fromKey = `${floorRoadInfo.floor}${SPLIT_FLG}${item.from}`;
173
173
  const toKey = `${floorRoadInfo.floor}${SPLIT_FLG}${item.to}`;
174
174
  const fromPoint = this.pointMap.get(fromKey);
@@ -195,6 +195,12 @@ export class RoadNetwork2 {
195
195
  this.addLineItem(toKey, fromKey, distance, this.forwardLineMap);
196
196
  break;
197
197
  }
198
+ // 正寻的车位线是不标注方向的,默认都是双向通行
199
+ if ((fromPoint.type === "parkingSpace" || toPoint.type === "parkingSpace") && item.direction === "noDir") {
200
+ console.log("到车位的线");
201
+ this.addLineItem(fromKey, toKey, distance, this.forwardLineMap);
202
+ this.addLineItem(toKey, fromKey, distance, this.forwardLineMap);
203
+ }
198
204
  } else {
199
205
  // 有权限的点 先收集起来
200
206
  if (fromPoint.permission) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aibee/crc-bmap",
3
- "version": "0.8.33",
3
+ "version": "0.8.36",
4
4
  "description": "",
5
5
  "main": "lib/bmap.min.js",
6
6
  "module": "lib/bmap.esm.js",
@@ -1 +0,0 @@
1
- export {};
@@ -1,34 +0,0 @@
1
- import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
- import { RoadNetwork2 } from "../../utils/road2";
3
- import { xhrGet } from "../../utils/ajax";
4
- import { getDirectPath } from "../../utils/path";
5
- import { RoadNetwork } from "../../utils/road";
6
- import { toWebWorker } from '../../utils/webworker';
7
- let roadNetwork = new RoadNetwork();
8
- toWebWorker({
9
- onChangeRoadNetwork (type) {
10
- switch(type){
11
- case 'RoadNetwork':
12
- roadNetwork = new RoadNetwork();
13
- break;
14
- case 'RoadNetwork2':
15
- roadNetwork = new RoadNetwork2();
16
- break;
17
- }
18
- },
19
- onLoadRoad: /*#__PURE__*/ _async_to_generator(function*(fetchOption) {
20
- const res = yield xhrGet(fetchOption.url, fetchOption);
21
- const roadInfo = res.data.map((item)=>JSON.parse(item.road_info));
22
- roadNetwork.initRoute(roadInfo);
23
- return roadInfo;
24
- }),
25
- onSetRoadInfo ({ roadData, facilities }) {
26
- roadNetwork.initRoute(roadData, facilities);
27
- },
28
- onGetPath ({ start, end, type }) {
29
- return roadNetwork.getPath(start, end, type);
30
- },
31
- onGetDirectionPath (points) {
32
- return getDirectPath(points);
33
- }
34
- });