@aibee/crc-bmap 0.0.92 → 0.0.94
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/example/index.css +8 -12
- package/example/index.html +3 -3
- package/example/src/a.json +5688 -0
- package/example/src/main.ts +24 -6
- package/example/vite.config.ts +1 -1
- package/lib/bmap.cjs.min.js +21 -3
- package/lib/bmap.cjs.min.js.map +4 -4
- package/lib/bmap.esm.js +1052 -815
- package/lib/bmap.esm.js.map +4 -4
- package/lib/bmap.esm.min.js +21 -3
- package/lib/bmap.esm.min.js.map +4 -4
- package/lib/bmap.min.js +21 -3
- package/lib/bmap.min.js.map +4 -4
- package/lib/src/bmap.d.ts +14 -6
- package/lib/src/config.d.ts +1 -0
- package/lib/src/index.d.ts +1 -0
- package/lib/src/plugins/base.d.ts +6 -0
- package/lib/src/plugins/equipment/equipment.d.ts +21 -0
- package/lib/src/plugins/equipment/index.d.ts +1 -0
- package/lib/src/plugins/index.d.ts +2 -0
- package/lib/src/plugins/navigation/index.d.ts +1 -0
- package/lib/src/plugins/navigation/navigation.d.ts +9 -0
- package/lib/src/plugins/navigation/path.worker.d.ts +2 -0
- package/lib/src/utils/event-name.d.ts +4 -0
- package/lib/src/utils/events.d.ts +17 -0
- package/lib/src/utils/index.d.ts +2 -0
- package/package.json +5 -4
package/lib/src/bmap.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { EventDispatcher, Object3D, Vector3 } from "three";
|
|
2
2
|
import { Context } from "./context";
|
|
3
|
-
import {
|
|
3
|
+
import { Timer, Events } from "./utils";
|
|
4
|
+
import { Config } from "./config";
|
|
4
5
|
import { Graphic, HeatmapDataParam, ModelOptions, PoiOptionsParam } from "./elements";
|
|
5
6
|
import { GraphicInfo, GraphicOptions } from "./types";
|
|
7
|
+
import { Plugin } from "./plugins/base";
|
|
6
8
|
export interface LoadQuery {
|
|
7
9
|
brand: string;
|
|
8
10
|
project: string;
|
|
@@ -38,14 +40,20 @@ export declare class BMap extends EventDispatcher<BmapEventMap> {
|
|
|
38
40
|
buildingGroundMap: Map<string, GraphicInfo | null>;
|
|
39
41
|
currentBuildGround: GraphicInfo | null;
|
|
40
42
|
private observe;
|
|
43
|
+
event: Events;
|
|
44
|
+
timer: Timer;
|
|
45
|
+
plugins: Plugin[];
|
|
41
46
|
constructor(container: HTMLElement, config?: Partial<Config>);
|
|
42
47
|
private loadGraphics;
|
|
43
|
-
getBuildingKey({ brand, project, phase, building }: Omit<LoadQuery, "floor" | "ts" | "resource_type_list">): string;
|
|
48
|
+
getBuildingKey({ brand, project, phase, building, }: Omit<LoadQuery, "floor" | "ts" | "resource_type_list">): string;
|
|
44
49
|
private loadBuildingGround;
|
|
45
|
-
getFloorKey({ brand, project, phase, building, floor, ts, resource_type_list }: LoadQuery): string;
|
|
46
|
-
load({ brand, project, phase, building, floor, ts, resource_type_list }: LoadQuery): Promise<GraphicInfo[] | undefined>;
|
|
50
|
+
getFloorKey({ brand, project, phase, building, floor, ts, resource_type_list, }: LoadQuery): string;
|
|
51
|
+
load({ brand, project, phase, building, floor, ts, resource_type_list, }: LoadQuery): Promise<GraphicInfo[] | undefined>;
|
|
52
|
+
loadEquipment(): void;
|
|
53
|
+
use(plugin: Plugin): void;
|
|
54
|
+
loadNavigation(): void;
|
|
47
55
|
private createFloor;
|
|
48
|
-
switchFloor({ brand, project, phase, building, floor, ts, resource_type_list }: LoadQuery): void;
|
|
56
|
+
switchFloor({ brand, project, phase, building, floor, ts, resource_type_list, }: LoadQuery): void;
|
|
49
57
|
onControlChange: () => void;
|
|
50
58
|
addModel(graphic: Graphic, options: ModelOptions): void;
|
|
51
59
|
addHeatmap(data: HeatmapDataParam): import("./elements").HeatmapElement | undefined;
|
|
@@ -72,7 +80,7 @@ export declare class BMap extends EventDispatcher<BmapEventMap> {
|
|
|
72
80
|
*/
|
|
73
81
|
translateElementToCenterX(ele: {
|
|
74
82
|
getPosition: () => Vector3;
|
|
75
|
-
}, duration?: number): Promise<
|
|
83
|
+
}, duration?: number): Promise<unknown>;
|
|
76
84
|
/**
|
|
77
85
|
* 获取物体的屏幕坐标
|
|
78
86
|
*/
|
package/lib/src/config.d.ts
CHANGED
package/lib/src/index.d.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BMap } from "../../bmap";
|
|
2
|
+
import { Plugin } from "../base";
|
|
3
|
+
import { Graphic } from "../../elements";
|
|
4
|
+
interface EquipmentData {
|
|
5
|
+
equipment_id: string;
|
|
6
|
+
equipment_name: string;
|
|
7
|
+
equipment_icon: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class Equipment extends Plugin {
|
|
10
|
+
equipmentList: EquipmentData[];
|
|
11
|
+
equipmentMap: Map<string, EquipmentData>;
|
|
12
|
+
constructor(bmap: BMap);
|
|
13
|
+
fetchEquipment(): Promise<void>;
|
|
14
|
+
onSwitchFloor: (floor: {
|
|
15
|
+
graphics: Graphic[];
|
|
16
|
+
}) => void;
|
|
17
|
+
getGraphicEquipment(graphic: Graphic): any;
|
|
18
|
+
changeGraphicToEquipment(graphics: Graphic[]): void;
|
|
19
|
+
dispose(): void;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './equipment';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './navigation';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const workerCode = "\nself.onmessage = (e) => {\n console.log(e.data)\n loadRoad(\"\");\n getPath(\"\", \"\")\n}\n\nfunction loadRoad(project) { \n // \u8BF7\u6C42\u5168\u90E8\u697C\u5C42\u7684\u8DEF\u7F51\n console.log(project)\n self.postMessage(\"project\")\n}\n\nfunction getPath(start, end) { \n // \u89C4\u5212\u8DEF\u7EBF\n console.log(start, end)\n self.postMessage(\"getPath\")\n}\n";
|
|
2
|
+
export default workerCode;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type DefaultFn = (...args: any[]) => void;
|
|
2
|
+
interface EventI {
|
|
3
|
+
on(type: string, callback: DefaultFn): void;
|
|
4
|
+
once(type: string, callback: DefaultFn): void;
|
|
5
|
+
off(type: string, callback: DefaultFn): void;
|
|
6
|
+
offAll(): void;
|
|
7
|
+
emit(type: string, ...args: any[]): void;
|
|
8
|
+
}
|
|
9
|
+
export type { EventI };
|
|
10
|
+
export declare class Events implements EventI {
|
|
11
|
+
events: Map<string, Set<DefaultFn>>;
|
|
12
|
+
on(type: string, callback: DefaultFn): Set<DefaultFn> | Map<string, Set<DefaultFn>> | undefined;
|
|
13
|
+
once(type: string, callback: DefaultFn): Set<DefaultFn> | Map<string, Set<DefaultFn>> | undefined;
|
|
14
|
+
off(type: string, callback: DefaultFn): void;
|
|
15
|
+
offAll(): void;
|
|
16
|
+
emit(type: string, ...args: any[]): void;
|
|
17
|
+
}
|
package/lib/src/utils/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aibee/crc-bmap",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.94",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/bmap.min.js",
|
|
6
6
|
"module": "lib/bmap.esm.min.js",
|
|
@@ -9,14 +9,15 @@
|
|
|
9
9
|
"lib",
|
|
10
10
|
"example"
|
|
11
11
|
],
|
|
12
|
+
"type": "module",
|
|
12
13
|
"scripts": {
|
|
13
14
|
"build": "pnpm clean && pnpm build:min",
|
|
14
|
-
"build:min": "ts-node ./build/index.ts",
|
|
15
|
+
"build:min": "ts-node --esm ./build/index.ts",
|
|
15
16
|
"gen-type": "tsc",
|
|
16
17
|
"clean": "rm -rf lib",
|
|
17
18
|
"lint": "eslint src/**/*.ts",
|
|
18
19
|
"start": "cd example && vite",
|
|
19
|
-
"publish:all": "npm run build && npm version patch && npm run publish:npm
|
|
20
|
+
"publish:all": "npm run build && npm version patch && npm run publish:npm && npm run publish:aibee",
|
|
20
21
|
"publish:npm": "npm publish --access public --registry https://registry.npmjs.org",
|
|
21
22
|
"publish:aibee": "npm publish --registry https://npm.aibee.cn"
|
|
22
23
|
},
|
|
@@ -36,10 +37,10 @@
|
|
|
36
37
|
"vite": "^4.4.11"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@types/three": "^0.156.0",
|
|
40
40
|
"@mars3d/heatmap.js": "^2.0.7",
|
|
41
41
|
"@turf/turf": "^6.5.0",
|
|
42
42
|
"@tweenjs/tween.js": "^21.0.0",
|
|
43
|
+
"@types/three": "^0.156.0",
|
|
43
44
|
"hotkeys-js": "^3.12.0",
|
|
44
45
|
"lodash": "^4.17.21",
|
|
45
46
|
"three": "^0.157.0"
|