LayerCollection

new Cesium.LayerCollection()

普通数据图层集合类,用于管理场景中除影像、地形数据外的所有数据.

Members

获取该图层集合中的图层数量.
Determines if primitives in this collection will be shown.
Default Value: true

Methods

add(layer)Object

向集合中添加图层.
Name Type Description
layer Object 指定的图层.
Returns:
添加到集合中的图层
Throws:

contains(value)Boolean

监测value是否在集合中.
Name Type Description
value Object | Layer | Cesium3DTileset optional 待监测的layer.
Returns:
如果value在集合中返回true,否则返回false.

find(layername)Object

根据指定名称查找图层对象。
Name Type Description
layername String optional 指定图层的名称
Returns:
名称为layername的图层

findById(id)Object

根据指定id查找图层对象。
Name Type Description
id String | Number optional 指定图层的索引
Returns:
索引为index的图层

findByIndex(index)Object

根据指定索引查找图层对象。
Name Type Description
index Number optional 指定图层的索引
Returns:
索引为index的图层
向下调整图层顺序。
Name Type Description
layer Object optional 指定的图层
将图层移动到最底层
Name Type Description
layer Object optional 指定的图层
向上调整图层顺序。
Name Type Description
layer Object optional 指定的图层

remove(destroy)Boolean

如果图层存在的话从集合将图层移除.
Name Type Default Description
指定的图层. layer
destroy Boolean true optional 是否要销毁图层.
Returns:
如果图层被移除了则返回true,否则返回false
移除集合中的所有图层数据.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.