@aibee/crc-bmap 0.0.111 → 0.0.112

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
@@ -70,6 +70,8 @@ export declare class BMap extends EventDispatcher<BmapEventMap> {
70
70
  };
71
71
  triggerHooks(hooks: HooksName, data: any): void;
72
72
  switchFloor({ brand, project, floor, ts, resource_type_list, }: LoadQuery): void;
73
+ switchFloorByData(data: GraphicInfo[], name: string, key?: string): void;
74
+ switchFloorByFloor(floor: Floor, graphics?: Object3D<import("three").Object3DEventMap>[]): void;
73
75
  initialFloorCamera(): void;
74
76
  onControlChange: () => void;
75
77
  addModel(graphic: Graphic, options: ModelOptions): void;
@@ -8,6 +8,7 @@ import { Selection } from "./operations/selection/selection";
8
8
  import { HoverHelper } from "./operations";
9
9
  import { MaterialFactory } from "./factory";
10
10
  import { CameraBound } from "./utils/camera-bound";
11
+ import { TextureFactory } from "./factory/texture";
11
12
  export interface ContextEventMap {
12
13
  update: {};
13
14
  "graphic-click": {
@@ -61,6 +62,7 @@ export declare class Context extends EventDispatcher<ContextEventMap> {
61
62
  hoverHelper: HoverHelper;
62
63
  private basicRatio?;
63
64
  materialFactory: MaterialFactory;
65
+ textureFactory: TextureFactory;
64
66
  cameraBound: CameraBound;
65
67
  clientSize: {
66
68
  width: number;
@@ -1,5 +1,5 @@
1
1
  import { Context } from "../context";
2
- import { Object3D, Vector3 } from "three";
2
+ import { Group, 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";
@@ -7,6 +7,7 @@ import { Shadow } from "./shadow";
7
7
  import { PoiOptionsParam } from "./poi";
8
8
  import { HeatmapDataParam, HeatmapElement } from './heatmap';
9
9
  import { Model, ModelOptions } from "./model";
10
+ import { GroundTextureOptionsParam } from "./ground-texture";
10
11
  export declare class Floor extends Object3D {
11
12
  context: Context;
12
13
  graphicLayer: GraphicLayer;
@@ -17,6 +18,7 @@ export declare class Floor extends Object3D {
17
18
  groundUpper: Object3D<import("three").Object3DEventMap>;
18
19
  models: Object3D<import("three").Object3DEventMap>;
19
20
  modelMap: Map<any, any>;
21
+ groundTextures: Group<import("three").Object3DEventMap>;
20
22
  groundMaxHeight: number;
21
23
  name: string;
22
24
  key: string;
@@ -31,6 +33,7 @@ export declare class Floor extends Object3D {
31
33
  addShadow(): void;
32
34
  addGraphic(graphicOptions: GraphicOptionsParam): Graphic;
33
35
  addPoi(poiOptions: PoiOptionsParam): import("./poi").Poi;
36
+ addGroundTexture(options: GroundTextureOptionsParam): void;
34
37
  addHeatmap(data: HeatmapDataParam): HeatmapElement;
35
38
  removeHeatMap(): void;
36
39
  setShadowOpacity(opacity: number): void;
@@ -0,0 +1,25 @@
1
+ import { Context } from "../context";
2
+ import { Mesh, Object3D } from "three";
3
+ export interface GroundTextureOptions {
4
+ uuid: string;
5
+ url: string;
6
+ name: string;
7
+ angleX: number;
8
+ angleY: number;
9
+ angleZ: number;
10
+ width: number;
11
+ height: number;
12
+ center: [number, number];
13
+ opacity: number;
14
+ visible: boolean;
15
+ }
16
+ export declare const defaultOptions: GroundTextureOptions;
17
+ export type GroundTextureOptionsParam = Partial<GroundTextureOptions>;
18
+ export declare class GroundTexture extends Object3D {
19
+ private context;
20
+ options: GroundTextureOptions;
21
+ mesh?: Mesh;
22
+ constructor(context: Context, options: GroundTextureOptionsParam);
23
+ init(): Promise<void>;
24
+ dispose(): void;
25
+ }
@@ -0,0 +1,6 @@
1
+ import { Context } from "../context";
2
+ import { Object3D } from "three";
3
+ export declare class Wall extends Object3D {
4
+ private context;
5
+ constructor(context: Context);
6
+ }
@@ -21,18 +21,24 @@ interface ShaderMaterialOptions {
21
21
  max: Vector3;
22
22
  min: Vector3;
23
23
  }
24
+ interface GroundTextureMaterialOptions {
25
+ url: string;
26
+ opacity: number;
27
+ }
24
28
  export declare class MaterialFactory {
25
29
  private context;
26
30
  private lineMaterialMap;
27
31
  private meshStandardMaterialMap;
28
32
  private meshBasicMaterialMap;
29
33
  private shaderMaterialMap;
34
+ private groundTextureMaterialMap;
30
35
  constructor(context: Context);
31
36
  generateLineMaterialKey({ color, opacity }: LineMaterialOptions): string;
32
37
  createLineMaterial({ color, opacity }: LineMaterialOptions): LineBasicMaterial;
33
38
  createMeshStandardMaterial({ color, opacity }: MeshStandardMaterialOptions): MeshStandardMaterial;
34
39
  createMeshBasicMaterial({ color, opacity }: MeshBasicMaterialOptions): MeshBasicMaterial;
35
40
  createShaderMaterial({ gradualColor, center, maxValue, opacity, direction, max, min, }: ShaderMaterialOptions): ShaderMaterial;
41
+ createGroundTextureMaterial({ url, opacity }: GroundTextureMaterialOptions): Promise<MeshBasicMaterial>;
36
42
  dispose(): void;
37
43
  }
38
44
  export {};
@@ -0,0 +1,10 @@
1
+ import { Texture, TextureLoader } from "three";
2
+ import { Context } from "../context";
3
+ export declare class TextureFactory {
4
+ private context;
5
+ textureMap: Map<string, Texture>;
6
+ loader: TextureLoader;
7
+ constructor(context: Context);
8
+ getTexture(url: string): Promise<Texture>;
9
+ dispose(): void;
10
+ }
@@ -0,0 +1,26 @@
1
+ import { BMap } from "../../bmap";
2
+ import { Floor } from "../../elements";
3
+ export interface AibeeLoaderOption {
4
+ loadRoadNetwork: boolean;
5
+ }
6
+ export declare const defaultAibeeLoaderOption: {
7
+ loadRoadNetwork: boolean;
8
+ };
9
+ export declare class AibeeLoader {
10
+ bmap: BMap;
11
+ placeId: number | null;
12
+ canUseZstd: boolean;
13
+ worker: any;
14
+ constructor(bmap: BMap);
15
+ initDb(): Promise<void>;
16
+ load(placeId: number): Promise<void>;
17
+ getFLoorData(floor: string): Promise<Floor>;
18
+ getRoadNetworkData(): Promise<void>;
19
+ getOtherDataByFreeTime(): Promise<void>;
20
+ getMulFloorsData(floor: string[]): Promise<Floor[]>;
21
+ getDataByUrl(url: string): Promise<Floor>;
22
+ getDataByJson(data: any): Floor;
23
+ clear(): void;
24
+ setCanUseZstd(bool: boolean): void;
25
+ dispose(): void;
26
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './AibeeLoader';
@@ -0,0 +1 @@
1
+ export * from './mul-floors';
@@ -0,0 +1,15 @@
1
+ import { Floor } from "../../elements";
2
+ import { BMap } from "../../bmap";
3
+ import { Plugin } from "../base";
4
+ import { PoiLayer } from "../../layer";
5
+ import { Group } from "three";
6
+ export declare class MulFloors extends Plugin {
7
+ poiLayer: PoiLayer;
8
+ floors: Floor[];
9
+ group: Group<import("three").Object3DEventMap>;
10
+ constructor(bmap: BMap);
11
+ show(floors: Floor[]): void;
12
+ hide(): void;
13
+ fitCamera(): void;
14
+ dispose(): void;
15
+ }
@@ -11,6 +11,9 @@ interface EventMap {
11
11
  };
12
12
  "path-animation": {};
13
13
  "path-animation-end": {};
14
+ "fetch-road-data": {
15
+ roadInfo: RoadData[];
16
+ };
14
17
  }
15
18
  export interface NavigationConfig {
16
19
  path?: Partial<PathConfig>;
@@ -1 +1,3 @@
1
- export declare function xhrGet<T>(url: string, options: RequestInit): Promise<T>;
1
+ export declare function xhrGet<T>(url: string, options: RequestInit & {
2
+ responseType?: 'json' | 'arraybuffer';
3
+ }): Promise<T>;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * 获取indexDb连接
3
+ * @param database
4
+ * @returns
5
+ */
6
+ export declare function createDb(database?: string): Promise<IDBDatabase>;
7
+ /**
8
+ * 查询数据
9
+ * @param storeName
10
+ * @param key
11
+ * @param db
12
+ * @returns
13
+ */
14
+ export declare function get(storeName: string, key: string, db?: IDBDatabase): Promise<unknown>;
15
+ /**
16
+ * 添加数据
17
+ * @param storeName
18
+ * @param key
19
+ * @param value
20
+ * @param db
21
+ * @returns
22
+ */
23
+ export declare function set(storeName: string, key: string, value: any, db?: IDBDatabase): Promise<unknown>;
24
+ /**
25
+ * 创建数据表
26
+ * @param storeName
27
+ * @param db
28
+ * @returns
29
+ */
30
+ export declare function createStore(storeName: string, db?: IDBDatabase): void;
31
+ /**
32
+ * 删除数据
33
+ * @param storeName
34
+ * @param key
35
+ * @param db
36
+ * @returns
37
+ */
38
+ export declare function remove(storeName: string, key: string, db?: IDBDatabase): Promise<unknown>;
39
+ /**
40
+ * 更新数据
41
+ * @param storeName
42
+ * @param key
43
+ * @param value
44
+ * @param db
45
+ * @returns
46
+ */
47
+ export declare function update(storeName: string, key: string, value: any, db?: IDBDatabase): Promise<unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aibee/crc-bmap",
3
- "version": "0.0.111",
3
+ "version": "0.0.112",
4
4
  "description": "",
5
5
  "main": "lib/bmap.min.js",
6
6
  "module": "lib/bmap.esm.js",
@@ -31,7 +31,7 @@
31
31
  "@types/node": "^20.8.3",
32
32
  "@types/node-dijkstra": "^2.5.6",
33
33
  "@types/tween.js": "^18.6.1",
34
- "esbuild": "^0.19.4",
34
+ "esbuild": "^0.23.0",
35
35
  "esbuild-plugin-inline-worker": "^0.1.1",
36
36
  "eslint": "^8.51.0",
37
37
  "eslint-plugin-prettier": "^5.0.0",
@@ -51,6 +51,6 @@
51
51
  "meshline": "^3.3.0",
52
52
  "node-dijkstra": "^2.5.0",
53
53
  "three": "^0.157.0",
54
- "three.meshline": "^1.4.0"
54
+ "zstddec": "^0.1.0"
55
55
  }
56
56
  }