Skip to content
本页目录

TXPolylineStyle: ​

线对象样式类,主要用于设置TXGeoPolyline(线对象)的样式风格,包括线宽、线色等样式。

经常和TXGeoPolyline类配合使用

示例代码 ​

Python
polyline_style = TXPolylineStyle()
# 设置具体的多段线样式:线颜色、线宽度等
line_color = TXColor(139, 0, 139, 255)
polyline_style.SetLineColor(line_color)
polyline_style.SetLineWidth(5)
...
# 设置多段线的样式
polyline.SetStyle(polyline_style)

方法:SetLineColor ​

设置线颜色

参数:line_color ​

线顔色

返回:无 ​

示例代码: ​

Python
line_color = TXColor(139, 0, 139, 255)
polyline_style.SetLineColor(line_color)

方法:GetLineColor ​

获取线颜色

参数:无 ​

返回:line_color ​

线颜色

示例代码: ​

Python
line_color = polyline_style.GetLineColor()

方法:SetLineWidth ​

设置线宽度

参数:line_width ​

线宽度

返回:无 ​

示例代码: ​

Python
polyline_style.SetLineWidth(5)

方法:GetLineWidth ​

获取线宽度

参数:无 ​

返回:line_width ​

线宽度

示例代码: ​

Python
line_width = polyline_style.GetLineWidth()

方法:SetLineType ​

设置线类型

参数:line_type ​

线类型,分为实线、虚线、点线、点划线、双点划线五种

返回:无 ​

示例代码: ​

Python
# LineType_ELT_SOLID                实线
# LineType_ELT_DASH                 虚线
# LineType_ELT_DOT                  点线
# LineType_ELT_DASHDOT              点划线
# LineType_ELT_DASHDOTDOT           双点划线
line_type = LineType_ELT_DASH
polyline_style.SetLineType(line_type)

方法:GetLineType ​

获取线类型

参数:无 ​

返回:line_style ​

文字样式

示例代码: ​

Python
line_type = polyline_style.GetLineType()