TargetStyle()

目标样式

new TargetStyle()

Methods

setShowStyle(style)

设置目标显示样式

Parameters:
Name Type Description
style Object

样式对象

Properties
Name Type Description
pens Object

画笔对象

fills Object

填充对象

fonts Object

文字对象

比例尺标识 | 标识 | 值 | 说明| | ------------ | ------------ | | ship | number |船型显示最小比例尺。当前视窗比例比大于这个值时不显示船型,小于该值才显示| | text | number | 文字显示最表比例尺。当前视窗比例尺大于该值时文字不显示,小于该值时显示 |

画笔标识 | 标识 | 值 | 说明| | ------------ | ------------ | | shape | Pen |船型的画笔样式| | shape-hovered | Pen | 鼠标hovered在目标上时船型的画笔样式| | shape-selected | Pen | 选中目标时,目标船型的画笔样式 | | hdg | Pen | 船首向线的画笔样式 | | hdg-hovered | Pen | 鼠标hovered在目标上时船首向的画笔样式| | hdg-selected | Pen | 选中轨迹时,船首向线的画笔样式 | | cog | Pen | 航线的画笔样式 | | cog-hovered | Pen | 鼠标hovered在目标上时航线的画笔样式| | cog-selected | Pen | 选中轨迹时,航线的画笔样式 | | text | Pen | 文字的画笔样式 | | text-hovered | Pen | 鼠标hovered在目标上时文字的画笔样式| | text-selected | Pen | 选中轨迹时,文字的画笔样式 | | textbox | Pen | 文字标签的画笔样式 | | textbox-hovered | Pen | 鼠标hovered在目标上时文字标签的画笔样式| | textbox-selected | Pen | 选中轨迹时,文字标签的画笔样式 | | selectbox | Pen | 选择框的画笔样式 | | circle | Pen | 船型外套一层圈的画笔样式 |

填充样式标识 | 标识 | 值 | 说明| | ------------ | ------------ | | shape | Brush |船型的填充样式| | shape-hovered | Brush | 鼠标hovered在目标上时船型的填充样式| | shape-selected | Brush | 选中目标时,目标船型的填充样式 | | textbox | Brush | 文字标签的填充样式 | | textbox-hovered | Brush | 鼠标hovered在目标上时文字标签的填充样式| | textbox-selected | Brush | 选中轨迹时,文字标签的填充样式 |

字体标识 | 标识 | 值 | 说明| | ------------ | ------------ | | text | Font |目标显示文字字体| | text-hovered | Font | 鼠标hovered在目标上时的文字字体| | text-selected | Font | 选中目标时,文字字体 |

示例 //多样式设置 targetLayer.getStyle().setShowStyle({ pens:{ "shape":new Pen({color:[255,0,0,1]}), "shape-lost":new Pen({color:[255,0,0,1]}), "text":new Pen({color:[255,0,0,1]}) } })