Class: BaseLayerCollection

CMAP.BaseLayerCollection()

BaseLayerCollection 底图图层的集合

Constructor

new BaseLayerCollection()

构造函数

Extends

Methods

add(obj, index)

重写add方法,添加一个TileLayer对象实例到Selector中
Parameters:
Name Type Description
obj CMAP.TileLayer 要添加的图层
index Number 添加的位置 在baseLayerCollection中,位置越靠后,图层越靠上 如果不填默认填在最后 index从0开始
Author:
Example
map.baseLayers.add(tileLayer);//tileLayer是一个TileLayer实例 要在地图上添加该图层到最上层

remove(obj)

移除单个图层
Parameters:
Name Type Description
obj CMAP.TileLayer 需要删除的图层
可以是对象(obj传TileLayer对象实例),也可以是图层在BaseLayerCollection中的index(obj传Number)
Author:
Example
map.baseLayers.remove(tileLayer);//tileLayer是一个TileLayer实例 要在地图上移除该图层

removeAll() → {Void}

移除全部图层
Inherited From:
Author:
Returns:
Type
Void
Example
map.userLayers.removeAll();//userLayers移除全部图层