new RouteAnimationTool(viewer, options)
engineExtensions/tools/routeAnimationTool/RouteAnimationTool.js, line 16
请参考以下示例:
1、模型沿地形漫游
路径漫游工具(支持实例化多个工具)
| Name | Type | Default | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
viewer |
Cesium.Viewer | null |
可选
场景视图,详见Cesium.Viewer |
||||||||||||||||||||||||
options |
Object | {} |
可选
额外初始化参数
|
Example
// 参考示例:
http://192.168.82.91:8086/#/modules/cesium/analyse/commonAnalyse/path-roaming
// ES5引入方式
const { RouteAnimationTool } = zondy.cesium
// ES6引入方式
import { RouteAnimationTool } from "@mapgis/webclient-cesium-plugin"
// 1 构造漫游路径数组,单位为笛卡尔3
const pathPositions = [...]
// 2 定义漫游工具对象
animationTool = new RouteAnimationTool(viewer, {
//类型指定为routes
path: new RouteAnimationPath({
positions: pathPositions,
speeds: [5],
}),
...
})
// 3 开始漫游
animationTool.start()
// 4 暂停漫游
animationTool.pause()
// 5 继续漫游
animationTool.play()
// 6 结束漫游
animationTool.stop()
Members
-
animationEntityObject
-
漫游的模型实体对象
-
controlRouteAnimationControl
-
路径漫游控制对象
-
labelRouteAnimationLabel
-
路径漫游标牌对象
-
modelRouteAnimationModel
-
路径漫游模型对象
-
路径漫游路径对象
-
perspectiveRouteAnimationPerspective
-
路径漫游视角对象
Methods
-
pause()
engineExtensions/tools/routeAnimationTool/RouteAnimationTool.js, line 177 -
控制动画的暂停
-
play()
engineExtensions/tools/routeAnimationTool/RouteAnimationTool.js, line 206 -
控制动画继续播放
-
start()
engineExtensions/tools/routeAnimationTool/RouteAnimationTool.js, line 126 -
开始漫游
-
stop()
engineExtensions/tools/routeAnimationTool/RouteAnimationTool.js, line 149 -
结束漫游