@aibee/crc-bmap 0.0.47 → 0.0.48

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.
@@ -10,6 +10,7 @@ export interface Config {
10
10
  useFloorCache: boolean;
11
11
  control: {
12
12
  maxPolar: number;
13
+ defaultPolar: number;
13
14
  };
14
15
  svg: {
15
16
  circle: {
@@ -27,6 +28,22 @@ export interface Config {
27
28
  hover: {
28
29
  time: number;
29
30
  };
31
+ ground: {
32
+ color: string;
33
+ opacity: number;
34
+ height: number;
35
+ stroke: boolean;
36
+ strokeColor: string;
37
+ strokeOpacity: number;
38
+ };
39
+ markGraphic: {
40
+ color: string;
41
+ opacity: number;
42
+ height: number;
43
+ stroke: boolean;
44
+ strokeColor: string;
45
+ strokeOpacity: number;
46
+ };
30
47
  }
31
48
  export declare const defaultConfig: Config;
32
49
  export declare function getConfig(config: Partial<Config>): Config;
@@ -6,6 +6,7 @@ import { Group as TweenGroup } from "@tweenjs/tween.js";
6
6
  import { Config } from "./config";
7
7
  import { Selection } from "./operations/selection/selection";
8
8
  import { HoverHelper } from "./operations";
9
+ import { MaterialFactory } from "./factory";
9
10
  export interface ContextEventMap {
10
11
  update: {};
11
12
  "graphic-click": {
@@ -51,6 +52,7 @@ export declare class Context extends EventDispatcher<ContextEventMap> {
51
52
  selection: Selection;
52
53
  hoverHelper: HoverHelper;
53
54
  private basicRatio?;
55
+ materialFactory: MaterialFactory;
54
56
  clientSize: {
55
57
  width: number;
56
58
  height: number;
@@ -103,7 +105,7 @@ export declare class Context extends EventDispatcher<ContextEventMap> {
103
105
  * 设置横向旋转角度
104
106
  * @param azimuthal 弧度
105
107
  */
106
- setAzimuthalAngle(azimuthal: number, duration?: number): Promise<unknown>;
108
+ setAzimuthalAngle(azimuthal: number, duration?: number): Promise<unknown> | undefined;
107
109
  getCameraLookAt(): Vector3;
108
110
  /**
109
111
  * 按照一个中心点设置相机的放大缩小
@@ -1,8 +1,6 @@
1
- import { Object3D, ExtrudeGeometry, MeshStandardMaterial, Mesh, Raycaster, Object3DEventMap, Vector3 } from 'three';
1
+ import { Object3D, ExtrudeGeometry, MeshStandardMaterial, Mesh, Raycaster, Object3DEventMap, Vector3, BufferGeometry, LineBasicMaterial, LineSegments } from 'three';
2
2
  import { GraphicOptions } from 'src/types';
3
3
  import { Context } from '../context';
4
- import { LineMaterial } from 'three/examples/jsm/lines/LineMaterial.js';
5
- import { LineSegments2 } from 'three/examples/jsm/lines/LineSegments2.js';
6
4
  declare const DoorType: {
7
5
  single: string;
8
6
  double: string;
@@ -33,6 +31,8 @@ export declare class Graphic extends Object3D<GraphicEventMap> {
33
31
  private material;
34
32
  mesh: Mesh;
35
33
  private line;
34
+ private lineMaterial?;
35
+ private lineGeometry?;
36
36
  options: GraphicOptions;
37
37
  constructor(context: Context, options: GraphicOptionsParam);
38
38
  getCenter(): Vector3;
@@ -41,10 +41,11 @@ export declare class Graphic extends Object3D<GraphicEventMap> {
41
41
  init(): void;
42
42
  initGeometry(): ExtrudeGeometry;
43
43
  initMaterial(): MeshStandardMaterial;
44
- initLineMaterial(): LineMaterial;
45
- initMesh(): Mesh<ExtrudeGeometry, MeshStandardMaterial, Object3DEventMap>;
46
- getBorderPoints(): number[];
47
- createBorder(): LineSegments2;
44
+ initLineMaterial(): LineBasicMaterial;
45
+ initMesh(): void;
46
+ getBorderPoints(): Vector3[];
47
+ initLineGeometry(): void;
48
+ createBorder(): LineSegments<BufferGeometry<import("three").NormalBufferAttributes>, LineBasicMaterial>;
48
49
  raycast(raycaster: Raycaster): false | {
49
50
  position: Vector3;
50
51
  distance: number;
@@ -0,0 +1 @@
1
+ export * from './material';
@@ -0,0 +1,21 @@
1
+ import { Context } from "../context";
2
+ import { LineBasicMaterial, MeshStandardMaterial } from "three";
3
+ interface LineMaterialOptions {
4
+ color: string;
5
+ opacity: number;
6
+ }
7
+ interface MeshStandardMaterialOptions {
8
+ color: string;
9
+ opacity: number;
10
+ }
11
+ export declare class MaterialFactory {
12
+ private context;
13
+ private lineMaterialMap;
14
+ private meshStandardMaterialMap;
15
+ constructor(context: Context);
16
+ generateLineMaterialKey({ color, opacity }: LineMaterialOptions): string;
17
+ createLineMaterial({ color, opacity }: LineMaterialOptions): LineBasicMaterial;
18
+ createMeshStandardMaterial({ color, opacity }: MeshStandardMaterialOptions): MeshStandardMaterial;
19
+ dispose(): void;
20
+ }
21
+ export {};
@@ -29,6 +29,8 @@ export interface GraphicOptions {
29
29
  layerType: string;
30
30
  zIndex: number;
31
31
  transformToBuildingGround?: boolean;
32
+ stroke?: boolean;
33
+ userData: Record<string, any>;
32
34
  }
33
35
  /**
34
36
  * 接口返回的图元信息
@@ -1 +1,8 @@
1
1
  export declare function strToNumber(str: string): number;
2
+ /**
3
+ * 给颜色加上透明度
4
+ * @param hexColor
5
+ * @param alpha
6
+ * @returns
7
+ */
8
+ export declare function addAlphaToHexColor(hexColor: string, alpha: number): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aibee/crc-bmap",
3
- "version": "0.0.47",
3
+ "version": "0.0.48",
4
4
  "description": "",
5
5
  "main": "lib/bmap.min.js",
6
6
  "module": "lib/bmap.esm.min.js",