Class: FMTextMarker

FMTextMarker

FMTextMarker 文本标注对象, 属于fengmap.map.min.js

new fengmap.FMTextMarker(options)

Name Type Description
options json

参数

Name Type Description
height number

离地高度, 默认 1

x number

图片地图位置x值,默认对应楼层中心点坐标,必填

y number

图片地图位置y值,默认对应楼层中心点坐标,必填

text string

文字内容,必填

textAlign fengmap.FMTextAlign

文字对齐方式

fontsize int

文本字号, 默认20

fontFamily string

字体样式,如果没有给定,使用默认字体样式

fillColor string

文本填充色,rgb类型字符串,默认 "255,0,0"

strokeColor string

文本边框填充色,rgb类型字符串。默认 '255,255,0'

strokeWidth number

描边线宽

plateColor string

底色

plateStrokeColor string

底色边框颜色

anchor fengmap.FMMarkerAnchor

锚点位置

collision bool

true:开启避让 false:关闭避让 默认 true

depth bool

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

Members

readonlybound

Properties:
Name Type Description
bound fengmap.FMBound

边界

collision

是否开启避让效果,默认开启

fillColor

Properties:
Name Type Description
fillColor string

文字填充色 例如 "255,0,0" 修改需要调用update方法更新

readonlyfontsize

Properties:
Name Type Description
fontsize number

文字字号 修改需要调用update方法更新

height

离地高度

Properties:
Name Type Description
height number

离地高度

readonlylevel

Properties:
Name Type Description
level number

楼层等级,初始化完成后可以获取当前值

plateColor

Properties:
Name Type Description
plateColor String

文字背景色 修改需要调用update方法更新

plateStrokeColor

Properties:
Name Type Description
plateStrokeColor String

文字背景色边框 修改需要调用update方法更新

strokeColor

Properties:
Name Type Description
strokeColor String

文字描边颜色 修改需要调用update方法更新

strokeWidth

Properties:
Name Type Description
strokeWidth number

文字描边宽度,默认为 1 修改需要调用update方法更新

text

Properties:
Name Type Description
text string

文字内容, 修改需要调用update方法更新

readonlytype

Properties:
Name Type Description
type fengmap.FMType

节点类型

visible

Properties:
Name Type Description
visible Boolean

true 显示 false 隐藏

readonlyx

Properties:
Name Type Description
x number

坐标

readonlyy

Properties:
Name Type Description
y number

坐标

Methods

addTo(floor)

添加到楼层

Name Type Description
floor Object

楼层等级

moveTo(options){fengmap.FMAnimation}

动画移动marker到指定位置

Name Type Description
options json
Name Type Description
x number

图片地图位置x值,默认对应楼层中心点坐标

y number

图片地图位置y值,默认对应楼层中心点坐标

animate boolean

是否需要动画,默认false

duration number

移动到指定位置所用的时间(秒),默认0.5

finish function

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

Returns:
Type Description
fengmap.FMAnimation animation 动画类

remove()

从楼层中移除

inherited traverse(callback)

遍历返回子节点

Name Type Description
callback

update()

更新marker