Constructor
- Description:
- 图层控制类,通过此类对象,可直接添加相关类型图层,并对添加的图层对象进行控制,而不用多次new 不同类型的图层对象。
Parameters:
Name |
Type |
Attributes |
Description |
viewer |
Cesium.Viewer
|
|
当前viewer对象 |
opt |
Object
|
<optional>
|
其他参数 |
Members
_layerObjs
Properties:
Name |
Type |
Description |
layerObjs |
Array
|
图层对象数组 |
Methods
add(opt) → {Object}
- Description:
Parameters:
Name |
Type |
Description |
opt |
Object
|
图层属性
Properties
Name |
Type |
Attributes |
Description |
id |
String
|
Number
|
<optional>
|
图层id,如果不传入,则自动生成 |
type |
String
|
|
图层的类别(xyz、wfs、geojson、mapserver、arcgiscache、tdt、singleImage、tms、3dtiles、wms、grid) |
alpha |
String
|
|
图层的透明度 |
|
Returns:
图层对象
-
Type
-
Object
destroy()
- Description:
getAllhide() → {Array}
- Description:
Returns:
图层对象数组
-
Type
-
Array
getAllshow() → {Array}
- Description:
Returns:
图层对象数组
-
Type
-
Array
getLayerObjByField(field, val) → {Array}
- Description:
Parameters:
Name |
Type |
Description |
field |
String
|
字段名称 |
val |
String
|
字段值 |
Returns:
符合查询条件的图层对象数组
-
Type
-
Array
getLayerObjById(id) → {Object}
- Description:
Parameters:
Name |
Type |
Description |
id |
String
|
Number
|
|
Returns:
layerObj为图层对象,index为图层对象在数组中位置
-
Type
-
Object
getLayerObjByObjId(id) → {Object}
- Description:
Parameters:
Name |
Type |
Description |
id |
String
|
Number
|
|
Returns:
layerObj为图层对象,index为图层对象在数组中位置
-
Type
-
Object
hideAll()
- Description:
hideById(id)
- Description:
Parameters:
Name |
Type |
Description |
id |
String
|
Number
|
图层对象id |
removeAll()
- Description:
removeLayerObj(layerObj)
- Description:
Parameters:
Name |
Type |
Description |
layerObj |
Object
|
图层对象 |
removeLayerObjById(id)
- Description:
Parameters:
Name |
Type |
Description |
id |
String
|
Number
|
图层对象id |
setVisible(id, isShow)
- Description:
Parameters:
Name |
Type |
Description |
id |
String
|
Number
|
图层对象id |
isShow |
Boolean
|
是否显示 |
showById(id)
- Description:
Parameters:
Name |
Type |
Description |
id |
String
|
Number
|
图层对象id |
zoomTo(id)
- Description:
Parameters:
Name |
Type |
Description |
id |
String
|
Number
|
图层对象id |