new MarkLayer()
标注图层
Extends
Methods
add()
- Overrides:
添加
addMark(optionsArray)
添加标注 目前支持divMark/billboard/label
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
optionsArray |
单个标注或者一组标注 |
||||||||||||||||||||||||||||||||||||||||||||||||||||
options.id |
Number |
<optional> |
标注ID 要求唯一 |
||||||||||||||||||||||||||||||||||||||||||||||||||
options.position |
Cartesian3 |
<optional> |
标注在场景中的位置 Cartesian3类型 |
||||||||||||||||||||||||||||||||||||||||||||||||||
options.divMark |
Object |
<optional> |
div标注相关参数 Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||
options.billboard |
Object |
<optional> |
公告板 支持Cesium原生所有参数 |
||||||||||||||||||||||||||||||||||||||||||||||||||
options.label |
Object |
<optional> |
文字标注 支持Cesium原生所有参数 |
Returns:
None
centerAt(duration)
- Inherited From:
定位到图层
Parameters:
Name | Type | Description |
---|---|---|
duration |
Number | 定位到图层经历的秒数 |
create()
- Inherited From:
创建图层,可以在图层的Config中定义 OnCreate(viewer) 方法, 当图层创建时调用
deleteAllMark()
移除所有标注
Returns:
None
deleteMark(idopt)
根据ID移除单个标注
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
id |
Number |
<optional> |
标注ID |
Returns:
None
getEntityCollection()
获取该图层的实体集合
Returns:
EntityCollection
getMarkByID()
根据ID来获取标注 返回Object对象{entity:xxx,markInfo:xxx} entity是添加到场景中的实体 markInfo是构建标注时的参数
Returns:
Object
getVisible() → {boolean}
- Inherited From:
得到图层是否显示
Returns:
图层是否显示
- Type
- boolean
initialize(cfg, viewer)
- Inherited From:
初始化图层
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cfg |
Object | 图层配置 Properties
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
viewer |
ViewerEx |
remove()
- Overrides:
移除
setOpacity(value)
- Inherited From:
设置不透明度
Parameters:
Name | Type | Description |
---|---|---|
value |
Number | 不透明度 0.0 到 1.0 |
setVisible(val)
- Inherited From:
设置图层是否显示
Parameters:
Name | Type | Description |
---|---|---|
val |
boolean | 图层是否显示 |
setZIndex(value)
- Inherited From:
设置叠加顺序
Parameters:
Name | Type | Description |
---|---|---|
value |
Number | 叠加顺序, int值 |