vis-core 0.31.33 → 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 +485 -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;
|
|
@@ -687,11 +621,9 @@ declare class Map_2 extends Base {
|
|
|
687
621
|
private _loadGeojsonFromConfig;
|
|
688
622
|
private _loadBaseGeojson;
|
|
689
623
|
private getGeojson;
|
|
690
|
-
|
|
691
|
-
saveCamvasState(type: 'userControls' | 'controls', index: number): void;
|
|
692
|
-
fixNear(adcode: number): void;
|
|
624
|
+
/* Excluded from this release type: buildRegion */
|
|
693
625
|
private calcPaddingFromReference;
|
|
694
|
-
fitTo(obj: BaseObject, { polarAngle, azimuthAngle, reference, z, handleStart, adcode, enableTransition, }?: {
|
|
626
|
+
fitTo(obj: BaseObject, { polarAngle, azimuthAngle, reference, z, handleStart, adcode, enableTransition, smoothTime, }?: {
|
|
695
627
|
adcode?: number;
|
|
696
628
|
polarAngle?: number;
|
|
697
629
|
azimuthAngle?: number;
|
|
@@ -701,9 +633,11 @@ declare class Map_2 extends Base {
|
|
|
701
633
|
center?: [number, number];
|
|
702
634
|
};
|
|
703
635
|
enableTransition?: boolean;
|
|
636
|
+
smoothTime?: number;
|
|
704
637
|
z?: number;
|
|
705
638
|
handleStart?: () => void;
|
|
706
639
|
}): Promise<void>;
|
|
640
|
+
private regionAppearance?;
|
|
707
641
|
drawPlaneMap({ geojson, extrudeLineGeojson, bbox, depth, extrudelineBloom, adcode, }: {
|
|
708
642
|
geojson: GeoJSON_3;
|
|
709
643
|
extrudeLineGeojson?: GeoJSON_3;
|
|
@@ -712,10 +646,6 @@ declare class Map_2 extends Base {
|
|
|
712
646
|
adcode: number;
|
|
713
647
|
extrudelineBloom?: boolean;
|
|
714
648
|
}): Promise<PlaneMap>;
|
|
715
|
-
private handleBack;
|
|
716
|
-
handleLookBack(duration?: number): Promise<void>;
|
|
717
|
-
compareLocations(currentO: any[], destinationO: any[]): number[];
|
|
718
|
-
private setAdcode;
|
|
719
649
|
setPadding(padding: [number, number, number, number], fitTo?: boolean, enableTransition?: boolean): void;
|
|
720
650
|
findAdcodeInfo(adcode: number): {
|
|
721
651
|
adcode: number;
|
|
@@ -735,7 +665,8 @@ declare class Map_2 extends Base {
|
|
|
735
665
|
* 根据当前 options.center 重新计算投影
|
|
736
666
|
*/
|
|
737
667
|
private updateProjection;
|
|
738
|
-
|
|
668
|
+
protected onSceneRestored(): Promise<void>;
|
|
669
|
+
getSceneBindings(): MapSceneBindings;
|
|
739
670
|
/**
|
|
740
671
|
* 快照:捕获 PlaneMap 上用户添加的叠加对象
|
|
741
672
|
*/
|
|
@@ -749,41 +680,30 @@ declare class Map_2 extends Base {
|
|
|
749
680
|
* 根据 switchFixConfig 对场景中的对象做位置/缩放修复
|
|
750
681
|
*/
|
|
751
682
|
private applySwitchFixConfig;
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
Area: Area;
|
|
759
|
-
Building: Building;
|
|
760
|
-
Road: Road;
|
|
761
|
-
Point: Point;
|
|
762
|
-
Arc: Arc;
|
|
763
|
-
Model: Model;
|
|
764
|
-
Plane: Plane;
|
|
765
|
-
PlaneShadow: PlaneShadow;
|
|
766
|
-
Sphere: Sphere;
|
|
767
|
-
Sprite: Sprite;
|
|
768
|
-
Box: Box;
|
|
769
|
-
Circle: Circle;
|
|
770
|
-
Tube: Tube;
|
|
771
|
-
Ring: Ring;
|
|
772
|
-
AmbientLight: AmbientLight;
|
|
773
|
-
DirectionalLight: DirectionalLight;
|
|
774
|
-
PointLight: PointLight;
|
|
775
|
-
SpotLight: SpotLight;
|
|
776
|
-
HemisphereLight: HemisphereLight;
|
|
777
|
-
RectAreaLight: RectAreaLight;
|
|
778
|
-
Node: NodeObject;
|
|
779
|
-
ExtrudePolygon: typeof ExtrudePolygonObject;
|
|
780
|
-
Line: LineObject;
|
|
781
|
-
Group: typeof GroupObject;
|
|
782
|
-
}): Promise<void>;
|
|
783
|
-
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;
|
|
784
689
|
}
|
|
785
690
|
export { Map_2 as Map }
|
|
786
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
|
+
|
|
787
707
|
declare interface MapCityOptions extends MapOptions {
|
|
788
708
|
cacheCity?: boolean;
|
|
789
709
|
nearbyCities?: boolean | 'full';
|
|
@@ -798,139 +718,16 @@ declare interface MapCityOptions extends MapOptions {
|
|
|
798
718
|
citySSAO?: boolean;
|
|
799
719
|
}
|
|
800
720
|
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
private container;
|
|
807
|
-
private controlsContainer?;
|
|
808
|
-
private assetsPrefix?;
|
|
809
|
-
private fixConfig?;
|
|
810
|
-
private raycasterPointsThreshold;
|
|
811
|
-
private readonly MAX_ZOOM_FACTOR;
|
|
812
|
-
private readonly MIN_ZOOM_FACTOR;
|
|
813
|
-
private mapInstances;
|
|
814
|
-
private mapDistances;
|
|
815
|
-
private mapConfigs;
|
|
816
|
-
private mapReference;
|
|
817
|
-
private mapBloomConfig;
|
|
818
|
-
private currentMap;
|
|
819
|
-
private currentZoom;
|
|
820
|
-
private mapMultiplyScalar;
|
|
821
|
-
private mapPadding?;
|
|
822
|
-
private isInitializing;
|
|
823
|
-
private rmTemplateIdentifier;
|
|
824
|
-
private geojsonExtensions;
|
|
825
|
-
private areaHoverMlistName;
|
|
826
|
-
private distanceChangeMlistName;
|
|
827
|
-
private showBuildingOnlyWithoutChildren;
|
|
828
|
-
private groups;
|
|
829
|
-
private areaCloseTimer;
|
|
830
|
-
private key;
|
|
831
|
-
private topAdcode;
|
|
832
|
-
private clickHandleDrillDown;
|
|
833
|
-
private clickOusideBack;
|
|
834
|
-
static findAdcodeInfoByName: (name: string) => {
|
|
835
|
-
adcode: number;
|
|
836
|
-
lng: number;
|
|
837
|
-
lat: number;
|
|
838
|
-
name: string;
|
|
839
|
-
level: string;
|
|
840
|
-
parent: number;
|
|
841
|
-
c: number[];
|
|
842
|
-
b: number[];
|
|
843
|
-
} | undefined;
|
|
844
|
-
static getAdcodeShowLevel: (adcode: number, fix?: boolean) => string | undefined;
|
|
845
|
-
static findAdcodeInfo: (adcode: number) => {
|
|
846
|
-
adcode: number;
|
|
847
|
-
lng: number;
|
|
848
|
-
lat: number;
|
|
849
|
-
name: string;
|
|
850
|
-
level: string;
|
|
851
|
-
parent: number;
|
|
852
|
-
c: number[];
|
|
853
|
-
b: number[];
|
|
854
|
-
} | undefined;
|
|
855
|
-
static extendsAdcodeAll: (cb: any) => void;
|
|
856
|
-
constructor(config: MapManagerConfig);
|
|
857
|
-
/**
|
|
858
|
-
* 获取当前地图实例
|
|
859
|
-
*/
|
|
860
|
-
getCurrentMap(): Map_2 | null;
|
|
861
|
-
/**
|
|
862
|
-
* 获取当前缩放级别
|
|
863
|
-
*/
|
|
864
|
-
getCurrentZoom(): number;
|
|
865
|
-
/**
|
|
866
|
-
* 初始化地图
|
|
867
|
-
*/
|
|
868
|
-
showMap(adcodeArr: number[], fixedAdcode?: boolean): Promise<Map_2 | null>;
|
|
869
|
-
/**
|
|
870
|
-
* 创建地图实例
|
|
871
|
-
*/
|
|
872
|
-
private createMapInstance;
|
|
873
|
-
/**
|
|
874
|
-
* 绑定区域交互事件
|
|
875
|
-
*/
|
|
876
|
-
private bindAreaEvents;
|
|
877
|
-
/**
|
|
878
|
-
* 设置缩放级别
|
|
879
|
-
*/
|
|
880
|
-
setZoom(zoom: number): void;
|
|
881
|
-
/**
|
|
882
|
-
* 创建分组
|
|
883
|
-
* @param groupId 分组ID,用于后续管理
|
|
884
|
-
* @returns 分组实例
|
|
885
|
-
*/
|
|
886
|
-
createGroup(groupId: string): Promise<Awaited<ReturnType<Map_2['addGroup']>> | null>;
|
|
887
|
-
/**
|
|
888
|
-
* 获取分组
|
|
889
|
-
*/
|
|
890
|
-
getGroup(groupId: string): Awaited<ReturnType<Map_2['addGroup']>> | undefined;
|
|
891
|
-
/**
|
|
892
|
-
* 清除指定分组
|
|
893
|
-
*/
|
|
894
|
-
clearGroup(groupId: string): void;
|
|
895
|
-
/**
|
|
896
|
-
* 清除所有分组
|
|
897
|
-
*/
|
|
898
|
-
clearAllGroups(): void;
|
|
899
|
-
/**
|
|
900
|
-
* 清除区域关闭定时器(供 PortalModal 调用)
|
|
901
|
-
*/
|
|
902
|
-
clearAreaCloseTimer(): void;
|
|
903
|
-
triggerAreaLeave({ areaName }?: {
|
|
904
|
-
areaName: string;
|
|
905
|
-
}): void;
|
|
906
|
-
/**
|
|
907
|
-
* 销毁所有地图实例
|
|
908
|
-
*/
|
|
909
|
-
dispose(): void;
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
export declare interface MapManagerConfig {
|
|
913
|
-
key?: string;
|
|
914
|
-
container: HTMLElement;
|
|
915
|
-
controlsContainer?: HTMLElement;
|
|
916
|
-
assetsPrefix?: string;
|
|
917
|
-
fixConfig?: FixConfig;
|
|
918
|
-
raycasterPointsThreshold?: number;
|
|
919
|
-
mapPadding?: [number, number, number, number];
|
|
920
|
-
rmTemplateIdentifier?: boolean;
|
|
921
|
-
geojsonExtensions?: Record<string, any[]>;
|
|
922
|
-
mapConfigs?: Record<string, any>;
|
|
923
|
-
areaHoverMlistName?: Record<string, [string, string, number?]>;
|
|
924
|
-
distanceChangeMlistName?: Record<string, [string, string, number?][]>;
|
|
925
|
-
topAdcode?: number;
|
|
926
|
-
showBuildingOnlyWithoutChildren?: boolean;
|
|
927
|
-
clickHandleDrillDown?: boolean;
|
|
928
|
-
clickOusideBack?: boolean;
|
|
929
|
-
mapMultiplyScalar?: number;
|
|
721
|
+
declare interface MapLabelStyle {
|
|
722
|
+
color?: string;
|
|
723
|
+
fontSize?: number;
|
|
724
|
+
fontFamily?: string;
|
|
725
|
+
fontWeight?: string;
|
|
930
726
|
}
|
|
931
727
|
|
|
932
728
|
declare interface MapOptions extends BaseOptions {
|
|
933
729
|
adcode: number;
|
|
730
|
+
sceneBindings?: MapSceneBindings;
|
|
934
731
|
center?: [number, number];
|
|
935
732
|
parentBg?: boolean | number;
|
|
936
733
|
parentBgDepth?: number;
|
|
@@ -938,20 +735,13 @@ declare interface MapOptions extends BaseOptions {
|
|
|
938
735
|
topSegments?: number;
|
|
939
736
|
continentsBg?: boolean;
|
|
940
737
|
continentsBgDepth?: number;
|
|
941
|
-
|
|
942
|
-
mapDepth?: number[];
|
|
943
|
-
depthReference?: number[];
|
|
738
|
+
mapDepth?: number;
|
|
944
739
|
mapPadding?: [number, number, number, number];
|
|
945
740
|
fixGeojson?: Record<string, string>;
|
|
946
|
-
plateInCenter?: boolean;
|
|
947
|
-
clickHandleDrillDown?: boolean;
|
|
948
|
-
drillDownPlateInCenter?: boolean;
|
|
949
|
-
drillDownHideParent?: boolean;
|
|
950
|
-
drillDownRestrictions?: 'city' | 'district';
|
|
951
|
-
drillDownSecondLevelMats?: boolean;
|
|
952
|
-
drillDownThirdLevelMats?: boolean;
|
|
953
741
|
showDistrict?: boolean;
|
|
954
742
|
showLabel?: boolean | 'lite';
|
|
743
|
+
labelStyle?: MapLabelStyle;
|
|
744
|
+
labelOffsets?: Record<string, [number, number, number]>;
|
|
955
745
|
lineWidth?: number;
|
|
956
746
|
lineOffset?: number;
|
|
957
747
|
extrudeLineWidth?: number;
|
|
@@ -961,30 +751,72 @@ declare interface MapOptions extends BaseOptions {
|
|
|
961
751
|
projectionType?: 'mercator' | 'equirectangular' | 'winkel3';
|
|
962
752
|
polarAngle?: number;
|
|
963
753
|
azimuthAngle?: number;
|
|
964
|
-
showOneLevel?: boolean;
|
|
965
|
-
handleBackKeepCamvasState?: boolean;
|
|
966
754
|
worldPacificCentre?: boolean;
|
|
967
755
|
mapBoundary?: boolean;
|
|
968
756
|
mergeSide?: boolean;
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
757
|
+
/** switchMapRegion 时重建城市建筑、道路、河流等数据层。 */
|
|
758
|
+
cityOnMap?: boolean;
|
|
759
|
+
/** 大洲背景使用地图原点,不按经纬度再次定位。 */
|
|
760
|
+
continentsBgAtOrigin?: boolean;
|
|
761
|
+
/** 代码初始化空地图时是否创建默认聚光灯。 */
|
|
972
762
|
geojsonExtensions?: Record<string, GeoJSON_3 | string | number | (GeoJSON_3 | string | number)[]>;
|
|
973
763
|
geojsonMapReplace?: Record<string, GeoJSON_3 | string | number>;
|
|
974
764
|
extrudeLineGeojsonMapReplace?: Record<string, GeoJSON_3 | string | number>;
|
|
975
765
|
shadowMap?: boolean;
|
|
976
766
|
switchFixConfig?: SwitchFixConfig;
|
|
977
|
-
|
|
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[];
|
|
978
810
|
}
|
|
979
811
|
|
|
980
812
|
declare class Model extends GroupObject {
|
|
981
|
-
options:
|
|
813
|
+
options: Options_7;
|
|
982
814
|
mixer: THREE.AnimationMixer | null;
|
|
983
815
|
clips: THREE.AnimationClip[];
|
|
984
816
|
actions: THREE.AnimationAction[];
|
|
985
817
|
actionStates: Record<string, boolean>;
|
|
986
818
|
objectType: string;
|
|
987
|
-
constructor(options:
|
|
819
|
+
constructor(options: Options_7);
|
|
988
820
|
create(): Promise<void>;
|
|
989
821
|
render(): void;
|
|
990
822
|
/**
|
|
@@ -1057,8 +889,16 @@ declare class Mountain extends GroupObject {
|
|
|
1057
889
|
rebuildFromScene(): void;
|
|
1058
890
|
}
|
|
1059
891
|
|
|
1060
|
-
declare interface Options {
|
|
1061
|
-
|
|
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;
|
|
1062
902
|
}
|
|
1063
903
|
|
|
1064
904
|
declare interface Options_10 {
|
|
@@ -1106,33 +946,13 @@ declare interface Options_13 {
|
|
|
1106
946
|
map?: THREE.Texture | null;
|
|
1107
947
|
}
|
|
1108
948
|
|
|
1109
|
-
declare interface Options_2
|
|
1110
|
-
from: number[];
|
|
1111
|
-
to: number[];
|
|
1112
|
-
control1?: number[];
|
|
1113
|
-
control2?: number[];
|
|
1114
|
-
radius?: number;
|
|
1115
|
-
globe?: boolean;
|
|
1116
|
-
color?: string;
|
|
1117
|
-
lineWidth?: number;
|
|
1118
|
-
offsetLoop?: boolean;
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
declare interface Options_3 {
|
|
949
|
+
declare interface Options_2 {
|
|
1122
950
|
path?: THREE.Curve<THREE.Vector3>;
|
|
1123
951
|
radius?: number;
|
|
1124
952
|
multiplyScalar?: number;
|
|
1125
953
|
}
|
|
1126
954
|
|
|
1127
|
-
declare interface
|
|
1128
|
-
src?: string;
|
|
1129
|
-
autoPlay?: boolean;
|
|
1130
|
-
playbackSpeed?: number;
|
|
1131
|
-
serializedClips?: SerializedClip[];
|
|
1132
|
-
playingClipNames?: string[];
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
|
-
declare interface Options_5 {
|
|
955
|
+
declare interface Options_3 {
|
|
1136
956
|
uuid?: string;
|
|
1137
957
|
areaGroup?: boolean;
|
|
1138
958
|
geojson: GeoJSON_2;
|
|
@@ -1169,19 +989,32 @@ declare interface Options_5 {
|
|
|
1169
989
|
bloom?: boolean;
|
|
1170
990
|
}
|
|
1171
991
|
|
|
1172
|
-
declare interface
|
|
992
|
+
declare interface Options_4 {
|
|
1173
993
|
radius?: number;
|
|
1174
994
|
rotationY?: number;
|
|
1175
995
|
}
|
|
1176
996
|
|
|
1177
|
-
declare interface
|
|
997
|
+
declare interface Options_5 {
|
|
1178
998
|
radius?: number;
|
|
1179
999
|
}
|
|
1180
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
|
+
|
|
1181
1013
|
declare interface Options_8 {
|
|
1182
1014
|
scale: number;
|
|
1183
1015
|
depth: number;
|
|
1184
1016
|
assetsPrefix?: string;
|
|
1017
|
+
geojsonSource: string;
|
|
1185
1018
|
}
|
|
1186
1019
|
|
|
1187
1020
|
declare interface Options_9 {
|
|
@@ -1206,7 +1039,7 @@ declare class Plane extends MeshObject {
|
|
|
1206
1039
|
|
|
1207
1040
|
declare class PlaneMap extends GroupObject {
|
|
1208
1041
|
objectType: string;
|
|
1209
|
-
options: Required<Omit<
|
|
1042
|
+
options: Required<Omit<Options_3, 'bbox' | 'extrudeLineGeojson'>> & Pick<Options_3, 'bbox' | 'extrudeLineGeojson'>;
|
|
1210
1043
|
isActive: boolean;
|
|
1211
1044
|
groupArr: GroupObject[];
|
|
1212
1045
|
areaArr: ExtrudePolygonObject[];
|
|
@@ -1214,10 +1047,12 @@ declare class PlaneMap extends GroupObject {
|
|
|
1214
1047
|
mergeSideArea: ExtrudePolygonObject | null;
|
|
1215
1048
|
extrudelineArr?: LineObject[];
|
|
1216
1049
|
splitPolygons: number;
|
|
1217
|
-
constructor(options:
|
|
1050
|
+
constructor(options: Options_3);
|
|
1218
1051
|
create(): Promise<void>;
|
|
1052
|
+
private markGeneratedObjects;
|
|
1219
1053
|
private ensureExtrudeLineMaterials;
|
|
1220
1054
|
createExtrudeLines(): Promise<void>;
|
|
1055
|
+
createLines(lineMaterial?: MeshLineMaterial, bgLineMaterial?: MeshLineMaterial): Promise<LineObject[]>;
|
|
1221
1056
|
clearExtrudeLines(): void;
|
|
1222
1057
|
syncExtrudeLines(hasExtrudeLine?: boolean): Promise<void>;
|
|
1223
1058
|
mergeAreaSide(): Promise<void>;
|
|
@@ -1252,6 +1087,12 @@ declare class PlaneMap extends GroupObject {
|
|
|
1252
1087
|
deactive(): void;
|
|
1253
1088
|
render(): void;
|
|
1254
1089
|
rebuildFromScene(): void;
|
|
1090
|
+
private clearGeneratedRegionProperties;
|
|
1091
|
+
/**
|
|
1092
|
+
* 场景快照保存的是网格实际材质,options 中的 Material 会被导出器过滤。
|
|
1093
|
+
* 恢复完成后从生成对象反推下一次区域重建所需的运行时材质。
|
|
1094
|
+
*/
|
|
1095
|
+
private restoreMaterialOptionsFromScene;
|
|
1255
1096
|
toggleExtrudelineBloom(s: boolean): void;
|
|
1256
1097
|
active(): void;
|
|
1257
1098
|
dispose(): void;
|
|
@@ -1264,8 +1105,8 @@ declare class PlaneShadow extends MeshObject {
|
|
|
1264
1105
|
|
|
1265
1106
|
declare class Point extends BaseObject {
|
|
1266
1107
|
objectType: string;
|
|
1267
|
-
options:
|
|
1268
|
-
constructor(options:
|
|
1108
|
+
options: Options_6;
|
|
1109
|
+
constructor(options: Options_6);
|
|
1269
1110
|
get material(): THREE.MeshBasicMaterial | THREE.SpriteMaterial;
|
|
1270
1111
|
getMaterial(): THREE.MeshBasicMaterial | THREE.SpriteMaterial;
|
|
1271
1112
|
create(): Promise<void>;
|
|
@@ -1280,9 +1121,35 @@ declare class PointLight extends PointLightObject {
|
|
|
1280
1121
|
}
|
|
1281
1122
|
|
|
1282
1123
|
declare class RectAreaLight extends RectAreaLightObject {
|
|
1283
|
-
render(): void;
|
|
1284
1124
|
}
|
|
1285
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
|
+
|
|
1286
1153
|
declare class Ring extends MeshObject {
|
|
1287
1154
|
objectType: string;
|
|
1288
1155
|
create(): void;
|
|
@@ -1299,19 +1166,162 @@ declare class Road extends GroupObject {
|
|
|
1299
1166
|
dispose(): void;
|
|
1300
1167
|
}
|
|
1301
1168
|
|
|
1302
|
-
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;
|
|
1303
1312
|
name: string;
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
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>;
|
|
1313
1321
|
}
|
|
1314
1322
|
|
|
1323
|
+
export declare function selectSceneDocument(document: VisSceneDocument, sceneId: string): VisSceneDocument;
|
|
1324
|
+
|
|
1315
1325
|
declare type SerializedClip = ReturnType<(typeof THREE.AnimationClip)['toJSON']>;
|
|
1316
1326
|
|
|
1317
1327
|
declare const sinusoidalInOut: ({ onUpdate, onComplete, backwards, }?: {
|
|
@@ -1338,8 +1348,8 @@ declare class Sphere extends MeshObject {
|
|
|
1338
1348
|
|
|
1339
1349
|
declare class SphereShadow extends MeshObject {
|
|
1340
1350
|
objectType: string;
|
|
1341
|
-
options: Required<
|
|
1342
|
-
constructor(options:
|
|
1351
|
+
options: Required<Options_5>;
|
|
1352
|
+
constructor(options: Options_5);
|
|
1343
1353
|
create(): Promise<void>;
|
|
1344
1354
|
rebuildFromScene(): void;
|
|
1345
1355
|
}
|
|
@@ -1371,14 +1381,21 @@ declare interface SwitchFixConfig {
|
|
|
1371
1381
|
r?: string[];
|
|
1372
1382
|
}
|
|
1373
1383
|
|
|
1384
|
+
export declare interface SwitchSceneOptions {
|
|
1385
|
+
/** 返回历史时不再记录当前场景。 */
|
|
1386
|
+
recordHistory?: boolean;
|
|
1387
|
+
/** false 关闭动画;地图场景之间默认 mapDrill,其他场景默认 fade。 */
|
|
1388
|
+
transition?: false | SceneTransitionOptions;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1374
1391
|
export { THREE }
|
|
1375
1392
|
|
|
1376
1393
|
declare const timeOut: (ms: number) => Promise<any>;
|
|
1377
1394
|
|
|
1378
1395
|
declare class Tube extends MeshObject {
|
|
1379
1396
|
objectType: string;
|
|
1380
|
-
options:
|
|
1381
|
-
constructor(options:
|
|
1397
|
+
options: Options_2;
|
|
1398
|
+
constructor(options: Options_2);
|
|
1382
1399
|
create(): void;
|
|
1383
1400
|
}
|
|
1384
1401
|
|
|
@@ -1386,7 +1403,16 @@ export { TWEEN }
|
|
|
1386
1403
|
|
|
1387
1404
|
export { Tween }
|
|
1388
1405
|
|
|
1389
|
-
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
|
+
}
|
|
1390
1416
|
|
|
1391
1417
|
export { }
|
|
1392
1418
|
|