vis-core 0.31.32 → 0.32.0
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/dist/index.d.ts +490 -459
- package/dist/index.js +21 -22
- package/package.json +26 -47
- package/README.md +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -17,10 +17,10 @@ import { MeshObject } from 'gl-draw';
|
|
|
17
17
|
import { MultiPolygon } from 'geojson';
|
|
18
18
|
import { NodeObject } from 'gl-draw';
|
|
19
19
|
import { Pencil } from 'gl-draw';
|
|
20
|
-
import { PickFunctionsItem } from 'gl-draw';
|
|
21
20
|
import { PointLightObject } from 'gl-draw';
|
|
22
21
|
import { Polygon } from 'geojson';
|
|
23
22
|
import { Position } from 'geojson';
|
|
23
|
+
import { ProjectionOptions } from 'gl-draw';
|
|
24
24
|
import { RectAreaLightObject } from 'gl-draw';
|
|
25
25
|
import { RoomEnvironment } from 'three/examples/jsm/environments/RoomEnvironment.js';
|
|
26
26
|
import { SpotLightObject } from 'gl-draw';
|
|
@@ -32,7 +32,6 @@ import { Water } from './Water2';
|
|
|
32
32
|
|
|
33
33
|
declare class AmbientLight extends AmbientLightObject {
|
|
34
34
|
constructor(...options: ConstructorParameters<typeof AmbientLightObject>);
|
|
35
|
-
render(): void;
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
export declare namespace animationUtils {
|
|
@@ -48,21 +47,16 @@ export declare namespace animationUtils {
|
|
|
48
47
|
|
|
49
48
|
declare class Arc extends LineObject {
|
|
50
49
|
objectType: string;
|
|
51
|
-
options:
|
|
52
|
-
|
|
53
|
-
constructor(options: Options_2);
|
|
54
|
-
static getInitOptions(pencil: default_2, options: Options_2): {
|
|
55
|
-
from: THREE.Vector3Tuple;
|
|
56
|
-
to: THREE.Vector3Tuple;
|
|
57
|
-
};
|
|
50
|
+
options: Options;
|
|
51
|
+
constructor(options: Options);
|
|
58
52
|
create(): Promise<void>;
|
|
59
|
-
instantiate(ops: Parameters<BaseObject['instantiate']>[0]): Promise<this>;
|
|
60
53
|
line: {
|
|
61
54
|
options: {
|
|
62
55
|
nodes: THREE.Vector3[];
|
|
63
56
|
};
|
|
64
57
|
};
|
|
65
|
-
|
|
58
|
+
getCurve(): THREE.CubicBezierCurve3;
|
|
59
|
+
setControlPoints(points: [THREE.Vector3, THREE.Vector3, THREE.Vector3, THREE.Vector3]): void;
|
|
66
60
|
setPath(from: THREE.Vector3 | number[], to: THREE.Vector3 | number[], radius: number, setPointWidth?: (p: number) => number): void;
|
|
67
61
|
pickTube: Tube | null;
|
|
68
62
|
addPickTarget(radius?: number, show?: boolean): Promise<Tube>;
|
|
@@ -75,7 +69,6 @@ declare class Arc extends LineObject {
|
|
|
75
69
|
onComplete?: (...args: any[]) => void;
|
|
76
70
|
onRepeat?: (count: number) => void;
|
|
77
71
|
}): void;
|
|
78
|
-
update(): void;
|
|
79
72
|
render(): void;
|
|
80
73
|
}
|
|
81
74
|
|
|
@@ -88,15 +81,22 @@ declare class Area extends GroupObject {
|
|
|
88
81
|
rebuildFromScene(): void;
|
|
89
82
|
}
|
|
90
83
|
|
|
84
|
+
/** vis-core 的运行时入口只接受编辑平台导出的完整场景文档。 */
|
|
85
|
+
export declare function assertRuntimeSceneDocument(value: unknown): asserts value is VisSceneDocument & Record<string, any>;
|
|
86
|
+
|
|
87
|
+
export declare function assertSupportedSceneDocument(value: unknown): void;
|
|
88
|
+
|
|
91
89
|
export declare class Base extends Camera {
|
|
92
90
|
static VisName: string;
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
runtimePolicy: {
|
|
92
|
+
observeParentScale: boolean;
|
|
93
|
+
applyDisabledMouseButtons: boolean;
|
|
94
|
+
cacheCityGeometry: boolean;
|
|
95
|
+
};
|
|
95
96
|
leftTruck: boolean;
|
|
96
97
|
options: BaseOptions;
|
|
97
98
|
showState: boolean;
|
|
98
99
|
settings: Record<string, any>;
|
|
99
|
-
extendsOptions: Record<string, any>;
|
|
100
100
|
lead: Lead;
|
|
101
101
|
mList: default_2['mList'];
|
|
102
102
|
tier0: boolean;
|
|
@@ -105,6 +105,7 @@ export declare class Base extends Camera {
|
|
|
105
105
|
roomEnvMap?: THREE.Texture;
|
|
106
106
|
visName: string;
|
|
107
107
|
private detectRes?;
|
|
108
|
+
private ownsPencil;
|
|
108
109
|
publicDir: Record<string, string>;
|
|
109
110
|
constructor(options: BaseOptions);
|
|
110
111
|
private getDetectRes;
|
|
@@ -115,125 +116,70 @@ export declare class Base extends Camera {
|
|
|
115
116
|
private resolveRendererDepthBufferOptions;
|
|
116
117
|
private showDetectRes;
|
|
117
118
|
setOptions(options: Record<string, any>): void;
|
|
118
|
-
syncExtendsOptionToScene(name: string, value: any): void;
|
|
119
119
|
fromJSON(jsonOrUrl: Record<string, any> | string, hooksE?: Record<string, any>): Promise<void>;
|
|
120
|
-
private
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
120
|
+
private runtimeInitialization?;
|
|
121
|
+
private disposed;
|
|
122
|
+
/* Excluded from this release type: initializeRuntime */
|
|
123
|
+
/** 子类扩展点:运行环境只初始化一次,适合建立投影和绑定控制器事件。 */
|
|
124
|
+
protected onRuntimeReady(): Promise<void>;
|
|
125
|
+
/** 子类扩展点:恢复场景引用和运行时派生状态,不生成地图几何或移动相机。 */
|
|
126
|
+
protected onSceneRestored(): Promise<void>;
|
|
127
|
+
/** 子类扩展点:释放额外引用和监听;页面资源由 Base 统一释放。 */
|
|
128
|
+
protected onDispose(): void;
|
|
129
|
+
protected get objectTypes(): Record<string, any>;
|
|
130
|
+
protected get defaultCameraUp(): THREE.Vector3;
|
|
129
131
|
private observeScale;
|
|
130
|
-
|
|
132
|
+
private createRuntime;
|
|
131
133
|
private sceneActive;
|
|
132
134
|
setSceneActive(): void;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
/** 把 Pencil 生命周期交给外部场景管理器,当前实例仅拥有自己的 page。 */
|
|
136
|
+
releasePencilOwnership(): void;
|
|
137
|
+
private initSceneUserData;
|
|
138
|
+
/** Save a partial object state and apply its effects without replaying other state. */
|
|
139
|
+
setObjectState(object: BaseObject, patch: Record<string, any>): BaseObject<THREE.Object3D<THREE.Object3DEventMap>>;
|
|
140
|
+
applyObjectState(object: BaseObject, state?: Record<string, any>): void;
|
|
141
|
+
/** 场景页提交后的默认入场动画;地图可覆盖为更有空间感的过渡。 */
|
|
142
|
+
playEnterTransition({ duration, onPrepared, }: SceneEnterTransitionOptions): Promise<void>;
|
|
137
143
|
addCSS3DRenderer(container?: HTMLElement): void;
|
|
138
144
|
initSettingsObj?: Record<string, any>;
|
|
139
145
|
mouseButtonsActiveStore: Record<string, any> | null;
|
|
140
|
-
initSettings
|
|
146
|
+
private initSettings;
|
|
141
147
|
handleSetting(key: string, value: any): void;
|
|
142
|
-
|
|
143
|
-
|
|
148
|
+
protected prepareInitialCamera(): Promise<void>;
|
|
149
|
+
private showing?;
|
|
150
|
+
show(): Promise<void>;
|
|
144
151
|
hide(): void;
|
|
145
152
|
exportScene(): THREE.Object3DJSON;
|
|
146
153
|
exportBaseObject(baseObject: BaseObject): THREE.Object3DJSON;
|
|
147
|
-
restoreBaseObject(data: string | THREE.Object3DJSON, target?: BaseObject, objectsMap?:
|
|
148
|
-
|
|
149
|
-
Arc: typeof Arc;
|
|
150
|
-
Model: Model;
|
|
151
|
-
Plane: Plane;
|
|
152
|
-
PlaneShadow: PlaneShadow;
|
|
153
|
-
Sphere: Sphere;
|
|
154
|
-
Sprite: typeof Sprite;
|
|
155
|
-
Box: Box;
|
|
156
|
-
Circle: Circle;
|
|
157
|
-
Tube: Tube;
|
|
158
|
-
Ring: Ring;
|
|
159
|
-
AmbientLight: AmbientLight;
|
|
160
|
-
DirectionalLight: DirectionalLight;
|
|
161
|
-
PointLight: PointLight;
|
|
162
|
-
SpotLight: SpotLight;
|
|
163
|
-
HemisphereLight: HemisphereLight;
|
|
164
|
-
RectAreaLight: RectAreaLight;
|
|
165
|
-
Node: typeof NodeObject;
|
|
166
|
-
ExtrudePolygon: ExtrudePolygonObject;
|
|
167
|
-
Line: typeof LineObject;
|
|
168
|
-
Group: GroupObject;
|
|
169
|
-
}): Promise<BaseObject<THREE.Object3D<THREE.Object3DEventMap>>>;
|
|
170
|
-
restoreScene(str: string | THREE.Object3DJSON, objectsMap?: {
|
|
171
|
-
Point: Point;
|
|
172
|
-
Arc: typeof Arc;
|
|
173
|
-
Model: Model;
|
|
174
|
-
Plane: Plane;
|
|
175
|
-
PlaneShadow: PlaneShadow;
|
|
176
|
-
Sphere: Sphere;
|
|
177
|
-
Sprite: typeof Sprite;
|
|
178
|
-
Box: Box;
|
|
179
|
-
Circle: Circle;
|
|
180
|
-
Tube: Tube;
|
|
181
|
-
Ring: Ring;
|
|
182
|
-
AmbientLight: AmbientLight;
|
|
183
|
-
DirectionalLight: DirectionalLight;
|
|
184
|
-
PointLight: PointLight;
|
|
185
|
-
SpotLight: SpotLight;
|
|
186
|
-
HemisphereLight: HemisphereLight;
|
|
187
|
-
RectAreaLight: RectAreaLight;
|
|
188
|
-
Node: typeof NodeObject;
|
|
189
|
-
ExtrudePolygon: ExtrudePolygonObject;
|
|
190
|
-
Line: typeof LineObject;
|
|
191
|
-
Group: GroupObject;
|
|
192
|
-
}): Promise<void>;
|
|
193
|
-
rebuildFromScene(): Promise<void>;
|
|
154
|
+
restoreBaseObject(data: string | THREE.Object3DJSON, target?: BaseObject, objectsMap?: Record<string, any>): Promise<BaseObject<THREE.Object3D<THREE.Object3DEventMap>>>;
|
|
155
|
+
restoreScene(str: string | THREE.Object3DJSON, objectsMap?: Record<string, any>): Promise<void>;
|
|
194
156
|
getClassRefByType(type: string): typeof BaseObject;
|
|
195
|
-
addGroup(): Promise<GroupObject>;
|
|
157
|
+
addGroup(): Promise< GroupObject>;
|
|
196
158
|
addCSS2D(dom: HTMLElement, options?: {
|
|
197
159
|
display?: string;
|
|
198
160
|
onTop?: number;
|
|
199
161
|
target?: BaseObject;
|
|
200
|
-
}): Promise<NodeObject>;
|
|
162
|
+
}): Promise< NodeObject>;
|
|
201
163
|
addCSS3D(dom: HTMLElement, options?: {
|
|
202
164
|
display?: string;
|
|
203
165
|
onTop?: number;
|
|
204
166
|
type?: '3d' | '3dSprite';
|
|
205
167
|
target?: BaseObject;
|
|
206
|
-
}): Promise<NodeObject>;
|
|
168
|
+
}): Promise< NodeObject>;
|
|
207
169
|
private addNode;
|
|
208
170
|
getRoomEnvMap(): THREE.Texture<unknown, THREE.TextureEventMap>;
|
|
209
|
-
handlePick(objArr: PickFunctionsItem['objArr'], type: PickFunctionsItem['type'], cb: PickFunctionsItem['cb']): void;
|
|
210
171
|
getScreenPosition(x: number, y: number, z: number): {
|
|
211
172
|
x: number;
|
|
212
173
|
y: number;
|
|
213
174
|
};
|
|
214
175
|
uuidByObject(object: THREE.Object3D): string | undefined;
|
|
215
|
-
objectByUuid(key: string): THREE.
|
|
216
|
-
uuidByBaseObject(object: BaseObject): string
|
|
176
|
+
objectByUuid(key: string): THREE.Object3D<THREE.Object3DEventMap>;
|
|
177
|
+
uuidByBaseObject(object: BaseObject): string;
|
|
217
178
|
baseObjectByUuid(key: `arc${string}`): Arc;
|
|
218
179
|
baseObjectByUuid(key: `sprite${string}`): Sprite;
|
|
219
180
|
baseObjectByUuid(key: string): BaseObject;
|
|
181
|
+
private normalizeBaseObjectKey;
|
|
220
182
|
baseObjectByName(name: string): BaseObject<THREE.Object3D<THREE.Object3DEventMap>> | undefined;
|
|
221
|
-
private _selectOptionMaps;
|
|
222
|
-
findSelectItem(key: any, val: any): SelectedMeta | undefined;
|
|
223
|
-
selectOption: SelectedMeta[];
|
|
224
|
-
changeSelectOption(): void;
|
|
225
|
-
private _mListOptionsMaps;
|
|
226
|
-
findMListSelectItem(key: any, val: any): any;
|
|
227
|
-
mListOptions: {
|
|
228
|
-
key: string;
|
|
229
|
-
name: string;
|
|
230
|
-
type: string;
|
|
231
|
-
use: number;
|
|
232
|
-
object: THREE.Mesh;
|
|
233
|
-
material: THREE.Material;
|
|
234
|
-
baseObject: BaseObject;
|
|
235
|
-
}[];
|
|
236
|
-
changeMListOptions(): never[] | undefined;
|
|
237
183
|
dispose(): void;
|
|
238
184
|
}
|
|
239
185
|
|
|
@@ -289,6 +235,8 @@ declare interface BaseOptions {
|
|
|
289
235
|
tier?: number;
|
|
290
236
|
observeParentScale?: boolean;
|
|
291
237
|
createIfNeeded?: boolean;
|
|
238
|
+
/** 相机输入与场景运行控制,由平台随场景参数导出。 */
|
|
239
|
+
controls?: SceneControlsOptions;
|
|
292
240
|
[key: string]: any;
|
|
293
241
|
}
|
|
294
242
|
|
|
@@ -316,7 +264,7 @@ declare class Camera extends Event_2 {
|
|
|
316
264
|
cameraState: Record<string, number[]>;
|
|
317
265
|
cameraStateActive: string;
|
|
318
266
|
setSaveCamera(type: string): void;
|
|
319
|
-
useSaveCamera(type: string, enableTransition?: boolean): Promise<boolean>;
|
|
267
|
+
useSaveCamera(type: string, enableTransition?: boolean, smoothTime?: number): Promise<boolean>;
|
|
320
268
|
lookAt(positionX: number, positionY: number, positionZ: number, targetX: number, targetY: number, targetZ: number, enableTransition?: boolean, smoothTime?: number): Promise<void>;
|
|
321
269
|
truck(x: number, y: number, enableTransition?: boolean, smoothTime?: number): Promise<void>;
|
|
322
270
|
moveTo(x: number, y: number, z: number, enableTransition?: boolean, smoothTime?: number): Promise<void>;
|
|
@@ -343,7 +291,7 @@ declare class City {
|
|
|
343
291
|
adcode: number;
|
|
344
292
|
pcenter: [number, number];
|
|
345
293
|
pscale: number;
|
|
346
|
-
projection:
|
|
294
|
+
projection: GeoProjection;
|
|
347
295
|
options: CityOptions;
|
|
348
296
|
group: GroupObject;
|
|
349
297
|
building: Building;
|
|
@@ -354,8 +302,9 @@ declare class City {
|
|
|
354
302
|
constructor(pencil: Pencil);
|
|
355
303
|
setOptions(options: CityOptions): void;
|
|
356
304
|
multiplyScalar: number;
|
|
305
|
+
private getProjectionOptions;
|
|
357
306
|
fixNearFar(n?: number, f?: number): void;
|
|
358
|
-
init(): Promise<void>;
|
|
307
|
+
init(existingGroup?: GroupObject): Promise<void>;
|
|
359
308
|
drawCityPlane(adcode: number, target?: BaseObject): Promise<void>;
|
|
360
309
|
drawBuilding(options?: {
|
|
361
310
|
jsonUrl?: string;
|
|
@@ -369,7 +318,7 @@ declare class City {
|
|
|
369
318
|
type?: 'river' | 'grassland';
|
|
370
319
|
oArr?: number[];
|
|
371
320
|
grey?: boolean;
|
|
372
|
-
}): Promise<Area | undefined>;
|
|
321
|
+
}): Promise< Area | undefined>;
|
|
373
322
|
drawRoad(options?: {
|
|
374
323
|
jsonUrl?: string;
|
|
375
324
|
meters?: number;
|
|
@@ -383,6 +332,7 @@ declare interface CityOptions {
|
|
|
383
332
|
jsonName: string;
|
|
384
333
|
cacheKey?: string;
|
|
385
334
|
center?: [number, number];
|
|
335
|
+
projectionType?: ProjectionOptions['projectionType'];
|
|
386
336
|
plane?: boolean;
|
|
387
337
|
grey?: boolean;
|
|
388
338
|
showBuilding?: boolean;
|
|
@@ -392,6 +342,12 @@ declare interface CityOptions {
|
|
|
392
342
|
showGrassland?: boolean;
|
|
393
343
|
showRiver?: boolean;
|
|
394
344
|
setWaterMaterial?: boolean;
|
|
345
|
+
dataSources?: {
|
|
346
|
+
building?: string;
|
|
347
|
+
road?: string;
|
|
348
|
+
river?: string;
|
|
349
|
+
grassland?: string;
|
|
350
|
+
};
|
|
395
351
|
}
|
|
396
352
|
|
|
397
353
|
declare class CityPlane extends MeshObject {
|
|
@@ -402,7 +358,7 @@ declare class CityPlane extends MeshObject {
|
|
|
402
358
|
water?: Water;
|
|
403
359
|
create(): Promise<void>;
|
|
404
360
|
rebuildFromScene(): void;
|
|
405
|
-
addWater(): void;
|
|
361
|
+
addWater(normalMaps: [THREE.Texture, THREE.Texture]): void;
|
|
406
362
|
}
|
|
407
363
|
|
|
408
364
|
declare class ContinentsBg extends GroupObject {
|
|
@@ -428,26 +384,13 @@ export declare class Earth extends Base {
|
|
|
428
384
|
static VisName: string;
|
|
429
385
|
leftTruck: boolean;
|
|
430
386
|
options: Required<EarthOptions>;
|
|
431
|
-
extendsOptions: Record<string, any>;
|
|
432
387
|
map: PlaneMap;
|
|
388
|
+
sphere?: BaseObject;
|
|
389
|
+
secondaryMap?: PlaneMap;
|
|
433
390
|
get mapArea(): ExtrudePolygonObject[];
|
|
434
391
|
setOptions(options: EarthOptions): void;
|
|
435
392
|
handleSetting(key: string, value: any): void;
|
|
436
|
-
|
|
437
|
-
animationIn(): void;
|
|
438
|
-
initLight(): Promise<void>;
|
|
439
|
-
getLocationPosition(location: [number, number], dr?: number): [number, number, number];
|
|
440
|
-
getRadius(): number;
|
|
441
|
-
checkBehindEarth(objArr: () => BaseObject[], cb: (obj: BaseObject[], res: boolean[]) => any): void;
|
|
442
|
-
/**
|
|
443
|
-
* 设置物体在球面上的位置和旋转,使其垂直于球面
|
|
444
|
-
* @param object - 要设置的物体
|
|
445
|
-
* @param location - 经纬度 [经度, 纬度]
|
|
446
|
-
* @param height - 距离球面的高度,默认为0
|
|
447
|
-
* @param upAxis - 物体的up轴方向,默认为Y轴 [0, 1, 0]
|
|
448
|
-
*/
|
|
449
|
-
setObjectOnSphere(baseObject: BaseObject, location: [number, number], height?: number, upAxis?: [number, number, number]): void;
|
|
450
|
-
restoreScene(str: string, objectsMap?: {
|
|
393
|
+
protected get objectTypes(): {
|
|
451
394
|
Earth: Earth_2;
|
|
452
395
|
SphereShadow: SphereShadow;
|
|
453
396
|
Countries: typeof PlaneMap;
|
|
@@ -473,29 +416,48 @@ export declare class Earth extends Base {
|
|
|
473
416
|
ExtrudePolygon: ExtrudePolygonObject;
|
|
474
417
|
Line: LineObject;
|
|
475
418
|
Group: GroupObject;
|
|
476
|
-
}
|
|
477
|
-
private
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
419
|
+
};
|
|
420
|
+
private rotationControls?;
|
|
421
|
+
private readonly stopAutoRotate;
|
|
422
|
+
private readonly resumeAutoRotate;
|
|
423
|
+
protected onRuntimeReady(): Promise<void>;
|
|
424
|
+
protected onDispose(): void;
|
|
425
|
+
getLocationPosition(location: [number, number], dr?: number): [number, number, number];
|
|
426
|
+
getRadius(): number;
|
|
427
|
+
checkBehindEarth(objArr: () => BaseObject[], cb: (obj: BaseObject[], res: boolean[]) => any): void;
|
|
428
|
+
/**
|
|
429
|
+
* 设置物体在球面上的位置和旋转,使其垂直于球面
|
|
430
|
+
* @param object - 要设置的物体
|
|
431
|
+
* @param location - 经纬度 [经度, 纬度]
|
|
432
|
+
* @param height - 距离球面的高度,默认为0
|
|
433
|
+
* @param upAxis - 物体的up轴方向,默认为Y轴 [0, 1, 0]
|
|
434
|
+
*/
|
|
435
|
+
setObjectOnSphere(baseObject: BaseObject, location: [number, number], height?: number, upAxis?: [number, number, number]): void;
|
|
436
|
+
getSceneBindings(): EarthSceneBindings;
|
|
437
|
+
protected onSceneRestored(): Promise<void>;
|
|
482
438
|
}
|
|
483
439
|
|
|
484
440
|
declare class Earth_2 extends Sphere {
|
|
485
441
|
objectType: string;
|
|
486
|
-
options: Required<
|
|
487
|
-
constructor(options:
|
|
442
|
+
options: Required<Options_4>;
|
|
443
|
+
constructor(options: Options_4);
|
|
488
444
|
create(): void;
|
|
489
445
|
rebuildFromScene(): void;
|
|
490
446
|
}
|
|
491
447
|
|
|
492
448
|
declare interface EarthOptions extends BaseOptions {
|
|
449
|
+
sceneBindings?: EarthSceneBindings;
|
|
493
450
|
mapDepth?: number;
|
|
494
451
|
otherMapDepth?: number;
|
|
495
452
|
radius?: number;
|
|
496
453
|
copyChinaPlane?: boolean;
|
|
497
454
|
mergeSide?: boolean;
|
|
498
|
-
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
declare interface EarthSceneBindings {
|
|
458
|
+
sphere?: string;
|
|
459
|
+
map?: string;
|
|
460
|
+
secondaryMap?: string;
|
|
499
461
|
}
|
|
500
462
|
|
|
501
463
|
declare class Event_2 {
|
|
@@ -520,85 +482,36 @@ declare const findAdcodeInfo: (adcode: number) => {
|
|
|
520
482
|
b: number[];
|
|
521
483
|
} | undefined;
|
|
522
484
|
|
|
523
|
-
export declare interface FixConfig {
|
|
524
|
-
[key: `${string}`]: {
|
|
525
|
-
s?: string[];
|
|
526
|
-
z?: string[];
|
|
527
|
-
t?: string[];
|
|
528
|
-
b?: string[];
|
|
529
|
-
l?: string[];
|
|
530
|
-
r?: string[];
|
|
531
|
-
};
|
|
532
|
-
}
|
|
533
|
-
|
|
534
485
|
declare type GeoJSON_2 = FeatureCollection<Polygon | MultiPolygon>;
|
|
535
486
|
|
|
536
487
|
declare type GeoJSON_3 = FeatureCollection<Polygon | MultiPolygon>;
|
|
537
488
|
|
|
538
489
|
declare type GeoJSON_4 = FeatureCollection<Polygon | MultiPolygon>;
|
|
539
490
|
|
|
540
|
-
declare
|
|
541
|
-
center: [number, number];
|
|
542
|
-
scale: number;
|
|
543
|
-
projectionType?: "mercator" | "equirectangular" | "winkel3";
|
|
544
|
-
translate?: [number, number];
|
|
545
|
-
precision?: number;
|
|
546
|
-
rotate?: [number, number];
|
|
547
|
-
}) => GeoProjection;
|
|
548
|
-
|
|
549
|
-
declare const getProjection_2: (options: {
|
|
550
|
-
center: [number, number];
|
|
551
|
-
scale: number;
|
|
552
|
-
projectionType?: "mercator" | "equirectangular" | "winkel3";
|
|
553
|
-
translate?: [number, number];
|
|
554
|
-
precision?: number;
|
|
555
|
-
rotate?: [number, number];
|
|
556
|
-
}) => GeoProjection;
|
|
491
|
+
export declare function getSceneDocument(document: VisSceneDocument, sceneId?: string): SceneViewportDocument;
|
|
557
492
|
|
|
558
493
|
declare class HemisphereLight extends HemisphereLightObject {
|
|
559
|
-
render(): void;
|
|
560
494
|
}
|
|
561
495
|
|
|
496
|
+
/**
|
|
497
|
+
* 新场景文档以完整场景快照作为恢复基线。
|
|
498
|
+
* 未带标记的 JSON 属于旧格式,仍由编辑器的兼容流程处理。
|
|
499
|
+
*/
|
|
500
|
+
export declare function isSceneDocument(value: unknown): value is SceneDocumentMarker & Record<string, any>;
|
|
501
|
+
|
|
562
502
|
declare class Map_2 extends Base {
|
|
563
503
|
static VisName: string;
|
|
564
504
|
options: Required<MapCityOptions>;
|
|
565
|
-
|
|
505
|
+
/** 当前唯一主地图的运行时状态。 */
|
|
506
|
+
mapObj: {
|
|
566
507
|
map: PlaneMap;
|
|
567
508
|
mapInfo: NonNullable<ReturnType<typeof findAdcodeInfo>>;
|
|
568
509
|
z: number;
|
|
569
510
|
cX: number;
|
|
570
511
|
cY: number;
|
|
571
512
|
depth: number;
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
polarAngle: number;
|
|
575
|
-
azimuthAngle: number;
|
|
576
|
-
};
|
|
577
|
-
userControls?: {
|
|
578
|
-
lookAt: [number, number, number, number, number, number];
|
|
579
|
-
polarAngle: number;
|
|
580
|
-
azimuthAngle: number;
|
|
581
|
-
};
|
|
582
|
-
}[];
|
|
583
|
-
get mapObj(): {
|
|
584
|
-
map: PlaneMap;
|
|
585
|
-
mapInfo: NonNullable<ReturnType<typeof findAdcodeInfo>>;
|
|
586
|
-
z: number;
|
|
587
|
-
cX: number;
|
|
588
|
-
cY: number;
|
|
589
|
-
depth: number;
|
|
590
|
-
controls?: {
|
|
591
|
-
lookAt: [number, number, number, number, number, number];
|
|
592
|
-
polarAngle: number;
|
|
593
|
-
azimuthAngle: number;
|
|
594
|
-
};
|
|
595
|
-
userControls?: {
|
|
596
|
-
lookAt: [number, number, number, number, number, number];
|
|
597
|
-
polarAngle: number;
|
|
598
|
-
azimuthAngle: number;
|
|
599
|
-
};
|
|
600
|
-
};
|
|
601
|
-
get map(): PlaneMap;
|
|
513
|
+
} | undefined;
|
|
514
|
+
get map(): PlaneMap | undefined;
|
|
602
515
|
get mapInfo(): {
|
|
603
516
|
adcode: number;
|
|
604
517
|
lng: number;
|
|
@@ -608,59 +521,80 @@ declare class Map_2 extends Base {
|
|
|
608
521
|
parent: number;
|
|
609
522
|
c: number[];
|
|
610
523
|
b: number[];
|
|
611
|
-
};
|
|
612
|
-
get mapArea(): ExtrudePolygonObject[];
|
|
613
|
-
get mapLine(): LineObject[];
|
|
614
|
-
|
|
524
|
+
} | undefined;
|
|
525
|
+
get mapArea(): ExtrudePolygonObject[] | undefined;
|
|
526
|
+
get mapLine(): LineObject[] | undefined;
|
|
527
|
+
/** 当前已恢复或生成的主地图区域;空场景为 undefined。 */
|
|
528
|
+
get adcode(): number | undefined;
|
|
615
529
|
activePlaneMap: PlaneMap | null;
|
|
616
|
-
isAnimating: boolean;
|
|
617
530
|
parentBg: PlaneMap[];
|
|
618
531
|
continentsBg?: ContinentsBg;
|
|
619
532
|
group: GroupObject;
|
|
620
|
-
projection:
|
|
533
|
+
projection: GeoProjection;
|
|
621
534
|
pcenter: [number, number];
|
|
622
535
|
pscale: number;
|
|
623
536
|
meters: number;
|
|
624
537
|
cityVis: City[];
|
|
625
538
|
cityGroup: GroupObject[];
|
|
626
|
-
|
|
539
|
+
/**
|
|
540
|
+
* 目标模板默认保存视角对应的地图基准。地区替换会修改 adcode、center
|
|
541
|
+
* 和 sceneBindings,因此在场景刚恢复时记录,供后续 fitTo 复用设计师视角。
|
|
542
|
+
*/
|
|
543
|
+
private regionCameraFitReference?;
|
|
627
544
|
setOptions(options: MapOptions): void;
|
|
628
|
-
initGroup(): Promise<void>;
|
|
629
545
|
private _getProjectionCenter;
|
|
630
546
|
private _getProjectionRotate;
|
|
631
547
|
private _getSplitPolygons;
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
548
|
+
protected get objectTypes(): {
|
|
549
|
+
PlaneMap: typeof PlaneMap;
|
|
550
|
+
ContinentsBg: typeof ContinentsBg;
|
|
551
|
+
Mountain: Mountain;
|
|
552
|
+
CityPlane: CityPlane;
|
|
553
|
+
Area: Area;
|
|
554
|
+
Building: Building;
|
|
555
|
+
Road: Road;
|
|
556
|
+
Point: Point;
|
|
557
|
+
Arc: Arc;
|
|
558
|
+
Model: Model;
|
|
559
|
+
Plane: Plane;
|
|
560
|
+
PlaneShadow: PlaneShadow;
|
|
561
|
+
Sphere: Sphere;
|
|
562
|
+
Sprite: Sprite;
|
|
563
|
+
Box: Box;
|
|
564
|
+
Circle: Circle;
|
|
565
|
+
Tube: Tube;
|
|
566
|
+
Ring: Ring;
|
|
567
|
+
AmbientLight: AmbientLight;
|
|
568
|
+
DirectionalLight: DirectionalLight;
|
|
569
|
+
PointLight: PointLight;
|
|
570
|
+
SpotLight: SpotLight;
|
|
571
|
+
HemisphereLight: HemisphereLight;
|
|
572
|
+
RectAreaLight: RectAreaLight;
|
|
573
|
+
Node: NodeObject;
|
|
574
|
+
ExtrudePolygon: ExtrudePolygonObject;
|
|
575
|
+
Line: LineObject;
|
|
576
|
+
Group: typeof GroupObject;
|
|
577
|
+
};
|
|
578
|
+
protected get defaultCameraUp(): THREE.Vector3;
|
|
579
|
+
protected onRuntimeReady(): Promise<void>;
|
|
580
|
+
protected prepareInitialCamera(): Promise<void>;
|
|
581
|
+
private updateMapBoundary;
|
|
582
|
+
/* Excluded from this release type: finalizeRegionGeometry */
|
|
636
583
|
initCityVis(adcode: number, grey?: boolean): Promise<City>;
|
|
637
584
|
initCityOnMap(adcode: number): Promise<void>;
|
|
638
|
-
initVisBg(): Promise<void>;
|
|
639
|
-
initVis(): Promise<void>;
|
|
640
|
-
loaderAddBg(): void;
|
|
641
|
-
initMaterialBg(): Promise<void>;
|
|
642
585
|
private _getParentBgMetrics;
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
586
|
+
clearParentBackground(): void;
|
|
587
|
+
ensureParentBackground(): Promise<{
|
|
588
|
+
planeWidth: number;
|
|
589
|
+
planeHeight: number;
|
|
590
|
+
center: THREE.Vector3;
|
|
591
|
+
} | undefined>;
|
|
592
|
+
clearContinentsBackground(): void;
|
|
593
|
+
ensureContinentsBackground(): Promise<void>;
|
|
647
594
|
consoleMousePostion(): void;
|
|
648
|
-
caId: string | number | undefined;
|
|
649
|
-
showAction(): Promise<void>;
|
|
650
|
-
hide(): Promise<void>;
|
|
651
595
|
shadowMapEnabled(): Promise<void>;
|
|
652
|
-
getOptionsDepth(adcode: number): number;
|
|
653
|
-
getDepth(adcode: number): number;
|
|
654
596
|
getReferenceScale(bboxa: number[], bboxb: number[]): number;
|
|
655
597
|
getAdcodeShowLevel(adcode: number, fix?: boolean): string | undefined;
|
|
656
|
-
private handleClick;
|
|
657
|
-
beforeShowMap(_adcodes: number[]): boolean;
|
|
658
|
-
getAdcodes(adcode: number): number[];
|
|
659
|
-
showMap({ adcode, adcodes: prevAdcodes, duration, }: {
|
|
660
|
-
adcode?: number;
|
|
661
|
-
adcodes?: number[];
|
|
662
|
-
duration?: number;
|
|
663
|
-
}): Promise<void>;
|
|
664
598
|
drawLabels(): Promise<void>;
|
|
665
599
|
private labelGroupObject3dUserData;
|
|
666
600
|
eraseLabels(): void;
|
|
@@ -684,12 +618,12 @@ declare class Map_2 extends Base {
|
|
|
684
618
|
* @returns 是否在板块内
|
|
685
619
|
*/
|
|
686
620
|
booleanPointInMap(location: [number, number]): boolean;
|
|
621
|
+
private _loadGeojsonFromConfig;
|
|
622
|
+
private _loadBaseGeojson;
|
|
687
623
|
private getGeojson;
|
|
688
|
-
|
|
689
|
-
saveCamvasState(type: 'userControls' | 'controls', index: number): void;
|
|
690
|
-
fixNear(adcode: number): void;
|
|
624
|
+
/* Excluded from this release type: buildRegion */
|
|
691
625
|
private calcPaddingFromReference;
|
|
692
|
-
fitTo(obj: BaseObject, { polarAngle, azimuthAngle, reference, z, handleStart, adcode, enableTransition, }?: {
|
|
626
|
+
fitTo(obj: BaseObject, { polarAngle, azimuthAngle, reference, z, handleStart, adcode, enableTransition, smoothTime, }?: {
|
|
693
627
|
adcode?: number;
|
|
694
628
|
polarAngle?: number;
|
|
695
629
|
azimuthAngle?: number;
|
|
@@ -699,9 +633,11 @@ declare class Map_2 extends Base {
|
|
|
699
633
|
center?: [number, number];
|
|
700
634
|
};
|
|
701
635
|
enableTransition?: boolean;
|
|
636
|
+
smoothTime?: number;
|
|
702
637
|
z?: number;
|
|
703
638
|
handleStart?: () => void;
|
|
704
639
|
}): Promise<void>;
|
|
640
|
+
private regionAppearance?;
|
|
705
641
|
drawPlaneMap({ geojson, extrudeLineGeojson, bbox, depth, extrudelineBloom, adcode, }: {
|
|
706
642
|
geojson: GeoJSON_3;
|
|
707
643
|
extrudeLineGeojson?: GeoJSON_3;
|
|
@@ -710,10 +646,6 @@ declare class Map_2 extends Base {
|
|
|
710
646
|
adcode: number;
|
|
711
647
|
extrudelineBloom?: boolean;
|
|
712
648
|
}): Promise<PlaneMap>;
|
|
713
|
-
private handleBack;
|
|
714
|
-
handleLookBack(duration?: number): Promise<void>;
|
|
715
|
-
compareLocations(currentO: any[], destinationO: any[]): number[];
|
|
716
|
-
private setAdcode;
|
|
717
649
|
setPadding(padding: [number, number, number, number], fitTo?: boolean, enableTransition?: boolean): void;
|
|
718
650
|
findAdcodeInfo(adcode: number): {
|
|
719
651
|
adcode: number;
|
|
@@ -733,7 +665,8 @@ declare class Map_2 extends Base {
|
|
|
733
665
|
* 根据当前 options.center 重新计算投影
|
|
734
666
|
*/
|
|
735
667
|
private updateProjection;
|
|
736
|
-
|
|
668
|
+
protected onSceneRestored(): Promise<void>;
|
|
669
|
+
getSceneBindings(): MapSceneBindings;
|
|
737
670
|
/**
|
|
738
671
|
* 快照:捕获 PlaneMap 上用户添加的叠加对象
|
|
739
672
|
*/
|
|
@@ -747,41 +680,30 @@ declare class Map_2 extends Base {
|
|
|
747
680
|
* 根据 switchFixConfig 对场景中的对象做位置/缩放修复
|
|
748
681
|
*/
|
|
749
682
|
private applySwitchFixConfig;
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
Area: Area;
|
|
757
|
-
Building: Building;
|
|
758
|
-
Road: Road;
|
|
759
|
-
Point: Point;
|
|
760
|
-
Arc: Arc;
|
|
761
|
-
Model: Model;
|
|
762
|
-
Plane: Plane;
|
|
763
|
-
PlaneShadow: PlaneShadow;
|
|
764
|
-
Sphere: Sphere;
|
|
765
|
-
Sprite: Sprite;
|
|
766
|
-
Box: Box;
|
|
767
|
-
Circle: Circle;
|
|
768
|
-
Tube: Tube;
|
|
769
|
-
Ring: Ring;
|
|
770
|
-
AmbientLight: AmbientLight;
|
|
771
|
-
DirectionalLight: DirectionalLight;
|
|
772
|
-
PointLight: PointLight;
|
|
773
|
-
SpotLight: SpotLight;
|
|
774
|
-
HemisphereLight: HemisphereLight;
|
|
775
|
-
RectAreaLight: RectAreaLight;
|
|
776
|
-
Node: NodeObject;
|
|
777
|
-
ExtrudePolygon: typeof ExtrudePolygonObject;
|
|
778
|
-
Line: LineObject;
|
|
779
|
-
Group: typeof GroupObject;
|
|
780
|
-
}): Promise<void>;
|
|
781
|
-
dispose(): void;
|
|
683
|
+
/* Excluded from this release type: rebuildRegion */
|
|
684
|
+
/** 候选区域提交后的相机过渡,不参与场景序列化。 */
|
|
685
|
+
playRegionEnterTransition({ duration, sourceCamera, onPrepared, }: MapRegionEnterTransitionOptions): Promise<void>;
|
|
686
|
+
private setRegionTexture;
|
|
687
|
+
applyRegionTextureRules(adcode: number): Promise<void>;
|
|
688
|
+
protected onDispose(): void;
|
|
782
689
|
}
|
|
783
690
|
export { Map_2 as Map }
|
|
784
691
|
|
|
692
|
+
declare interface MapAssetSources {
|
|
693
|
+
worldGeojson: string;
|
|
694
|
+
worldLiteGeojson: string;
|
|
695
|
+
regionGeojson: string;
|
|
696
|
+
regionLiteGeojson: string;
|
|
697
|
+
continentsLiteGeojson: string;
|
|
698
|
+
waterNormalMaps?: [string, string];
|
|
699
|
+
city?: {
|
|
700
|
+
building?: string;
|
|
701
|
+
road?: string;
|
|
702
|
+
river?: string;
|
|
703
|
+
grassland?: string;
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
|
|
785
707
|
declare interface MapCityOptions extends MapOptions {
|
|
786
708
|
cacheCity?: boolean;
|
|
787
709
|
nearbyCities?: boolean | 'full';
|
|
@@ -796,159 +718,30 @@ declare interface MapCityOptions extends MapOptions {
|
|
|
796
718
|
citySSAO?: boolean;
|
|
797
719
|
}
|
|
798
720
|
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
private container;
|
|
805
|
-
private controlsContainer?;
|
|
806
|
-
private assetsPrefix?;
|
|
807
|
-
private fixConfig?;
|
|
808
|
-
private raycasterPointsThreshold;
|
|
809
|
-
private readonly MAX_ZOOM_FACTOR;
|
|
810
|
-
private readonly MIN_ZOOM_FACTOR;
|
|
811
|
-
private mapInstances;
|
|
812
|
-
private mapDistances;
|
|
813
|
-
private mapConfigs;
|
|
814
|
-
private mapReference;
|
|
815
|
-
private mapBloomConfig;
|
|
816
|
-
private currentMap;
|
|
817
|
-
private currentZoom;
|
|
818
|
-
private mapMultiplyScalar;
|
|
819
|
-
private mapPadding?;
|
|
820
|
-
private isInitializing;
|
|
821
|
-
private rmTemplateIdentifier;
|
|
822
|
-
private geojsonExtensions;
|
|
823
|
-
private areaHoverMlistName;
|
|
824
|
-
private distanceChangeMlistName;
|
|
825
|
-
private showBuildingOnlyWithoutChildren;
|
|
826
|
-
private groups;
|
|
827
|
-
private areaCloseTimer;
|
|
828
|
-
private key;
|
|
829
|
-
private topAdcode;
|
|
830
|
-
private clickHandleDrillDown;
|
|
831
|
-
private clickOusideBack;
|
|
832
|
-
static findAdcodeInfoByName: (name: string) => {
|
|
833
|
-
adcode: number;
|
|
834
|
-
lng: number;
|
|
835
|
-
lat: number;
|
|
836
|
-
name: string;
|
|
837
|
-
level: string;
|
|
838
|
-
parent: number;
|
|
839
|
-
c: number[];
|
|
840
|
-
b: number[];
|
|
841
|
-
} | undefined;
|
|
842
|
-
static getAdcodeShowLevel: (adcode: number, fix?: boolean) => string | undefined;
|
|
843
|
-
static findAdcodeInfo: (adcode: number) => {
|
|
844
|
-
adcode: number;
|
|
845
|
-
lng: number;
|
|
846
|
-
lat: number;
|
|
847
|
-
name: string;
|
|
848
|
-
level: string;
|
|
849
|
-
parent: number;
|
|
850
|
-
c: number[];
|
|
851
|
-
b: number[];
|
|
852
|
-
} | undefined;
|
|
853
|
-
static extendsAdcodeAll: (cb: any) => void;
|
|
854
|
-
constructor(config: MapManagerConfig);
|
|
855
|
-
/**
|
|
856
|
-
* 获取当前地图实例
|
|
857
|
-
*/
|
|
858
|
-
getCurrentMap(): Map_2 | null;
|
|
859
|
-
/**
|
|
860
|
-
* 获取当前缩放级别
|
|
861
|
-
*/
|
|
862
|
-
getCurrentZoom(): number;
|
|
863
|
-
/**
|
|
864
|
-
* 初始化地图
|
|
865
|
-
*/
|
|
866
|
-
showMap(adcodeArr: number[], fixedAdcode?: boolean): Promise<Map_2 | null>;
|
|
867
|
-
/**
|
|
868
|
-
* 创建地图实例
|
|
869
|
-
*/
|
|
870
|
-
private createMapInstance;
|
|
871
|
-
/**
|
|
872
|
-
* 绑定区域交互事件
|
|
873
|
-
*/
|
|
874
|
-
private bindAreaEvents;
|
|
875
|
-
/**
|
|
876
|
-
* 设置缩放级别
|
|
877
|
-
*/
|
|
878
|
-
setZoom(zoom: number): void;
|
|
879
|
-
/**
|
|
880
|
-
* 创建分组
|
|
881
|
-
* @param groupId 分组ID,用于后续管理
|
|
882
|
-
* @returns 分组实例
|
|
883
|
-
*/
|
|
884
|
-
createGroup(groupId: string): Promise<Awaited<ReturnType<Map_2['addGroup']>> | null>;
|
|
885
|
-
/**
|
|
886
|
-
* 获取分组
|
|
887
|
-
*/
|
|
888
|
-
getGroup(groupId: string): Awaited<ReturnType<Map_2['addGroup']>> | undefined;
|
|
889
|
-
/**
|
|
890
|
-
* 清除指定分组
|
|
891
|
-
*/
|
|
892
|
-
clearGroup(groupId: string): void;
|
|
893
|
-
/**
|
|
894
|
-
* 清除所有分组
|
|
895
|
-
*/
|
|
896
|
-
clearAllGroups(): void;
|
|
897
|
-
/**
|
|
898
|
-
* 清除区域关闭定时器(供 PortalModal 调用)
|
|
899
|
-
*/
|
|
900
|
-
clearAreaCloseTimer(): void;
|
|
901
|
-
triggerAreaLeave({ areaName }?: {
|
|
902
|
-
areaName: string;
|
|
903
|
-
}): void;
|
|
904
|
-
/**
|
|
905
|
-
* 销毁所有地图实例
|
|
906
|
-
*/
|
|
907
|
-
dispose(): void;
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
export declare interface MapManagerConfig {
|
|
911
|
-
key?: string;
|
|
912
|
-
container: HTMLElement;
|
|
913
|
-
controlsContainer?: HTMLElement;
|
|
914
|
-
assetsPrefix?: string;
|
|
915
|
-
fixConfig?: FixConfig;
|
|
916
|
-
raycasterPointsThreshold?: number;
|
|
917
|
-
mapPadding?: [number, number, number, number];
|
|
918
|
-
rmTemplateIdentifier?: boolean;
|
|
919
|
-
geojsonExtensions?: Record<string, any[]>;
|
|
920
|
-
mapConfigs?: Record<string, any>;
|
|
921
|
-
areaHoverMlistName?: Record<string, [string, string, number?]>;
|
|
922
|
-
distanceChangeMlistName?: Record<string, [string, string, number?][]>;
|
|
923
|
-
topAdcode?: number;
|
|
924
|
-
showBuildingOnlyWithoutChildren?: boolean;
|
|
925
|
-
clickHandleDrillDown?: boolean;
|
|
926
|
-
clickOusideBack?: boolean;
|
|
927
|
-
mapMultiplyScalar?: number;
|
|
721
|
+
declare interface MapLabelStyle {
|
|
722
|
+
color?: string;
|
|
723
|
+
fontSize?: number;
|
|
724
|
+
fontFamily?: string;
|
|
725
|
+
fontWeight?: string;
|
|
928
726
|
}
|
|
929
727
|
|
|
930
728
|
declare interface MapOptions extends BaseOptions {
|
|
931
729
|
adcode: number;
|
|
730
|
+
sceneBindings?: MapSceneBindings;
|
|
932
731
|
center?: [number, number];
|
|
933
732
|
parentBg?: boolean | number;
|
|
934
733
|
parentBgDepth?: number;
|
|
734
|
+
worldBgFull?: boolean;
|
|
935
735
|
topSegments?: number;
|
|
936
736
|
continentsBg?: boolean;
|
|
937
737
|
continentsBgDepth?: number;
|
|
938
|
-
|
|
939
|
-
mapDepth?: number[];
|
|
940
|
-
depthReference?: number[];
|
|
738
|
+
mapDepth?: number;
|
|
941
739
|
mapPadding?: [number, number, number, number];
|
|
942
740
|
fixGeojson?: Record<string, string>;
|
|
943
|
-
plateInCenter?: boolean;
|
|
944
|
-
clickHandleDrillDown?: boolean;
|
|
945
|
-
drillDownPlateInCenter?: boolean;
|
|
946
|
-
drillDownHideParent?: boolean;
|
|
947
|
-
drillDownRestrictions?: 'city' | 'district';
|
|
948
|
-
drillDownSecondLevelMats?: boolean;
|
|
949
|
-
drillDownThirdLevelMats?: boolean;
|
|
950
741
|
showDistrict?: boolean;
|
|
951
742
|
showLabel?: boolean | 'lite';
|
|
743
|
+
labelStyle?: MapLabelStyle;
|
|
744
|
+
labelOffsets?: Record<string, [number, number, number]>;
|
|
952
745
|
lineWidth?: number;
|
|
953
746
|
lineOffset?: number;
|
|
954
747
|
extrudeLineWidth?: number;
|
|
@@ -958,28 +751,72 @@ declare interface MapOptions extends BaseOptions {
|
|
|
958
751
|
projectionType?: 'mercator' | 'equirectangular' | 'winkel3';
|
|
959
752
|
polarAngle?: number;
|
|
960
753
|
azimuthAngle?: number;
|
|
961
|
-
showOneLevel?: boolean;
|
|
962
|
-
handleBackKeepCamvasState?: boolean;
|
|
963
754
|
worldPacificCentre?: boolean;
|
|
964
755
|
mapBoundary?: boolean;
|
|
965
756
|
mergeSide?: boolean;
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
757
|
+
/** switchMapRegion 时重建城市建筑、道路、河流等数据层。 */
|
|
758
|
+
cityOnMap?: boolean;
|
|
759
|
+
/** 大洲背景使用地图原点,不按经纬度再次定位。 */
|
|
760
|
+
continentsBgAtOrigin?: boolean;
|
|
761
|
+
/** 代码初始化空地图时是否创建默认聚光灯。 */
|
|
969
762
|
geojsonExtensions?: Record<string, GeoJSON_3 | string | number | (GeoJSON_3 | string | number)[]>;
|
|
763
|
+
geojsonMapReplace?: Record<string, GeoJSON_3 | string | number>;
|
|
764
|
+
extrudeLineGeojsonMapReplace?: Record<string, GeoJSON_3 | string | number>;
|
|
970
765
|
shadowMap?: boolean;
|
|
971
766
|
switchFixConfig?: SwitchFixConfig;
|
|
972
|
-
|
|
767
|
+
/** switchMapRegion 后按场景声明替换区域相关纹理。 */
|
|
768
|
+
regionTextureRules?: RegionTextureRule[];
|
|
769
|
+
/** 动态地图、城市数据和水面纹理的资源地址模板。 */
|
|
770
|
+
assetSources?: MapAssetSources;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
export declare interface MapRegionBackInteraction {
|
|
774
|
+
trigger: 'click' | 'clickOutside';
|
|
775
|
+
objectId: string;
|
|
776
|
+
filter?: SceneInteractionFilter;
|
|
777
|
+
action: {
|
|
778
|
+
type: 'backMapRegion';
|
|
779
|
+
};
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
declare interface MapRegionEnterTransitionOptions extends SceneEnterTransitionOptions {
|
|
783
|
+
sourceCamera?: [number, number, number, number, number, number];
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
export declare type MapRegionSceneResolver = (document: VisSceneDocument, adcode: number) => string | SceneViewportDocument | null | undefined | Promise<string | SceneViewportDocument | null | undefined>;
|
|
787
|
+
|
|
788
|
+
export declare interface MapRegionSwitchInteraction {
|
|
789
|
+
trigger: 'click';
|
|
790
|
+
objectId: string;
|
|
791
|
+
filter?: SceneInteractionFilter;
|
|
792
|
+
action: {
|
|
793
|
+
/** 先恢复目标层级模板,再把其中的地图切换到命中的行政区。 */
|
|
794
|
+
type: 'switchMapRegion';
|
|
795
|
+
sceneId: string;
|
|
796
|
+
adcode: 'clicked' | number;
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
/** 平台导出的运行时对象绑定,使用 Lead 的完整 key,不依赖命名规则。 */
|
|
801
|
+
declare interface MapSceneBindings {
|
|
802
|
+
container: string;
|
|
803
|
+
region: {
|
|
804
|
+
adcode: number;
|
|
805
|
+
object: string;
|
|
806
|
+
};
|
|
807
|
+
parentBackgrounds: string[];
|
|
808
|
+
continentsBackground?: string;
|
|
809
|
+
cities: string[];
|
|
973
810
|
}
|
|
974
811
|
|
|
975
812
|
declare class Model extends GroupObject {
|
|
976
|
-
options:
|
|
813
|
+
options: Options_7;
|
|
977
814
|
mixer: THREE.AnimationMixer | null;
|
|
978
815
|
clips: THREE.AnimationClip[];
|
|
979
816
|
actions: THREE.AnimationAction[];
|
|
980
817
|
actionStates: Record<string, boolean>;
|
|
981
818
|
objectType: string;
|
|
982
|
-
constructor(options:
|
|
819
|
+
constructor(options: Options_7);
|
|
983
820
|
create(): Promise<void>;
|
|
984
821
|
render(): void;
|
|
985
822
|
/**
|
|
@@ -1052,8 +889,16 @@ declare class Mountain extends GroupObject {
|
|
|
1052
889
|
rebuildFromScene(): void;
|
|
1053
890
|
}
|
|
1054
891
|
|
|
1055
|
-
declare interface Options {
|
|
1056
|
-
|
|
892
|
+
declare interface Options extends NonNullable<ConstructorParameters<typeof LineObject>[0]> {
|
|
893
|
+
from: number[];
|
|
894
|
+
to: number[];
|
|
895
|
+
control1?: number[];
|
|
896
|
+
control2?: number[];
|
|
897
|
+
radius?: number;
|
|
898
|
+
globe?: boolean;
|
|
899
|
+
color?: string;
|
|
900
|
+
lineWidth?: number;
|
|
901
|
+
offsetLoop?: boolean;
|
|
1057
902
|
}
|
|
1058
903
|
|
|
1059
904
|
declare interface Options_10 {
|
|
@@ -1101,33 +946,13 @@ declare interface Options_13 {
|
|
|
1101
946
|
map?: THREE.Texture | null;
|
|
1102
947
|
}
|
|
1103
948
|
|
|
1104
|
-
declare interface Options_2
|
|
1105
|
-
from: number[];
|
|
1106
|
-
to: number[];
|
|
1107
|
-
control1?: number[];
|
|
1108
|
-
control2?: number[];
|
|
1109
|
-
radius?: number;
|
|
1110
|
-
globe?: boolean;
|
|
1111
|
-
color?: string;
|
|
1112
|
-
lineWidth?: number;
|
|
1113
|
-
offsetLoop?: boolean;
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
declare interface Options_3 {
|
|
949
|
+
declare interface Options_2 {
|
|
1117
950
|
path?: THREE.Curve<THREE.Vector3>;
|
|
1118
951
|
radius?: number;
|
|
1119
952
|
multiplyScalar?: number;
|
|
1120
953
|
}
|
|
1121
954
|
|
|
1122
|
-
declare interface
|
|
1123
|
-
src?: string;
|
|
1124
|
-
autoPlay?: boolean;
|
|
1125
|
-
playbackSpeed?: number;
|
|
1126
|
-
serializedClips?: SerializedClip[];
|
|
1127
|
-
playingClipNames?: string[];
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
declare interface Options_5 {
|
|
955
|
+
declare interface Options_3 {
|
|
1131
956
|
uuid?: string;
|
|
1132
957
|
areaGroup?: boolean;
|
|
1133
958
|
geojson: GeoJSON_2;
|
|
@@ -1164,19 +989,32 @@ declare interface Options_5 {
|
|
|
1164
989
|
bloom?: boolean;
|
|
1165
990
|
}
|
|
1166
991
|
|
|
1167
|
-
declare interface
|
|
992
|
+
declare interface Options_4 {
|
|
1168
993
|
radius?: number;
|
|
1169
994
|
rotationY?: number;
|
|
1170
995
|
}
|
|
1171
996
|
|
|
1172
|
-
declare interface
|
|
997
|
+
declare interface Options_5 {
|
|
1173
998
|
radius?: number;
|
|
1174
999
|
}
|
|
1175
1000
|
|
|
1001
|
+
declare interface Options_6 {
|
|
1002
|
+
sprite?: boolean;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
declare interface Options_7 {
|
|
1006
|
+
src?: string;
|
|
1007
|
+
autoPlay?: boolean;
|
|
1008
|
+
playbackSpeed?: number;
|
|
1009
|
+
serializedClips?: SerializedClip[];
|
|
1010
|
+
playingClipNames?: string[];
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1176
1013
|
declare interface Options_8 {
|
|
1177
1014
|
scale: number;
|
|
1178
1015
|
depth: number;
|
|
1179
1016
|
assetsPrefix?: string;
|
|
1017
|
+
geojsonSource: string;
|
|
1180
1018
|
}
|
|
1181
1019
|
|
|
1182
1020
|
declare interface Options_9 {
|
|
@@ -1201,7 +1039,7 @@ declare class Plane extends MeshObject {
|
|
|
1201
1039
|
|
|
1202
1040
|
declare class PlaneMap extends GroupObject {
|
|
1203
1041
|
objectType: string;
|
|
1204
|
-
options: Required<Omit<
|
|
1042
|
+
options: Required<Omit<Options_3, 'bbox' | 'extrudeLineGeojson'>> & Pick<Options_3, 'bbox' | 'extrudeLineGeojson'>;
|
|
1205
1043
|
isActive: boolean;
|
|
1206
1044
|
groupArr: GroupObject[];
|
|
1207
1045
|
areaArr: ExtrudePolygonObject[];
|
|
@@ -1209,10 +1047,12 @@ declare class PlaneMap extends GroupObject {
|
|
|
1209
1047
|
mergeSideArea: ExtrudePolygonObject | null;
|
|
1210
1048
|
extrudelineArr?: LineObject[];
|
|
1211
1049
|
splitPolygons: number;
|
|
1212
|
-
constructor(options:
|
|
1050
|
+
constructor(options: Options_3);
|
|
1213
1051
|
create(): Promise<void>;
|
|
1052
|
+
private markGeneratedObjects;
|
|
1214
1053
|
private ensureExtrudeLineMaterials;
|
|
1215
1054
|
createExtrudeLines(): Promise<void>;
|
|
1055
|
+
createLines(lineMaterial?: MeshLineMaterial, bgLineMaterial?: MeshLineMaterial): Promise<LineObject[]>;
|
|
1216
1056
|
clearExtrudeLines(): void;
|
|
1217
1057
|
syncExtrudeLines(hasExtrudeLine?: boolean): Promise<void>;
|
|
1218
1058
|
mergeAreaSide(): Promise<void>;
|
|
@@ -1247,6 +1087,12 @@ declare class PlaneMap extends GroupObject {
|
|
|
1247
1087
|
deactive(): void;
|
|
1248
1088
|
render(): void;
|
|
1249
1089
|
rebuildFromScene(): void;
|
|
1090
|
+
private clearGeneratedRegionProperties;
|
|
1091
|
+
/**
|
|
1092
|
+
* 场景快照保存的是网格实际材质,options 中的 Material 会被导出器过滤。
|
|
1093
|
+
* 恢复完成后从生成对象反推下一次区域重建所需的运行时材质。
|
|
1094
|
+
*/
|
|
1095
|
+
private restoreMaterialOptionsFromScene;
|
|
1250
1096
|
toggleExtrudelineBloom(s: boolean): void;
|
|
1251
1097
|
active(): void;
|
|
1252
1098
|
dispose(): void;
|
|
@@ -1259,8 +1105,8 @@ declare class PlaneShadow extends MeshObject {
|
|
|
1259
1105
|
|
|
1260
1106
|
declare class Point extends BaseObject {
|
|
1261
1107
|
objectType: string;
|
|
1262
|
-
options:
|
|
1263
|
-
constructor(options:
|
|
1108
|
+
options: Options_6;
|
|
1109
|
+
constructor(options: Options_6);
|
|
1264
1110
|
get material(): THREE.MeshBasicMaterial | THREE.SpriteMaterial;
|
|
1265
1111
|
getMaterial(): THREE.MeshBasicMaterial | THREE.SpriteMaterial;
|
|
1266
1112
|
create(): Promise<void>;
|
|
@@ -1275,9 +1121,35 @@ declare class PointLight extends PointLightObject {
|
|
|
1275
1121
|
}
|
|
1276
1122
|
|
|
1277
1123
|
declare class RectAreaLight extends RectAreaLightObject {
|
|
1278
|
-
render(): void;
|
|
1279
1124
|
}
|
|
1280
1125
|
|
|
1126
|
+
declare interface RegionTextureRule {
|
|
1127
|
+
/** mList 中的材质 key,例如 plane#topMat。 */
|
|
1128
|
+
material: string;
|
|
1129
|
+
/** THREE.Material 上的纹理属性,例如 map、emissiveMap。 */
|
|
1130
|
+
property: string;
|
|
1131
|
+
/** 资源地址模板,支持 {adcode} 和 {level} 占位符。 */
|
|
1132
|
+
url?: string;
|
|
1133
|
+
/** adcode 到资源地址的显式映射,优先级高于 url。 */
|
|
1134
|
+
sources?: Record<string, string>;
|
|
1135
|
+
/** 复用同一材质上另一个纹理槽位的图片。 */
|
|
1136
|
+
copyFrom?: string;
|
|
1137
|
+
/** 仅在指定地图展示层级应用。 */
|
|
1138
|
+
levels?: string[];
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
export declare interface RemappedSceneDocument {
|
|
1142
|
+
entrySceneId: string;
|
|
1143
|
+
scenes: SceneViewportDocument[];
|
|
1144
|
+
idMap: Map<string, string>;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
/**
|
|
1148
|
+
* 复制一组场景并为它们分配新 ID,同时保持文档内部的场景跳转关系。
|
|
1149
|
+
* 用于把完整模板追加到另一个场景文档中。
|
|
1150
|
+
*/
|
|
1151
|
+
export declare function remapSceneDocumentIds(document: VisSceneDocument, createSceneId: (scene: SceneViewportDocument, index: number) => string): RemappedSceneDocument;
|
|
1152
|
+
|
|
1281
1153
|
declare class Ring extends MeshObject {
|
|
1282
1154
|
objectType: string;
|
|
1283
1155
|
create(): void;
|
|
@@ -1294,19 +1166,162 @@ declare class Road extends GroupObject {
|
|
|
1294
1166
|
dispose(): void;
|
|
1295
1167
|
}
|
|
1296
1168
|
|
|
1297
|
-
declare
|
|
1169
|
+
export declare const SCENE_DOCUMENT_FORMAT: "vis-scene";
|
|
1170
|
+
|
|
1171
|
+
export declare const SCENE_DOCUMENT_SCHEMA_VERSION: 2;
|
|
1172
|
+
|
|
1173
|
+
export declare interface SceneBackInteraction {
|
|
1174
|
+
trigger: 'click' | 'clickOutside';
|
|
1175
|
+
objectId: string;
|
|
1176
|
+
filter?: SceneInteractionFilter;
|
|
1177
|
+
action: {
|
|
1178
|
+
type: 'back';
|
|
1179
|
+
};
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
declare interface SceneControlsOptions {
|
|
1183
|
+
mouseLeft?: number | boolean;
|
|
1184
|
+
mouseRight?: number | boolean;
|
|
1185
|
+
mouseWheel?: number | boolean;
|
|
1186
|
+
mouseNone?: boolean;
|
|
1187
|
+
viewportPadding?: [number, number, number, number];
|
|
1188
|
+
autoRotateSpeed?: number;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
export declare interface SceneDocumentMarker {
|
|
1192
|
+
format: typeof SCENE_DOCUMENT_FORMAT;
|
|
1193
|
+
schemaVersion: number;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
declare interface SceneEnterTransitionOptions {
|
|
1197
|
+
duration: number;
|
|
1198
|
+
/** 动画初始状态布置完成后恢复渲染。 */
|
|
1199
|
+
onPrepared?: () => void;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
export declare type SceneInteraction = SceneSwitchInteraction | SceneBackInteraction | MapRegionSwitchInteraction | MapRegionBackInteraction;
|
|
1203
|
+
|
|
1204
|
+
export declare interface SceneInteractionFilter {
|
|
1205
|
+
mode: 'include' | 'exclude';
|
|
1206
|
+
objectIds?: string[];
|
|
1207
|
+
baseObjectTypes?: string[];
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
/**
|
|
1211
|
+
* 管理一个多场景文档。所有场景共享同一个 Pencil/Renderer,场景实例按 id 缓存。
|
|
1212
|
+
*/
|
|
1213
|
+
export declare class SceneManager extends Event_2 {
|
|
1214
|
+
private options;
|
|
1215
|
+
private document?;
|
|
1216
|
+
private runtimeHooks?;
|
|
1217
|
+
private instances;
|
|
1218
|
+
private currentSceneId;
|
|
1219
|
+
private history;
|
|
1220
|
+
private isSwitching;
|
|
1221
|
+
private isRegionSwitching;
|
|
1222
|
+
private pencil?;
|
|
1223
|
+
private debugInteraction;
|
|
1224
|
+
private enablePickDebug;
|
|
1225
|
+
private disposeInactiveScenes;
|
|
1226
|
+
constructor(options: SceneManagerInitOptions);
|
|
1227
|
+
private captureCamera;
|
|
1228
|
+
private playTransition;
|
|
1229
|
+
/** 接管一个已经恢复完成的场景,供编辑器首次加载时复用。 */
|
|
1230
|
+
attach(document: VisSceneDocument, sceneId: string, scene: Base): Base;
|
|
1231
|
+
/** 更新可编辑文档,并释放已经不属于文档的非活动场景实例。 */
|
|
1232
|
+
setDocument(document: VisSceneDocument): void;
|
|
1233
|
+
load(documentOrUrl: VisSceneDocument | string, hooks?: Record<string, any>): Promise<Base>;
|
|
1234
|
+
/**
|
|
1235
|
+
* 以指定地图模板和行政区直接启动,不先加载文档配置的入口场景。
|
|
1236
|
+
* 适用于宿主按路由或业务参数决定初始省、市、区的场景。
|
|
1237
|
+
*/
|
|
1238
|
+
loadMapRegion(documentOrUrl: VisSceneDocument | string, sceneId: string, adcode: number, hooks?: Record<string, any>): Promise<Map_2>;
|
|
1239
|
+
loadMapRegion(documentOrUrl: VisSceneDocument | string, adcode: number, resolveScene: MapRegionSceneResolver, hooks?: Record<string, any>): Promise<Map_2>;
|
|
1240
|
+
private loadDocument;
|
|
1241
|
+
switchScene(sceneId: string, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<Base | null>;
|
|
1242
|
+
/** 编辑器事务:在独立页面上修改参数并重建快照,成功后一起提交文档和实例。 */
|
|
1243
|
+
editScene(sceneId: string, edit: (scene: Base, definition: SceneViewportDocument) => Promise<SceneViewportDocument>, hooks?: Record<string, any>): Promise<Base>;
|
|
1244
|
+
back(hooks?: Record<string, any>): Promise<Base | null>;
|
|
1245
|
+
/**
|
|
1246
|
+
* 切到目标地图场景,并按 adcode 重建其中的地图。sceneId 不同时,语义等价于
|
|
1247
|
+
* switchScene(sceneId) 后 switchMapRegion(adcode),但候选场景只在两步都成功后提交,
|
|
1248
|
+
* 避免显示模板原始行政区、播放两次动画或产生两条返回历史。
|
|
1249
|
+
* 始终从文档基线构建隔离页面,避免对缓存实例反复施加缩放/删除修正。
|
|
1250
|
+
* 旧页面在构建期间保持完整;只有所有资源、几何和交互就绪才提交导航。
|
|
1251
|
+
*/
|
|
1252
|
+
switchMapRegion(sceneId: string, adcode: number, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<Map_2 | null>;
|
|
1253
|
+
/** 场景切换与区域切换共享一条返回历史。 */
|
|
1254
|
+
backMapRegion(hooks?: Record<string, any>): Promise<Base | null>;
|
|
1255
|
+
getCurrentSceneId(): string;
|
|
1256
|
+
getCurrentScene<T extends SceneType>(type: T): SceneTypeMap[T] | null;
|
|
1257
|
+
getCurrentScene(): Base | null;
|
|
1258
|
+
private getCurrentSceneByType;
|
|
1259
|
+
getScene<T extends SceneType>(sceneId: string, type: T): SceneTypeMap[T] | undefined;
|
|
1260
|
+
getScene(sceneId: string): Base | undefined;
|
|
1261
|
+
private getSceneByType;
|
|
1262
|
+
getDocument(): VisSceneDocument | undefined;
|
|
1263
|
+
private bindSceneInteractions;
|
|
1264
|
+
canBack(): boolean;
|
|
1265
|
+
private disposeInstances;
|
|
1266
|
+
dispose(): void;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
export declare interface SceneManagerBehaviorOptions {
|
|
1270
|
+
/** 编辑器模式下设为 false,避免绑定运行时点击跳转。 */
|
|
1271
|
+
bindInteractions?: boolean;
|
|
1272
|
+
/** 输出射线命中和场景交互诊断,仅用于开发排查。 */
|
|
1273
|
+
debugInteractions?: boolean;
|
|
1274
|
+
/** 创建场景后、恢复 JSON 前调用。 */
|
|
1275
|
+
prepareScene?: (scene: Base) => void;
|
|
1276
|
+
/** 是否保留非活动场景实例;编辑器可关闭以限制 GPU/内存占用。 */
|
|
1277
|
+
cacheScenes?: boolean;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
export declare type SceneManagerInitOptions = SceneManagerOptions & SceneManagerBehaviorOptions;
|
|
1281
|
+
|
|
1282
|
+
export declare interface SceneManagerOptions extends Pick<BaseOptions, 'container' | 'controlsContainer' | 'css2DContainer' | 'assetsPrefix' | 'pencilConfig' | 'logarithmicDepthBuffer' | 'tier' | 'observeParentScale'> {
|
|
1283
|
+
/** 动态行政区数据访问使用的授权 key。 */
|
|
1284
|
+
mapSwitchKey?: string;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
export declare interface SceneSwitchInteraction {
|
|
1288
|
+
trigger: 'click' | 'clickOutside';
|
|
1289
|
+
objectId: string;
|
|
1290
|
+
filter?: SceneInteractionFilter;
|
|
1291
|
+
action: {
|
|
1292
|
+
type: 'switchScene';
|
|
1293
|
+
sceneId: string;
|
|
1294
|
+
};
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
export declare interface SceneTransitionOptions {
|
|
1298
|
+
type?: 'fade' | 'mapDrill';
|
|
1299
|
+
duration?: number;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
export declare type SceneType = keyof SceneTypeMap;
|
|
1303
|
+
|
|
1304
|
+
export declare interface SceneTypeMap {
|
|
1305
|
+
base: Base;
|
|
1306
|
+
earth: Earth;
|
|
1307
|
+
map: Map_2;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
export declare interface SceneViewportDocument {
|
|
1311
|
+
id: string;
|
|
1298
1312
|
name: string;
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
children: SelectedMeta[];
|
|
1313
|
+
interactions?: SceneInteraction[];
|
|
1314
|
+
cs?: Record<string, number[]>;
|
|
1315
|
+
csa?: string;
|
|
1316
|
+
vis: {
|
|
1317
|
+
type: string;
|
|
1318
|
+
options: Record<string, any>;
|
|
1319
|
+
};
|
|
1320
|
+
scene: Record<string, any>;
|
|
1308
1321
|
}
|
|
1309
1322
|
|
|
1323
|
+
export declare function selectSceneDocument(document: VisSceneDocument, sceneId: string): VisSceneDocument;
|
|
1324
|
+
|
|
1310
1325
|
declare type SerializedClip = ReturnType<(typeof THREE.AnimationClip)['toJSON']>;
|
|
1311
1326
|
|
|
1312
1327
|
declare const sinusoidalInOut: ({ onUpdate, onComplete, backwards, }?: {
|
|
@@ -1333,8 +1348,8 @@ declare class Sphere extends MeshObject {
|
|
|
1333
1348
|
|
|
1334
1349
|
declare class SphereShadow extends MeshObject {
|
|
1335
1350
|
objectType: string;
|
|
1336
|
-
options: Required<
|
|
1337
|
-
constructor(options:
|
|
1351
|
+
options: Required<Options_5>;
|
|
1352
|
+
constructor(options: Options_5);
|
|
1338
1353
|
create(): Promise<void>;
|
|
1339
1354
|
rebuildFromScene(): void;
|
|
1340
1355
|
}
|
|
@@ -1366,14 +1381,21 @@ declare interface SwitchFixConfig {
|
|
|
1366
1381
|
r?: string[];
|
|
1367
1382
|
}
|
|
1368
1383
|
|
|
1384
|
+
export declare interface SwitchSceneOptions {
|
|
1385
|
+
/** 返回历史时不再记录当前场景。 */
|
|
1386
|
+
recordHistory?: boolean;
|
|
1387
|
+
/** false 关闭动画;地图场景之间默认 mapDrill,其他场景默认 fade。 */
|
|
1388
|
+
transition?: false | SceneTransitionOptions;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1369
1391
|
export { THREE }
|
|
1370
1392
|
|
|
1371
1393
|
declare const timeOut: (ms: number) => Promise<any>;
|
|
1372
1394
|
|
|
1373
1395
|
declare class Tube extends MeshObject {
|
|
1374
1396
|
objectType: string;
|
|
1375
|
-
options:
|
|
1376
|
-
constructor(options:
|
|
1397
|
+
options: Options_2;
|
|
1398
|
+
constructor(options: Options_2);
|
|
1377
1399
|
create(): void;
|
|
1378
1400
|
}
|
|
1379
1401
|
|
|
@@ -1381,7 +1403,16 @@ export { TWEEN }
|
|
|
1381
1403
|
|
|
1382
1404
|
export { Tween }
|
|
1383
1405
|
|
|
1384
|
-
export declare const VERSION = "0.
|
|
1406
|
+
export declare const VERSION = "0.32.0";
|
|
1407
|
+
|
|
1408
|
+
export declare interface VisSceneDocument extends SceneDocumentMarker {
|
|
1409
|
+
entrySceneId: string;
|
|
1410
|
+
scenes: SceneViewportDocument[];
|
|
1411
|
+
c?: Record<string, any>;
|
|
1412
|
+
d?: Record<string, any>;
|
|
1413
|
+
h?: Record<string, any>;
|
|
1414
|
+
s?: string;
|
|
1415
|
+
}
|
|
1385
1416
|
|
|
1386
1417
|
export { }
|
|
1387
1418
|
|