@aibee/crc-bmap 0.0.94 → 0.0.95
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/src/main.ts +376 -331
- package/lib/bmap.cjs.min.js +3 -3
- package/lib/bmap.cjs.min.js.map +4 -4
- package/lib/bmap.esm.js +234 -150
- package/lib/bmap.esm.js.map +4 -4
- package/lib/bmap.esm.min.js +3 -3
- package/lib/bmap.esm.min.js.map +4 -4
- package/lib/bmap.min.js +3 -3
- package/lib/bmap.min.js.map +4 -4
- package/lib/src/api/floor.d.ts +15 -0
- package/lib/src/api/index.d.ts +1 -0
- package/lib/src/bmap.d.ts +13 -19
- package/lib/src/elements/floor.d.ts +1 -0
- package/lib/src/elements/poi.d.ts +1 -0
- package/lib/src/index.d.ts +1 -0
- package/lib/src/plugins/base.d.ts +1 -1
- package/lib/src/plugins/index.d.ts +1 -0
- package/lib/src/plugins/split-load/index.d.ts +1 -0
- package/lib/src/plugins/split-load/split-load.d.ts +14 -0
- package/lib/src/types/index.d.ts +7 -0
- package/lib/src/utils/coordinate.d.ts +2 -2
- package/lib/src/utils/event-name.d.ts +1 -1
- package/lib/src/utils/index.d.ts +1 -0
- package/lib/src/utils/obj-utils.d.ts +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Config } from "../config";
|
|
2
|
+
import { GraphicInfo, LoadQuery } from "../types";
|
|
3
|
+
type BuildingGroundQuery = Omit<LoadQuery, "floor" | "ts" | "resource_type_list">;
|
|
4
|
+
/**
|
|
5
|
+
* 请求楼栋地面
|
|
6
|
+
*/
|
|
7
|
+
export declare function loadBuildingGround({ brand, project }: BuildingGroundQuery, config: Config): Promise<GraphicInfo | null>;
|
|
8
|
+
/**
|
|
9
|
+
* 加载图元
|
|
10
|
+
* @param param0
|
|
11
|
+
* @param config
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare function loadGraphics({ brand, project, floor, ts, resource_type_list, }: LoadQuery, config: Config): Promise<GraphicInfo[]>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './floor';
|
package/lib/src/bmap.d.ts
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import { EventDispatcher, Object3D, Vector3 } from "three";
|
|
2
2
|
import { Context } from "./context";
|
|
3
|
-
import { Timer, Events } from "./utils";
|
|
3
|
+
import { Timer, Events, HooksName } from "./utils";
|
|
4
4
|
import { Config } from "./config";
|
|
5
|
-
import { Graphic, HeatmapDataParam, ModelOptions, PoiOptionsParam } from "./elements";
|
|
6
|
-
import { GraphicInfo, GraphicOptions } from "./types";
|
|
5
|
+
import { Floor, Graphic, HeatmapDataParam, ModelOptions, PoiOptionsParam } from "./elements";
|
|
6
|
+
import { GraphicInfo, GraphicOptions, LoadQuery } from "./types";
|
|
7
7
|
import { Plugin } from "./plugins/base";
|
|
8
|
-
export interface LoadQuery {
|
|
9
|
-
brand: string;
|
|
10
|
-
project: string;
|
|
11
|
-
phase: string;
|
|
12
|
-
building: string;
|
|
13
|
-
floor: string;
|
|
14
|
-
ts: string;
|
|
15
|
-
resource_type_list: string;
|
|
16
|
-
}
|
|
17
8
|
interface BmapEventMap {
|
|
18
9
|
"zoom-change": {
|
|
19
10
|
basicZoom: number;
|
|
@@ -44,16 +35,19 @@ export declare class BMap extends EventDispatcher<BmapEventMap> {
|
|
|
44
35
|
timer: Timer;
|
|
45
36
|
plugins: Plugin[];
|
|
46
37
|
constructor(container: HTMLElement, config?: Partial<Config>);
|
|
47
|
-
|
|
48
|
-
getBuildingKey({ brand, project, phase, building, }: Omit<LoadQuery, "floor" | "ts" | "resource_type_list">): string;
|
|
38
|
+
loadGraphics({ brand, project, floor, ts, resource_type_list, }: LoadQuery): Promise<GraphicInfo[]>;
|
|
49
39
|
private loadBuildingGround;
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
load({ brand, project, floor, ts, resource_type_list, }: LoadQuery): Promise<GraphicInfo[] | undefined>;
|
|
41
|
+
transformGraphicData(data: GraphicInfo[], center: [number, number]): void;
|
|
52
42
|
loadEquipment(): void;
|
|
53
43
|
use(plugin: Plugin): void;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
createFloor(data: GraphicInfo[]): {
|
|
45
|
+
curFloor: Floor;
|
|
46
|
+
graphics: Graphic[];
|
|
47
|
+
};
|
|
48
|
+
triggerHooks(hooks: HooksName, ...args: any[]): void;
|
|
49
|
+
switchFloor({ brand, project, floor, ts, resource_type_list, }: LoadQuery): void;
|
|
50
|
+
initialFloorCamera(): void;
|
|
57
51
|
onControlChange: () => void;
|
|
58
52
|
addModel(graphic: Graphic, options: ModelOptions): void;
|
|
59
53
|
addHeatmap(data: HeatmapDataParam): import("./elements").HeatmapElement | undefined;
|
|
@@ -18,6 +18,7 @@ export declare class Floor extends Object3D {
|
|
|
18
18
|
models: Object3D<import("three").Object3DEventMap>;
|
|
19
19
|
modelMap: Map<any, any>;
|
|
20
20
|
private groundMaxHeight;
|
|
21
|
+
name: string;
|
|
21
22
|
constructor(context: Context);
|
|
22
23
|
getPosition(): Vector3;
|
|
23
24
|
createGround(options: GraphicOptionsParam): void;
|
|
@@ -50,6 +50,7 @@ export declare class Poi extends EventDispatcher<PoiEventMap> {
|
|
|
50
50
|
position: Vector3;
|
|
51
51
|
userData: {};
|
|
52
52
|
showTextStatus: boolean;
|
|
53
|
+
disposed: boolean;
|
|
53
54
|
constructor(context: Context, options: PoiOptionsParam);
|
|
54
55
|
get withinDisplayRange(): boolean;
|
|
55
56
|
resetSize(): Promise<void>;
|
package/lib/src/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './split-load';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GraphicInfo, LoadQuery } from "../../types";
|
|
2
|
+
import { Plugin } from "../base";
|
|
3
|
+
type LoadGraphicQuery = Omit<LoadQuery, "resource_type_list">;
|
|
4
|
+
export declare class SplitLoad extends Plugin {
|
|
5
|
+
cacheData: Map<string, GraphicInfo[]>;
|
|
6
|
+
load(query: LoadQuery): Promise<GraphicInfo[]>;
|
|
7
|
+
isSameFloor(query: LoadGraphicQuery): boolean;
|
|
8
|
+
switchFloorByData(data: GraphicInfo[], query: LoadGraphicQuery): void;
|
|
9
|
+
filterData(data: GraphicInfo[], query: LoadGraphicQuery): GraphicInfo[];
|
|
10
|
+
private switchFloorByStoreData;
|
|
11
|
+
private switchFloorByOtherData;
|
|
12
|
+
changeFloor(query: LoadGraphicQuery): Promise<unknown[]>;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
package/lib/src/types/index.d.ts
CHANGED
|
@@ -59,3 +59,10 @@ export interface ResGraphicInfo {
|
|
|
59
59
|
export interface GraphicInfo extends Omit<ResGraphicInfo, "info"> {
|
|
60
60
|
info: GraphicOptions;
|
|
61
61
|
}
|
|
62
|
+
export interface LoadQuery {
|
|
63
|
+
brand: string;
|
|
64
|
+
project: string;
|
|
65
|
+
floor: string;
|
|
66
|
+
ts: string;
|
|
67
|
+
resource_type_list: string;
|
|
68
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Coordinate } from '
|
|
1
|
+
import { Coordinate } from '../types';
|
|
2
2
|
import { Vector3, Camera } from 'three';
|
|
3
3
|
/**
|
|
4
4
|
* 3D坐标转屏幕坐标
|
|
@@ -16,7 +16,7 @@ export declare function vector3ToDevice(vector: Vector3, camera: Camera, w: numb
|
|
|
16
16
|
* 获取多变形的中心点
|
|
17
17
|
* @param coordinates
|
|
18
18
|
*/
|
|
19
|
-
export declare function getCenter(coordinates: Coordinate[]):
|
|
19
|
+
export declare function getCenter(coordinates: Coordinate[]): [number, number];
|
|
20
20
|
type Position = {
|
|
21
21
|
x: number;
|
|
22
22
|
y: number;
|
package/lib/src/utils/index.d.ts
CHANGED