Constructor
new MarkAnimation(options, options)
Example
var plotDoc = earth.plotDoc;
var plotLayer = plotDoc.add(new PlotLayer({
viewer : earth.viewer,
name : "ceshi2",
}));
// 创建飞机
var model = new MarkModel({
id : "model",
name : "飞机模型",
uri : "../../Apps/SampleData/models/CesiumAir/Cesium_Air.glb",
position : new GeoPosition(113.695, 34.76, 2000),
scale : 52,
})
plotLayer.add(model);
// 创建锥形探测器
var detector = new MarkDetector({
id : "detector",
name : "探测器",
position : new GeoPosition(113.695, 34.76, 2000),
radius : 800,
height : 2000,
color : new Cesium.Color(0.0, 1.0, 1.0, 0.5),
dynamic : true
});
plotLayer.add(detector);
// 位置数组
var positions = [
new GeoPosition(113.695, 34.76, 2000),
new GeoPosition(113.68182, 34.78121, 2000),
new GeoPosition(113.65, 34.79, 2000),
new GeoPosition(113.61818, 34.78121, 2000),
new GeoPosition(113.605, 34.76, 2000),
new GeoPosition(113.61818, 34.73879, 2000),
new GeoPosition(113.65, 34.73, 2000),
new GeoPosition(113.68182, 34.73879, 2000),
new GeoPosition(113.695, 34.76, 2000)
]
// 时间数组
var times = [Cesium.JulianDate.fromDate(new Date(2015, 2, 25, 16)),
Cesium.JulianDate.fromDate(new Date(2015, 2, 25, 16, 0, 45)),
Cesium.JulianDate.fromDate(new Date(2015, 2, 25, 16, 1, 30)),
Cesium.JulianDate.fromDate(new Date(2015, 2, 25, 16, 2, 15)),
Cesium.JulianDate.fromDate(new Date(2015, 2, 25, 16, 3, 0)),
Cesium.JulianDate.fromDate(new Date(2015, 2, 25, 16, 3, 45)),
Cesium.JulianDate.fromDate(new Date(2015, 2, 25, 16, 4, 30)),
Cesium.JulianDate.fromDate(new Date(2015, 2, 25, 16, 5, 15)),
Cesium.JulianDate.fromDate(new Date(2015, 2, 25, 16, 6, 0))
]
// 创建运动实例
var markAnimation = new MarkAnimation({
viewer : earth.viewer,
positions : positions,
times : times,
marks : [model1, detector], // 填入飞机和探测器两个标绘实体
interpAlgorithm : Cesium.LagrangePolynomialApproximation,
showPath : true
})
// 开始运动
markAnimation.start();
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | 拥有以下属性的对象:
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object | 拥有以下属性的对象:
Properties
|
Members
interpAlgorithm :Cesium.InterpolationAlgorithm
- Default Value:
- Cesium.LinearApproximation
获取或设置运动路径插值算法。
Type:
- Cesium.InterpolationAlgorithm
interpDegree :Number
- Default Value:
- 1
获取或设置运动路径插值程度。
Type:
- Number
pathColor :Cesium.Color
- Default Value:
- Cesium.Color.YELLOW
获取或设置运动路径颜色。
Type:
- Cesium.Color
pathLeadTime :Number
- Default Value:
- null
获取或设置前置运动路径秒数。
Type:
- Number
pathTrailTime :Number
- Default Value:
- null
获取或设置后置运动路径秒数。
Type:
- Number
pathWidth :Number
- Default Value:
- 2
获取或设置运动路径宽度。
Type:
- Number
showPath :Boolean
- Default Value:
- true
是否显示运动路径。
Type:
- Boolean