PlottingLayer

new Cesium.PlottingLayer(scene, layerName)

标绘图层类
Name Type Description
scene Scene 场景
layerName String 标绘图层名称

Members

geoGraphicObjects : Array.<GeoGraphicObject>

图层的标绘对象数组

id : Number

图层ID

isEditable : Boolean

图层是否可编辑

isLocked : Boolean

图层是否锁定

isSelected : Boolean

图层是否可选择

name : String

图层的名字

readonlyselectedFeature : GeoGraphicObject

当前被选中的对象

symbolAddedEvent : Event

标号添加事件

visibility : Boolean

图层的可见型

Methods

addFeature(geoGraphicObject)Boolean

Name Type Description
geoGraphicObject GeoGraphicObject 要添加的标号对象
Returns:
是否添加成功

createGroupObject(features)GroupObject

创建组合对象。
Name Type Description
features Array.<GeoGraphicObject> 标号对象。
Returns:
组合对象。

createGroupObject(geoJSON)Array.<GroupObject>

根据GeoJson 创建组合对象。
Name Type Description
geoJSON GeoJson 根据GeoJson对象。
Returns:
组合对象数组。

createModelAndPicture(options, callback)

根据模型和图片资源路径创建标绘对象
Name Type Description
options Object 配置项
Name Type Description
libID Number 标号库编码
code Number 标号编码
points Array.<PlotPoint3D> 位置点数组
url String 模型或图片的资源路径
modelScale Number 模型缩放值
callback function optional 回调函数。

createSymbol(libID, code, points, options, callback)

根据标号库编码和标号编码创建标号
Name Type Description
libID Number 标号库编码
code Number 标号编码
points Array.<PlotPoint3D> 位置点数组
options Object 配置项(创建模型和图片图元的扩展属性)
Name Type Description
lineColor Color 线色
lineWidth Number 线宽
modelScale Number 模型缩放比例
pictureSize Cartesian2 图片大小
textContent String 注记内容
fontSize String 注记大小
fontColor String 注记颜色
url String 模型或图片的资源路径
callback function optional 回调函数。

destroy(isRaiseEvent)

释放资源销毁图层
Name Type Description
isRaiseEvent Boolean 是否触发标绘移除事件

geoJsonToGeoGraphicObject(geoJSON, callback)

将geoJson转换为标绘对象并添加到当前标绘图层
Name Type Description
geoJSON JSON GeoJson格式数据
callback function optional 回调函数。

getFeatureByUuid(id)GeoGraphicObject

根据id确定标号对象
Name Type Description
id String 标号对象id
Returns:
标号对象

releaseSelection()

释放被选中的对象

removeAll(isRaiseEvent)

清空图层
Name Type Description
isRaiseEvent Boolean 是否触发标绘移除事件

removeFeatureByUuId(uuid, isRaiseEvent)

根据uuid移除图层中指定标号
Name Type Description
uuid String 要移除标号的id
isRaiseEvent Boolean 是否发送标绘移除事件

removeGeoGraphicObject(geoGraphicObject, isRaiseEvent)

移除指定标号
Name Type Description
geoGraphicObject GeoGraphicObject 要移除的标号对象
isRaiseEvent Boolean 是否发送标绘移除事件

setSelectedFeature(geoGraphicObject)

设置选中标号
Name Type Description
geoGraphicObject GeoGraphicObject

setSelectedFeatureByID(id)

根据id设置选中标号
Name Type Description
id String 标绘对象ID

setSelectedFeatureByIndex(index)

根据索引设置选中标号
Name Type Description
index Number 在图层中的索引

setUseDepthTest(是否支持深度检测)

设置图层是否支持深度检测
Name Type Description
是否支持深度检测 Boolean

unGroupObject(features)Boolean

拆分组合对象。
Name Type Description
features Array.<GeoGraphicObject> 组合对象。
Returns:
是否拆分成功。

updateGeoGraphicObjectByGeoJson(geoJson)

通过GeoJson修改标绘对象
Name Type Description
geoJson Object
Returns:
标绘对象