@aibee/crc-bmap 0.0.141 → 0.0.143
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 +204 -204
- package/lib/bmap.cjs.min.js.map +4 -4
- package/lib/bmap.esm.js +1473 -1457
- package/lib/bmap.esm.js.map +4 -4
- package/lib/bmap.esm.min.js +205 -205
- package/lib/bmap.esm.min.js.map +4 -4
- package/lib/bmap.min.js +204 -204
- package/lib/bmap.min.js.map +4 -4
- package/lib/src/bmap.d.ts +5 -18
- package/lib/src/context/camera.d.ts +4 -0
- package/lib/src/{context.d.ts → context/context.d.ts} +18 -25
- package/lib/src/context/control.d.ts +47 -0
- package/lib/src/context/index.d.ts +5 -0
- package/lib/src/context/renderer.d.ts +23 -0
- package/lib/src/context/scene.d.ts +4 -0
- package/lib/src/elements/base-svg.d.ts +1 -1
- package/lib/src/elements/floor.d.ts +2 -1
- package/lib/src/elements/glb-model.d.ts +2 -2
- package/lib/src/elements/graphic.d.ts +1 -1
- package/lib/src/elements/ground-texture.d.ts +1 -1
- package/lib/src/elements/heatmap.d.ts +1 -1
- package/lib/src/elements/index.d.ts +1 -0
- package/lib/src/elements/lane.d.ts +1 -1
- package/lib/src/elements/merge-graphic.d.ts +1 -1
- package/lib/src/elements/model.d.ts +1 -1
- package/lib/src/elements/overlay.d.ts +1 -1
- package/lib/src/elements/poi.d.ts +1 -1
- package/lib/src/elements/poi2.d.ts +2 -2
- package/lib/src/elements/select-box.d.ts +1 -1
- package/lib/src/elements/svg-line.d.ts +1 -1
- package/lib/src/elements/svg-polygon.d.ts +1 -1
- package/lib/src/elements/text-texture.d.ts +28 -0
- package/lib/src/elements/wall.d.ts +1 -1
- package/lib/src/factory/img-texture.d.ts +7 -0
- package/lib/src/factory/index.d.ts +4 -0
- package/lib/src/factory/material.d.ts +14 -22
- package/lib/src/factory/model.d.ts +7 -0
- package/lib/src/factory/text-texture.d.ts +20 -0
- package/lib/src/factory/unique-key.d.ts +7 -0
- package/lib/src/index.d.ts +2 -2
- package/lib/src/layer/graphic-layer.d.ts +1 -1
- package/lib/src/layer/layer.d.ts +1 -1
- package/lib/src/layer/poi-layer.d.ts +1 -1
- package/lib/src/layer/poi-layer2.d.ts +1 -1
- package/lib/src/loader/AibeeLoader/type.d.ts +13 -1
- package/lib/src/{api → loader/CrLoader/api}/floor.d.ts +2 -2
- package/lib/src/loader/CrLoader/index.d.ts +21 -0
- package/lib/src/loader/index.d.ts +1 -0
- package/lib/src/operations/hover/hover-helper.d.ts +1 -1
- package/lib/src/operations/selection/box-selection.d.ts +1 -1
- package/lib/src/operations/selection/selection.d.ts +1 -1
- package/lib/src/plugins/index.d.ts +0 -1
- package/lib/src/plugins/navigation/navigation.d.ts +2 -2
- package/lib/src/utils/camera-bound.d.ts +1 -1
- package/lib/src/utils/color.d.ts +1 -0
- package/lib/src/utils/create.d.ts +2 -0
- package/lib/src/utils/index.d.ts +2 -3
- package/lib/src/utils/init-helper.d.ts +2 -7
- package/lib/src/{loader/AibeeLoader/utils.d.ts → utils/translate.d.ts} +1 -1
- package/package.json +1 -1
- package/lib/src/factory/texture.d.ts +0 -10
- package/lib/src/plugins/split-load/index.d.ts +0 -1
- package/lib/src/plugins/split-load/split-load.d.ts +0 -16
- package/lib/src/utils/model.d.ts +0 -8
- package/lib/src/utils/texture.d.ts +0 -10
- package/lib/src/utils/unique-key.d.ts +0 -7
- /package/lib/src/{api → loader/CrLoader/api}/index.d.ts +0 -0
package/lib/src/bmap.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { EventDispatcher, Object3D, Vector3 } from "three";
|
|
2
|
-
import { Context } from "./context";
|
|
2
|
+
import { Context } from "./context/context";
|
|
3
3
|
import { Timer, HooksName } from "./utils";
|
|
4
4
|
import { Config } from "./config";
|
|
5
5
|
import { Floor, Graphic, HeatmapDataParam, ModelOptions, Poi, Poi2, PoiOptionsParam } from "./elements";
|
|
6
6
|
import { SvgLine, SvgPolygon } from "./elements";
|
|
7
|
-
import { GraphicInfo, GraphicOptions
|
|
7
|
+
import { GraphicInfo, GraphicOptions } from "./types";
|
|
8
8
|
import { Plugin } from "./plugins/base";
|
|
9
9
|
interface BmapEventMap {
|
|
10
10
|
"zoom-change": {
|
|
@@ -45,32 +45,19 @@ export declare class BMap extends EventDispatcher<BmapEventMap> {
|
|
|
45
45
|
basicZoom: number;
|
|
46
46
|
prevCameraZoom: number;
|
|
47
47
|
type: MapType;
|
|
48
|
-
floorDataMap: Map<string, GraphicInfo[]>;
|
|
49
|
-
buildingGroundMap: Map<string, GraphicInfo | null>;
|
|
50
|
-
buildingGroundPromiseMap: Map<string, Promise<GraphicInfo | null>>;
|
|
51
48
|
currentBuildGround: GraphicInfo | null;
|
|
52
49
|
observe: ResizeObserver | null;
|
|
53
|
-
buildingCenter: number
|
|
50
|
+
buildingCenter: [number, number];
|
|
54
51
|
timer: Timer;
|
|
55
52
|
plugins: Plugin[];
|
|
56
53
|
constructor(container: HTMLElement, config?: Partial<Config>);
|
|
57
|
-
loadGraphics({ brand, project, floor, ts, resource_type_list, }: LoadQuery): Promise<GraphicInfo[]>;
|
|
58
54
|
changeBuildingCenter(data: GraphicInfo | null, { brand, project }: {
|
|
59
55
|
brand: string;
|
|
60
56
|
project: string;
|
|
61
57
|
}): void;
|
|
62
|
-
loadBuildingGround({ brand, project, }: Omit<LoadQuery, "floor" | "ts" | "resource_type_list">): Promise<GraphicInfo | null>;
|
|
63
|
-
load({ brand, project, floor, ts, resource_type_list, }: LoadQuery): Promise<GraphicInfo[] | undefined>;
|
|
64
|
-
transformGraphicData(data: GraphicInfo[], center?: number[], baseIndex?: number): void;
|
|
65
58
|
use(plugin: Plugin): void;
|
|
66
59
|
unUse(plugin: Plugin): void;
|
|
67
|
-
createFloor(data: GraphicInfo[]): {
|
|
68
|
-
curFloor: Floor;
|
|
69
|
-
graphics: Graphic[];
|
|
70
|
-
};
|
|
71
60
|
triggerHooks(hooks: HooksName, data: any): void;
|
|
72
|
-
switchFloor({ brand, project, floor, ts, resource_type_list, }: LoadQuery): void;
|
|
73
|
-
switchFloorByData(data: GraphicInfo[], name: string, key?: string): void;
|
|
74
61
|
switchFloorByFloor(floor: Floor, graphics?: Object3D<import("three").Object3DEventMap>[]): void;
|
|
75
62
|
initialFloorCamera(): void;
|
|
76
63
|
onControlChange: () => void;
|
|
@@ -120,14 +107,14 @@ export declare class BMap extends EventDispatcher<BmapEventMap> {
|
|
|
120
107
|
* @param duration
|
|
121
108
|
* @returns
|
|
122
109
|
*/
|
|
123
|
-
reduceMap(zoom?: number, duration?: number): Promise<unknown
|
|
110
|
+
reduceMap(zoom?: number, duration?: number): void | Promise<unknown>;
|
|
124
111
|
/**
|
|
125
112
|
* 放大地图
|
|
126
113
|
* @param zoom
|
|
127
114
|
* @param duration
|
|
128
115
|
* @returns
|
|
129
116
|
*/
|
|
130
|
-
enlargeMap(zoom?: number, duration?: number): Promise<unknown
|
|
117
|
+
enlargeMap(zoom?: number, duration?: number): void | Promise<unknown>;
|
|
131
118
|
onKeydown: (e: KeyboardEvent) => void;
|
|
132
119
|
onKeyUp: (e: KeyboardEvent) => void;
|
|
133
120
|
registryEvent(): void;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { TextureFactory } from "./factory/texture";
|
|
1
|
+
import { EventDispatcher, Vector3, Object3D } from "three";
|
|
2
|
+
import { Graphic, Poi, Floor, Poi2 } from "../elements";
|
|
3
|
+
import { Config } from "../config";
|
|
4
|
+
import { Selection } from "../operations/selection/selection";
|
|
5
|
+
import { HoverHelper } from "../operations";
|
|
6
|
+
import { CameraBound } from "../utils/camera-bound";
|
|
7
|
+
import { Control } from "./control";
|
|
8
|
+
import { Renderer } from "./renderer";
|
|
9
|
+
import { ContextScene } from "./scene";
|
|
10
|
+
import { ContextCamera } from "./camera";
|
|
12
11
|
export interface ContextEventMap {
|
|
13
12
|
update: {};
|
|
14
13
|
"graphic-click": {
|
|
@@ -53,19 +52,15 @@ export interface ContextEventMap {
|
|
|
53
52
|
export declare class Context extends EventDispatcher<ContextEventMap> {
|
|
54
53
|
container: HTMLElement;
|
|
55
54
|
config: Config;
|
|
56
|
-
scene:
|
|
57
|
-
renderer:
|
|
58
|
-
camera:
|
|
59
|
-
control:
|
|
55
|
+
scene: ContextScene;
|
|
56
|
+
renderer: Renderer;
|
|
57
|
+
camera: ContextCamera;
|
|
58
|
+
control: Control;
|
|
60
59
|
lights: import("three").Group<import("three").Object3DEventMap>;
|
|
61
|
-
timer: Timer;
|
|
62
|
-
tweenGroup: TweenGroup;
|
|
63
60
|
currentFloor?: Floor;
|
|
64
61
|
selection: Selection;
|
|
65
62
|
hoverHelper: HoverHelper;
|
|
66
63
|
private basicRatio?;
|
|
67
|
-
materialFactory: MaterialFactory;
|
|
68
|
-
textureFactory: TextureFactory;
|
|
69
64
|
cameraBound: CameraBound;
|
|
70
65
|
clientSize: {
|
|
71
66
|
width: number;
|
|
@@ -74,7 +69,6 @@ export declare class Context extends EventDispatcher<ContextEventMap> {
|
|
|
74
69
|
y: number;
|
|
75
70
|
};
|
|
76
71
|
renderRf: number;
|
|
77
|
-
prevCameraZoom: number;
|
|
78
72
|
constructor(container: HTMLElement, config: Config);
|
|
79
73
|
resizeClientSize(): void;
|
|
80
74
|
init(): void;
|
|
@@ -124,7 +118,7 @@ export declare class Context extends EventDispatcher<ContextEventMap> {
|
|
|
124
118
|
* 设置横向旋转角度
|
|
125
119
|
* @param azimuthal 弧度
|
|
126
120
|
*/
|
|
127
|
-
setAzimuthalAngle(azimuthal: number, duration?: number): Promise<unknown
|
|
121
|
+
setAzimuthalAngle(azimuthal: number, duration?: number): void | Promise<unknown>;
|
|
128
122
|
getCameraLookAt(): Vector3;
|
|
129
123
|
/**
|
|
130
124
|
* 按照一个中心点设置相机的放大缩小
|
|
@@ -132,7 +126,7 @@ export declare class Context extends EventDispatcher<ContextEventMap> {
|
|
|
132
126
|
* @param center
|
|
133
127
|
* @returns
|
|
134
128
|
*/
|
|
135
|
-
setZoom(zoom: number, center: Vector3, duration?: number): Promise<unknown
|
|
129
|
+
setZoom(zoom: number, center: Vector3, duration?: number): void | Promise<unknown>;
|
|
136
130
|
getFitCameraToObjectZoom(object: Object3D, padding?: [number, number, number, number], duration?: number, force2DView?: boolean): {
|
|
137
131
|
zoom: number;
|
|
138
132
|
center: Vector3;
|
|
@@ -144,16 +138,15 @@ export declare class Context extends EventDispatcher<ContextEventMap> {
|
|
|
144
138
|
* @param duration
|
|
145
139
|
* @returns
|
|
146
140
|
*/
|
|
147
|
-
fitCameraToObject(object: Object3D, padding?: [number, number, number, number], duration?: number, force2DView?: boolean): Promise<unknown
|
|
141
|
+
fitCameraToObject(object: Object3D, padding?: [number, number, number, number], duration?: number, force2DView?: boolean): void | Promise<unknown>;
|
|
148
142
|
getFitCameraToGroundZoom(padding?: [number, number, number, number], duration?: number, force2DView?: boolean): number | undefined;
|
|
149
|
-
fitCameraToGround(padding?: [number, number, number, number], duration?: number, force2DView?: boolean): Promise<unknown
|
|
143
|
+
fitCameraToGround(padding?: [number, number, number, number], duration?: number, force2DView?: boolean): void | Promise<unknown>;
|
|
150
144
|
/**
|
|
151
145
|
* 修改相机位置
|
|
152
146
|
* @param position 修改后的相机的位置
|
|
153
147
|
* @param duration 动画持续时间
|
|
154
148
|
*/
|
|
155
149
|
setCameraPosition(position: Vector3, duration: number): Promise<unknown>;
|
|
156
|
-
render(): void;
|
|
157
150
|
pauseRender(): void;
|
|
158
151
|
continueRender(): void;
|
|
159
152
|
dispose(): void;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { OrthographicCamera, Vector3 } from "three";
|
|
2
|
+
import { MapControls } from "three/examples/jsm/controls/MapControls";
|
|
3
|
+
import { Group as TweenGroup } from '@tweenjs/tween.js';
|
|
4
|
+
import { Timer } from "../utils";
|
|
5
|
+
declare module 'three/examples/jsm/controls/OrbitControls' {
|
|
6
|
+
interface OrbitControlsEventMap {
|
|
7
|
+
"change-zoom": {
|
|
8
|
+
zoom: number;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export declare class Control extends MapControls {
|
|
13
|
+
camera: OrthographicCamera;
|
|
14
|
+
domElement: HTMLElement;
|
|
15
|
+
prevCameraZoom: number;
|
|
16
|
+
tweenGroup: TweenGroup;
|
|
17
|
+
timer: Timer;
|
|
18
|
+
offsetY: number;
|
|
19
|
+
constructor(camera: OrthographicCamera, domElement: HTMLElement);
|
|
20
|
+
registryEvent(): void;
|
|
21
|
+
tweenUpdate: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* 设置纵向旋转角度
|
|
24
|
+
* @param polar 弧度
|
|
25
|
+
*/
|
|
26
|
+
setPolarAngle(polar: number, force?: boolean): void;
|
|
27
|
+
setPolarAngleByDuration(polar: number, force?: boolean, duration?: number): Promise<unknown>;
|
|
28
|
+
setAzimuthalAngle(azimuthAngle: number, force: boolean): void;
|
|
29
|
+
setAzimuthalAngleDuration(azimuthal: number, force?: boolean, duration?: number): void | Promise<unknown>;
|
|
30
|
+
getCameraLookAt(): Vector3;
|
|
31
|
+
/**
|
|
32
|
+
* 修改相机位置
|
|
33
|
+
* @param position 修改后的相机的位置
|
|
34
|
+
* @param duration 动画持续时间
|
|
35
|
+
*/
|
|
36
|
+
setCameraPositionByTarget(newTarget: Vector3, duration: number): Promise<unknown>;
|
|
37
|
+
setZoom(zoom: number, center: Vector3, force?: boolean): void;
|
|
38
|
+
/**
|
|
39
|
+
* 按照一个中心点设置相机的放大缩小
|
|
40
|
+
* @param zoom
|
|
41
|
+
* @param center
|
|
42
|
+
* @returns
|
|
43
|
+
*/
|
|
44
|
+
setZoomByDuration(zoom: number, center: Vector3, force?: boolean, duration?: number): void | Promise<unknown>;
|
|
45
|
+
setTargetByOffset(offsetY: number, target?: Vector3): void;
|
|
46
|
+
dispose(): void;
|
|
47
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EventDispatcher, WebGLRenderer, WebGLRendererParameters, EventListener } from "three";
|
|
2
|
+
import { ContextScene } from "./scene";
|
|
3
|
+
import { ContextCamera } from "./camera";
|
|
4
|
+
import { Timer } from "../utils";
|
|
5
|
+
interface RendererEventMap {
|
|
6
|
+
update: {};
|
|
7
|
+
}
|
|
8
|
+
export declare class Renderer extends WebGLRenderer {
|
|
9
|
+
event: EventDispatcher<RendererEventMap>;
|
|
10
|
+
scene?: ContextScene;
|
|
11
|
+
camera?: ContextCamera;
|
|
12
|
+
enable: boolean;
|
|
13
|
+
timer: Timer;
|
|
14
|
+
constructor(options?: WebGLRendererParameters);
|
|
15
|
+
setCameraAndScene(scene: ContextScene, camera: ContextCamera): void;
|
|
16
|
+
autoRender(): void;
|
|
17
|
+
pauseRender(): void;
|
|
18
|
+
continueRender(): void;
|
|
19
|
+
addEventListener<T extends Extract<keyof RendererEventMap, string>>(type: T, listener: EventListener<RendererEventMap[T], T, typeof this.event>): void;
|
|
20
|
+
removeEventListener<T extends Extract<keyof RendererEventMap, string>>(type: T, listener: EventListener<RendererEventMap[T], T, typeof this.event>): void;
|
|
21
|
+
dispose(): void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Context } from "../context";
|
|
1
|
+
import { Context } from "../context/context";
|
|
2
2
|
import { Box3, Object3D, Vector3 } from "three";
|
|
3
3
|
import { Graphic, GraphicOptionsParam } from "./graphic";
|
|
4
4
|
import { Shadow } from "./shadow";
|
|
@@ -16,6 +16,7 @@ export declare class Floor extends Object3D {
|
|
|
16
16
|
glbModelLayer: Layer;
|
|
17
17
|
laneLayer: Layer;
|
|
18
18
|
mergeGraphicLayer: Layer;
|
|
19
|
+
textTextureLayer: Layer;
|
|
19
20
|
grounds: Set<Graphic>;
|
|
20
21
|
groundLayer: Layer;
|
|
21
22
|
shadow: Shadow;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Object3D } from "three";
|
|
2
|
-
import { Context } from "../context";
|
|
2
|
+
import { Context } from "../context/context";
|
|
3
3
|
import { GLTF } from "three/examples/jsm/loaders/GLTFLoader";
|
|
4
|
-
import { PolygonGeometry } from "
|
|
4
|
+
import { PolygonGeometry } from "../types";
|
|
5
5
|
export interface GlbModelOptions {
|
|
6
6
|
url: string;
|
|
7
7
|
geometry: PolygonGeometry;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Object3D, ExtrudeGeometry, Mesh, MeshBasicMaterial, Raycaster, Object3DEventMap, Vector3, BufferGeometry, LineBasicMaterial, LineSegments, ShaderMaterial } from "three";
|
|
2
2
|
import { GraphicOptions } from "src/types";
|
|
3
|
-
import { Context } from "../context";
|
|
3
|
+
import { Context } from "../context/context";
|
|
4
4
|
export type GraphicOptionsParam = Partial<GraphicOptions>;
|
|
5
5
|
export type GraphicEventMap = {
|
|
6
6
|
[K in keyof GraphicOptions as `change-${K}`]: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PolygonGeometry } from "../types";
|
|
2
|
-
import { Context } from "../context";
|
|
2
|
+
import { Context } from "../context/context";
|
|
3
3
|
import { BufferGeometry, LineBasicMaterial, LineSegments, Mesh, MeshBasicMaterial, Object3D, Vector3 } from "three";
|
|
4
4
|
import { Line2 } from 'three/examples/jsm/lines/Line2';
|
|
5
5
|
export interface LaneOptions {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Object3D, Mesh, Vector3, BufferGeometry, LineBasicMaterial, LineSegments, ShaderMaterial } from "three";
|
|
2
2
|
import { GraphicOptions } from "src/types";
|
|
3
|
-
import { Context } from "../context";
|
|
3
|
+
import { Context } from "../context/context";
|
|
4
4
|
import { GraphicEventMap, GraphicOptionsParam } from "./graphic";
|
|
5
5
|
export declare class MergeGraphic extends Object3D<GraphicEventMap> {
|
|
6
6
|
private context;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Context } from "../context";
|
|
1
|
+
import { Context } from "../context/context";
|
|
2
2
|
import { Box2, Object3D, Object3DEventMap, Sprite, Vector3 } from "three";
|
|
3
3
|
export interface PoiOptions2 {
|
|
4
4
|
text: string;
|
|
@@ -30,7 +30,7 @@ export declare class Poi2 extends Object3D<PoiEventMap2> {
|
|
|
30
30
|
box: Box2;
|
|
31
31
|
boxHelper?: HTMLDivElement;
|
|
32
32
|
constructor(context: Context, options: PoiOptionsParam2);
|
|
33
|
-
get durIconAndText():
|
|
33
|
+
get durIconAndText(): 2 | 0;
|
|
34
34
|
get offset(): 0 | 0.5;
|
|
35
35
|
get iconWidth(): number;
|
|
36
36
|
get iconHeight(): number;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Context } from "../context/context";
|
|
2
|
+
import { Mesh, Object3D } from "three";
|
|
3
|
+
import { PolygonGeometry } from "../types";
|
|
4
|
+
export interface TextTextureOptions {
|
|
5
|
+
texts: string[];
|
|
6
|
+
deltaHeight: number;
|
|
7
|
+
airHeight: number;
|
|
8
|
+
height: number;
|
|
9
|
+
geometry: PolygonGeometry;
|
|
10
|
+
fillColor: string;
|
|
11
|
+
fillOpacity: number;
|
|
12
|
+
strokeColor: string;
|
|
13
|
+
strokeOpacity: number;
|
|
14
|
+
secondHeight: number;
|
|
15
|
+
secondRotate: number;
|
|
16
|
+
center_x: number;
|
|
17
|
+
center_y: number;
|
|
18
|
+
}
|
|
19
|
+
export declare const defaultTextTextureOptions: TextTextureOptions;
|
|
20
|
+
export type TextTextureOptionsParam = Partial<TextTextureOptions>;
|
|
21
|
+
export declare class TextTexture extends Object3D {
|
|
22
|
+
private context;
|
|
23
|
+
options: TextTextureOptions[];
|
|
24
|
+
mesh?: Mesh;
|
|
25
|
+
constructor(context: Context, options: TextTextureOptionsParam[]);
|
|
26
|
+
init(): Promise<void>;
|
|
27
|
+
dispose(): void;
|
|
28
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PolygonGeometry } from "../types";
|
|
2
|
-
import { Context } from "../context";
|
|
2
|
+
import { Context } from "../context/context";
|
|
3
3
|
import { BufferGeometry, LineBasicMaterial, LineSegments, Mesh, Object3D, ShaderMaterial, Vector3 } from "three";
|
|
4
4
|
export interface WallOptions {
|
|
5
5
|
id: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Texture, TextureLoader } from "three";
|
|
2
|
+
export declare class ImgTextureFactory {
|
|
3
|
+
static textureLoader: TextureLoader;
|
|
4
|
+
static urlTextureMap: Map<string, Texture | Promise<Texture>>;
|
|
5
|
+
static getTextureByUrl(url: string): Texture | Promise<Texture>;
|
|
6
|
+
static dispose(): void;
|
|
7
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LineMaterial } from "three/examples/jsm/lines/LineMaterial";
|
|
2
|
-
import {
|
|
3
|
-
import { LineBasicMaterial, MeshStandardMaterial, MeshBasicMaterial, ShaderMaterial, Vector3 } from "three";
|
|
2
|
+
import { LineBasicMaterial, MeshStandardMaterial, MeshBasicMaterial, ShaderMaterial, Vector3, Vector2 } from "three";
|
|
4
3
|
interface LineMaterialOptions {
|
|
5
4
|
color: string;
|
|
6
5
|
opacity: number;
|
|
@@ -22,31 +21,24 @@ interface ShaderMaterialOptions {
|
|
|
22
21
|
max: Vector3;
|
|
23
22
|
min: Vector3;
|
|
24
23
|
}
|
|
25
|
-
interface GroundTextureMaterialOptions {
|
|
26
|
-
url: string;
|
|
27
|
-
opacity: number;
|
|
28
|
-
}
|
|
29
24
|
interface Line2MaterialMapOptions {
|
|
30
25
|
color: string;
|
|
31
26
|
width: number;
|
|
32
27
|
dashed: boolean;
|
|
28
|
+
resolution: Vector2;
|
|
33
29
|
}
|
|
34
30
|
export declare class MaterialFactory {
|
|
35
|
-
private
|
|
36
|
-
private
|
|
37
|
-
private
|
|
38
|
-
private
|
|
39
|
-
private
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
createShaderMaterial({ gradualColor, center, maxValue, opacity, direction, max, min, }: ShaderMaterialOptions): ShaderMaterial;
|
|
48
|
-
createGroundTextureMaterial({ url, opacity }: GroundTextureMaterialOptions): Promise<MeshBasicMaterial>;
|
|
49
|
-
createLine2MaterialMap({ color, width, dashed }: Line2MaterialMapOptions): LineMaterial;
|
|
50
|
-
dispose(): void;
|
|
31
|
+
private static lineMaterialMap;
|
|
32
|
+
private static meshStandardMaterialMap;
|
|
33
|
+
private static meshBasicMaterialMap;
|
|
34
|
+
private static shaderMaterialMap;
|
|
35
|
+
private static line2MaterialMap;
|
|
36
|
+
static generateLineMaterialKey({ color, opacity }: LineMaterialOptions): string;
|
|
37
|
+
static createLineMaterial({ color, opacity }: LineMaterialOptions): LineBasicMaterial;
|
|
38
|
+
static createMeshStandardMaterial({ color, opacity }: MeshStandardMaterialOptions): MeshStandardMaterial;
|
|
39
|
+
static createMeshBasicMaterial({ color, opacity }: MeshBasicMaterialOptions): MeshBasicMaterial;
|
|
40
|
+
static createShaderMaterial({ gradualColor, center, maxValue, opacity, direction, max, min, }: ShaderMaterialOptions): ShaderMaterial;
|
|
41
|
+
static createLine2MaterialMap({ color, width, dashed, resolution }: Line2MaterialMapOptions): LineMaterial;
|
|
42
|
+
static dispose(): void;
|
|
51
43
|
}
|
|
52
44
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GLTF, GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
2
|
+
export declare class ModelFactory {
|
|
3
|
+
static loader: GLTFLoader;
|
|
4
|
+
static modelMap: Map<string, GLTF | Promise<GLTF>>;
|
|
5
|
+
static loadModel(url: string): Promise<GLTF>;
|
|
6
|
+
static dispose(): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DataTexture } from "three";
|
|
2
|
+
export declare class TextTextureFactory {
|
|
3
|
+
private static canvas;
|
|
4
|
+
private static ctx;
|
|
5
|
+
private static options;
|
|
6
|
+
static getCanvas(): HTMLCanvasElement;
|
|
7
|
+
static getCtx(): CanvasRenderingContext2D;
|
|
8
|
+
static getMergedOptions(options?: Partial<typeof this.options>): {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
font: string;
|
|
12
|
+
textBaseline: CanvasTextBaseline;
|
|
13
|
+
lineWidth: number;
|
|
14
|
+
fillStyle: string;
|
|
15
|
+
strokeStyle: string;
|
|
16
|
+
};
|
|
17
|
+
static setCtxStyle(options: typeof this.options): void;
|
|
18
|
+
static getTextureByText(text: string, options?: Partial<typeof this.options>): DataTexture;
|
|
19
|
+
static dispose(): void;
|
|
20
|
+
}
|
package/lib/src/index.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ export * from './bmap';
|
|
|
2
2
|
export * from './utils';
|
|
3
3
|
export * from './elements';
|
|
4
4
|
export * from './config';
|
|
5
|
-
export * from './context';
|
|
5
|
+
export * from './context/context';
|
|
6
6
|
export * from './layer';
|
|
7
7
|
export * from './types';
|
|
8
8
|
export * from './operations';
|
|
9
9
|
export * from './plugins';
|
|
10
|
-
export * from './api';
|
|
10
|
+
export * from './loader/CrLoader/api';
|
|
11
11
|
export * from './loader';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Graphic, GraphicOptionsParam } from "../elements";
|
|
2
2
|
import { Raycaster, Vector3 } from "three";
|
|
3
3
|
import { Layer } from "./layer";
|
|
4
|
-
import { Context } from "../context";
|
|
4
|
+
import { Context } from "../context/context";
|
|
5
5
|
export declare class GraphicLayer extends Layer {
|
|
6
6
|
graphicMap: Map<string, Graphic>;
|
|
7
7
|
constructor(context: Context);
|
package/lib/src/layer/layer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Poi, PoiOptionsParam } from "../elements";
|
|
2
2
|
import { Layer } from "./layer";
|
|
3
|
-
import { Context } from '../context';
|
|
3
|
+
import { Context } from '../context/context';
|
|
4
4
|
import { Timer } from "../utils";
|
|
5
5
|
export declare class PoiLayer extends Layer {
|
|
6
6
|
pois: Poi[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Poi2, PoiOptionsParam2 } from "../elements";
|
|
2
2
|
import { Layer } from "./layer";
|
|
3
|
-
import { Context } from "../context";
|
|
3
|
+
import { Context } from "../context/context";
|
|
4
4
|
import { Timer } from "../utils";
|
|
5
5
|
export declare class PoiLayer2 extends Layer {
|
|
6
6
|
pois: Poi2[];
|
|
@@ -122,7 +122,19 @@ export interface AibeeParkingSpaceLayer {
|
|
|
122
122
|
geometry: PolygonGeometry;
|
|
123
123
|
})[];
|
|
124
124
|
}
|
|
125
|
-
export
|
|
125
|
+
export interface AibeeTextLayer {
|
|
126
|
+
name: string;
|
|
127
|
+
l_type: "text";
|
|
128
|
+
elements: (AibeeGraphicLayer["elements"][0] & {
|
|
129
|
+
texts: string[];
|
|
130
|
+
secondHeight: number;
|
|
131
|
+
secondRotate: number;
|
|
132
|
+
center_x: number;
|
|
133
|
+
center_y: number;
|
|
134
|
+
geometry: PolygonGeometry;
|
|
135
|
+
})[];
|
|
136
|
+
}
|
|
137
|
+
export type AibeeLayerData = AibeeGraphicLayer | AibeeRangeLayer | AibeeGroundLayer | AibeeWallLayer | AibeeLaneLayer | AibeeTexture2dLayer | AibeeTexture3dLayer | AibeeGlbLayer | AibeeStoreLayer | AibeeFacilityLayer | AibeeParkingSpaceLayer | AibeeTextLayer;
|
|
126
138
|
export interface AibeeFloorData {
|
|
127
139
|
layers: AibeeLayerData[];
|
|
128
140
|
floorHeight: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Config } from "
|
|
2
|
-
import { GraphicInfo, LoadQuery } from "
|
|
1
|
+
import { Config } from "../../../config";
|
|
2
|
+
import { GraphicInfo, LoadQuery } from "../../../types";
|
|
3
3
|
type BuildingGroundQuery = Omit<LoadQuery, "floor" | "ts" | "resource_type_list">;
|
|
4
4
|
/**
|
|
5
5
|
* 请求楼栋地面
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BMap } from "src/bmap";
|
|
2
|
+
import { Floor } from "../../elements";
|
|
3
|
+
import { GraphicInfo, LoadQuery } from "../../types";
|
|
4
|
+
type LoadGraphicQuery = Omit<LoadQuery, "resource_type_list">;
|
|
5
|
+
export declare class CrLoader {
|
|
6
|
+
bmap: BMap;
|
|
7
|
+
cacheData: Map<string, GraphicInfo[]>;
|
|
8
|
+
floorDataLengthMap: Map<any, any>;
|
|
9
|
+
buildingGroundMap: Map<string, GraphicInfo | Promise<GraphicInfo | null> | null>;
|
|
10
|
+
constructor(bmap: BMap);
|
|
11
|
+
load(query: LoadQuery): Promise<GraphicInfo[]>;
|
|
12
|
+
switchFloorByData(data: GraphicInfo[], floor: Floor): void;
|
|
13
|
+
filterData(data: GraphicInfo[], floor: Floor): GraphicInfo[];
|
|
14
|
+
private switchFloorByStoreData;
|
|
15
|
+
private switchFloorByOtherData;
|
|
16
|
+
loadBuildGround({ brand, project }: LoadGraphicQuery): Promise<GraphicInfo | null>;
|
|
17
|
+
loadBuildingGround({ brand, project, }: Omit<LoadQuery, "floor" | "ts" | "resource_type_list">): Promise<GraphicInfo | null>;
|
|
18
|
+
switchFloor(query: LoadGraphicQuery): Promise<Floor>;
|
|
19
|
+
dispose(): void;
|
|
20
|
+
}
|
|
21
|
+
export {};
|