更改兴趣点状态

命令 0xc7: 更改兴趣点状态#

ubyte string ubyte <value_type>
可变长度 PoI ID 值的类型 新值

更改兴趣点(Point-of-interest, PoI)的状态。由于可以更改 PoI 的不同值,因此需要提供的参数数量及其类型在不同命令之间有所不同。下表显示了可以更改的值以及必须提供的参数。

**可更改的 PoI 变量概览**
变量 值类型 (ValueType) 描述 Python 方法
type (0x4f) string 将 PoI 的类型设置为给定值 setType
color (0x45) color (ubyte,ubyte,ubyte,ubyte) 将 PoI 的颜色设置为给定值 (r,g,b,a) - 请注意 a(lpha) = 0 表示完全透明 setColor
position (0x42) Position2D (double, double) 将 PoI 的位置设置为给定值 setPosition
image file (0x93) string 设置 PoI 图像文件的路径 setImageFile
width (0x4d) float 设置渲染图像文件的宽度 setWidth
height (0xbc) float 设置渲染图像文件的高度 setHeight
angle (0x43) float 设置渲染图像文件的角度 setAngle
ADD (0x80) PoI-definition, 见下文 添加定义的 PoI add
REMOVE (0x81) int (layer), 见下文 移除定义的 PoI remove
highlight (0x6c) highlight specification, 见下文 为 PoI 添加高亮显示 highlight

消息内容如下:

type (0x4f)#

ubyte string
值类型 string 新类型名称

color (0x45)#

ubyte ubyte ubyte ubyte ubyte
值类型 color 绿 透明度

position (0x42)#

ubyte double double
值类型 position2D x 坐标 y 坐标

ADD (0x80)#

ubyte int ubyte string ubyte color ubyte int ubyte position
值类型 compound 项目数 = 4 值类型 string 类型名称 值类型 color 颜色 值类型 int 图层 值类型 position2D 位置

如果由于同一图层中已存在具有相同 ID 的另一个 PoI 而无法添加该 PoI,则会生成错误消息。 请注意,如果已传递图像(通过 imgFile 属性),则 POI 的最终颜色是图像的原生颜色与传递的 color 值的组合。在这种情况下,传递 color 为 (255,255,255) 将导致 POI 具有与传递的图像相同的颜色。

REMOVE (0x81)#

ubyte int
值类型 int 图层

如果在给定图层中找不到指定的 PoI,则会移除具有给定 ID 的所有 PoI(从所有图层中)。如果找不到具有给定 ID 的 PoI,则会生成错误消息。

highlight (0x6c)#

ubyte int ubyte color ubyte double ubyte ubyte ubyte double ubyte ubyte
值类型 compound {0,1,2,3,4,5} 中的项目数 值类型 color 颜色 值类型 double 大小(半径,单位:米) 值类型 ubyte 最大透明度值 值类型 double 持续时间(单位:秒) 值类型 ubyte 类型 ID(允许不同的高亮类别)

highlight 方法在 POI 中心添加一个指定大小和颜色的圆。如果给定正值,圆的 alpha 值会在指定持续时间内进行动画处理(淡入和淡出),maxAlpha <= 0 表示没有动画的持久高亮显示。