Class: AnimationObject

csanimation~ AnimationObject


new AnimationObject(options)

动目标对象
Parameters:
Name Type Description
options *
Fires:
  • event:AddTrackPoint
  • event:RemoveTrackPoint
  • event:ModifyTrackPoint
  • event:ChangePosition

Extends

Methods


getAnimationLayer()

获取动目标图层

getPopupVisible()

获取标牌的显隐状态

setPopupVisible(flag)

设置标牌的显隐
Parameters:
Name Type Description
flag *

getLockable()

是否锁定标牌,标牌将不能拖动

setLockable(lock)

设置是否锁定标牌,标牌将不能拖动
Parameters:
Name Type Description
lock *

getMobileAttribute(key)

获取动目标属性
Parameters:
Name Type Description
key *

setMobileAttribute(key, value)

设置动目标属性
Parameters:
Name Type Description
key *
value *

removeMobileAttribute(key)

移除动目标属性
Parameters:
Name Type Description
key *

getAllMobileAttributes()

获取动目标所有属性

setAllMobileAttributes(mobileProperty)

设置动目标所有属性
Parameters:
Name Type Description
mobileProperty *

getLeadlineColor()

获取标牌牵引线颜色

setLeadlineColor(color)

设置标牌牵引线的颜色
Parameters:
Name Type Description
color *

getLeadlineWidth()

获取标牌牵引线宽度

setLeadlineWidth(width)

设置标牌牵引线的宽度
Parameters:
Name Type Description
width *

getLeadlineDash()

获取标牌牵引线是否显示虚线

setLeadlineDash(dash)

设置标牌牵引线是否显示虚线模式
Parameters:
Name Type Description
dash boolean

getTagFont()

获取标牌字体

setTagFont(font)

设置标牌字体
Parameters:
Name Type Description
font *

getTagFontSize()

获取标牌字体大小

setTagFontSize(fontSize)

设置标牌字体大小
Parameters:
Name Type Description
fontSize *

getTagFontColor()

获取标牌字体颜色

setTagFontColor(cssColor)

设置标牌字体颜色
Parameters:
Name Type Description
cssColor *

getTagFontStroke()

获取标牌字体是否镶边

setTagFontStroke(flag)

设置标牌字体是否镶边
Parameters:
Name Type Description
flag *

getTagFontStrokeColor()

获取标牌字体镶边颜色

setTagFontStrokeColor(cssColor)

设置标牌字体镶边颜色
Parameters:
Name Type Description
cssColor *

getTagFontStrokeWidth()

获取标牌字体镶边宽度

setTagFontStrokeWidth(width)

设置标牌字体镶边宽度
Parameters:
Name Type Description
width *

getTagLength()

获取标牌距离动目标的长度

setTagLength(length)

设置标牌距离动目标的长度
Parameters:
Name Type Description
length *

getTagAngle()

获取标牌跟动目标的角度

setTagAngle(angle)

设置标牌跟动目标的角度
Parameters:
Name Type Description
angle *

getTagOffset()

获取标牌相对动目标的偏移,即标牌跟动目标的长度和角度

setTagOffset(value)

设置标牌相对动目标的偏移,即标牌跟动目标的长度和角度
Parameters:
Name Type Description
value *

getTagBackgroundColor()

获取标牌的背景色

setTagBackgroundColor(cssColor)

设置标牌的背景色
Parameters:
Name Type Description
cssColor *

getTagWidth()

获取标牌的宽度

setTagWidth(width)

设置标牌的宽度
Parameters:
Name Type Description
width *

getTagDisplayAttributes()

获取标牌上显示的属性

setTagDisplayAttributes(attributeNames)

设置标牌上需要显示的属性(必须是动目标的属性)
Parameters:
Name Type Description
attributeNames *

addTagDisplayAttribute(attributeName)

添加一个动目标的属性,让其显示在标牌上
Parameters:
Name Type Description
attributeName *

insertTagDisplayAttribute(attributeName, index)

插入一个动目标的属性到标牌上指定序号位置
Parameters:
Name Type Description
attributeName *
index *

removeTagDisplayAttribute(attributeName)

移除标牌上的一个属性
Parameters:
Name Type Description
attributeName *

getTagDisplayAttributeCount()

获取所有显示在标牌上的属性数量

removeAllTagDisplayAttributes()

移除标牌上显示的所有属性(不会移除动目标的属性,只是不在标牌上显示)

addPositionSample(time, longitude, latitude, height)

添加一个位置采样点
Parameters:
Name Type Description
time JulianDate 位置采样点时间
longitude Degrees 在指定时间时的经度
latitude Degrees 在指定时间时的纬度
height Number 在指定时间时的高度

removePositionSample(time)

移除指定时间的位置采样点
Parameters:
Name Type Description
time *

removePositionSampleByIndex(index)

移除指定序号的位置采样点
Parameters:
Name Type Description
index *

removeAllPositionSamples()

移除所有的位置采样点(除了当前的位置采样点)

modifyPositionSampleByIndex(index, longitude, latitude, height)

修改指定序号位置采样点的位置
Parameters:
Name Type Description
index *
longitude *
latitude *
height *

getPositionSampleByIndex(index)

获取指定序号的位置采样点的位置
Parameters:
Name Type Description
index *

getPositionTimes()

获取所有位置采样点的时间

getPositionValues()

获取所有位置采样点的位置信息

getPositionValue(time, result)

获取指定时间时的位置
Parameters:
Name Type Description
time *
result *

getVelocityValue(time, result)

获取指定时间时的速度
Parameters:
Name Type Description
time *
result *

getOrientationValue(time, result)

获取指定时间时的旋转四元数
Parameters:
Name Type Description
time *
result *

getPositionIndex(time)

获取指定时间时的位置采样点位置序号
Parameters:
Name Type Description
time *

getCurrentPosition()

获取当前位置

addPropertySample(time, property)

添加一个属性采样点
Parameters:
Name Type Description
time *
property *

getPropertyValue(time)

获取指定时间时的属性
Parameters:
Name Type Description
time *

getPropertyIndex(time)

获取指定时间时的属性采样点的序号
Parameters:
Name Type Description
time *

getPropertyTimes()

获取所有属性采样点的时间

getPropertyValues()

获取所有属性采样点的属性

addObject(object)

添加一个对象,并绑定到当前动目标,该对象必须是可以表示为一个点状的对象,比如矢量点、图标、模型、点标号(态势符号)
Parameters:
Name Type Description
object *

removeObject(object)

移除一个对象,解除该对象绑定到当前动目标
Parameters:
Name Type Description
object *

removeAllObjects()

移除所有的对象,解除该对象绑定到当前动目标

getHighlight()

获取是否高亮状态

setHighlight(value)

设置高亮状态
Parameters:
Name Type Description
value *

getVisible()

获取显隐状态

setVisible(value)

设置显隐状态
Parameters:
Name Type Description
value *

获取闪烁状态

设置闪烁状态
Parameters:
Name Type Description
value *

getPickable()

获取是否可选状态

setPickable(flag)

设置是否可选
Parameters:
Name Type Description
flag *

lockView()

锁定视角到当前动目标,如果二三维视角联动时,需要解除二三维视角联动,不然移动二维会导致视角错乱

unlockView()

解除视角锁定

enableLight()

开启光照

disableLight()

关闭光照

getTrackPointDisplayCount()

获取显示的轨迹点数

setTrackPointDisplayCount(value)

设置显示的轨迹点数
Parameters:
Name Type Description
value *

getMaxTrackPointsCount()

获取最大轨迹点数

setMaxTrackPointsCount(value)

设置最大轨迹点数
Parameters:
Name Type Description
value *

getTrackPointsCount()

获取轨迹点数

getCurrentTrackPoint(time)

根据指定时间获取当前轨迹点
Parameters:
Name Type Description
time *

getLastTrackPointTime(time)

根据指定时间获取该轨迹点的时间
Parameters:
Name Type Description
time *

getTrackLineColor()

获取轨迹线的颜色

setTrackLineColor(color)

设置轨迹线的颜色
Parameters:
Name Type Description
color *

getTrackLineOpacity()

获取轨迹线的透明度

setTrackLineOpacity(opacity)

设置轨迹线的透明度
Parameters:
Name Type Description
opacity *

getTrackLineWidth()

获取轨迹线宽

setTrackLineWidth(width)

设置轨迹线宽
Parameters:
Name Type Description
width *

getTrackLineType()

获取轨迹线的显示模式

setTrackLineType(type)

设置轨迹线的显示模式
Parameters:
Name Type Description
type * 有4种:'none','extrude','ribbon','fire',分别是不显示轨迹、剖面、飘带、尾焰

destroy()

销毁动目标,不应该由用户调用,如果需要销毁,请调用module:csanimation.AnimationLayer#removeAnimationObject
Overrides:

dispatchEvent(event)

发送事件消息,每个事件消息都有类型(type),所有监听此对象对应类型事件的监听者都会接收到相应的事件消息
Parameters:
Name Type Description
event string | module:events.Event 事件对象
Inherited From:
Overrides:

on(type, listener [, opt_this])

指定监听器监听指定类型的事件
Parameters:
Name Type Argument Default Description
type string 事件类型
listener callback | function 监听器
opt_this Object <optional>
target 在监听器中的`this`所指示的对象,默认是`target`自身
Inherited From:
Overrides:
Returns:
监听器的唯一标识.
Type
Object

once(type, listener [, opt_this])

指定监听器只监听一次指定类型的事件
Parameters:
Name Type Argument Default Description
type string 事件类型
listener callback | function 监听器
opt_this Object <optional>
target 在监听器中的`this`所指示的对象,默认是`target`自身
Inherited From:
Overrides:
Returns:
监听器的唯一标识.
Type
Object

un(type, listener [, opt_this])

取消指定监听器监听指定类型的事件
Parameters:
Name Type Argument Default Description
type string 事件类型
listener callback | function 监听器
opt_this Object <optional>
target 在监听器中的`this`所指示的对象,默认是`target`自身
Inherited From:
Overrides:

unByKey(key)

根据监听器的唯一标识取消指定监听器监听事件,监听器的唯一标识通过`on()`或者`once()`返回得到
Parameters:
Name Type Description
key Object | Array.<Object> 监听器的唯一标识,通过`on()`或者`once()`返回得到,可以是多个监听器的唯一标识数组
Inherited From:
Overrides: