Class: FMImageMarker

FMImageMarker

FMImageMarker 自定义图片标注对象,为自定义图层。

new fengmap.FMImageMarker(option)

Name Type Description
option json
Name Type Description
x float

图片地图位置x值

y float

图片地图位置y值

size int

图片尺寸

height int

标注高度

url string

图片地址

anchor string

锚点位置

depth bool

文本渲染深度 【true】:开启深度;【false】:关闭深度

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】: 隐藏

url

marker图片路径

Properties:
Name Type Description
url string

图片路径

Methods

inherited alwaysShow()

是否一直显示。

inherited avoid(value)

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

Name Type Description
value bool

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

jump(params)

图标标注跳动动画。

Name Type Description
params json
Name Type Description
height number

图标跳动的高度。

times number

图标跳动次数。不设置该参数或设置为0时, 一直跳动。

duration number

单次跳动动画的持续时长(秒)。

delay number

一次跳动完成到下次跳动开始的等待时长(秒)。

moveTo(params)

动画移动marker到指定位置

Name Type Description
params json
Name Type Description
x number

地图x坐标

y number

地图y坐标

time number

移动到指定位置所用的时间(秒)

callback function

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

update function

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

moveToGroup(gid)

将marker移动到另一楼层

Name Type Description
gid number

楼层id

setPosition(x, y, gid, height)

设置marker位置

Name Type Description
x number

地图x坐标

y number

地图y坐标

gid number

楼层id

height number

偏移高度

stopJump()

停止图标标注jump动画。

stopMoveTo()

停止moveTo动画