soonspacejs 2.10.15 → 2.11.2
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.esm.js +4 -4
- package/package.json +2 -2
- package/types/Interface/events.d.ts +0 -1
- package/types/Library/PoiNode.d.ts +2 -2
- package/types/Viewport/RendererManager.d.ts +6 -4
- package/types/Viewport/SoonGISManager/coords-to-matrix.d.ts +8 -0
- package/types/Viewport/SoonGISManager/index.d.ts +29 -0
- package/types/Viewport/SoonGISManager/sync-camera.d.ts +2 -0
- package/types/Viewport/index.d.ts +14 -6
- package/types/index.d.ts +10 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soonspacejs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.2",
|
|
4
4
|
"homepage": "http://www.xwbuilders.com:8800/",
|
|
5
5
|
"description": "soonspacejs 2.x",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"three": ">=0.155.0"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "ffbf8598e122d3ba75cfded86295b8aabd02ea82"
|
|
33
33
|
}
|
|
@@ -36,6 +36,5 @@ interface SceneGlobalEvents {
|
|
|
36
36
|
poiDblClick?: (poi: PoiEventParams) => void;
|
|
37
37
|
selectPosition?: (position: Position) => void;
|
|
38
38
|
sceneClick?: (param: SceneClickParam) => void;
|
|
39
|
-
resize?: () => void;
|
|
40
39
|
}
|
|
41
40
|
export { ScenePoiIntersect, SceneModelIntersect, ModelEventParams, SceneClickParam, SceneGlobalEvents, };
|
|
@@ -11,8 +11,8 @@ interface PoiNodeInfo extends BaseObject3DInfo {
|
|
|
11
11
|
scaleFixed?: ScaleFixed | null;
|
|
12
12
|
}
|
|
13
13
|
declare class PoiNode extends BaseObject3D {
|
|
14
|
-
readonly elementType
|
|
15
|
-
readonly element
|
|
14
|
+
readonly elementType: PoiNodeInfo['type'];
|
|
15
|
+
readonly element: PoiNodeInfo['element'];
|
|
16
16
|
elementAutoDisplay: PoiNodeInfo['elementAutoDisplay'];
|
|
17
17
|
occlude: PoiNodeInfo['occlude'];
|
|
18
18
|
occludeThrottle: PoiNodeInfo['occludeThrottle'];
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { WebGLRenderer } from 'three';
|
|
2
|
+
import type SoonGIS from 'soongis';
|
|
2
3
|
import { CSS2DRenderer, CSS3DRenderer } from '../Renderer';
|
|
3
4
|
import { InternalOptions } from '../Interface';
|
|
4
5
|
import Viewport from '.';
|
|
5
6
|
declare class RendererManager {
|
|
6
7
|
readonly viewport: Viewport;
|
|
8
|
+
readonly soongis?: SoonGIS | undefined;
|
|
7
9
|
internalOptions: InternalOptions;
|
|
8
10
|
renderer: WebGLRenderer;
|
|
9
|
-
container:
|
|
10
|
-
interactiveContainer:
|
|
11
|
+
container: HTMLElement;
|
|
12
|
+
interactiveContainer: HTMLElement;
|
|
11
13
|
rendererCSS2D: CSS2DRenderer;
|
|
12
14
|
rendererCSS3D: CSS3DRenderer;
|
|
13
|
-
constructor(viewport: Viewport);
|
|
15
|
+
constructor(viewport: Viewport, soongis?: SoonGIS | undefined);
|
|
14
16
|
setInternalState(name: keyof InternalOptions, state: boolean): void;
|
|
15
|
-
_initContainer():
|
|
17
|
+
_initContainer(): HTMLElement;
|
|
16
18
|
_initRenderer(): WebGLRenderer;
|
|
17
19
|
_initRenderCSS2D(): CSS2DRenderer;
|
|
18
20
|
_initRenderCSS3D(): CSS3DRenderer;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MercatorCoordinate } from 'maplibre-gl';
|
|
2
|
+
export type Coordinates = {
|
|
3
|
+
longitude: number;
|
|
4
|
+
latitude: number;
|
|
5
|
+
altitude: number;
|
|
6
|
+
};
|
|
7
|
+
/** calculate Matrix4 from coordinates */
|
|
8
|
+
export declare function coordsToMatrix({ longitude, latitude, altitude, }: Coordinates, fromLngLat: typeof MercatorCoordinate.fromLngLat): Promise<import("three").Matrix4Tuple>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PerspectiveCamera } from 'three';
|
|
2
|
+
import type { Map } from 'maplibre-gl';
|
|
3
|
+
import type SoonGIS from 'soongis';
|
|
4
|
+
import Viewport from '..';
|
|
5
|
+
import { Coordinates } from './coords-to-matrix';
|
|
6
|
+
declare class SoonGISManager {
|
|
7
|
+
readonly viewport: Viewport;
|
|
8
|
+
readonly soongis?: SoonGIS | undefined;
|
|
9
|
+
SOONSPACE_LAYER_ID: string;
|
|
10
|
+
map: Map | undefined;
|
|
11
|
+
camera: PerspectiveCamera;
|
|
12
|
+
coordinates: Coordinates;
|
|
13
|
+
_mapResize: () => void;
|
|
14
|
+
constructor(viewport: Viewport, soongis?: SoonGIS | undefined);
|
|
15
|
+
/**
|
|
16
|
+
* 设置经纬度、海拔
|
|
17
|
+
* @param coordinates
|
|
18
|
+
*/
|
|
19
|
+
setCoordinates(coordinates: Coordinates): void;
|
|
20
|
+
/**
|
|
21
|
+
* 使用 map 的 render 代替 soonspace render
|
|
22
|
+
*/
|
|
23
|
+
triggerRender(): void;
|
|
24
|
+
dispose(): void;
|
|
25
|
+
_initialize(): void;
|
|
26
|
+
_initSspSetting(): void;
|
|
27
|
+
_initLayer(): void;
|
|
28
|
+
}
|
|
29
|
+
export default SoonGISManager;
|
|
@@ -4,8 +4,10 @@ import { EffectComposer } from 'postprocessing';
|
|
|
4
4
|
import Stats from 'three/examples/jsm/libs/stats.module.js';
|
|
5
5
|
import { Sky } from 'three/examples/jsm/objects/Sky.js';
|
|
6
6
|
import { AnimationOperate } from '@three3d/animation';
|
|
7
|
+
import type SoonGIS from 'soongis';
|
|
7
8
|
import Scener from './Scener';
|
|
8
9
|
import { CSS2DRenderer, CSS3DRenderer } from '../Renderer';
|
|
10
|
+
import SoonGISManager from './SoonGISManager';
|
|
9
11
|
import RendererManager from './RendererManager';
|
|
10
12
|
import CameraManager from './CameraManager';
|
|
11
13
|
import EffectManager from './EffectManager';
|
|
@@ -19,6 +21,7 @@ export declare const innerRenderState: {
|
|
|
19
21
|
needsUpdate: boolean;
|
|
20
22
|
};
|
|
21
23
|
declare class Viewport {
|
|
24
|
+
readonly soongis?: SoonGIS | undefined;
|
|
22
25
|
clock: Clock;
|
|
23
26
|
raycaster: Raycaster;
|
|
24
27
|
options: ViewportOptions;
|
|
@@ -28,8 +31,8 @@ declare class Viewport {
|
|
|
28
31
|
scene: Scene;
|
|
29
32
|
sky: Sky | null;
|
|
30
33
|
rendererManager: RendererManager;
|
|
31
|
-
container:
|
|
32
|
-
interactiveContainer:
|
|
34
|
+
container: HTMLElement;
|
|
35
|
+
interactiveContainer: HTMLElement;
|
|
33
36
|
renderer: WebGLRenderer;
|
|
34
37
|
rendererCSS2D: CSS2DRenderer;
|
|
35
38
|
rendererCSS3D: CSS3DRenderer;
|
|
@@ -45,6 +48,7 @@ declare class Viewport {
|
|
|
45
48
|
mixer: AnimationMixer;
|
|
46
49
|
clipsSet: Set<AnimationClip>;
|
|
47
50
|
viewHelper: ViewHelper;
|
|
51
|
+
soongisManager: SoonGISManager;
|
|
48
52
|
/**
|
|
49
53
|
* render 前回调(每帧执行)
|
|
50
54
|
*/
|
|
@@ -52,11 +56,11 @@ declare class Viewport {
|
|
|
52
56
|
/**
|
|
53
57
|
* render 后回调
|
|
54
58
|
*/
|
|
55
|
-
postRender: Map<string | number, (
|
|
59
|
+
postRender: Map<string | number, () => void>;
|
|
56
60
|
private selectModel;
|
|
57
61
|
private selectPoi;
|
|
58
62
|
private _loop;
|
|
59
|
-
constructor(options: ViewportOptions);
|
|
63
|
+
constructor(options: ViewportOptions, soongis?: SoonGIS | undefined);
|
|
60
64
|
_initInfo(): void;
|
|
61
65
|
_initStats(): void;
|
|
62
66
|
/**
|
|
@@ -95,7 +99,7 @@ declare class Viewport {
|
|
|
95
99
|
*/
|
|
96
100
|
render(fn?: () => unknown): Promise<number>;
|
|
97
101
|
/**
|
|
98
|
-
*
|
|
102
|
+
* 触发渲染(兼容 soongis)
|
|
99
103
|
* @param count
|
|
100
104
|
*/
|
|
101
105
|
triggerRender(count?: number): void;
|
|
@@ -113,7 +117,11 @@ declare class Viewport {
|
|
|
113
117
|
* @param time
|
|
114
118
|
* @returns
|
|
115
119
|
*/
|
|
116
|
-
autoRender(
|
|
120
|
+
autoRender(): void;
|
|
121
|
+
/**
|
|
122
|
+
* 兼容 soongis
|
|
123
|
+
*/
|
|
124
|
+
baseRender(): void;
|
|
117
125
|
animate(time: number): void;
|
|
118
126
|
getOffsetByPosition(position: Position): {
|
|
119
127
|
left: number;
|
package/types/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import * as THREE from 'three';
|
|
10
10
|
import { Object3D, Vector3, Euler, Box3, AnimationClip, Light, Texture, Mesh, Skeleton } from 'three';
|
|
11
11
|
import type { Camera } from 'three';
|
|
12
|
+
import type SoonGIS from 'soongis';
|
|
12
13
|
import * as shared from './Shared';
|
|
13
14
|
import Animation from './Animation';
|
|
14
15
|
import { PathAnimation, PathAnimationOptions } from './Animation/path-animation';
|
|
@@ -16,6 +17,7 @@ import { CreatePathAnimationOptions, CreatePathAnimationActionForCameraOptions,
|
|
|
16
17
|
import * as library from './Library';
|
|
17
18
|
import { BaseObject3D, Model, ModelInfo, Poi, PoiInfo, PoiNode, PoiNodeInfo, Topology, TopologyInfo, Group, GroupInfo, Canvas3D, Canvas3DInfo, PluginObject, PluginObjectInfo } from './Library';
|
|
18
19
|
import { Controls } from './Controls';
|
|
20
|
+
import SoonGISManager from './Viewport/SoonGISManager';
|
|
19
21
|
import Viewport from './Viewport';
|
|
20
22
|
import Manager from './Manager';
|
|
21
23
|
import { BaseObjectInfo, ViewportOptions, SceneGlobalEvents, PluginsConstructor, IColor, Position, Rotation, OffsetPoint, ModelAnimationFindFunc, TopologyNodeInfo, FlyToViewpoint, FlyToOptions, FlyToObjOptions, SurroundOptions, LabelOptions, EdgeSelectOptions, StrokeSelectOptions, OpacitySelectOptions, HighlightSelectOptions, EmissiveSelectOptions, FogOptions, UserDataPropertyFindFunc, AmbientLightOptions, DirectionalLightOptions, HemisphereLightOptions, SpotLightOptions, PointLightOptions, CloneModelInfo, ClonePoiInfo, ShortestPathInfo, ShortestPathByMultipleStartPoints, ShortestPathByMultipleEndPoints, TopologyInfoForGml, GridHelperOptions, AxesHelperOptions, BoxHelperOptions, PlaneHelperOptions, GroundHelperOptions, DirectionalLightHelperOptions, HemisphereLightHelperOptions, SpotLightHelperOptions, PointLightHelperOptions, SignalsState, ControlsOptions, RectAreaLightOptions, RectAreaLightHelperOptions, SkyOptions, IColorSpace, ToneMappingOptions, SSROptions, SSAOOptions, BloomOptions, IVector3, EnvironmentOptions, PluginsConstructorWithOptions, TopologyPassableInfo, CameraViewpointData, CameraViewpointDataLegacy } from './Interface';
|
|
@@ -25,9 +27,10 @@ import './three-patches';
|
|
|
25
27
|
export type InitOptions = ViewportOptions;
|
|
26
28
|
export type InitEvents = SceneGlobalEvents;
|
|
27
29
|
export interface SoonSpaceConstructor {
|
|
28
|
-
el
|
|
30
|
+
el?: string;
|
|
29
31
|
options?: InitOptions;
|
|
30
32
|
events?: InitEvents;
|
|
33
|
+
soongis?: SoonGIS;
|
|
31
34
|
}
|
|
32
35
|
export * from './Library';
|
|
33
36
|
export * from './Interface';
|
|
@@ -45,9 +48,7 @@ export declare class SoonSpace {
|
|
|
45
48
|
};
|
|
46
49
|
Quadratic: {
|
|
47
50
|
In: (amount: number) => number;
|
|
48
|
-
Out: (amount: number) => number;
|
|
49
|
-
/******/
|
|
50
|
-
/******/
|
|
51
|
+
Out: (amount: number) => number;
|
|
51
52
|
InOut: (amount: number) => number;
|
|
52
53
|
};
|
|
53
54
|
Cubic: {
|
|
@@ -58,7 +59,7 @@ export declare class SoonSpace {
|
|
|
58
59
|
Quartic: {
|
|
59
60
|
In: (amount: number) => number;
|
|
60
61
|
Out: (amount: number) => number;
|
|
61
|
-
InOut: (amount: number) => number;
|
|
62
|
+
InOut: (amount: number) => number; /******* Init methods */
|
|
62
63
|
};
|
|
63
64
|
Quintic: {
|
|
64
65
|
In: (amount: number) => number;
|
|
@@ -126,9 +127,7 @@ export declare class SoonSpace {
|
|
|
126
127
|
};
|
|
127
128
|
Quadratic: {
|
|
128
129
|
In: (amount: number) => number;
|
|
129
|
-
Out: (amount: number) => number;
|
|
130
|
-
/******/
|
|
131
|
-
/******/
|
|
130
|
+
Out: (amount: number) => number;
|
|
132
131
|
InOut: (amount: number) => number;
|
|
133
132
|
};
|
|
134
133
|
Cubic: {
|
|
@@ -139,7 +138,7 @@ export declare class SoonSpace {
|
|
|
139
138
|
Quartic: {
|
|
140
139
|
In: (amount: number) => number;
|
|
141
140
|
Out: (amount: number) => number;
|
|
142
|
-
InOut: (amount: number) => number;
|
|
141
|
+
InOut: (amount: number) => number; /******* Init methods */
|
|
143
142
|
};
|
|
144
143
|
Quintic: {
|
|
145
144
|
In: (amount: number) => number;
|
|
@@ -228,10 +227,11 @@ export declare class SoonSpace {
|
|
|
228
227
|
readonly library: typeof library;
|
|
229
228
|
readonly signals: SignalsState;
|
|
230
229
|
readonly controls: Controls;
|
|
230
|
+
readonly soongisManager: SoonGISManager;
|
|
231
231
|
readonly viewport: Viewport;
|
|
232
232
|
readonly manager: Manager;
|
|
233
233
|
readonly plugins: Record<string, any>;
|
|
234
|
-
constructor(
|
|
234
|
+
constructor(params: SoonSpaceConstructor);
|
|
235
235
|
/******/
|
|
236
236
|
/******/
|
|
237
237
|
/******* Init methods */
|