@aibee/crc-bmap 0.0.46 → 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.
- package/example/src/main.ts +28 -14
- package/example/vite.config.ts +2 -1
- package/lib/bmap.cjs.min.js +1 -2
- package/lib/bmap.cjs.min.js.map +4 -4
- package/lib/bmap.esm.js +240 -96
- package/lib/bmap.esm.js.map +4 -4
- package/lib/bmap.esm.min.js +1 -2
- package/lib/bmap.esm.min.js.map +4 -4
- package/lib/bmap.min.js +1 -2
- package/lib/bmap.min.js.map +4 -4
- package/lib/src/bmap.d.ts +2 -2
- package/lib/src/config.d.ts +17 -0
- package/lib/src/context.d.ts +6 -4
- package/lib/src/elements/graphic.d.ts +8 -6
- package/lib/src/elements/poi.d.ts +6 -1
- package/lib/src/factory/index.d.ts +1 -0
- package/lib/src/factory/material.d.ts +21 -0
- package/lib/src/types/index.d.ts +2 -0
- package/lib/src/utils/color.d.ts +7 -0
- package/package.json +1 -1
package/lib/src/bmap.d.ts
CHANGED
|
@@ -81,14 +81,14 @@ export declare class BMap extends EventDispatcher<BmapEventMap> {
|
|
|
81
81
|
* @param duration
|
|
82
82
|
* @returns
|
|
83
83
|
*/
|
|
84
|
-
reduceMap(zoom?: number, duration?: number): Promise<unknown
|
|
84
|
+
reduceMap(zoom?: number, duration?: number): Promise<unknown> | undefined;
|
|
85
85
|
/**
|
|
86
86
|
* 放大地图
|
|
87
87
|
* @param zoom
|
|
88
88
|
* @param duration
|
|
89
89
|
* @returns
|
|
90
90
|
*/
|
|
91
|
-
enlargeMap(zoom?: number, duration?: number): Promise<unknown
|
|
91
|
+
enlargeMap(zoom?: number, duration?: number): Promise<unknown> | undefined;
|
|
92
92
|
onKeydown: (e: KeyboardEvent) => void;
|
|
93
93
|
onKeyUp: (e: KeyboardEvent) => void;
|
|
94
94
|
registryEvent(): void;
|
package/lib/src/config.d.ts
CHANGED
|
@@ -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;
|
package/lib/src/context.d.ts
CHANGED
|
@@ -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
|
* 按照一个中心点设置相机的放大缩小
|
|
@@ -111,7 +113,7 @@ export declare class Context extends EventDispatcher<ContextEventMap> {
|
|
|
111
113
|
* @param center
|
|
112
114
|
* @returns
|
|
113
115
|
*/
|
|
114
|
-
setZoom(zoom: number, center: Vector3, duration?: number): Promise<unknown
|
|
116
|
+
setZoom(zoom: number, center: Vector3, duration?: number): Promise<unknown> | undefined;
|
|
115
117
|
/**
|
|
116
118
|
* 放大相机到物体占全屏
|
|
117
119
|
* @param object
|
|
@@ -119,8 +121,8 @@ export declare class Context extends EventDispatcher<ContextEventMap> {
|
|
|
119
121
|
* @param duration
|
|
120
122
|
* @returns
|
|
121
123
|
*/
|
|
122
|
-
fitCameraToObject(object: Object3D, padding?: [number, number, number, number], duration?: number): Promise<unknown
|
|
123
|
-
fitCameraToGround(padding?: [number, number, number, number], duration?: number): Promise<unknown
|
|
124
|
+
fitCameraToObject(object: Object3D, padding?: [number, number, number, number], duration?: number): Promise<unknown> | undefined;
|
|
125
|
+
fitCameraToGround(padding?: [number, number, number, number], duration?: number): Promise<unknown> | undefined;
|
|
124
126
|
/**
|
|
125
127
|
* 修改相机位置
|
|
126
128
|
* @param position 修改后的相机的位置
|
|
@@ -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,9 +41,11 @@ export declare class Graphic extends Object3D<GraphicEventMap> {
|
|
|
41
41
|
init(): void;
|
|
42
42
|
initGeometry(): ExtrudeGeometry;
|
|
43
43
|
initMaterial(): MeshStandardMaterial;
|
|
44
|
-
initLineMaterial():
|
|
45
|
-
initMesh():
|
|
46
|
-
|
|
44
|
+
initLineMaterial(): LineBasicMaterial;
|
|
45
|
+
initMesh(): void;
|
|
46
|
+
getBorderPoints(): Vector3[];
|
|
47
|
+
initLineGeometry(): void;
|
|
48
|
+
createBorder(): LineSegments<BufferGeometry<import("three").NormalBufferAttributes>, LineBasicMaterial>;
|
|
47
49
|
raycast(raycaster: Raycaster): false | {
|
|
48
50
|
position: Vector3;
|
|
49
51
|
distance: number;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { Object3D, Object3DEventMap } from 'three';
|
|
2
2
|
import { Context } from '../context';
|
|
3
3
|
export interface PoiOptions {
|
|
4
|
-
|
|
4
|
+
texts: {
|
|
5
|
+
text: string;
|
|
6
|
+
styles?: {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
};
|
|
9
|
+
}[];
|
|
5
10
|
icon?: string;
|
|
6
11
|
icon_size?: [number, number];
|
|
7
12
|
level: 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 {};
|
package/lib/src/types/index.d.ts
CHANGED
package/lib/src/utils/color.d.ts
CHANGED