LabelGraphic
大约 2 分钟
LabelGraphic
VE.graphic.LabelGraphic
图标
参数
new VE.graphic.LabelGraphic(options)
options
参数名称 | 类型 | 描述信息 |
---|---|---|
primitive | VE.Point | 是否是 primitive |
position | VE.Point | 位置 |
style | VE.graphic.LabelGraphic.StyleOption | 样式 |
属性
attr
当前属性
readonly
center- 类型: VE.Point
获取中心点
readonly
hpr- 类型: object
获取俯仰角
readonly
point- 类型: VE.Point | null
当前实际位置
position
- 类型: VE.Point | Array | String | Object
设置位置信息
readonly
style方法
addDynamicPosition (p)
移动到一个新点
参数名称 | 类型 | 描述信息 |
---|---|---|
p | VE.Point | 坐标 |
addTo (target)
添加到
参数名称 | 类型 | 描述信息 |
---|---|---|
target | Map | GroupGraphic |
clampToGround ()
手动贴地
clampToTerrain ()
手动贴地形
destroy ()
销毁
edit ()
编辑
flyTo ()
飞至
hide ()
隐藏
rotate (params)
旋转
参数名称 | 类型 | 描述信息 |
---|---|---|
params | object | 旋转 |
params.rotateX | object | x旋转(同roll) |
params.rotateY | object | y旋转(同pitch) |
params.rotateZ | object | z旋转(同heading) |
setOptions (options)
设置属性
参数名称 | 类型 | 描述信息 |
---|---|---|
options | object | |
options.position | VE.Point | 位置信息 |
options.positions | Array.<VE.Point> | 位置信息 |
options.attr | object | 属性 |
options.style | object | 样式 |
- 返回值:
BaseGraphic
show ()
显示
startPositionEdit (log)
开启位置编辑
参数名称 | 类型 | 描述信息 |
---|---|---|
log | boolean | 是否打印位置信息 |
stopPositionEdit ()
关闭位置编辑
toGeoJson ()
获取geoJson数据
- 返回值:
Feature.<Point, Properties>
类型定义
VE.graphic.LabelGraphic.StyleOption
- 类型: Object
参数名称 | 类型 | 默认值 | 描述信息 |
---|---|---|---|
text | string | 文本 | |
color | String | #fff | 字体颜色 |
fontWeight | number | normal | 字重 |
fontSize | number | 25 | 字体大小 |
fontFamily | String | 黑体 | 字体名称 |
backgroundColor | String | rgba(0.165, 0.165, 0.165, 0.8) | 背景色 |
scale | number | 1 | 缩放 |
backgroundPadding | Array | [7, 5] | 内边距。 |
horizontalOrigin | horizontalOrigin | HorizontalOrigin.CENTER | 横向方向的对齐方式(CENTER、LEFT、RIGHT). |
verticalOrigin | verticalOrigin | VerticalOrigin.CENTER | 垂直方向的对齐方式(CENTER、BOTTOM、BASELINE、TOP). |
outlineColor | String | #000 | 边框颜色 |
outlineWidth | number | 1 | 边框宽度 |
visibleDepth | boolean | true | 是否被遮挡 |
下面的很少用 | |||
pixelOffset | Array | Cartesian2 | Cartesian2.ZERO |
eyeOffset | Array | Cartesian3 | Cartesian3.ZERO |
scaleByDistance | Cesium.NearFarScalar | Array | |
distanceDisplayCondition | Cesium.DistanceDisplayCondition | Array | |
下面的基本用不上 | |||
heightReference | Cesium.HeightReference | HeightReference.NONE | 相对于高度的高度 |
translucencyByDistance | Cesium.NearFarScalar | Array | |
pixelOffsetScaleByDistance | Array | NearFarScalar | |
disableDepthTestDistance | Number | 定要禁用深度测试的距离相机的距离 |