@aibee/crc-bmap 0.0.13 → 0.0.15

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
@@ -26,7 +26,7 @@ export declare class BMap extends EventDispatcher {
26
26
  private loadBuildingGround;
27
27
  load({ brand, project, phase, building, floor, ts }: LoadQuery): Promise<GraphicInfo[] | undefined>;
28
28
  private createFloor;
29
- switchFloor(floor: string): void;
29
+ switchFloor(floor: string): Promise<void>;
30
30
  addHeatmap(data: HeatmapDataParam): import("./elements").HeatmapElement | undefined;
31
31
  getLegacyToGraphicMap(): any;
32
32
  /**
@@ -34,7 +34,7 @@ export declare class BMap extends EventDispatcher {
34
34
  * @returns
35
35
  */
36
36
  getFloorAllGraphics(): Graphic[];
37
- createGraphicPoi(graphic: Graphic, options: PoiOptionsParam): null;
37
+ createGraphicPoi(graphic: Graphic, options: PoiOptionsParam): import("./elements").Poi | null;
38
38
  removeHeatMap(): void;
39
39
  /**
40
40
  * 移动相机位置让选中的元素居中显示
@@ -1,5 +1,5 @@
1
1
  import { Context } from "../context";
2
- import { Object3D } from "three";
2
+ import { Object3D, Vector3 } from "three";
3
3
  import { GraphicLayer } from '../layer/graphic-layer';
4
4
  import { PoiLayer } from '../layer/poi-layer';
5
5
  import { Graphic, GraphicOptionsParam } from "./graphic";
@@ -16,6 +16,8 @@ export declare class Floor extends Object3D {
16
16
  groundUpper: Object3D<import("three").Object3DEventMap>;
17
17
  constructor(context: Context);
18
18
  addGrounds(grounds: Graphic[]): void;
19
+ get hasElement(): boolean;
20
+ getCenter(): Vector3;
19
21
  addShadow(): void;
20
22
  addGraphic(graphicOptions: GraphicOptionsParam): Graphic;
21
23
  addPoi(poiOptions: PoiOptionsParam): import("./poi").Poi;
@@ -42,7 +42,10 @@ export declare class Graphic extends Object3D<GraphicEventMap> {
42
42
  initLineMaterial(): LineBasicMaterial;
43
43
  initMesh(): Mesh<ExtrudeGeometry, MeshStandardMaterial, Object3DEventMap>;
44
44
  createBorder(): LineSegments<EdgesGeometry<ExtrudeGeometry>, LineBasicMaterial>;
45
- raycast(raycaster: Raycaster): false | Vector3;
45
+ raycast(raycaster: Raycaster): false | {
46
+ position: Vector3;
47
+ distance: number;
48
+ };
46
49
  dispose(): void;
47
50
  }
48
51
  export {};
@@ -10,6 +10,7 @@ export declare class Overlay extends EventDispatcher {
10
10
  bindElement(element: Object3D): void;
11
11
  unBindElement(): void;
12
12
  setVisible(visible: boolean, display?: string): void;
13
+ setOpacity(opacity: number): void;
13
14
  getPosition(): Vector3;
14
15
  onUpdate: () => void;
15
16
  registryEvent(): void;
@@ -6,6 +6,7 @@ export interface PoiOptions {
6
6
  icon_size?: [number, number];
7
7
  level: number;
8
8
  collision_enable: boolean;
9
+ opacity: number;
9
10
  }
10
11
  type PoiEventMap = {
11
12
  [K in keyof PoiOptions as `change-${K}`]: {
@@ -15,14 +16,15 @@ type PoiEventMap = {
15
16
  export type PoiOptionsParam = Partial<PoiOptions>;
16
17
  export declare class Poi extends Object3D<PoiEventMap> {
17
18
  private context;
18
- private span;
19
+ private textDiv;
19
20
  private img?;
20
21
  private overlay;
21
22
  options: PoiOptions;
22
23
  constructor(context: Context, options: PoiOptionsParam);
23
24
  initDiv(): HTMLDivElement;
24
25
  getPosition(): import("three").Vector3;
25
- initText(): HTMLSpanElement;
26
+ initText(): HTMLDivElement;
27
+ createTextFragment(): DocumentFragment;
26
28
  initIcon(): HTMLImageElement;
27
29
  private _changePosition;
28
30
  registryEvent(): void;
@@ -1,4 +1,16 @@
1
1
  export type Coordinate = [number, number];
2
+ export interface PointGeometry {
3
+ type: "point";
4
+ cds: Coordinate;
5
+ curveCpt: Coordinate[];
6
+ curveIndex: [];
7
+ }
8
+ export interface PolygonGeometry {
9
+ type: "polygon";
10
+ cds: Coordinate[][];
11
+ curveCpt: Coordinate[];
12
+ curveIndex: [];
13
+ }
2
14
  export interface GraphicOptions {
3
15
  id: string;
4
16
  height: number;
@@ -12,12 +24,7 @@ export interface GraphicOptions {
12
24
  locked: boolean;
13
25
  visible: boolean;
14
26
  doors: any[];
15
- geometry: {
16
- type: "polygon" | "point";
17
- cds: Coordinate[][];
18
- curveCpt: Coordinate[];
19
- curveIndex: [];
20
- };
27
+ geometry: PolygonGeometry | PointGeometry;
21
28
  layerType: string;
22
29
  zIndex: number;
23
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aibee/crc-bmap",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "",
5
5
  "main": "lib/bmap.min.js",
6
6
  "module": "lib/bmap.esm.min.js",