GeoAnimationManager

标绘元素动画管理器类

new Cesium.GeoAnimationManager(options)

Name Type Description
options Object optional 参数选项:
Name Type Description
animations Array.Animation optional 动画对象数组
Author:
  • zj
Example:
var singleArrowElement = new Cesium.GeoSingleArrowElement({
		viewer: viewer,
		positions: [
			[106.50255907979172, 30.124293956577112],
			[109.57560428200443, 28.695531735044707],
			[112.19039125075413, 29.356410433383108],
			[114.08748761156725, 30.56765059559664]
		],
		lineColor: new Cesium.Color(0, 1, 1, 1),
		lineWidth: 5,
		lineStyle: GeoElement.LINE_STYLE.SOLID,
		fillMode: "gradient", //gradient
		fillColor: new Cesium.Color(0, 0, 1, 1),
		fillStartColor: new Cesium.Color(0, 0, 1, 1),
		fillEndColor: new Cesium.Color(0, 1, 0, 1),
		visibleSwallowTail: true
	})

	var animation = new Cesium.GeoAnimationGrow({
		name: '单箭头,多途径点的动画',
		startTime: 0,
		duration: 5,
		element: singleArrowElement
	})

	var doubleArrowElement = new Cesium.GeoDoubleArrowElement({
		viewer: viewer,
		positions: [
			[114.32672638334496, 34.06526265570961],
			[118.58435074139295, 32.17305709060316],
			[115.19719950610559, 30.354446348688],
			[113.72546321786797, 31.234367143944176]
		],
		lineColor: new Cesium.Color(0, 1, 1, 1),
		lineWidth: 1,
		lineStyle: GeoElement.LINE_STYLE.SOLID,
		fillMode: "gradient",
		fillColor: new Cesium.Color(0, 0, 1, 1),
		fillStartColor: new Cesium.Color(0, 0, 1, 1),
		fillEndColor: new Cesium.Color(0, 1, 0, 1),
		visibleSwallowTail: true
	})

	var animation2 = new Cesium.GeoAnimationGrow({
		name: '双箭头,多途径点的动画',
		startTime: 0,
		duration: 5,
		element: doubleArrowElement
	});

	let animationManager = new Cesium.GeoAnimationManager({
		animations: [animation, animation2]
	}); 
 animationManager.play();

Methods

addAnimation(animation)

添加动画对象
Name Type Description
animation Object

getEndTime()

获取所有动画对象的最后结束时间

getRemainingTime()

获取暂时后的到结束时的剩余时间

hasAnimation(animation)

判断指定动画对象是否被添加到动画管理对象中
Name Type Description
animation Object 动画对象

pause()

暂停播放动画

play()

播放动画

removeAll(animation)

清空所有动画对象
Name Type Description
animation Object

removeAnimation(animation)

移除动画对象
Name Type Description
animation Object

stop()

停止播放动画