@aibee/crc-bmap 0.0.129 → 0.0.130
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/bmap.cjs.min.js +7 -7
- package/lib/bmap.cjs.min.js.map +4 -4
- package/lib/bmap.esm.js +879 -190
- package/lib/bmap.esm.js.map +4 -4
- package/lib/bmap.esm.min.js +7 -7
- package/lib/bmap.esm.min.js.map +4 -4
- package/lib/bmap.min.js +7 -7
- package/lib/bmap.min.js.map +4 -4
- package/lib/src/bmap.d.ts +5 -5
- package/lib/src/context.d.ts +6 -2
- package/lib/src/elements/floor.d.ts +5 -2
- package/lib/src/elements/index.d.ts +1 -0
- package/lib/src/elements/poi2.d.ts +53 -0
- package/lib/src/layer/index.d.ts +1 -0
- package/lib/src/layer/poi-layer2.d.ts +30 -0
- package/lib/src/plugins/navigation/navigation.d.ts +13 -5
- package/lib/src/plugins/navigation/path.d.ts +3 -0
- package/lib/src/utils/camera-bound.d.ts +3 -0
- package/lib/src/utils/path.d.ts +2 -0
- package/lib/src/utils/texture.d.ts +2 -1
- package/package.json +1 -1
package/lib/src/bmap.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { EventDispatcher, Object3D, Vector3 } from "three";
|
|
|
2
2
|
import { Context } from "./context";
|
|
3
3
|
import { Timer, HooksName } from "./utils";
|
|
4
4
|
import { Config } from "./config";
|
|
5
|
-
import { Floor, Graphic, HeatmapDataParam, ModelOptions, PoiOptionsParam } from "./elements";
|
|
5
|
+
import { Floor, Graphic, HeatmapDataParam, ModelOptions, Poi, Poi2, PoiOptionsParam } from "./elements";
|
|
6
6
|
import { SvgLine, SvgPolygon } from "./elements";
|
|
7
7
|
import { GraphicInfo, GraphicOptions, LoadQuery } from "./types";
|
|
8
8
|
import { Plugin } from "./plugins/base";
|
|
@@ -82,7 +82,7 @@ export declare class BMap extends EventDispatcher<BmapEventMap> {
|
|
|
82
82
|
* @returns
|
|
83
83
|
*/
|
|
84
84
|
getFloorAllGraphics(): Graphic[];
|
|
85
|
-
createGraphicPoi(graphic: Graphic, options: PoiOptionsParam):
|
|
85
|
+
createGraphicPoi(graphic: Graphic, options: PoiOptionsParam): Poi | null;
|
|
86
86
|
removeHeatMap(): void;
|
|
87
87
|
/**
|
|
88
88
|
* 移动相机位置让选中的元素居中显示
|
|
@@ -162,9 +162,9 @@ export declare class BMap extends EventDispatcher<BmapEventMap> {
|
|
|
162
162
|
getGraphicByNodeId(nodeId: string): Graphic | null;
|
|
163
163
|
deleteGraphic(graphic: Graphic): void;
|
|
164
164
|
createGraphicByOptions(options: GraphicOptions): Graphic | undefined;
|
|
165
|
-
removePoiById(id: string): void
|
|
166
|
-
getPoiById(id: string):
|
|
167
|
-
getPois():
|
|
165
|
+
removePoiById(id: string): void;
|
|
166
|
+
getPoiById(id: string): Poi | Poi2 | null | undefined;
|
|
167
|
+
getPois(): (Poi | Poi2)[];
|
|
168
168
|
clearPoi(): void;
|
|
169
169
|
removeSelectGraphic(graphic: Graphic): void;
|
|
170
170
|
resize: () => void;
|
package/lib/src/context.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MapControls } from "three/examples/jsm/controls/MapControls";
|
|
2
2
|
import { Timer } from "./utils";
|
|
3
3
|
import { EventDispatcher, OrthographicCamera, Vector3, Object3D } from "three";
|
|
4
|
-
import { Graphic, Poi, Floor } from "./elements";
|
|
4
|
+
import { Graphic, Poi, Floor, Poi2 } from "./elements";
|
|
5
5
|
import { Group as TweenGroup } from "@tweenjs/tween.js";
|
|
6
6
|
import { Config } from "./config";
|
|
7
7
|
import { Selection } from "./operations/selection/selection";
|
|
@@ -46,6 +46,9 @@ export interface ContextEventMap {
|
|
|
46
46
|
width: number;
|
|
47
47
|
height: number;
|
|
48
48
|
};
|
|
49
|
+
"control-zoom-change": {
|
|
50
|
+
zoom: number;
|
|
51
|
+
};
|
|
49
52
|
}
|
|
50
53
|
export declare class Context extends EventDispatcher<ContextEventMap> {
|
|
51
54
|
container: HTMLElement;
|
|
@@ -71,6 +74,7 @@ export declare class Context extends EventDispatcher<ContextEventMap> {
|
|
|
71
74
|
y: number;
|
|
72
75
|
};
|
|
73
76
|
renderRf: number;
|
|
77
|
+
prevCameraZoom: number;
|
|
74
78
|
constructor(container: HTMLElement, config: Config);
|
|
75
79
|
resizeClientSize(): void;
|
|
76
80
|
init(): void;
|
|
@@ -98,7 +102,7 @@ export declare class Context extends EventDispatcher<ContextEventMap> {
|
|
|
98
102
|
* @param y
|
|
99
103
|
* @returns
|
|
100
104
|
*/
|
|
101
|
-
getPoisByDeviceXy(x: number, y: number): Poi[];
|
|
105
|
+
getPoisByDeviceXy(x: number, y: number): (Poi | Poi2)[];
|
|
102
106
|
onPointerover: (e: PointerEvent) => void;
|
|
103
107
|
onPointermove: (e: PointerEvent) => void;
|
|
104
108
|
onPointerleave: (e: PointerEvent) => void;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Context } from "../context";
|
|
2
|
-
import { Object3D, Vector3 } from "three";
|
|
2
|
+
import { Box3, Object3D, Vector3 } from "three";
|
|
3
3
|
import { Graphic, GraphicOptionsParam } from "./graphic";
|
|
4
4
|
import { Shadow } from "./shadow";
|
|
5
5
|
import { PoiOptionsParam } from "./poi";
|
|
6
6
|
import { HeatmapDataParam, HeatmapElement } from './heatmap';
|
|
7
7
|
import { Model, ModelOptions } from "./model";
|
|
8
|
-
import { Layer, GraphicLayer, PoiLayer } from "../layer";
|
|
8
|
+
import { Layer, GraphicLayer, PoiLayer, PoiLayer2 } from "../layer";
|
|
9
9
|
export declare class Floor extends Object3D {
|
|
10
10
|
context: Context;
|
|
11
11
|
graphicLayer: GraphicLayer;
|
|
12
12
|
poiLayer: PoiLayer;
|
|
13
|
+
poiLayer2: PoiLayer2;
|
|
13
14
|
wallLayer: Layer;
|
|
14
15
|
textureLayer: Layer;
|
|
15
16
|
glbModelLayer: Layer;
|
|
@@ -25,6 +26,7 @@ export declare class Floor extends Object3D {
|
|
|
25
26
|
groundMaxHeight: number;
|
|
26
27
|
name: string;
|
|
27
28
|
key: string;
|
|
29
|
+
box: Box3;
|
|
28
30
|
constructor(context: Context);
|
|
29
31
|
getPosition(): Vector3;
|
|
30
32
|
createGround(options: GraphicOptionsParam): void;
|
|
@@ -40,5 +42,6 @@ export declare class Floor extends Object3D {
|
|
|
40
42
|
removeHeatMap(): void;
|
|
41
43
|
setShadowOpacity(opacity: number): void;
|
|
42
44
|
setShadowVisible(visible: boolean): void;
|
|
45
|
+
updateBox(): void;
|
|
43
46
|
dispose(): void;
|
|
44
47
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Context } from "../context";
|
|
2
|
+
import { Box2, Object3D, Object3DEventMap, Sprite, Vector3 } from "three";
|
|
3
|
+
export interface PoiOptions2 {
|
|
4
|
+
text: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
icon_size: [number, number];
|
|
7
|
+
level: number;
|
|
8
|
+
collision_enable: boolean;
|
|
9
|
+
opacity: number;
|
|
10
|
+
id: string;
|
|
11
|
+
position: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
z: number;
|
|
15
|
+
};
|
|
16
|
+
text_font_size: number;
|
|
17
|
+
}
|
|
18
|
+
type PoiEventMap2 = {
|
|
19
|
+
[K in keyof PoiOptions2 as `change-${K}`]: {
|
|
20
|
+
value: PoiOptions2[K];
|
|
21
|
+
};
|
|
22
|
+
} & Object3DEventMap;
|
|
23
|
+
export type PoiOptionsParam2 = Partial<PoiOptions2>;
|
|
24
|
+
export declare class Poi2 extends Object3D<PoiEventMap2> {
|
|
25
|
+
context: Context;
|
|
26
|
+
options: PoiOptions2;
|
|
27
|
+
textAspect: number;
|
|
28
|
+
spriteText?: Sprite;
|
|
29
|
+
spriteIcon?: Sprite;
|
|
30
|
+
box: Box2;
|
|
31
|
+
boxHelper?: HTMLDivElement;
|
|
32
|
+
constructor(context: Context, options: PoiOptionsParam2);
|
|
33
|
+
get durIconAndText(): 0 | 2;
|
|
34
|
+
get offset(): 0 | 0.5;
|
|
35
|
+
get iconWidth(): number;
|
|
36
|
+
get iconHeight(): number;
|
|
37
|
+
get textWidth(): number;
|
|
38
|
+
get textHeight(): number;
|
|
39
|
+
get deltaZ(): number;
|
|
40
|
+
registryEvent(): void;
|
|
41
|
+
unRegistryEvent(): void;
|
|
42
|
+
initIcon(): Promise<void>;
|
|
43
|
+
initText(): void;
|
|
44
|
+
initSize(): void;
|
|
45
|
+
init(): Promise<void>;
|
|
46
|
+
private _initScale;
|
|
47
|
+
resetZ(): void;
|
|
48
|
+
getBox(v3: Vector3): Box2;
|
|
49
|
+
renderBoxHelper(): void;
|
|
50
|
+
parentSetVisible(visible: boolean): void;
|
|
51
|
+
dispose(): void;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
package/lib/src/layer/index.d.ts
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Poi2, PoiOptionsParam2 } from "../elements";
|
|
2
|
+
import { Layer } from "./layer";
|
|
3
|
+
import { Context } from "../context";
|
|
4
|
+
import { Timer } from "../utils";
|
|
5
|
+
export declare class PoiLayer2 extends Layer {
|
|
6
|
+
pois: Poi2[];
|
|
7
|
+
debounceCollisionDetection: () => void;
|
|
8
|
+
timer: Timer;
|
|
9
|
+
constructor(context: Context);
|
|
10
|
+
clear(): this;
|
|
11
|
+
createPoi(options: PoiOptionsParam2): Poi2;
|
|
12
|
+
changePoiLevelOrCollisionEnable(poi: Poi2): void;
|
|
13
|
+
removePoi(poi: Poi2): void;
|
|
14
|
+
removePoiById(id: string): void;
|
|
15
|
+
getPoiById(id: string): Poi2 | null;
|
|
16
|
+
/**
|
|
17
|
+
* 保存poi按照level排序
|
|
18
|
+
* @param poi
|
|
19
|
+
*/
|
|
20
|
+
pushPoi(poi: Poi2): void;
|
|
21
|
+
getPoiByDeviceXy(x: number, y: number): Poi2[];
|
|
22
|
+
onUpdate: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* 碰撞检测
|
|
25
|
+
*/
|
|
26
|
+
collisionDetection(): void;
|
|
27
|
+
registryEvent(): void;
|
|
28
|
+
unRegistryEvent(): void;
|
|
29
|
+
dispose(): void;
|
|
30
|
+
}
|
|
@@ -2,14 +2,16 @@ import { BMap } from "../../bmap";
|
|
|
2
2
|
import { Plugin } from "../base";
|
|
3
3
|
import { Path, PathConfig } from "./path";
|
|
4
4
|
import { End, PathData, RoadData, RouteType, Start, UniqueKey } from "../../utils";
|
|
5
|
-
import { Floor,
|
|
5
|
+
import { Floor, Poi2, PoiOptions } from "../../elements";
|
|
6
6
|
import { Group as TweenGroup } from "@tweenjs/tween.js";
|
|
7
7
|
export type Point = [number, number];
|
|
8
8
|
interface EventMap {
|
|
9
9
|
"fetch-road-status": {
|
|
10
10
|
status: boolean;
|
|
11
11
|
};
|
|
12
|
-
"path-animation": {
|
|
12
|
+
"path-animation": {
|
|
13
|
+
pathIndex: number;
|
|
14
|
+
};
|
|
13
15
|
"path-animation-end": {};
|
|
14
16
|
"fetch-road-data": {
|
|
15
17
|
roadInfo: RoadData[];
|
|
@@ -32,7 +34,9 @@ export declare class Navigation extends Plugin<EventMap> {
|
|
|
32
34
|
paths: PathData;
|
|
33
35
|
options: NavigationConfig;
|
|
34
36
|
pathTween: TweenGroup;
|
|
35
|
-
startPoi:
|
|
37
|
+
startPoi: Poi2 | null;
|
|
38
|
+
movedDistance: number;
|
|
39
|
+
pathStart: [number, number];
|
|
36
40
|
animationPathOptions: {
|
|
37
41
|
cPathIndex: number;
|
|
38
42
|
};
|
|
@@ -57,13 +61,17 @@ export declare class Navigation extends Plugin<EventMap> {
|
|
|
57
61
|
/**
|
|
58
62
|
* 按照指定速度移动到目标位置
|
|
59
63
|
* @param point 目标位置
|
|
60
|
-
* @param speed 移动速度
|
|
64
|
+
* @param speed 移动速度 / 米/s
|
|
61
65
|
*/
|
|
62
66
|
animationTo(point: {
|
|
63
67
|
floor: string;
|
|
64
68
|
pos: [number, number];
|
|
65
69
|
}, speed?: number): Promise<unknown>;
|
|
66
|
-
|
|
70
|
+
getPathDirection(): number | null;
|
|
71
|
+
changeCameraToPathUp(duration?: number): Promise<unknown>;
|
|
72
|
+
initNavigationCamera(): Promise<void>;
|
|
73
|
+
translateCameraToStartPoi(duration?: number): Promise<unknown>;
|
|
74
|
+
initCameraZoom(duration?: number): Promise<unknown>;
|
|
67
75
|
dispose(): void;
|
|
68
76
|
}
|
|
69
77
|
export {};
|
|
@@ -15,7 +15,9 @@ export declare class Path extends Object3D {
|
|
|
15
15
|
texture: Texture | null;
|
|
16
16
|
config: PathConfig;
|
|
17
17
|
points: [number, number][];
|
|
18
|
+
pathDistance: number;
|
|
18
19
|
basicRepeat: number;
|
|
20
|
+
prevCameraZoom: number;
|
|
19
21
|
constructor(navigation: Navigation, config?: Partial<PathConfig>);
|
|
20
22
|
registryEvent(): void;
|
|
21
23
|
unRegistryEvent(): void;
|
|
@@ -26,6 +28,7 @@ export declare class Path extends Object3D {
|
|
|
26
28
|
loadTexture(url: string): Promise<Texture>;
|
|
27
29
|
transformPoints(points: [number, number][]): number[];
|
|
28
30
|
updatePoints(points: [number, number][]): void;
|
|
31
|
+
movePath(distance: number): void;
|
|
29
32
|
create(points: [number, number][]): Promise<Mesh<any, any, import("three").Object3DEventMap>>;
|
|
30
33
|
dispose(): void;
|
|
31
34
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { Box3 } from "three";
|
|
1
2
|
import { Context } from "../context";
|
|
2
3
|
export declare class CameraBound {
|
|
3
4
|
private context;
|
|
4
5
|
private prevCamera;
|
|
5
6
|
private enable;
|
|
7
|
+
box: Box3;
|
|
6
8
|
constructor(context: Context);
|
|
9
|
+
updateBox(): void;
|
|
7
10
|
setEnable(enable: boolean): void;
|
|
8
11
|
changePrevCamera(): void;
|
|
9
12
|
backToPrevCamera(): void;
|
package/lib/src/utils/path.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataTexture } from 'three';
|
|
1
|
+
import { DataTexture, Texture } from 'three';
|
|
2
2
|
export declare function initCanvas(): {
|
|
3
3
|
canvas: HTMLCanvasElement;
|
|
4
4
|
ctx: CanvasRenderingContext2D;
|
|
@@ -7,3 +7,4 @@ export declare function createCanvas(): void;
|
|
|
7
7
|
export declare function getTextureByText(text: string): DataTexture;
|
|
8
8
|
export declare function clearTextTexture(): void;
|
|
9
9
|
export declare function clearCanvas(): void;
|
|
10
|
+
export declare function getTextureByUrl(url: string): Promise<Texture>;
|