@aibee/crc-bmap 0.0.65 → 0.0.66

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/lib/src/bmap.d.ts CHANGED
@@ -47,6 +47,9 @@ export declare class BMap extends EventDispatcher<BmapEventMap> {
47
47
  private createFloor;
48
48
  switchFloor({ brand, project, phase, building, floor, ts, resource_type_list }: LoadQuery): void;
49
49
  onControlChange: () => void;
50
+ addStaircaseModel(graphic: Graphic, icon: string, modelUrl: string): void;
51
+ addLiftModel(graphic: Graphic): void;
52
+ addStairwayModel(graphic: Graphic): void;
50
53
  addHeatmap(data: HeatmapDataParam): import("./elements").HeatmapElement | undefined;
51
54
  getLegacyToGraphicMap(): Map<string, Graphic>;
52
55
  /**
@@ -64,6 +67,14 @@ export declare class BMap extends EventDispatcher<BmapEventMap> {
64
67
  translateElementToCenter(ele: {
65
68
  getPosition: () => Vector3;
66
69
  }, duration?: number): Promise<unknown>;
70
+ /**
71
+ * 移动相机位置让选中的元素居中显示
72
+ * @param ele { Graphic | Poi }
73
+ * @param duration
74
+ */
75
+ translateElementToCenterX(ele: {
76
+ getPosition: () => Vector3;
77
+ }, duration?: number): Promise<unknown>;
67
78
  /**
68
79
  * 获取物体的屏幕坐标
69
80
  */
@@ -6,6 +6,7 @@ import { Graphic, GraphicOptionsParam } from "./graphic";
6
6
  import { Shadow } from "./shadow";
7
7
  import { PoiOptionsParam } from "./poi";
8
8
  import { HeatmapDataParam, HeatmapElement } from './heatmap';
9
+ import { Model, ModelOptions } from "./model";
9
10
  export declare class Floor extends Object3D {
10
11
  context: Context;
11
12
  graphicLayer: GraphicLayer;
@@ -14,6 +15,7 @@ export declare class Floor extends Object3D {
14
15
  shadow: Shadow;
15
16
  heatmap?: HeatmapElement;
16
17
  groundUpper: Object3D<import("three").Object3DEventMap>;
18
+ models: Object3D<import("three").Object3DEventMap>;
17
19
  private groundMaxHeight;
18
20
  constructor(context: Context);
19
21
  createGround(options: GraphicOptionsParam): void;
@@ -21,6 +23,7 @@ export declare class Floor extends Object3D {
21
23
  changeGroundMaxHeight(): void;
22
24
  get hasElement(): boolean;
23
25
  getCenter(): Vector3;
26
+ addModel(options: ModelOptions): Model;
24
27
  addShadow(): void;
25
28
  addGraphic(graphicOptions: GraphicOptionsParam): Graphic;
26
29
  addPoi(poiOptions: PoiOptionsParam): import("./poi").Poi;
@@ -8,3 +8,4 @@ export * from './svg-line';
8
8
  export * from './svg-polygon';
9
9
  export * from './base-svg';
10
10
  export * from './select-box';
11
+ export * from './model';
@@ -0,0 +1,18 @@
1
+ import { Object3D } from "three";
2
+ import { Context } from "../context";
3
+ import { Overlay } from "./overlay";
4
+ import { GLTF } from "three/examples/jsm/loaders/GLTFLoader";
5
+ export interface ModelOptions {
6
+ modelUrl: string;
7
+ icon?: string;
8
+ }
9
+ export declare class Model extends Object3D {
10
+ context: Context;
11
+ private options;
12
+ overlay: Overlay | null;
13
+ model: GLTF | null;
14
+ constructor(context: Context, options: ModelOptions);
15
+ loadModel(): Promise<void>;
16
+ initOverlay(): void;
17
+ dispose(): void;
18
+ }
@@ -22,4 +22,9 @@ type Position = {
22
22
  y: number;
23
23
  };
24
24
  export declare function isContain(point: Position, start: Position, end: Position): boolean;
25
+ /**
26
+ * 获取最长边的方向
27
+ * @param cds
28
+ */
29
+ export declare function getLongestSideDir(cds: Coordinate[]): Vector3;
25
30
  export {};
@@ -9,3 +9,4 @@ export * from './promise';
9
9
  export * from './svg';
10
10
  export * from './sleep';
11
11
  export * from './color';
12
+ export * from './model';
@@ -0,0 +1,8 @@
1
+ import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
2
+ /**
3
+ * 加载模型
4
+ * @param url
5
+ * @returns
6
+ */
7
+ export declare function loadModel(url: string): Promise<GLTF> | GLTF;
8
+ export declare function disposeLoader(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aibee/crc-bmap",
3
- "version": "0.0.65",
3
+ "version": "0.0.66",
4
4
  "description": "",
5
5
  "main": "lib/bmap.min.js",
6
6
  "module": "lib/bmap.esm.min.js",