@baidumap/mapv-three 1.3.0 → 1.3.3

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.
Files changed (47) hide show
  1. package/dist/assets/wasm/lanelet.js +4263 -0
  2. package/dist/assets/wasm/lanelet.wasm +0 -0
  3. package/dist/assets/workers/BaiduVectorParser.worker-d550338e.js +7168 -0
  4. package/dist/assets/workers/CesiumTerrainParser.worker-20119751.js +5860 -0
  5. package/dist/assets/workers/MVTParser.worker-7dc8b0e4.js +10759 -0
  6. package/dist/mapvthree.module.js +22299 -30394
  7. package/dist/mapvthree.umd.js +6 -11
  8. package/dist/types/assets/wasm/lanelet.d.ts +2 -0
  9. package/dist/types/index.d.ts +2 -0
  10. package/dist/types/threejs/loaders/gltf/GLTFCesiumRTCExtension.d.ts +4 -0
  11. package/dist/types/threejs/objects/element/OctahedralImpostor.d.ts +3 -0
  12. package/dist/types/threejs/objects/polygon/Polygon.d.ts +1 -0
  13. package/dist/types/threemap/3dtiles/elements/TileInstancedElementManager.d.ts +18 -4
  14. package/dist/types/threemap/Engine.d.ts +5 -0
  15. package/dist/types/threemap/animations/ObjectTracker.d.ts +57 -47
  16. package/dist/types/threemap/animations/ObjectTracker_deprecated.d.ts +56 -0
  17. package/dist/types/threemap/animations/PathTracker.d.ts +101 -112
  18. package/dist/types/threemap/animations/PathTracker_deprecated.d.ts +136 -0
  19. package/dist/types/threemap/animations/RotateTracker.d.ts +29 -0
  20. package/dist/types/threemap/animations/TrackerAbstract.d.ts +103 -0
  21. package/dist/types/threemap/controls/editors/CircleEditor.d.ts +0 -7
  22. package/dist/types/threemap/controls/editors/Editor.d.ts +100 -21
  23. package/dist/types/threemap/controls/editors/PointEditor.d.ts +0 -9
  24. package/dist/types/threemap/controls/editors/PolygonEditor.d.ts +0 -9
  25. package/dist/types/threemap/controls/editors/RectEditor.d.ts +0 -9
  26. package/dist/types/threemap/controls/editors/SplineEditor.d.ts +0 -5
  27. package/dist/types/threemap/engine/Rendering.d.ts +12 -6
  28. package/dist/types/threemap/engine/map/earth/EllipsoidCamera.d.ts +3 -0
  29. package/dist/types/threemap/engine/rendering/MainNew.d.ts +1 -0
  30. package/dist/types/threemap/engine/rendering/MicroTaskScheduler.d.ts +1 -0
  31. package/dist/types/threemap/engine/rendering/Picking.d.ts +0 -1
  32. package/dist/types/threemap/engine/rendering/RenderState.d.ts +15 -0
  33. package/dist/types/threemap/engine/rendering/features/Features.d.ts +1 -0
  34. package/dist/types/threemap/engine/rendering/postprocessing/Postprocessings.d.ts +1 -0
  35. package/dist/types/threemap/engine/rendering/postprocessing/VolumetricCloudsPass.d.ts +1 -0
  36. package/dist/types/threemap/engine/rendering/scene/SceneRendering.d.ts +1 -0
  37. package/dist/types/threemap/mapView/constants.d.ts +5 -0
  38. package/dist/types/threemap/mapView/grid/BaiduLaneVectorGrid.d.ts +33 -0
  39. package/dist/types/threemap/mapView/grid/BaiduVectorOnlineGrid.d.ts +128 -2
  40. package/dist/types/threemap/mapView/map/MapView.d.ts +6 -0
  41. package/dist/types/threemap/mapView/surface/MapSurface.d.ts +19 -1
  42. package/dist/types/threemap/mapView/tileProvider/vector/BaiduLaneVectorTileProvider.d.ts +152 -0
  43. package/dist/types/threemap/mapView/tileProvider/worker/BaiduLaneVectorParser.worker.d.ts +1 -0
  44. package/dist/types/threemap/video/VideoConfig.d.ts +16 -0
  45. package/dist/types/util/math.d.ts +5 -0
  46. package/dist/types/util/request.d.ts +1 -1
  47. package/package.json +1 -2
@@ -0,0 +1,2 @@
1
+ export default Module;
2
+ declare function Module(moduleArg?: {}): Promise<{}>;
@@ -34,6 +34,7 @@ export { GridCoordProvider } from "./threemap/mapView/tileProvider/imagery/GridC
34
34
  export { PlaneTerrainTileProvider } from "./threemap/mapView/tileProvider/terrain/PlaneTerrainTileProvider";
35
35
  export { CesiumTerrainTileProvider } from "./threemap/mapView/tileProvider/terrain/CesiumTerrainTileProvider";
36
36
  export { BaiduVectorTileProvider } from "./threemap/mapView/tileProvider/vector/BaiduVectorTileProvider";
37
+ export { BaiduLaneVectorTileProvider } from "./threemap/mapView/tileProvider/vector/BaiduLaneVectorTileProvider";
37
38
  export { GeoJSONVectorTileProvider } from "./threemap/mapView/tileProvider/vector/GeoJSONVectorTileProvider";
38
39
  export { BaiduTrafficTileProvider } from "./threemap/mapView/tileProvider/vector/BaiduTrafficTileProvider";
39
40
  export { MapboxVectorTileProvider } from "./threemap/mapView/tileProvider/vector/MapboxVectorTileProvider";
@@ -159,6 +160,7 @@ export { FoliageLeafMaterial } from "./threejs/materials/natural/FoliageLeafMate
159
160
  export { BatchBuildingMaterial } from "./threemap/materials/BatchBuildingMaterial";
160
161
  export { ColorAdjustPass } from "./threejs/postprocessing/ColorAdjustPass";
161
162
  export { Transforms } from "../src/threemap/engine/map/earth/Transforms";
163
+ export { VideoConfig } from "./threemap/video/VideoConfig";
162
164
  export * as urlUtils from "./util/urlUtils";
163
165
  export * as geojsonUtils from "./util/geojsonUtils";
164
166
  export * as colorUtils from "./util/colorUtils";
@@ -0,0 +1,4 @@
1
+ export class GLTFCesiumRTCExtension {
2
+ name: string;
3
+ afterRoot(res: any): void;
4
+ }
@@ -5,6 +5,9 @@ export class OctahedralImpostor extends GeoInstancedMesh {
5
5
  normalDepth: null;
6
6
  orm: null;
7
7
  };
8
+ static _defaultTexturesPromise: null;
9
+ static _bitmapPromises: Map<any, any>;
10
+ static _getBitmap(url: any): any;
8
11
  static initDefaultTextures(): Promise<void>;
9
12
  static createTextures(diffuseUrl: any, normalDepthUrl: any, ormUrl: any): Promise<{
10
13
  diffuseTexture: any;
@@ -197,6 +197,7 @@ export class Polygon extends GeoMesh {
197
197
  * @protected
198
198
  */
199
199
  protected onBeforeSceneRenderHook(engine: Engine, scene: Scene, camera: Camera, renderState: Object): void;
200
+ getNormal(): any;
200
201
  /**
201
202
  * 计算矩形边界
202
203
  * @returns {Array<number>} 边界数组 [minX, minY, maxX, maxY]
@@ -153,14 +153,21 @@ export class TileInstancedElementManager {
153
153
  isFoliage: boolean;
154
154
  isBox: boolean;
155
155
  scaleByZ: boolean;
156
- instances: {
156
+ instances: ({
157
157
  subtype: string;
158
158
  diffuseTexture: string;
159
159
  normalDepthTexture: string;
160
160
  ormTexture: string;
161
161
  imposterScale: number;
162
162
  uvOffset: number;
163
- }[];
163
+ } | {
164
+ subtype: string;
165
+ imposterScale: number;
166
+ uvOffset: number;
167
+ diffuseTexture?: undefined;
168
+ normalDepthTexture?: undefined;
169
+ ormTexture?: undefined;
170
+ })[];
164
171
  };
165
172
  });
166
173
  get config(): {
@@ -169,14 +176,21 @@ export class TileInstancedElementManager {
169
176
  isFoliage: boolean;
170
177
  isBox: boolean;
171
178
  scaleByZ: boolean;
172
- instances: {
179
+ instances: ({
173
180
  subtype: string;
174
181
  diffuseTexture: string;
175
182
  normalDepthTexture: string;
176
183
  ormTexture: string;
177
184
  imposterScale: number;
178
185
  uvOffset: number;
179
- }[];
186
+ } | {
187
+ subtype: string;
188
+ imposterScale: number;
189
+ uvOffset: number;
190
+ diffuseTexture?: undefined;
191
+ normalDepthTexture?: undefined;
192
+ ormTexture?: undefined;
193
+ })[];
180
194
  };
181
195
  };
182
196
  set labelEnabled(enabled: boolean);
@@ -131,6 +131,11 @@ export class Engine {
131
131
  * // TODO: 暂时不对外开放,考虑移到engine.map中
132
132
  */
133
133
  private unlockCamera;
134
+ /**
135
+ * 渲染电影
136
+ * @param {Movie} movie 电影对象
137
+ */
138
+ renderVideo(videoConfig: any): Promise<void>;
134
139
  /**
135
140
  * 容器对象
136
141
  * @type {HTMLElement}
@@ -1,56 +1,66 @@
1
- /**
2
- * 对象跟踪
3
- * 用于追踪指定物体,跟随对象调整视野
4
- * ```javascript
5
- * const objectTracker = engine.add(new ObjectTracker())
6
- * objectTracker.track(car, {
7
- * radius: 50,
8
- * pitch: 40,
9
- * heading: 0
10
- * })
11
- * ```
12
- */
13
- export class ObjectTracker {
1
+ export class ObjectTracker extends TrackerAbstract {
2
+ /**
3
+ * 计算世界坐标系下的变换后 AABB(修正为 8 个唯一顶点)
4
+ */
14
5
  static computeTransformedBoundingBox(box: any, transform: any): any;
15
6
  /** @private */ private _trackObject;
16
- /** @private */ private _trackStatus;
17
7
  /** @private */ private _trackConfig;
18
- /** @private */ private _trackParams;
19
- /** @private */ private _lastTrackParams;
8
+ /** @private */ private _lastState;
20
9
  /**
21
- * 追踪物体
22
- * @param {*} object 物体
23
- * @param {*} config 追踪配置
24
- * @param {number?} config.radius 和对象的距离
25
- * @param {number?} config.heading 视野偏航角
26
- * @param {number?} config.pitch 视野俯仰角
27
- * @param {boolean?} config.lock 锁定视角,默认为true
28
- * @param {number?} config.height 相机高度
29
- */
30
- track(object: any, config: any): void;
10
+ * 开始追踪
11
+ * @param {Object3D|Vector3|[number,number,number]|{instance:any,instanceIndex:number}} object
12
+ * @param {{
13
+ * radius?:number, pitch?:number, heading?:number,
14
+ * lock?:boolean, height?:number, extraDir?:number,
15
+ * duration?:number, easing?:string|Function
16
+ * }} config
17
+ */
18
+ track(object: Object3D | Vector3 | [number, number, number] | {
19
+ instance: any;
20
+ instanceIndex: number;
21
+ }, config?: {
22
+ radius?: number;
23
+ pitch?: number;
24
+ heading?: number;
25
+ lock?: boolean;
26
+ height?: number;
27
+ extraDir?: number;
28
+ duration?: number;
29
+ easing?: string | Function;
30
+ }): void;
31
+ /**
32
+ * 基类要求:根据 ratio(0~1)返回当前帧状态
33
+ * 返回 { point: 地图坐标数组, hpr: {heading, pitch, roll} }
34
+ */
35
+ updatePositionByPercentage(): {
36
+ point: any[];
37
+ hpr: {
38
+ heading: number;
39
+ pitch: number;
40
+ roll: number;
41
+ };
42
+ } | null;
43
+ onTrackFrame(): void;
31
44
  /**
32
- * 停止追踪
45
+ * 计算目标点与朝向(内部统一从“世界坐标”推导 → 转为“地图坐标”返回)
33
46
  */
34
- stop(): void;
35
- /** @protected */
36
- protected afterAddToEngine(engine: any): void;
37
- _engine: any;
38
- /** @protected */
39
- protected onBeforeScenePrepareRender(engine: any, scene: any, camera: any, renderState: any): void;
40
- onTrackFrame(lastTrackParams: any, trackParams: any): void;
47
+ _computeTargetState(target: any, view: any): {
48
+ point: any[];
49
+ hpr: {
50
+ heading: number;
51
+ pitch: number;
52
+ roll: number;
53
+ };
54
+ };
41
55
  /**
42
- * 获取目标相机
43
- * @param {Object} viewer 视图实例
44
- * @param {any} target 可以是 Vector3或者[x,y,z]或者是几何体Mesh,Polygon,Line,Point等
45
- * @param {Object} view 目标视线
46
- * @param {Number} [view.yaw=0] 平视角
47
- * @param {Number} [view.pitch=-0.5*PI] 俯仰角
48
- * @param {Number} [view.radius=0] 和目标物之间的距离
49
- * @returns {Object} 相机
56
+ * 采样目标的“世界中心点 + 朝向”
57
+ * - 支持 instanced entity
58
+ * - 支持 Object3D(合并子层级包围盒 取 boundingSphere.center)
59
+ * - 支持 Vector3 / [x,y,z]
50
60
  */
51
- getCameraByTargetAndView(engine: any, target: any, view?: {
52
- yaw?: number | undefined;
53
- pitch?: number | undefined;
54
- radius?: number | undefined;
55
- }): Object;
61
+ _sampleTargetWorldPose(target: any, view: any): {
62
+ worldCenter: any;
63
+ targetEuler: any;
64
+ };
56
65
  }
66
+ import { TrackerAbstract } from './TrackerAbstract';
@@ -0,0 +1,56 @@
1
+ /**
2
+ * 对象跟踪
3
+ * 用于追踪指定物体,跟随对象调整视野
4
+ * ```javascript
5
+ * const objectTracker = engine.add(new ObjectTracker())
6
+ * objectTracker.track(car, {
7
+ * radius: 50,
8
+ * pitch: 40,
9
+ * heading: 0
10
+ * })
11
+ * ```
12
+ */
13
+ export class ObjectTracker {
14
+ static computeTransformedBoundingBox(box: any, transform: any): any;
15
+ /** @private */ private _trackObject;
16
+ /** @private */ private _trackStatus;
17
+ /** @private */ private _trackConfig;
18
+ /** @private */ private _trackParams;
19
+ /** @private */ private _lastTrackParams;
20
+ /**
21
+ * 追踪物体
22
+ * @param {*} object 物体
23
+ * @param {*} config 追踪配置
24
+ * @param {number?} config.radius 和对象的距离
25
+ * @param {number?} config.heading 视野偏航角
26
+ * @param {number?} config.pitch 视野俯仰角
27
+ * @param {boolean?} config.lock 锁定视角,默认为true
28
+ * @param {number?} config.height 相机高度
29
+ */
30
+ track(object: any, config: any): void;
31
+ /**
32
+ * 停止追踪
33
+ */
34
+ stop(): void;
35
+ /** @protected */
36
+ protected afterAddToEngine(engine: any): void;
37
+ _engine: any;
38
+ /** @protected */
39
+ protected onBeforeScenePrepareRender(engine: any, scene: any, camera: any, renderState: any): void;
40
+ onTrackFrame(lastTrackParams: any, trackParams: any): void;
41
+ /**
42
+ * 获取目标相机
43
+ * @param {Object} viewer 视图实例
44
+ * @param {any} target 可以是 Vector3或者[x,y,z]或者是几何体Mesh,Polygon,Line,Point等
45
+ * @param {Object} view 目标视线
46
+ * @param {Number} [view.yaw=0] 平视角
47
+ * @param {Number} [view.pitch=-0.5*PI] 俯仰角
48
+ * @param {Number} [view.radius=0] 和目标物之间的距离
49
+ * @returns {Object} 相机
50
+ */
51
+ getCameraByTargetAndView(engine: any, target: any, view?: {
52
+ yaw?: number | undefined;
53
+ pitch?: number | undefined;
54
+ radius?: number | undefined;
55
+ }): Object;
56
+ }
@@ -1,64 +1,84 @@
1
- export class PathTracker {
2
- /** @private */ private _isRunning;
3
- /** @private */ private _animationStartTime;
4
- /** @private */ private _animationDuration;
5
- /** @private */ private _animationTransform;
6
- /** @private */ private _animationCurrenState;
7
- /** @private */ private _engine;
8
- /** @private */ private _track;
9
- /** @private */ private _frameInfo;
10
- /** @private */ private _sampledPath;
11
- /** @private */ private _isPause;
12
- /** @private */ private _pauseTime;
13
- /** @private */ private _pauseTimestamp;
14
- /** @private */ private _object;
1
+ export class PathTracker extends TrackerAbstract {
2
+ _sampledPath: any[];
3
+ _arcInfo: {};
15
4
  /** @private */ private _interpolateDirectThreshold;
16
5
  /** @private */ private _interpolateDirectThresholdPercent;
17
- /** @private */ private _lockView;
18
- /** @private */ private _viewFollow;
19
- /** @private */ private _viewMode;
20
- /** @private */ private _arcInfo;
21
- /** @private */ private _pointHandle;
22
- /** @protected */
23
- protected afterAddToEngine(engine: any): void;
24
- beforeRemoveFromEngine(): void;
25
- _update: () => void;
26
- /**
27
- * @internal
28
- * 控制地图视野移动
29
- */
30
- _updateCamera(camera: any, center: any, zoom: any, zoomUnits: any, heading: any, pitch: any): void;
31
- _computeCameraMatrixGlobe(camera: any, center: any, zoom: any, zoomUnits: any, heading: any, pitch: any): void;
32
- /**
33
- * @internal
34
- * 不用map的方法,直接修改相机,避免出现卡顿问题
35
- */
36
- _computeCameraMatrixBlankMap(camera: any, center: any, zoom: any, zoomUnits: any, heading: any, pitch: any): void;
37
- /**
38
- * @internal
39
- * 3DControl的lookAt方法是直接操作相机
40
- */
41
- _computeCameraMatrixBlankMap3D(camera: any, center: any, zoom: any, zoomUnits: any, heading: any, pitch: any): void;
42
- _updatePositionAndDirection(last: any, current: any, percent: any, isTrans: any, transPercent: any): {
6
+ updatePositionByPercentage(ratio: any): {
7
+ point: any;
8
+ hpr: {
9
+ heading: number;
10
+ pitch: number;
11
+ roll: number;
12
+ };
13
+ direction: any;
14
+ } | {
15
+ point: any[];
16
+ hpr: {
17
+ heading: any;
18
+ pitch: any;
19
+ roll: any;
20
+ };
21
+ } | undefined;
22
+ _interpolatePath(ratio: any): {
23
+ point: any;
24
+ hpr: {
25
+ heading: number;
26
+ pitch: number;
27
+ roll: number;
28
+ };
29
+ direction: any;
30
+ } | {
43
31
  point: any[];
32
+ hpr: {
33
+ heading: any;
34
+ pitch: any;
35
+ roll: any;
36
+ };
37
+ };
38
+ _handleFrame(lastFrame: any, currentFrame: any, last: any, current: any, next: any, point: any, transPercent: any, percent: any, ratio: any): {
39
+ point: any;
40
+ hpr: {
41
+ heading: number;
42
+ pitch: number;
43
+ roll: number;
44
+ };
44
45
  direction: any;
45
46
  };
46
- _updatePitch(last: any, current: any, percent: any): number;
47
- /**
48
- * @internal
49
- */
50
- _interpolatePath(ratio: any): {
51
- percent: any;
47
+ _getSegment(ratio: any, dataLength: any): {
48
+ last: any;
49
+ current: any;
50
+ next: any;
51
+ isStart: boolean;
52
+ isEnd: boolean;
53
+ segmentPercent: number;
54
+ lastFrame: any;
55
+ currentFrame: any;
56
+ };
57
+ _computeTransition(percent: any, last: any, current: any, next: any, isStart: any, isEnd: any): {
58
+ isTransition: any;
59
+ transPercent: number;
60
+ };
61
+ _updatePositionAndDirection(last: any, current: any, percent: any, isTrans: any, transPercent: any): {
62
+ point: any[];
63
+ hpr: {
64
+ heading: any;
65
+ pitch: any;
66
+ roll: any;
67
+ };
68
+ };
69
+ _findCurrentSegment(ratio: any): {
70
+ last: any;
71
+ current: any;
72
+ next: any;
73
+ percent: number;
74
+ lastFrame: null;
75
+ currentFrame: null;
76
+ index: number;
77
+ } | null;
78
+ _calculateLocation(last: any, current: any, percent: any): {
52
79
  point: any[];
53
- position: any;
54
- distance: number;
55
80
  direction: any;
56
- pitch: number;
57
- path: any;
58
81
  };
59
- /**
60
- * @internal
61
- */
62
82
  _createSampledPath(path: any): {
63
83
  percent: string;
64
84
  point: any;
@@ -68,69 +88,38 @@ export class PathTracker {
68
88
  pitch: number;
69
89
  }[] | undefined;
70
90
  /**
71
- * @internal
72
- * 计算v0到v1的地图倾斜角度
73
- * @param {Array} v0 起点
74
- * @param {Array} v1 终点
75
- */
76
- _getRadians(v0: any[], v1: any[]): number;
77
- startByRouteServe(start: any, end: any, options?: {}): void;
78
- /**
79
- * 设置视野跟随的坐标
80
- * @param {Array | GeoJSON} target 坐标数组或geojson对象
81
- */
82
- set track(target: any[] | GeoJSON);
83
- get track(): any[] | GeoJSON;
84
- set viewMode(value: string);
85
- get viewMode(): string;
86
- set pointHandle(value: any);
87
- updateViewConfig(viewConfig: any): void;
88
- /**
89
- * 开始漫游动画,可设置动画时长、视野距离、视野偏移
90
- * @param {{duration?: number, heading?: number, pitch?: number, distance?: number}} options 动画参数
91
+ * 计算两点间的地图倾斜角度
91
92
  */
92
- start(options?: {
93
- duration?: number;
94
- heading?: number;
95
- pitch?: number;
96
- distance?: number;
97
- }): void;
93
+ _getRadians(v0: any, v1: any): number;
94
+ _parseCoordinateArray(target: any): {
95
+ track: any[];
96
+ frameInfo: never[];
97
+ } | undefined;
98
+ _parseGeoJSON(target: any): {
99
+ track: any;
100
+ frameInfo: any;
101
+ } | undefined;
102
+ _parseFrameArray(target: any): {
103
+ track: any[][];
104
+ frameInfo: {
105
+ pitch: any;
106
+ yaw: any;
107
+ aim: any;
108
+ speed: any;
109
+ time: any;
110
+ }[];
111
+ } | undefined;
98
112
  /**
99
- * 暂停漫游动画
100
- * @param {*} unlock 是否解锁视野
101
- * @returns 当前视角参数
102
- */
103
- pause(unlock: any): null;
104
- /**
105
- * 停止漫游动画
106
- */
107
- stop(): void;
108
- replay(): void;
109
- /**
110
- * 设置拐弯处的开始差值的距离
111
- * @param {number} value 距离单位米
113
+ * 设置路径数据
114
+ * @param {Array|Object} target 路径数据
112
115
  */
116
+ set track(target: any[] | Object);
117
+ get track(): any[] | Object;
113
118
  set interpolateDirectThreshold(value: number);
114
119
  get interpolateDirectThreshold(): number;
115
- /**
116
- * 设置拐弯处的开始差值的距离百分比
117
- * @param {number} value 百分比 0 < value < 0.5
118
- */
119
- set interpolateDirectThresholdPercent(value: number);
120
- get interpolateDirectThresholdPercent(): number;
121
- /**
122
- * 锁定视角
123
- * @param {boolean} value 是否锁定
124
- */
125
- set lockView(value: boolean);
126
- get lockView(): boolean;
127
- set viewFollow(value: boolean);
128
- get viewFollow(): boolean;
129
- /**
130
- * 设置跟踪的object物体,如果参数为模型则需遵循以下要求:模型的前进方向为X正半轴,且按+Y UP导出
131
- * @param {Object3D} value 传入threejs的Object对象
132
- */
133
- set object(value: Object3D);
134
- get object(): Object3D;
120
+ set pointHandle(value: any);
121
+ get pointHandle(): any;
122
+ _pointHandle: any;
135
123
  curvePath: any;
136
124
  }
125
+ import { TrackerAbstract } from './TrackerAbstract';
@@ -0,0 +1,136 @@
1
+ export class PathTracker {
2
+ /** @private */ private _isRunning;
3
+ /** @private */ private _animationStartTime;
4
+ /** @private */ private _animationDuration;
5
+ /** @private */ private _animationTransform;
6
+ /** @private */ private _animationCurrenState;
7
+ /** @private */ private _engine;
8
+ /** @private */ private _track;
9
+ /** @private */ private _frameInfo;
10
+ /** @private */ private _sampledPath;
11
+ /** @private */ private _isPause;
12
+ /** @private */ private _pauseTime;
13
+ /** @private */ private _pauseTimestamp;
14
+ /** @private */ private _object;
15
+ /** @private */ private _interpolateDirectThreshold;
16
+ /** @private */ private _interpolateDirectThresholdPercent;
17
+ /** @private */ private _lockView;
18
+ /** @private */ private _viewFollow;
19
+ /** @private */ private _viewMode;
20
+ /** @private */ private _arcInfo;
21
+ /** @private */ private _pointHandle;
22
+ /** @protected */
23
+ protected afterAddToEngine(engine: any): void;
24
+ beforeRemoveFromEngine(): void;
25
+ _update: () => void;
26
+ /**
27
+ * @internal
28
+ * 控制地图视野移动
29
+ */
30
+ _updateCamera(camera: any, center: any, zoom: any, zoomUnits: any, heading: any, pitch: any): void;
31
+ _computeCameraMatrixGlobe(camera: any, center: any, zoom: any, zoomUnits: any, heading: any, pitch: any): void;
32
+ /**
33
+ * @internal
34
+ * 不用map的方法,直接修改相机,避免出现卡顿问题
35
+ */
36
+ _computeCameraMatrixBlankMap(camera: any, center: any, zoom: any, zoomUnits: any, heading: any, pitch: any): void;
37
+ /**
38
+ * @internal
39
+ * 3DControl的lookAt方法是直接操作相机
40
+ */
41
+ _computeCameraMatrixBlankMap3D(camera: any, center: any, zoom: any, zoomUnits: any, heading: any, pitch: any): void;
42
+ _updatePositionAndDirection(last: any, current: any, percent: any, isTrans: any, transPercent: any): {
43
+ point: any[];
44
+ direction: any;
45
+ };
46
+ _updatePitch(last: any, current: any, percent: any): number;
47
+ /**
48
+ * @internal
49
+ */
50
+ _interpolatePath(ratio: any): {
51
+ percent: any;
52
+ point: any[];
53
+ position: any;
54
+ distance: number;
55
+ direction: any;
56
+ pitch: number;
57
+ path: any;
58
+ };
59
+ /**
60
+ * @internal
61
+ */
62
+ _createSampledPath(path: any): {
63
+ percent: string;
64
+ point: any;
65
+ position: any;
66
+ distance: number;
67
+ direction: any;
68
+ pitch: number;
69
+ }[] | undefined;
70
+ /**
71
+ * @internal
72
+ * 计算v0到v1的地图倾斜角度
73
+ * @param {Array} v0 起点
74
+ * @param {Array} v1 终点
75
+ */
76
+ _getRadians(v0: any[], v1: any[]): number;
77
+ startByRouteServe(start: any, end: any, options?: {}): void;
78
+ /**
79
+ * 设置视野跟随的坐标
80
+ * @param {Array | GeoJSON} target 坐标数组或geojson对象
81
+ */
82
+ set track(target: any[] | GeoJSON);
83
+ get track(): any[] | GeoJSON;
84
+ set viewMode(value: string);
85
+ get viewMode(): string;
86
+ set pointHandle(value: any);
87
+ updateViewConfig(viewConfig: any): void;
88
+ /**
89
+ * 开始漫游动画,可设置动画时长、视野距离、视野偏移
90
+ * @param {{duration?: number, heading?: number, pitch?: number, distance?: number}} options 动画参数
91
+ */
92
+ start(options?: {
93
+ duration?: number;
94
+ heading?: number;
95
+ pitch?: number;
96
+ distance?: number;
97
+ }): void;
98
+ /**
99
+ * 暂停漫游动画
100
+ * @param {*} unlock 是否解锁视野
101
+ * @returns 当前视角参数
102
+ */
103
+ pause(unlock: any): null;
104
+ /**
105
+ * 停止漫游动画
106
+ */
107
+ stop(): void;
108
+ replay(): void;
109
+ /**
110
+ * 设置拐弯处的开始差值的距离
111
+ * @param {number} value 距离单位米
112
+ */
113
+ set interpolateDirectThreshold(value: number);
114
+ get interpolateDirectThreshold(): number;
115
+ /**
116
+ * 设置拐弯处的开始差值的距离百分比
117
+ * @param {number} value 百分比 0 < value < 0.5
118
+ */
119
+ set interpolateDirectThresholdPercent(value: number);
120
+ get interpolateDirectThresholdPercent(): number;
121
+ /**
122
+ * 锁定视角
123
+ * @param {boolean} value 是否锁定
124
+ */
125
+ set lockView(value: boolean);
126
+ get lockView(): boolean;
127
+ set viewFollow(value: boolean);
128
+ get viewFollow(): boolean;
129
+ /**
130
+ * 设置跟踪的object物体,如果参数为模型则需遵循以下要求:模型的前进方向为X正半轴,且按+Y UP导出
131
+ * @param {Object3D} value 传入threejs的Object对象
132
+ */
133
+ set object(value: Object3D);
134
+ get object(): Object3D;
135
+ curvePath: any;
136
+ }
@@ -0,0 +1,29 @@
1
+ export class RotateTracker extends TrackerAbstract {
2
+ center: number[];
3
+ radius: number;
4
+ _orbitNormal: any;
5
+ _startVector: any;
6
+ _pitchOffset: number;
7
+ _runConfig: {
8
+ center: any;
9
+ radius: any;
10
+ startAngle: any;
11
+ endAngle: any;
12
+ clockwise: any;
13
+ loopMode: any;
14
+ height: any;
15
+ } | undefined;
16
+ /**
17
+ * 根据 ratio 计算圆周位置
18
+ */
19
+ updatePositionByPercentage(ratio: any): {
20
+ point: any;
21
+ hpr: {
22
+ heading: any;
23
+ pitch: any;
24
+ roll: any;
25
+ };
26
+ direction: any;
27
+ };
28
+ }
29
+ import { TrackerAbstract } from './TrackerAbstract';