Class: FMDynamicModel

FMDynamicModel

FMDynamicModel 模型对象,是一种动态对象。

Name Type Description
map object
param json
Name Type Description
url string

DynamicModel路径

coord number

DynamicModel坐标

id number

DynamicModel唯一标识

color number

DynamicModel颜色

scale number

DynamicModel缩放比例

fadeIn boolean

DynamicModel是否开启淡入效果

fadeOut boolean

DynamicModel是否开启淡出效果

rotation number

DynamicModel旋转角度

callback function

model完成动画后的回调函数

Members

groupID

楼层id

Properties:
Name Type Description
groupID number

楼层id

height

高度

Properties:
Name Type Description
height number

高度

readonlymapCoord

元素中心点坐标点

Properties:
Name Type Description
mapCoord json

地图坐标{x;,y:,z:}

readonlynodeType

地图元素对象类型

Properties:
Name Type Description
nodeType fengmap.FMNodeType

地图元素对象类型

show

地图元素的显示/隐藏

Properties:
Name Type Description
show bool

【true】: 显示,【false】: 隐藏

Methods

inherited alwaysShow()

是否一直显示。

inherited avoid(value)

图层内或单个元素与同一图层内的其他元素在同一位置有相互遮盖时,是否自动避让。FMImageMarker FMTextMarker有效。

Name Type Description
value bool

【true】: 需避让,【false】: 不避让。注意:avoid方法与show属性不能同时使用,使用avoid方法会自动更新show属性的值。

moveTo(params, time)

以动画方式将marker到指定位置

Name Type Description
params object
Name Type Description
x number

指定点x坐标

y number

指定点y坐标

time number

移动到指定点所需的时间

rotateTo(params)

将locationMarker水平旋转至特定角度,带动画

Name Type Description
params json
Name Type Description
to number

角度

duration number

动画持续时间

callback function

移动到指定位置后的回调函数

update function

动画执行过程中位置更新时的回调函数,返回更新后的位置信息。

setColor(color)

设置模型着色颜色

Name Type Description
color string | int

颜色值

setPosition(x, y, gid, height)

设置marker位置

Name Type Description
x number

地图x坐标

y number

地图y坐标

gid number

楼层id

height number

偏移高度

setScale(scale)

设置模型显示比例

Name Type Description
scale number

显示比例

startAction(name, duration, isState)

开始播放模型对象的骨骼动画

Name Type Default Description
name string

模型对象的骨骼动画name名称

duration number 0.2

过渡时间

isState boolean

是否只执行一次动画,默认是循环执行

stopAction(name, duration)

停止播放模型对象的骨骼动画

Name Type Default Description
name string

模型对象的骨骼动画name名称

duration number 0.2

过渡时间

stopMoveTo()

停止moveTo动画