@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.
@@ -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
- private loadGraphics;
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
- 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>;
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
- loadNavigation(): void;
55
- private createFloor;
56
- switchFloor({ brand, project, phase, building, floor, ts, resource_type_list, }: LoadQuery): void;
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>;
@@ -7,3 +7,4 @@ export * from './layer';
7
7
  export * from './types';
8
8
  export * from './operations';
9
9
  export * from './plugins';
10
+ export * from './api';
@@ -1,4 +1,4 @@
1
- import { BMap } from "src/bmap";
1
+ import { BMap } from "../bmap";
2
2
  export declare class Plugin {
3
3
  bmap: BMap;
4
4
  constructor(bmap: BMap);
@@ -1,2 +1,3 @@
1
1
  export * from "./equipment";
2
2
  export * from "./navigation";
3
+ export * from './split-load';
@@ -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 {};
@@ -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 'src/types';
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[]): import("@turf/turf").Position;
19
+ export declare function getCenter(coordinates: Coordinate[]): [number, number];
20
20
  type Position = {
21
21
  x: number;
22
22
  y: number;
@@ -1,4 +1,4 @@
1
- export declare enum EventName {
1
+ export declare enum HooksName {
2
2
  SWITCH_FLOOR_BEFORE = "switch_floor_before",
3
3
  SWITCH_FLOOR_AFTER = "switch_floor_after"
4
4
  }
@@ -14,3 +14,4 @@ export * from './keyboard';
14
14
  export * from './os';
15
15
  export * from './events';
16
16
  export * from './event-name';
17
+ export * from './obj-utils';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 生成对象的key
3
+ * @param obj
4
+ * @returns
5
+ */
6
+ export declare function generatorKeyByObj(obj: Record<string, any>): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aibee/crc-bmap",
3
- "version": "0.0.94",
3
+ "version": "0.0.95",
4
4
  "description": "",
5
5
  "main": "lib/bmap.min.js",
6
6
  "module": "lib/bmap.esm.min.js",