@aibee/crc-bmap 0.0.66 → 0.0.68

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
@@ -1,7 +1,7 @@
1
1
  import { EventDispatcher, Object3D, Vector3 } from "three";
2
2
  import { Context } from "./context";
3
3
  import { Config } from './config';
4
- import { Graphic, HeatmapDataParam, PoiOptionsParam } from "./elements";
4
+ import { Graphic, HeatmapDataParam, ModelOptions, PoiOptionsParam } from "./elements";
5
5
  import { GraphicInfo, GraphicOptions } from "./types";
6
6
  export interface LoadQuery {
7
7
  brand: string;
@@ -47,9 +47,7 @@ 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
+ addModel(graphic: Graphic, options: ModelOptions): void;
53
51
  addHeatmap(data: HeatmapDataParam): import("./elements").HeatmapElement | undefined;
54
52
  getLegacyToGraphicMap(): Map<string, Graphic>;
55
53
  /**
@@ -49,6 +49,9 @@ export interface Config {
49
49
  graphic: {
50
50
  fillOpacity: number;
51
51
  };
52
+ cameraBound: {
53
+ padding: [number, number, number, number];
54
+ };
52
55
  }
53
56
  export declare const defaultConfig: Config;
54
57
  export declare function getConfig(config: Partial<Config>): Config;
@@ -7,6 +7,7 @@ import { Config } from "./config";
7
7
  import { Selection } from "./operations/selection/selection";
8
8
  import { HoverHelper } from "./operations";
9
9
  import { MaterialFactory } from "./factory";
10
+ import { CameraBound } from "./utils/camera-bound";
10
11
  export interface ContextEventMap {
11
12
  update: {};
12
13
  "graphic-click": {
@@ -58,7 +59,7 @@ export declare class Context extends EventDispatcher<ContextEventMap> {
58
59
  hoverHelper: HoverHelper;
59
60
  private basicRatio?;
60
61
  materialFactory: MaterialFactory;
61
- private observe;
62
+ cameraBound: CameraBound;
62
63
  clientSize: {
63
64
  width: number;
64
65
  height: number;
@@ -1,10 +1,12 @@
1
- import { Object3D } from "three";
1
+ import { Object3D, Vector3 } from "three";
2
2
  import { Context } from "../context";
3
3
  import { Overlay } from "./overlay";
4
4
  import { GLTF } from "three/examples/jsm/loaders/GLTFLoader";
5
5
  export interface ModelOptions {
6
6
  modelUrl: string;
7
7
  icon?: string;
8
+ icon_size?: [number, number];
9
+ position?: Vector3;
8
10
  }
9
11
  export declare class Model extends Object3D {
10
12
  context: Context;
@@ -0,0 +1,31 @@
1
+ import { Context } from "../context";
2
+ export declare class CameraBound {
3
+ private context;
4
+ private prevCamera;
5
+ private enable;
6
+ constructor(context: Context);
7
+ setEnable(enable: boolean): void;
8
+ changePrevCamera(): void;
9
+ backToPrevCamera(): void;
10
+ registryEvent(): void;
11
+ unRegistryEvent(): void;
12
+ getCurFloorScreenPosition(): {
13
+ left: number;
14
+ right: number;
15
+ top: number;
16
+ bottom: number;
17
+ } | null;
18
+ /**
19
+ * 检测地图是不是在显示范围
20
+ * @param param0
21
+ * @returns
22
+ */
23
+ checkDistanceToScreenEdge({ left, right, top, bottom }: {
24
+ left: number;
25
+ right: number;
26
+ top: number;
27
+ bottom: number;
28
+ }): boolean;
29
+ onCameraChange: () => void;
30
+ dispose(): void;
31
+ }
@@ -4,5 +4,5 @@ import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
4
4
  * @param url
5
5
  * @returns
6
6
  */
7
- export declare function loadModel(url: string): Promise<GLTF> | GLTF;
7
+ export declare function loadModel(url: string): Promise<GLTF>;
8
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.66",
3
+ "version": "0.0.68",
4
4
  "description": "",
5
5
  "main": "lib/bmap.min.js",
6
6
  "module": "lib/bmap.esm.min.js",