vis-core 0.30.15 → 0.31.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 CHANGED
@@ -1,32 +1,38 @@
1
+ import { AmbientLightObject } from 'gl-draw';
1
2
  import { BaseObject } from 'gl-draw';
2
- import { ConicPolygon } from 'gl-draw';
3
3
  import { default as default_2 } from 'gl-draw';
4
+ import { DirectionalLightObject } from 'gl-draw';
4
5
  import { EventEmitter } from 'events';
5
- import { ExtrudePolygon } from 'gl-draw';
6
+ import { ExtrudePolygonObject } from 'gl-draw';
6
7
  import { FeatureCollection } from 'geojson';
7
8
  import { GeoJsonProperties } from 'geojson';
8
9
  import { GeoProjection } from 'd3-geo';
9
- import { Group } from 'gl-draw';
10
+ import { GroupObject } from 'gl-draw';
11
+ import { HemisphereLightObject } from 'gl-draw';
10
12
  import { Lead } from 'gl-draw';
11
- import { Light as Light_2 } from 'gl-draw';
12
- import { Line } from 'gl-draw';
13
- import { Line2 } from 'gl-draw';
13
+ import { LineObject } from 'gl-draw';
14
14
  import { Listener } from 'events';
15
15
  import { MeshLineMaterial } from 'gl-draw';
16
+ import { MeshObject } from 'gl-draw';
16
17
  import { MultiPolygon } from 'geojson';
17
- import { Node as Node_2 } from 'gl-draw';
18
+ import { NodeObject } from 'gl-draw';
18
19
  import { PickFunctionsItem } from 'gl-draw';
20
+ import { PointLightObject } from 'gl-draw';
19
21
  import { Polygon } from 'geojson';
20
22
  import { Position } from 'geojson';
23
+ import { RectAreaLightObject } from 'gl-draw';
21
24
  import { RoomEnvironment } from 'three/examples/jsm/environments/RoomEnvironment.js';
25
+ import { SpotLightObject } from 'gl-draw';
26
+ import { SpriteObject } from 'gl-draw';
22
27
  import * as THREE from 'three';
23
28
  import { default as TWEEN } from 'three/examples/jsm/libs/tween.module.js';
24
29
  import { Tween } from 'three/examples/jsm/libs/tween.module.js';
25
30
  import { Water } from './Water2';
26
31
 
27
- export declare const access: {
28
- token: string;
29
- };
32
+ declare class AmbientLight extends AmbientLightObject {
33
+ constructor(...options: ConstructorParameters<typeof AmbientLightObject>);
34
+ render(): void;
35
+ }
30
36
 
31
37
  export declare namespace animationUtils {
32
38
  export {
@@ -39,17 +45,23 @@ export declare namespace animationUtils {
39
45
  }
40
46
  }
41
47
 
42
- declare class Arc extends BaseObject {
43
- options: Options_4;
44
- line: Line;
48
+ declare class Arc extends LineObject {
49
+ objectType: string;
50
+ options: Options_2;
45
51
  helperMeshPosition?: THREE.Vector3[];
46
- constructor(options: Options_4);
47
- static getInitOptions(pencil: default_2, options: Options_4): {
52
+ constructor(options: Options_2);
53
+ static getInitOptions(pencil: default_2, options: Options_2): {
48
54
  from: THREE.Vector3Tuple;
49
55
  to: THREE.Vector3Tuple;
50
56
  };
51
57
  create(): Promise<void>;
52
- instantiate(ops?: any): Promise<this>;
58
+ instantiate(ops: Parameters<BaseObject['instantiate']>[0]): Promise<this>;
59
+ line: {
60
+ options: {
61
+ nodes: THREE.Vector3[];
62
+ };
63
+ };
64
+ private _tempCurve;
53
65
  setPath(from: THREE.Vector3 | number[], to: THREE.Vector3 | number[], radius: number, setPointWidth?: (p: number) => number): void;
54
66
  pickTube: Tube | null;
55
67
  addPickTarget(radius?: number, show?: boolean): Promise<Tube>;
@@ -64,81 +76,47 @@ declare class Arc extends BaseObject {
64
76
  }): void;
65
77
  update(): void;
66
78
  render(): void;
67
- dispose(): void;
68
79
  }
69
80
 
70
- declare class Area extends BaseObject {
71
- options: Options_10;
72
- area: ExtrudePolygon[];
73
- constructor(options: Options_10);
81
+ declare class Area extends GroupObject {
82
+ objectType: string;
83
+ options: Options_7;
84
+ area: ExtrudePolygonObject[];
85
+ constructor(options: Options_7);
74
86
  create(): Promise<void>;
87
+ rebuildFromScene(): void;
75
88
  }
76
89
 
77
90
  export declare class Base extends Camera {
78
91
  static VisName: string;
92
+ private static _loadingCount;
79
93
  playing: boolean;
80
94
  leftTruck: boolean;
81
95
  options: BaseOptions;
82
96
  showState: boolean;
83
97
  settings: Record<string, any>;
84
- delLoadArr?: string[];
85
98
  extendsOptions: Record<string, any>;
86
- leadObjs: {
87
- Plane: Plane;
88
- CrossPlane: CrossPlane;
89
- PlaneShadow: PlaneShadow;
90
- Ring: Ring;
91
- Sphere: Sphere;
92
- Sprite: Sprite;
93
- Tetrahedron: Tetrahedron;
94
- Torus: Torus;
95
- TorusKnot: TorusKnot;
96
- Tube: Tube;
97
- Box: Box;
98
- Capsule: Capsule;
99
- Circle: Circle;
100
- Cylinder: Cylinder;
101
- Dodecahedron: Dodecahedron;
102
- Icosahedron: Icosahedron;
103
- Lathe: Lathe;
104
- Octahedron: Octahedron;
105
- Node: typeof Node_2;
106
- Line: typeof Line;
107
- Line2: Line2;
108
- ExtrudePolygon: ExtrudePolygon;
109
- ConicPolygon: ConicPolygon;
110
- Group: Group;
111
- Light: Light;
112
- Point: Point;
113
- Arc: typeof Arc;
114
- Model: Model;
115
- };
116
- lead: Lead<typeof objs>;
99
+ lead: Lead;
117
100
  mList: default_2['mList'];
118
101
  tier0: boolean;
119
102
  pmremGenerator: THREE.PMREMGenerator | null;
120
103
  re: RoomEnvironment | null;
121
104
  roomEnvMap?: THREE.Texture;
122
105
  visName: string;
123
- editor?: Editor;
124
106
  publicDir: Record<string, string>;
125
107
  constructor(options: BaseOptions);
126
108
  private showDetectRes;
127
109
  setOptions(options: Record<string, any>): void;
128
- _baseObjectByUuid: Editor['baseObjectByUuid'];
129
- _objectByUuid: Editor['objectByUuid'];
130
- get fromJSON(): (jsonOrUrl: Record<string, any> | string, hooks?: Record<string, any>) => Promise<Record<string, any>>;
131
- get baseObjectByUuid(): {
132
- (key: `arc${string}`): Arc;
133
- (key: `sprite${string}`): Sprite;
134
- (key: string): BaseObject;
135
- };
136
- get objectByUuid(): (key: string) => THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap> | undefined;
137
- get getDataURL(): () => string;
110
+ fromJSON(jsonOrUrl: Record<string, any> | string, hooksE?: Record<string, any>): Promise<void>;
111
+ private parseHooks;
138
112
  loaderAdd(...args: any): void;
113
+ initGroup(): Promise<void>;
139
114
  initMaterial(...args: any): Promise<void>;
140
115
  initVis(...args: any): Promise<void>;
116
+ initFromScene(scene: any, set?: Record<string, any>): Promise<void>;
141
117
  init(...args: any[]): Promise<void>;
118
+ beforeInit(): Promise<void>;
119
+ afterInit(): Promise<void>;
142
120
  private observeScale;
143
121
  initPencil(): Promise<void>;
144
122
  private sceneActive;
@@ -150,28 +128,78 @@ export declare class Base extends Camera {
150
128
  initSettingsObj?: Record<string, any>;
151
129
  mouseButtonsActiveStore: Record<string, any> | null;
152
130
  initSettings(): void;
153
- handleSetting(key: string, value: any): Promise<any>;
131
+ handleSetting(key: string, value: any): void;
154
132
  show(): void;
155
133
  showAction(): void;
156
134
  hide(): void;
157
- addGroup(): Promise<Group>;
135
+ exportScene(): any;
136
+ restoreScene(str: string, objectsMap?: {
137
+ Point: Point;
138
+ Arc: typeof Arc;
139
+ Model: Model;
140
+ Plane: Plane;
141
+ PlaneShadow: PlaneShadow;
142
+ Sphere: Sphere;
143
+ Sprite: typeof Sprite;
144
+ Box: Box;
145
+ Circle: Circle;
146
+ Tube: Tube;
147
+ Ring: Ring;
148
+ AmbientLight: AmbientLight;
149
+ DirectionalLight: DirectionalLight;
150
+ PointLight: PointLight;
151
+ SpotLight: SpotLight;
152
+ HemisphereLight: HemisphereLight;
153
+ RectAreaLight: RectAreaLight;
154
+ Node: typeof NodeObject;
155
+ ExtrudePolygon: ExtrudePolygonObject;
156
+ Line: typeof LineObject;
157
+ Group: GroupObject;
158
+ }): Promise<void>;
159
+ rebuildFromScene(): Promise<void>;
160
+ getClassRefByType(type: string): typeof BaseObject;
161
+ addGroup(): Promise<GroupObject>;
158
162
  addCSS2D(dom: HTMLElement, options?: {
159
163
  display?: string;
160
164
  onTop?: number;
161
165
  target?: BaseObject;
162
- }): Promise<Node_2>;
166
+ }): Promise<NodeObject>;
163
167
  addCSS3D(dom: HTMLElement, options?: {
164
168
  display?: string;
165
169
  onTop?: number;
166
170
  type?: '3d' | '3dSprite';
167
171
  target?: BaseObject;
168
- }): Promise<Node_2>;
172
+ }): Promise<NodeObject>;
173
+ private addNode;
169
174
  getRoomEnvMap(): THREE.Texture<unknown>;
170
175
  handlePick(objArr: PickFunctionsItem['objArr'], type: PickFunctionsItem['type'], cb: PickFunctionsItem['cb']): void;
171
176
  getScreenPosition(x: number, y: number, z: number): {
172
177
  x: number;
173
178
  y: number;
174
179
  };
180
+ uuidByObject(object: THREE.Object3D): string | undefined;
181
+ objectByUuid(key: string): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap> | undefined;
182
+ uuidByBaseObject(object: BaseObject): string | undefined;
183
+ baseObjectByUuid(key: `arc${string}`): Arc;
184
+ baseObjectByUuid(key: `sprite${string}`): Sprite;
185
+ baseObjectByUuid(key: string): BaseObject;
186
+ baseObjectByName(name: string): BaseObject<THREE.Object3D<THREE.Object3DEventMap>> | undefined;
187
+ private _selectOptionMaps;
188
+ findSelectItem(key: any, val: any): SelectedMeta | undefined;
189
+ selectOption: SelectedMeta[];
190
+ changeSelectOption(): void;
191
+ private _mListOptionsMaps;
192
+ findMListSelectItem(key: any, val: any): any;
193
+ mListOptions: {
194
+ key: string;
195
+ name: string;
196
+ type: string;
197
+ use: number;
198
+ object: THREE.Mesh;
199
+ material: THREE.Material;
200
+ baseObject: BaseObject;
201
+ }[];
202
+ changeMListOptions(): never[] | undefined;
175
203
  dispose(): void;
176
204
  }
177
205
 
@@ -224,21 +252,23 @@ declare interface BaseOptions {
224
252
  pencil2?: any;
225
253
  pencilConfig?: Record<string, any>;
226
254
  disableInitShow?: boolean;
227
- editor?: boolean;
228
255
  logarithmicDepthBuffer?: boolean;
229
256
  tier?: number;
230
257
  observeParentScale?: boolean;
231
258
  [key: string]: any;
232
259
  }
233
260
 
234
- declare class Box extends BaseObject {
261
+ declare class Box extends MeshObject {
262
+ objectType: string;
235
263
  create(): void;
236
264
  }
237
265
 
238
- declare class Building extends BaseObject {
239
- options: Options_8;
240
- constructor(options: Options_8);
266
+ declare class Building extends GroupObject {
267
+ objectType: string;
268
+ options: Options_5;
269
+ constructor(options: Options_5);
241
270
  create(): Promise<void>;
271
+ rebuildFromScene(): void;
242
272
  worldPositionZ: {
243
273
  value: number;
244
274
  };
@@ -250,6 +280,7 @@ declare class Camera extends Event_2 {
250
280
  container: HTMLElement;
251
281
  pencil: default_2;
252
282
  cameraState: Record<string, number[]>;
283
+ cameraStateActive: string;
253
284
  setSaveCamera(type: string): void;
254
285
  useSaveCamera(type: string, enableTransition?: boolean): Promise<boolean>;
255
286
  lookAt(positionX: number, positionY: number, positionZ: number, targetX: number, targetY: number, targetZ: number, enableTransition?: boolean, smoothTime?: number): Promise<void>;
@@ -269,58 +300,19 @@ declare class Camera extends Event_2 {
269
300
  dispose(): void;
270
301
  }
271
302
 
272
- declare class Capsule extends BaseObject {
273
- create(): void;
274
- }
275
-
276
- declare class Circle extends BaseObject {
303
+ declare class Circle extends MeshObject {
304
+ objectType: string;
277
305
  create(): void;
278
306
  }
279
307
 
280
308
  export declare class City extends Base {
281
309
  static VisName: string;
282
- leadObjs: {
283
- Building: typeof Building;
284
- Road: typeof Road;
285
- Area: Area;
286
- CityPlane: CityPlane;
287
- Target: Target;
288
- Plane: Plane;
289
- CrossPlane: CrossPlane;
290
- PlaneShadow: PlaneShadow;
291
- Ring: Ring;
292
- Sphere: Sphere;
293
- Sprite: Sprite;
294
- Tetrahedron: Tetrahedron;
295
- Torus: Torus;
296
- TorusKnot: TorusKnot;
297
- Tube: Tube;
298
- Box: Box;
299
- Capsule: Capsule;
300
- Circle: Circle;
301
- Cylinder: Cylinder;
302
- Dodecahedron: Dodecahedron;
303
- Icosahedron: Icosahedron;
304
- Lathe: Lathe;
305
- Octahedron: Octahedron;
306
- Node: Node_2;
307
- Line: Line;
308
- Line2: Line2;
309
- ExtrudePolygon: ExtrudePolygon;
310
- ConicPolygon: ConicPolygon;
311
- Group: typeof Group;
312
- Light: Light;
313
- Point: Point;
314
- Arc: Arc;
315
- Model: Model;
316
- };
317
- lead: Lead<typeof objs_2>;
318
310
  adcode: number;
319
311
  pcenter: [number, number];
320
312
  pscale: number;
321
313
  projection: ReturnType<typeof getProjection>;
322
314
  options: CityOptions;
323
- group: Group;
315
+ group: GroupObject;
324
316
  building: Building;
325
317
  road: Road;
326
318
  setOptions(options: CityOptions): void;
@@ -329,7 +321,8 @@ export declare class City extends Base {
329
321
  initMaterial(): Promise<void>;
330
322
  disableSSAO(): void;
331
323
  enabledSSAO(): void;
332
- init(): Promise<void>;
324
+ initGroup(): Promise<void>;
325
+ beforeInit(): Promise<void>;
333
326
  getInvert(vector3: THREE.Vector3): [number, number] | null | undefined;
334
327
  fitTo(obj: BaseObject, enableTransition?: boolean): Promise<void>;
335
328
  initVis(): Promise<void>;
@@ -357,6 +350,35 @@ export declare class City extends Base {
357
350
  x: number;
358
351
  y: number;
359
352
  };
353
+ restoreScene(str: string, objectsMap?: {
354
+ Building: typeof Building;
355
+ Road: typeof Road;
356
+ Area: Area;
357
+ CityPlane: CityPlane;
358
+ Target: Target;
359
+ Point: Point;
360
+ Arc: Arc;
361
+ Model: Model;
362
+ Plane: Plane;
363
+ PlaneShadow: PlaneShadow;
364
+ Sphere: Sphere;
365
+ Sprite: Sprite;
366
+ Box: Box;
367
+ Circle: Circle;
368
+ Tube: Tube;
369
+ Ring: Ring;
370
+ AmbientLight: AmbientLight;
371
+ DirectionalLight: DirectionalLight;
372
+ PointLight: PointLight;
373
+ SpotLight: SpotLight;
374
+ HemisphereLight: HemisphereLight;
375
+ RectAreaLight: RectAreaLight;
376
+ Node: NodeObject;
377
+ ExtrudePolygon: ExtrudePolygonObject;
378
+ Line: LineObject;
379
+ Group: typeof GroupObject;
380
+ }): Promise<void>;
381
+ rebuildFromScene(): Promise<void>;
360
382
  }
361
383
 
362
384
  declare class city extends City {
@@ -386,103 +408,46 @@ declare interface CityOptions extends BaseOptions {
386
408
  ssao?: boolean;
387
409
  }
388
410
 
389
- declare class CityPlane extends BaseObject {
390
- options: Options_11;
391
- constructor(options: Options_11);
411
+ declare class CityPlane extends MeshObject {
412
+ objectType: string;
413
+ options: Options_8;
414
+ constructor(options: Options_8);
392
415
  plane: THREE.PlaneGeometry;
393
416
  water?: Water;
394
417
  create(): Promise<void>;
418
+ rebuildFromScene(): void;
395
419
  addWater(): void;
396
420
  }
397
421
 
398
- declare class Config {
399
- editor: Editor;
400
- meta: {
401
- name: string;
402
- key: string;
403
- open: boolean;
404
- jsonVersion: string;
405
- sdkVersion: string;
406
- __template: string;
407
- };
408
- constructor(editor: Editor);
409
- setConfig<K extends keyof Config['meta']>(key: K, value: Config['meta'][K]): void;
410
- fromJSON(json: any): void;
411
- compareVersion(): void;
412
- toJSON(): {
413
- version: string;
414
- };
415
- }
416
-
417
- declare class ContinentsBg extends BaseObject {
418
- options: Options_15;
422
+ declare class ContinentsBg extends GroupObject {
423
+ objectType: string;
424
+ options: Options_12;
419
425
  mapArr: PlaneMap[];
420
- constructor(options: Options_15);
426
+ constructor(options: Options_12);
421
427
  create(): Promise<void>;
422
428
  private getPointInContinentInfo;
423
429
  getPointInContinent(location: [number, number]): boolean;
424
430
  getLocationPosition(location: [number, number], tName?: string): [number, number, number] | undefined;
425
431
  render(): void;
432
+ rebuildFromScene(): void;
426
433
  dispose(): void;
427
434
  }
428
435
 
429
- declare class CrossPlane extends BaseObject {
430
- options: Options;
431
- constructor(options: Options);
432
- create(): Promise<void>;
433
- }
434
-
435
- declare class Cylinder extends BaseObject {
436
- create(): void;
437
- }
438
-
439
- declare class Dodecahedron extends BaseObject {
440
- create(): void;
436
+ declare class DirectionalLight extends DirectionalLightObject {
437
+ constructor(...options: ConstructorParameters<typeof DirectionalLightObject>);
438
+ update(delta: number, elapsed: number): void;
439
+ render(): void;
441
440
  }
442
441
 
443
442
  export declare class Earth extends Base {
444
443
  static VisName: string;
445
- leadObjs: {
446
- Earth: Earth_2;
447
- SphereShadow: SphereShadow;
448
- Countries: typeof PlaneMap;
449
- Plane: Plane;
450
- CrossPlane: CrossPlane;
451
- PlaneShadow: PlaneShadow;
452
- Ring: Ring;
453
- Sphere: Sphere;
454
- Sprite: Sprite;
455
- Tetrahedron: Tetrahedron;
456
- Torus: Torus;
457
- TorusKnot: TorusKnot;
458
- Tube: Tube;
459
- Box: Box;
460
- Capsule: Capsule;
461
- Circle: Circle;
462
- Cylinder: Cylinder;
463
- Dodecahedron: Dodecahedron;
464
- Icosahedron: Icosahedron;
465
- Lathe: Lathe;
466
- Octahedron: Octahedron;
467
- Node: Node_2;
468
- Line: Line;
469
- Line2: Line2;
470
- ExtrudePolygon: ExtrudePolygon;
471
- ConicPolygon: ConicPolygon;
472
- Group: Group;
473
- Light: Light;
474
- Point: Point;
475
- Arc: Arc;
476
- Model: Model;
477
- };
478
444
  leftTruck: boolean;
479
- lead: Lead<typeof objs_3>;
480
445
  options: Required<EarthOptions>;
481
446
  extendsOptions: Record<string, any>;
482
447
  map: PlaneMap;
483
- get mapArea(): ExtrudePolygon[];
448
+ get mapArea(): ExtrudePolygonObject[];
484
449
  setOptions(options: EarthOptions): void;
485
- handleSetting(key: string, value: any): Promise<any>;
450
+ handleSetting(key: string, value: any): void;
486
451
  show(): void;
487
452
  animationIn(): void;
488
453
  initLight(): Promise<void>;
@@ -510,12 +475,42 @@ export declare class Earth extends Base {
510
475
  * @param upAxis - 物体的up轴方向,默认为Y轴 [0, 1, 0]
511
476
  */
512
477
  setObjectOnSphere(baseObject: BaseObject, location: [number, number], height?: number, upAxis?: [number, number, number]): void;
478
+ restoreScene(str: string, objectsMap?: {
479
+ Earth: Earth_2;
480
+ SphereShadow: SphereShadow;
481
+ Countries: typeof PlaneMap;
482
+ PlaneMap: typeof PlaneMap;
483
+ Point: Point;
484
+ Arc: Arc;
485
+ Model: Model;
486
+ Plane: Plane;
487
+ PlaneShadow: PlaneShadow;
488
+ Sphere: Sphere;
489
+ Sprite: Sprite;
490
+ Box: Box;
491
+ Circle: Circle;
492
+ Tube: Tube;
493
+ Ring: Ring;
494
+ AmbientLight: AmbientLight;
495
+ DirectionalLight: DirectionalLight;
496
+ PointLight: PointLight;
497
+ SpotLight: SpotLight;
498
+ HemisphereLight: HemisphereLight;
499
+ RectAreaLight: RectAreaLight;
500
+ Node: NodeObject;
501
+ ExtrudePolygon: ExtrudePolygonObject;
502
+ Line: LineObject;
503
+ Group: GroupObject;
504
+ }): Promise<void>;
505
+ rebuildFromScene(): Promise<void>;
513
506
  }
514
507
 
515
508
  declare class Earth_2 extends Sphere {
516
- options: Required<Options_12>;
517
- constructor(options: Options_12);
509
+ objectType: string;
510
+ options: Required<Options_10>;
511
+ constructor(options: Options_10);
518
512
  create(): void;
513
+ rebuildFromScene(): void;
519
514
  }
520
515
 
521
516
  declare interface EarthOptions extends BaseOptions {
@@ -527,66 +522,6 @@ declare interface EarthOptions extends BaseOptions {
527
522
  style?: 'chinaPlate' | 'countryPlate' | 'base';
528
523
  }
529
524
 
530
- declare class Editor {
531
- selected: BaseObject | null;
532
- playing: boolean;
533
- currentMaterialSlot: number;
534
- events: EventEmitter;
535
- history: History_2;
536
- viewport: Viewport;
537
- hooks: Hooks;
538
- config: Config;
539
- pencil: default_2;
540
- on: (type: string | number, listener: Listener) => EventEmitter;
541
- emit: (type: string | number, ...args: any[]) => boolean;
542
- options: Options_7;
543
- constructor(options: Options_7);
544
- getObjectMaterial(object?: THREE.Mesh | null, slot?: number): THREE.Material | THREE.Material[] | undefined;
545
- getMListFixBaseObjectByObject(object: THREE.Mesh, slot: number): any;
546
- materialObjectByUuid(uuid: string): any;
547
- uuidByMaterialObject(object: THREE.Object3D): any;
548
- setObjectMaterial(object: THREE.Mesh, slot: number, newMaterial: THREE.Material): void;
549
- uuidByObject(object: THREE.Object3D): string | undefined;
550
- objectByUuid(key: string): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap> | undefined;
551
- uuidByBaseObject(object: BaseObject): string | undefined;
552
- baseObjectByUuid(key: `arc${string}`): Arc;
553
- baseObjectByUuid(key: `sprite${string}`): Sprite;
554
- baseObjectByUuid(key: string): BaseObject;
555
- baseObjectByName(name: string): BaseObject | undefined;
556
- private _selectOptionMaps;
557
- findSelectItem(key: any, val: any): SelectedMeta | undefined;
558
- selectOption: SelectedMeta[];
559
- changeSelectOption(): void;
560
- private _mListOptionsMaps;
561
- findMListSelectItem(key: any, val: any): any;
562
- mListOptions: {
563
- key: string;
564
- name: string;
565
- type: string;
566
- use: number;
567
- object: THREE.Mesh;
568
- material: THREE.Material;
569
- baseObject: BaseObject;
570
- }[];
571
- changeMListOptions(): never[] | undefined;
572
- execute(cmd: any, optionalName?: string): Promise<void>;
573
- private static urlCache;
574
- private static _loadingCount;
575
- /**
576
- * 清除特定 URL 的缓存
577
- * @param url 要清除的 URL,如果不提供则清除所有缓存
578
- */
579
- static clearUrlCache(url?: string): void;
580
- fromJSON(jsonOrUrl: Record<string, any> | string, hooks?: Record<string, any>): Promise<Record<string, any>>;
581
- appendJSON(jsonOrUrl: Record<string, any> | string): Promise<void>;
582
- toJSON(): {};
583
- select(...args: any[]): void;
584
- setViewportVis(...args: any[]): void;
585
- getDataURL(): string;
586
- _dispose: boolean;
587
- dispose(): void;
588
- }
589
-
590
525
  declare class Event_2 {
591
526
  event: EventEmitter;
592
527
  private eventHandlers;
@@ -635,17 +570,10 @@ export declare const getCityConfig: (adcode: number) => {
635
570
  jsonName: string;
636
571
  };
637
572
 
638
- /**
639
- * 获取地图配置
640
- * @param adcode 区域代码
641
- * @param options 配置选项
642
- */
643
- export declare const getMapConfig: (adcode: number, options?: MapConfigOptions) => Promise<any>;
644
-
645
573
  declare const getProjection: (options: {
646
574
  center: [number, number];
647
575
  scale: number;
648
- projectionType?: "equirectangular" | "mercator" | "winkel3";
576
+ projectionType?: "mercator" | "equirectangular" | "winkel3";
649
577
  translate?: [number, number];
650
578
  precision?: number;
651
579
  rotate?: [number, number];
@@ -654,162 +582,26 @@ declare const getProjection: (options: {
654
582
  declare const getProjection_2: (options: {
655
583
  center: [number, number];
656
584
  scale: number;
657
- projectionType?: "equirectangular" | "mercator" | "winkel3";
585
+ projectionType?: "mercator" | "equirectangular" | "winkel3";
658
586
  translate?: [number, number];
659
587
  precision?: number;
660
588
  rotate?: [number, number];
661
589
  }) => GeoProjection;
662
590
 
663
- declare class History_2 {
664
- editor: Editor;
665
- undos: any[];
666
- redos: any[];
667
- lastCmdTime: number;
668
- idCounter: number;
669
- historyDisabled: boolean;
670
- constructor(editor: Editor);
671
- /**
672
- * 检查两个命令是否可以合并
673
- */
674
- private canMergeCommands;
675
- execute(cmd: any, optionalName?: string): Promise<void>;
676
- undo(): any;
677
- redo(): any;
678
- /**
679
- * 处理图片数据,将ArrayBuffer转换为Base64字符串并建立引用映射
680
- */
681
- private processImageData;
682
- /**
683
- * 处理包含图片的命令
684
- */
685
- private processCommandWithImages;
686
- toJSON(): {
687
- u: any[];
688
- i: Record<string, string>;
689
- };
690
- /**
691
- * 处理图片引用,将引用字符串还原为实际URL或数据
692
- */
693
- private processImageReference;
694
- /**
695
- * 还原包含图片的命令数据
696
- */
697
- private restoreCommandImages;
698
- /**
699
- * 验证和规范化命令类型
700
- */
701
- private normalizeCommandType;
702
- /**
703
- * 创建命令实例
704
- */
705
- private createCommand;
706
- fromJSON(json: any): void;
707
- /**
708
- * 批量处理撤销操作,支持分帧执行以避免阻塞UI
709
- */
710
- processUndos(maxFrameTime?: number): Promise<string>;
711
- /**
712
- * 执行单个撤销命令
713
- */
714
- private executeUndo;
715
- /**
716
- * 清空所有历史记录
717
- */
718
- clear(): void;
719
- /**
720
- * 获取历史记录状态信息
721
- */
722
- getState(): {
723
- undoCount: number;
724
- redoCount: number;
725
- canUndo: boolean;
726
- canRedo: boolean;
727
- isDisabled: boolean;
728
- };
729
- /**
730
- * 启用/禁用历史记录功能
731
- */
732
- setEnabled(enabled: boolean): void;
733
- /**
734
- * 获取最后执行的命令
735
- */
736
- getLastCommand(): any;
737
- }
738
-
739
- declare class Hooks {
740
- editor: Editor;
741
- events: {
742
- beforeSetVisOptions: Function[];
743
- afterSetVisOptions: Function[];
744
- beforeExecuteUndo: Function[];
745
- afterExecuteUndo: Function[];
746
- beforeShow: Function[];
747
- afterShow: Function[];
748
- beforeFromJSON: Function[];
749
- afterFromJSON: Function[];
750
- errorFromJSON: Function[];
751
- };
752
- source: string;
753
- constructor(editor: Editor);
754
- addEvents(event: Record<string, Function>): void;
755
- addStaticEvents(func: Function): void;
756
- fromJSON(source: string): void;
757
- toJSON(): string;
758
- clear(): void;
759
- dispatch(type: keyof Hooks['events'], ...args: any[]): Promise<any>;
760
- }
761
-
762
- declare class Icosahedron extends BaseObject {
763
- create(): void;
764
- }
765
-
766
- declare class Lathe extends BaseObject {
767
- create(): void;
768
- }
769
-
770
- declare class Light extends Light_2 {
771
- constructor(options: any);
772
- update(delta: number, elapsed: number): void;
591
+ declare class HemisphereLight extends HemisphereLightObject {
773
592
  render(): void;
774
593
  }
775
594
 
595
+ /**
596
+ * 加载模板纹理图片,直接返回图片用于设置到材质上
597
+ */
598
+ export declare const loadTemplateImages: (templateId: string, adcode: number, base?: string, customTemplateConfigs?: Record<string, TemplateConfig>) => Promise<{
599
+ map?: HTMLImageElement;
600
+ emissiveMap?: HTMLImageElement;
601
+ }>;
602
+
776
603
  declare class Map_2 extends Base {
777
604
  static VisName: string;
778
- leadObjs: {
779
- PlaneMap: typeof PlaneMap;
780
- CityPlane: CityPlane;
781
- ContinentsBg: typeof ContinentsBg;
782
- Mountain: PlaneMap_2;
783
- Plane: Plane;
784
- CrossPlane: CrossPlane;
785
- PlaneShadow: PlaneShadow;
786
- Ring: Ring;
787
- Sphere: Sphere;
788
- Sprite: Sprite;
789
- Tetrahedron: Tetrahedron;
790
- Torus: Torus;
791
- TorusKnot: TorusKnot;
792
- Tube: Tube;
793
- Box: Box;
794
- Capsule: Capsule;
795
- Circle: Circle;
796
- Cylinder: Cylinder;
797
- Dodecahedron: Dodecahedron;
798
- Icosahedron: Icosahedron;
799
- Lathe: Lathe;
800
- Octahedron: Octahedron;
801
- Node: Node_2;
802
- Line: Line;
803
- Line2: Line2;
804
- ExtrudePolygon: typeof ExtrudePolygon;
805
- ConicPolygon: ConicPolygon;
806
- Group: typeof Group;
807
- Light: Light;
808
- Point: Point;
809
- Arc: Arc;
810
- Model: Model;
811
- };
812
- lead: Lead<typeof objs_4>;
813
605
  options: Required<MapCityOptions>;
814
606
  mapHistory: {
815
607
  map: PlaneMap;
@@ -858,14 +650,14 @@ declare class Map_2 extends Base {
858
650
  c: number[];
859
651
  b: number[];
860
652
  };
861
- get mapArea(): ExtrudePolygon[];
862
- get mapLine(): Line[];
653
+ get mapArea(): ExtrudePolygonObject[];
654
+ get mapLine(): LineObject[];
863
655
  get adcodes(): number[];
864
656
  activePlaneMap: PlaneMap | null;
865
657
  isAnimating: boolean;
866
658
  parentBg: PlaneMap[];
867
659
  continentsBg?: ContinentsBg;
868
- group: Group;
660
+ group: GroupObject;
869
661
  projection: ReturnType<typeof getProjection_2>;
870
662
  pcenter: [number, number];
871
663
  pscale: number;
@@ -873,13 +665,13 @@ declare class Map_2 extends Base {
873
665
  cityVis: city[];
874
666
  extendsOptions: Record<string, any>;
875
667
  setOptions(options: MapOptions): void;
876
- initSettingsObj: Record<string, any>;
877
- handleSetting(key: string, value: any): Promise<any>;
878
- init(): Promise<void>;
668
+ initGroup(): Promise<void>;
669
+ beforeInit(): Promise<void>;
670
+ afterInit(): Promise<void>;
879
671
  initCityVis(adcode: number, grey?: boolean): Promise<city>;
880
672
  initCityOnMap(adcode: number): Promise<void>;
881
673
  initVisBg(): Promise<void>;
882
- initVis(adcode: number): Promise<void>;
674
+ initVis(): Promise<void>;
883
675
  loaderAddBg(): void;
884
676
  initMaterialBg(): Promise<void>;
885
677
  consoleMousePostion(): void;
@@ -905,15 +697,12 @@ declare class Map_2 extends Base {
905
697
  caId: string | number | undefined;
906
698
  showAction(): Promise<void>;
907
699
  hide(): Promise<void>;
908
- shadowMapLight?: BaseObject;
909
- planeShadow?: BaseObject;
910
700
  shadowMapEnabled(): Promise<void>;
911
- shadowMapDisabled(): void;
912
701
  getOptionsDepth(adcode: number): number;
913
702
  getDepth(adcode: number, futureBox: number[]): number;
914
703
  getReferenceScale(bboxa: number[], bboxb: number[]): number;
915
704
  getAdcodeShowLevel(adcode: number, fix?: boolean): string | undefined;
916
- handleClick(area?: ExtrudePolygon): void;
705
+ handleClick(area?: ExtrudePolygonObject): void;
917
706
  beforeShowMap(adcodes: number[]): boolean;
918
707
  getAdcodes(adcode: number): number[];
919
708
  showMap({ adcode, adcodes: prevAdcodes, duration, }: {
@@ -937,14 +726,12 @@ declare class Map_2 extends Base {
937
726
  x: number;
938
727
  y: number;
939
728
  } | undefined;
940
- booleanPointInCn(location: [number, number]): boolean;
941
729
  /**
942
730
  * 判断经纬度是否在当前地图板块内
943
731
  * @param location - 经纬度坐标 [经度, 纬度]
944
- * @param adcode - 可选,指定板块的行政区划代码,不传则使用当前地图的adcode
945
732
  * @returns 是否在板块内
946
733
  */
947
- booleanPointInMap(location: [number, number], adcode?: number): boolean;
734
+ booleanPointInMap(location: [number, number]): boolean;
948
735
  private getGeojson;
949
736
  handleDrillDown({ adcode, duration, handleLook, saveBackCamvasState, extrudelineBloom, }: {
950
737
  adcode: number;
@@ -965,8 +752,8 @@ declare class Map_2 extends Base {
965
752
  handleStart?: () => void;
966
753
  }): Promise<void>;
967
754
  drawPlaneMap({ geojson, extrudeLineGeojson, bbox, depth, extrudelineBloom, adcode, }: {
968
- geojson: GeoJSON_4;
969
- extrudeLineGeojson?: GeoJSON_4;
755
+ geojson: GeoJSON_3;
756
+ extrudeLineGeojson?: GeoJSON_3;
970
757
  bbox?: number[];
971
758
  depth: number;
972
759
  adcode: number;
@@ -994,6 +781,60 @@ declare class Map_2 extends Base {
994
781
  c: number[];
995
782
  b: number[];
996
783
  } | undefined;
784
+ /**
785
+ * 根据目标 adcode 更新 options 中依赖 adcode 的字段
786
+ */
787
+ private updateOptionsForAdcode;
788
+ /**
789
+ * 根据当前 options.center 重新计算投影
790
+ */
791
+ private updateProjection;
792
+ rebuildFromScene(): Promise<void>;
793
+ /**
794
+ * 快照:捕获 PlaneMap 上用户添加的叠加对象
795
+ */
796
+ private captureOverlayLayers;
797
+ private captureObjectMaterialKeys;
798
+ /**
799
+ * 根据快照在 PlaneMap 上恢复叠加层
800
+ */
801
+ private applyOverlayLayers;
802
+ private _templateAdcode;
803
+ /**
804
+ * 根据 switchFixConfig 对场景中的对象做位置/缩放修复
805
+ */
806
+ private applySwitchFixConfig;
807
+ switchAdcode(targetAdcode: number, key: string): Promise<false | undefined>;
808
+ restoreScene(str: string, objectsMap?: {
809
+ PlaneMap: typeof PlaneMap;
810
+ ContinentsBg: typeof ContinentsBg;
811
+ Mountain: Mountain;
812
+ CityPlane: CityPlane;
813
+ Area: Area;
814
+ Building: Building;
815
+ Road: Road;
816
+ Point: Point;
817
+ Arc: Arc;
818
+ Model: Model;
819
+ Plane: Plane;
820
+ PlaneShadow: PlaneShadow;
821
+ Sphere: Sphere;
822
+ Sprite: Sprite;
823
+ Box: Box;
824
+ Circle: Circle;
825
+ Tube: Tube;
826
+ Ring: Ring;
827
+ AmbientLight: AmbientLight;
828
+ DirectionalLight: DirectionalLight;
829
+ PointLight: PointLight;
830
+ SpotLight: SpotLight;
831
+ HemisphereLight: HemisphereLight;
832
+ RectAreaLight: RectAreaLight;
833
+ Node: NodeObject;
834
+ ExtrudePolygon: typeof ExtrudePolygonObject;
835
+ Line: LineObject;
836
+ Group: typeof GroupObject;
837
+ }): Promise<void>;
997
838
  dispose(): void;
998
839
  }
999
840
  export { Map_2 as Map }
@@ -1012,20 +853,6 @@ declare interface MapCityOptions extends MapOptions {
1012
853
  citySSAO?: boolean;
1013
854
  }
1014
855
 
1015
- /**
1016
- * 地图配置选项接口
1017
- */
1018
- export declare interface MapConfigOptions {
1019
- /** 基础URL */
1020
- base?: string;
1021
- /** 之前的配置 */
1022
- prevConfig?: any;
1023
- /** 图像数组 */
1024
- imgArr?: string[] | Record<string, string>;
1025
- /** 自定义模板配置,会与默认配置合并 */
1026
- customTemplateConfigs?: Record<string, TemplateConfig>;
1027
- }
1028
-
1029
856
  export declare interface MapEventHandlers {
1030
857
  [key: string]: (...args: any[]) => void;
1031
858
  }
@@ -1072,6 +899,7 @@ export declare class MapManager {
1072
899
  b: number[];
1073
900
  } | undefined;
1074
901
  static extendsAdcodeAll: (cb: any) => void;
902
+ key: string;
1075
903
  constructor(config: MapManagerConfig);
1076
904
  /**
1077
905
  * 设置事件处理器
@@ -1097,10 +925,6 @@ export declare class MapManager {
1097
925
  * 创建地图实例
1098
926
  */
1099
927
  private createMapInstance;
1100
- /**
1101
- * 应用地图修复配置
1102
- */
1103
- private applyFixConfig;
1104
928
  /**
1105
929
  * 绑定区域交互事件
1106
930
  */
@@ -1141,6 +965,7 @@ export declare class MapManager {
1141
965
  }
1142
966
 
1143
967
  export declare interface MapManagerConfig {
968
+ key?: string;
1144
969
  container: HTMLDivElement;
1145
970
  controlsContainer?: HTMLDivElement;
1146
971
  assetsPrefix?: string;
@@ -1164,8 +989,6 @@ declare interface MapOptions extends BaseOptions {
1164
989
  mapDepth?: number[];
1165
990
  depthReference?: number[];
1166
991
  mapPadding?: number[];
1167
- geojsonMap?: Record<string, GeoJSON_4>;
1168
- extrudeLineGeojsonMap?: Record<string, GeoJSON_4>;
1169
992
  fixGeojson?: Record<string, string>;
1170
993
  plateInCenter?: boolean;
1171
994
  clickHandleDrillDown?: boolean;
@@ -1193,16 +1016,19 @@ declare interface MapOptions extends BaseOptions {
1193
1016
  style?: 'map2Base' | 'map2CityOnMap';
1194
1017
  bottomPlane?: boolean;
1195
1018
  bottomPlaneWater?: boolean;
1196
- geojsonExtensions?: Record<string, GeoJSON_4 | string | number | (GeoJSON_4 | string | number)[]>;
1019
+ geojsonExtensions?: Record<string, GeoJSON_3 | string | number | (GeoJSON_3 | string | number)[]>;
1020
+ shadowMap?: boolean;
1021
+ switchFixConfig?: SwitchFixConfig;
1197
1022
  }
1198
1023
 
1199
- declare class Model extends BaseObject {
1200
- options: Options_5;
1024
+ declare class Model extends GroupObject {
1025
+ options: Options_4;
1201
1026
  mixer: THREE.AnimationMixer | null;
1202
1027
  clips: THREE.AnimationClip[];
1203
1028
  actions: THREE.AnimationAction[];
1204
1029
  actionStates: Record<string, boolean>;
1205
- constructor(options: Options_5);
1030
+ objectType: string;
1031
+ constructor(options: Options_4);
1206
1032
  create(): Promise<void>;
1207
1033
  render(): void;
1208
1034
  /**
@@ -1257,144 +1083,19 @@ declare class Model extends BaseObject {
1257
1083
  dispose(): void;
1258
1084
  }
1259
1085
 
1260
- declare const objs: {
1261
- Plane: typeof Plane;
1262
- CrossPlane: typeof CrossPlane;
1263
- PlaneShadow: typeof PlaneShadow;
1264
- Ring: typeof Ring;
1265
- Sphere: typeof Sphere;
1266
- Sprite: typeof Sprite;
1267
- Tetrahedron: typeof Tetrahedron;
1268
- Torus: typeof Torus;
1269
- TorusKnot: typeof TorusKnot;
1270
- Tube: typeof Tube;
1271
- Box: typeof Box;
1272
- Capsule: typeof Capsule;
1273
- Circle: typeof Circle;
1274
- Cylinder: typeof Cylinder;
1275
- Dodecahedron: typeof Dodecahedron;
1276
- Icosahedron: typeof Icosahedron;
1277
- Lathe: typeof Lathe;
1278
- Octahedron: typeof Octahedron;
1279
- Node: typeof Node_2;
1280
- Line: typeof Line;
1281
- Line2: typeof Line2;
1282
- ExtrudePolygon: typeof ExtrudePolygon;
1283
- ConicPolygon: typeof ConicPolygon;
1284
- Group: typeof Group;
1285
- Light: typeof Light;
1286
- Point: typeof Point;
1287
- Arc: typeof Arc;
1288
- Model: typeof Model;
1289
- };
1290
-
1291
- declare const objs_2: {
1292
- Building: typeof Building;
1293
- Road: typeof Road;
1294
- Area: typeof Area;
1295
- CityPlane: typeof CityPlane;
1296
- Target: typeof Target;
1297
- Plane: Plane;
1298
- CrossPlane: CrossPlane;
1299
- PlaneShadow: PlaneShadow;
1300
- Ring: Ring;
1301
- Sphere: Sphere;
1302
- Sprite: Sprite;
1303
- Tetrahedron: Tetrahedron;
1304
- Torus: Torus;
1305
- TorusKnot: TorusKnot;
1306
- Tube: Tube;
1307
- Box: Box;
1308
- Capsule: Capsule;
1309
- Circle: Circle;
1310
- Cylinder: Cylinder;
1311
- Dodecahedron: Dodecahedron;
1312
- Icosahedron: Icosahedron;
1313
- Lathe: Lathe;
1314
- Octahedron: Octahedron;
1315
- Node: Node_2;
1316
- Line: Line;
1317
- Line2: Line2;
1318
- ExtrudePolygon: ExtrudePolygon;
1319
- ConicPolygon: ConicPolygon;
1320
- Group: Group;
1321
- Light: Light;
1322
- Point: Point;
1323
- Arc: Arc;
1324
- Model: Model;
1325
- };
1326
-
1327
- declare const objs_3: {
1328
- Earth: typeof Earth_2;
1329
- SphereShadow: typeof SphereShadow;
1330
- Countries: typeof PlaneMap;
1331
- Plane: Plane;
1332
- CrossPlane: CrossPlane;
1333
- PlaneShadow: PlaneShadow;
1334
- Ring: Ring;
1335
- Sphere: Sphere;
1336
- Sprite: Sprite;
1337
- Tetrahedron: Tetrahedron;
1338
- Torus: Torus;
1339
- TorusKnot: TorusKnot;
1340
- Tube: Tube;
1341
- Box: Box;
1342
- Capsule: Capsule;
1343
- Circle: Circle;
1344
- Cylinder: Cylinder;
1345
- Dodecahedron: Dodecahedron;
1346
- Icosahedron: Icosahedron;
1347
- Lathe: Lathe;
1348
- Octahedron: Octahedron;
1349
- Node: Node_2;
1350
- Line: Line;
1351
- Line2: Line2;
1352
- ExtrudePolygon: ExtrudePolygon;
1353
- ConicPolygon: ConicPolygon;
1354
- Group: Group;
1355
- Light: Light;
1356
- Point: Point;
1357
- Arc: Arc;
1358
- Model: Model;
1359
- };
1360
-
1361
- declare const objs_4: {
1362
- PlaneMap: typeof PlaneMap;
1363
- CityPlane: typeof CityPlane;
1364
- ContinentsBg: typeof ContinentsBg;
1365
- Mountain: typeof PlaneMap_2;
1366
- Plane: Plane;
1367
- CrossPlane: CrossPlane;
1368
- PlaneShadow: PlaneShadow;
1369
- Ring: Ring;
1370
- Sphere: Sphere;
1371
- Sprite: Sprite;
1372
- Tetrahedron: Tetrahedron;
1373
- Torus: Torus;
1374
- TorusKnot: TorusKnot;
1375
- Tube: Tube;
1376
- Box: Box;
1377
- Capsule: Capsule;
1378
- Circle: Circle;
1379
- Cylinder: Cylinder;
1380
- Dodecahedron: Dodecahedron;
1381
- Icosahedron: Icosahedron;
1382
- Lathe: Lathe;
1383
- Octahedron: Octahedron;
1384
- Node: Node_2;
1385
- Line: Line;
1386
- Line2: Line2;
1387
- ExtrudePolygon: ExtrudePolygon;
1388
- ConicPolygon: ConicPolygon;
1389
- Group: Group;
1390
- Light: Light;
1391
- Point: Point;
1392
- Arc: Arc;
1393
- Model: Model;
1394
- };
1395
-
1396
- declare class Octahedron extends BaseObject {
1397
- create(): void;
1086
+ declare class Mountain extends GroupObject {
1087
+ objectType: string;
1088
+ options: Required<Omit<Options_13, 'bbox'>> & Pick<Options_13, 'bbox'>;
1089
+ extrudePolygon: ExtrudePolygonObject;
1090
+ constructor(options: Options_13);
1091
+ geojson2Meta(geojson: GeoJSON_4): {
1092
+ coords: Position[][];
1093
+ properties: GeoJsonProperties;
1094
+ }[];
1095
+ create(): Promise<void>;
1096
+ setNoise(geometry: THREE.BufferGeometry, image: HTMLImageElement, maxHeight?: number): void;
1097
+ render(): void;
1098
+ rebuildFromScene(): void;
1398
1099
  }
1399
1100
 
1400
1101
  declare interface Opt {
@@ -1402,80 +1103,25 @@ declare interface Opt {
1402
1103
  }
1403
1104
 
1404
1105
  declare interface Options {
1405
- material?: THREE.Material;
1406
- key?: string;
1106
+ sprite?: boolean;
1407
1107
  }
1408
1108
 
1409
1109
  declare interface Options_10 {
1410
- jsonUrl: string;
1411
- projection: {
1412
- center: [number, number];
1413
- scale: number;
1414
- };
1415
- material: THREE.Material;
1416
- type: string;
1417
- cacheKey?: string;
1418
- oArr?: number[];
1419
- }
1420
-
1421
- declare interface Options_11 {
1422
- width: number;
1423
- height: number;
1424
- material?: THREE.Material;
1425
- color?: string;
1426
- map?: THREE.Texture | null;
1427
- }
1428
-
1429
- declare interface Options_12 {
1430
1110
  radius?: number;
1431
1111
  rotationY?: number;
1432
1112
  }
1433
1113
 
1434
- declare interface Options_13 {
1114
+ declare interface Options_11 {
1435
1115
  radius?: number;
1436
1116
  }
1437
1117
 
1438
- declare interface Options_14 {
1439
- areaGroup?: boolean;
1440
- geojson: GeoJSON_2;
1441
- projection?: {
1442
- center: [number, number];
1443
- scale: number;
1444
- rotate?: [number, number];
1445
- projectionType?: 'mercator' | 'equirectangular' | 'winkel3';
1446
- };
1447
- extrudeLineGeojson?: GeoJSON_2;
1448
- hasSide?: boolean;
1449
- hasTop?: boolean;
1450
- mergeSide?: boolean;
1451
- hasLine?: boolean;
1452
- start?: number;
1453
- depth?: number;
1454
- lineOffset?: number;
1455
- bbox?: number[];
1456
- topSegments?: number;
1457
- conic?: boolean;
1458
- materialOptions: {
1459
- topMat: THREE.Material;
1460
- sideMat?: THREE.Material;
1461
- lineMat?: MeshLineMaterial;
1462
- extrudeLineMat?: MeshLineMaterial;
1463
- bgTopMat?: THREE.Material;
1464
- bgSideMat?: THREE.Material;
1465
- bgLineMat?: MeshLineMaterial;
1466
- bgExtrudeLineMat?: MeshLineMaterial;
1467
- };
1468
- onTop?: number;
1469
- bloom?: boolean;
1470
- }
1471
-
1472
- declare interface Options_15 {
1118
+ declare interface Options_12 {
1473
1119
  scale: number;
1474
1120
  depth: number;
1475
1121
  }
1476
1122
 
1477
- declare interface Options_16 {
1478
- geojson: GeoJSON_3;
1123
+ declare interface Options_13 {
1124
+ geojson: GeoJSON_4;
1479
1125
  projection: {
1480
1126
  center: [number, number];
1481
1127
  scale: number;
@@ -1486,44 +1132,32 @@ declare interface Options_16 {
1486
1132
  bbox?: number[];
1487
1133
  }
1488
1134
 
1489
- declare interface Options_2 {
1490
- path?: THREE.Curve<THREE.Vector3>;
1491
- radius?: number;
1492
- multiplyScalar?: number;
1493
- }
1494
-
1495
- declare interface Options_3 {
1496
- sprite?: boolean;
1497
- }
1498
-
1499
- declare interface Options_4 {
1135
+ declare interface Options_2 extends NonNullable<ConstructorParameters<typeof LineObject>[0]> {
1500
1136
  from: number[];
1501
1137
  to: number[];
1138
+ control1?: number[];
1139
+ control2?: number[];
1502
1140
  radius?: number;
1503
1141
  globe?: boolean;
1504
1142
  color?: string;
1505
1143
  lineWidth?: number;
1506
1144
  offsetLoop?: boolean;
1507
- key?: string;
1508
1145
  }
1509
1146
 
1510
- declare interface Options_5 {
1147
+ declare interface Options_3 {
1148
+ path?: THREE.Curve<THREE.Vector3>;
1149
+ radius?: number;
1150
+ multiplyScalar?: number;
1151
+ }
1152
+
1153
+ declare interface Options_4 {
1511
1154
  src?: string;
1512
1155
  autoPlay?: boolean;
1513
1156
  playbackSpeed?: number;
1514
1157
  }
1515
1158
 
1516
- declare interface Options_6 {
1517
- visFactories?: Base;
1518
- }
1519
-
1520
- declare interface Options_7 {
1521
- visFactories?: Base;
1522
- assetsPrefix?: string;
1523
- processUndosMaxFrameTime?: number;
1524
- }
1525
-
1526
- declare interface Options_8 {
1159
+ declare interface Options_5 {
1160
+ uuid?: string;
1527
1161
  jsonUrl: string;
1528
1162
  projection: {
1529
1163
  center: [number, number];
@@ -1537,7 +1171,8 @@ declare interface Options_8 {
1537
1171
  grey?: boolean;
1538
1172
  }
1539
1173
 
1540
- declare interface Options_9 {
1174
+ declare interface Options_6 {
1175
+ uuid?: string;
1541
1176
  jsonUrl: string;
1542
1177
  projection: {
1543
1178
  center: [number, number];
@@ -1548,20 +1183,78 @@ declare interface Options_9 {
1548
1183
  grey?: boolean;
1549
1184
  }
1550
1185
 
1551
- declare class Plane extends BaseObject {
1186
+ declare interface Options_7 {
1187
+ uuid?: string;
1188
+ jsonUrl: string;
1189
+ projection: {
1190
+ center: [number, number];
1191
+ scale: number;
1192
+ };
1193
+ material: THREE.Material;
1194
+ type: string;
1195
+ cacheKey?: string;
1196
+ oArr?: number[];
1197
+ }
1198
+
1199
+ declare interface Options_8 {
1200
+ width: number;
1201
+ height: number;
1202
+ material?: THREE.Material;
1203
+ color?: string;
1204
+ map?: THREE.Texture | null;
1205
+ }
1206
+
1207
+ declare interface Options_9 {
1208
+ uuid?: string;
1209
+ areaGroup?: boolean;
1210
+ geojson: GeoJSON_2;
1211
+ projection?: {
1212
+ center: [number, number];
1213
+ scale: number;
1214
+ rotate?: [number, number];
1215
+ projectionType?: 'mercator' | 'equirectangular' | 'winkel3';
1216
+ };
1217
+ extrudeLineGeojson?: GeoJSON_2;
1218
+ hasSide?: boolean;
1219
+ hasTop?: boolean;
1220
+ mergeSide?: boolean;
1221
+ hasLine?: boolean;
1222
+ start?: number;
1223
+ depth?: number;
1224
+ lineOffset?: number;
1225
+ bbox?: number[];
1226
+ topSegments?: number;
1227
+ conic?: boolean;
1228
+ materialOptions: {
1229
+ topMat: THREE.Material;
1230
+ sideMat?: THREE.Material;
1231
+ lineMat?: MeshLineMaterial;
1232
+ extrudeLineMat?: MeshLineMaterial;
1233
+ bgTopMat?: THREE.Material;
1234
+ bgSideMat?: THREE.Material;
1235
+ bgLineMat?: MeshLineMaterial;
1236
+ bgExtrudeLineMat?: MeshLineMaterial;
1237
+ };
1238
+ onTop?: number;
1239
+ bloom?: boolean;
1240
+ }
1241
+
1242
+ declare class Plane extends MeshObject {
1243
+ objectType: string;
1552
1244
  create(): void;
1553
1245
  }
1554
1246
 
1555
- declare class PlaneMap extends BaseObject {
1556
- options: Required<Omit<Options_14, 'bbox' | 'extrudeLineGeojson'>> & Pick<Options_14, 'bbox' | 'extrudeLineGeojson'>;
1247
+ declare class PlaneMap extends GroupObject {
1248
+ objectType: string;
1249
+ options: Required<Omit<Options_9, 'bbox' | 'extrudeLineGeojson'>> & Pick<Options_9, 'bbox' | 'extrudeLineGeojson'>;
1557
1250
  isActive: boolean;
1558
- groupArr: Group[];
1559
- areaArr: ExtrudePolygon[];
1560
- lineArr: Line[];
1561
- mergeSideArea: ExtrudePolygon | null;
1562
- extrudelineArr?: Line[];
1251
+ groupArr: GroupObject[];
1252
+ areaArr: ExtrudePolygonObject[];
1253
+ lineArr: LineObject[];
1254
+ mergeSideArea: ExtrudePolygonObject | null;
1255
+ extrudelineArr?: LineObject[];
1563
1256
  splitPolygons: number;
1564
- constructor(options: Options_14);
1257
+ constructor(options: Options_9);
1565
1258
  create(): Promise<void>;
1566
1259
  addArea(geojson: GeoJSON_2, options: {
1567
1260
  material: THREE.Material | THREE.Material[];
@@ -1571,19 +1264,19 @@ declare class PlaneMap extends BaseObject {
1571
1264
  hasTop?: boolean;
1572
1265
  onTop?: number;
1573
1266
  castShadow?: boolean;
1574
- }): Promise<ExtrudePolygon[]>;
1267
+ }): Promise<ExtrudePolygonObject[]>;
1575
1268
  addLine(geojson: GeoJSON_2, options: {
1576
1269
  material?: MeshLineMaterial;
1577
1270
  onTop?: number;
1578
1271
  areaGroup?: boolean;
1579
- }): Promise<Line[]>;
1272
+ }): Promise<LineObject[]>;
1580
1273
  getPropertiesKey(properties: Record<string, any>): string;
1581
1274
  geojson2Meta(geojson: GeoJSON_2): {
1582
1275
  coords: Position[][];
1583
1276
  properties: GeoJsonProperties;
1584
1277
  }[];
1585
1278
  update(delta: number, elapsed: number): void;
1586
- findGroup(adcode: string | number, fix?: boolean): Group | undefined;
1279
+ findGroup(adcode: string | number, fix?: boolean): GroupObject | undefined;
1587
1280
  setAreaMaterial(key: string, material: THREE.Material[] | THREE.Material): void;
1588
1281
  useAreaMaterial(key: string): void;
1589
1282
  setLineMaterial(key: string, material: THREE.Material): void;
@@ -1596,55 +1289,51 @@ declare class PlaneMap extends BaseObject {
1596
1289
  }): void;
1597
1290
  deactive(): void;
1598
1291
  render(): void;
1292
+ rebuildFromScene(): void;
1599
1293
  toggleExtrudelineBloom(s: boolean): void;
1600
1294
  active(): void;
1601
1295
  dispose(): void;
1602
1296
  }
1603
1297
 
1604
- declare class PlaneMap_2 extends BaseObject {
1605
- options: Required<Omit<Options_16, 'bbox'>> & Pick<Options_16, 'bbox'>;
1606
- extrudePolygon: ExtrudePolygon;
1607
- constructor(options: Options_16);
1608
- geojson2Meta(geojson: GeoJSON_3): {
1609
- coords: Position[][];
1610
- properties: GeoJsonProperties;
1611
- }[];
1612
- create(): Promise<void>;
1613
- setNoise(geometry: THREE.BufferGeometry, image: HTMLImageElement, maxHeight?: number): void;
1614
- render(): void;
1615
- dispose(): void;
1616
- }
1617
-
1618
- declare class PlaneShadow extends BaseObject {
1298
+ declare class PlaneShadow extends MeshObject {
1299
+ objectType: string;
1619
1300
  create(): Promise<void>;
1620
1301
  }
1621
1302
 
1622
1303
  declare class Point extends BaseObject {
1623
- options: Options_3;
1624
- constructor(options: Options_3);
1625
- get material(): THREE.SpriteMaterial | THREE.MeshBasicMaterial;
1626
- getMaterial(): THREE.SpriteMaterial | THREE.MeshBasicMaterial;
1304
+ objectType: string;
1305
+ options: Options;
1306
+ constructor(options: Options);
1307
+ get material(): THREE.MeshBasicMaterial | THREE.SpriteMaterial;
1308
+ getMaterial(): THREE.MeshBasicMaterial | THREE.SpriteMaterial;
1627
1309
  create(): Promise<void>;
1628
1310
  scaleValue: number;
1629
1311
  setScale(n: number): void;
1630
1312
  }
1631
1313
 
1632
- /**
1633
- * 移除摄像机历史记录
1634
- * @param u 历史记录数组
1635
- */
1636
- export declare const removeCameraHistory: (u: any) => any;
1314
+ declare class PointLight extends PointLightObject {
1315
+ constructor(...options: ConstructorParameters<typeof PointLightObject>);
1316
+ update(delta: number, elapsed: number): void;
1317
+ render(): void;
1318
+ }
1319
+
1320
+ declare class RectAreaLight extends RectAreaLightObject {
1321
+ render(): void;
1322
+ }
1637
1323
 
1638
- declare class Ring extends BaseObject {
1324
+ declare class Ring extends MeshObject {
1325
+ objectType: string;
1639
1326
  create(): void;
1640
1327
  }
1641
1328
 
1642
- declare class Road extends BaseObject {
1643
- options: Options_9;
1644
- constructor(options: Options_9);
1645
- linePrimary: Line[];
1646
- lineSecondary: Line[];
1329
+ declare class Road extends GroupObject {
1330
+ objectType: string;
1331
+ options: Options_6;
1332
+ constructor(options: Options_6);
1333
+ linePrimary: LineObject[];
1334
+ lineSecondary: LineObject[];
1647
1335
  create(): Promise<void>;
1336
+ rebuildFromScene(): void;
1648
1337
  dispose(): void;
1649
1338
  }
1650
1339
 
@@ -1676,25 +1365,49 @@ declare const sinusoidalInOut: ({ onUpdate, onComplete, backwards, }?: {
1676
1365
  stop: () => void;
1677
1366
  };
1678
1367
 
1679
- declare class Sphere extends BaseObject {
1368
+ declare class Sphere extends MeshObject {
1680
1369
  radius: number;
1681
- material?: THREE.Material;
1682
- options?: any;
1370
+ options: any;
1371
+ objectType: string;
1372
+ constructor(options: any);
1683
1373
  create(): void;
1684
1374
  }
1685
1375
 
1686
- declare class SphereShadow extends BaseObject {
1687
- options: Required<Options_13>;
1688
- constructor(options: Options_13);
1376
+ declare class SphereShadow extends MeshObject {
1377
+ objectType: string;
1378
+ options: Required<Options_11>;
1379
+ constructor(options: Options_11);
1689
1380
  create(): Promise<void>;
1381
+ rebuildFromScene(): void;
1382
+ }
1383
+
1384
+ declare class SpotLight extends SpotLightObject {
1385
+ constructor(...options: ConstructorParameters<typeof SpotLightObject>);
1386
+ update(delta: number, elapsed: number): void;
1387
+ render(): void;
1690
1388
  }
1691
1389
 
1692
- declare class Sprite extends BaseObject {
1390
+ declare class Sprite extends SpriteObject {
1391
+ objectType: string;
1693
1392
  create(): void;
1694
1393
  setDesiredPixelSize(size: number): void;
1695
1394
  }
1696
1395
 
1697
- declare class Target extends BaseObject {
1396
+ declare interface SwitchFixConfig {
1397
+ /** 按参考缩放比缩放,并移到地图中心 */
1398
+ s?: string[];
1399
+ /** z 位置按缩放比缩放 */
1400
+ z?: string[];
1401
+ /** 移到地图顶面 */
1402
+ t?: string[];
1403
+ /** 移到地图底面 */
1404
+ b?: string[];
1405
+ /** 灯光按缩放比调整 */
1406
+ l?: string[];
1407
+ }
1408
+
1409
+ declare class Target extends GroupObject {
1410
+ objectType: string;
1698
1411
  options: Opt;
1699
1412
  time: {
1700
1413
  value: number;
@@ -1709,6 +1422,7 @@ declare class Target extends BaseObject {
1709
1422
  createCylinder(texture: THREE.Texture): THREE.Object3D<THREE.Object3DEventMap>;
1710
1423
  createTorus(color: string): THREE.Mesh<THREE.TorusGeometry, THREE.MeshBasicMaterial, THREE.Object3DEventMap>;
1711
1424
  create(): Promise<void>;
1425
+ rebuildFromScene(): void;
1712
1426
  erase(): void;
1713
1427
  update(delta: number, elapsed: number): void;
1714
1428
  }
@@ -1718,32 +1432,19 @@ declare class Target extends BaseObject {
1718
1432
  */
1719
1433
  declare interface TemplateConfig {
1720
1434
  id: string;
1721
- mapIndex?: number;
1722
- mapId?: string;
1723
- emissiveMapIndex?: number;
1724
- emmisiveMapId?: string;
1435
+ map?: boolean;
1436
+ emissiveMap?: boolean;
1725
1437
  cityOnly?: boolean;
1726
1438
  }
1727
1439
 
1728
- declare class Tetrahedron extends BaseObject {
1729
- create(): void;
1730
- }
1731
-
1732
1440
  export { THREE }
1733
1441
 
1734
1442
  declare const timeOut: (ms: number) => Promise<any>;
1735
1443
 
1736
- declare class Torus extends BaseObject {
1737
- create(): void;
1738
- }
1739
-
1740
- declare class TorusKnot extends BaseObject {
1741
- create(): void;
1742
- }
1743
-
1744
- declare class Tube extends BaseObject {
1745
- options: Options_2;
1746
- constructor(options: Options_2);
1444
+ declare class Tube extends MeshObject {
1445
+ objectType: string;
1446
+ options: Options_3;
1447
+ constructor(options: Options_3);
1747
1448
  create(): void;
1748
1449
  }
1749
1450
 
@@ -1751,45 +1452,7 @@ export { TWEEN }
1751
1452
 
1752
1453
  export { Tween }
1753
1454
 
1754
- export declare const VERSION = "0.30.15";
1755
-
1756
- declare class Viewport {
1757
- editor: Editor;
1758
- vis?: Base;
1759
- extendsOptions: Record<string, any>;
1760
- cameraState: Record<string, number[]>;
1761
- delLoadObj?: string[];
1762
- options: Options_6;
1763
- constructor(editor: Editor, options: Options_6);
1764
- setSaveCamera(type: string): void;
1765
- addVis(type: string, options?: Record<string, any>): Promise<void>;
1766
- replaceVis(): boolean;
1767
- setVis(type: string, options?: Record<string, any>): Promise<void>;
1768
- setResetCameraUp(): void;
1769
- initEvent(): void;
1770
- addObj(type: string, options?: Record<string, any>): Promise<void>;
1771
- removeObj(uuid?: string): Promise<void>;
1772
- private copyObjKey;
1773
- copyObj(key: string): void;
1774
- clearCopyObj(): void;
1775
- pasteObj(): Promise<void>;
1776
- copyMListMaterial(key: string): Promise<void>;
1777
- clearCopyMListMaterial(): Promise<void>;
1778
- pasteMListMaterial(): Promise<void>;
1779
- pasteMListMaterial2Replace(replaceKey: string): Promise<void>;
1780
- addMListMaterial(material?: string | Record<string, any>, object3d?: THREE.Mesh, slot?: number): Promise<string | undefined>;
1781
- removeMListMaterial(key: string): Promise<void>;
1782
- setExtendsOptions(name: string, value: any): void;
1783
- toJSON(): {
1784
- eo: Record<string, any>;
1785
- cs: Record<string, number[]>;
1786
- delLoadObj: string[] | undefined;
1787
- };
1788
- fromJSON(json: any): void;
1789
- getLoadObj(): string[];
1790
- setTransformControlsModal(modal: 'translate' | 'rotate' | 'scale'): void;
1791
- dispose(): void;
1792
- }
1455
+ export declare const VERSION = "0.31.0";
1793
1456
 
1794
1457
  export { }
1795
1458