BaseLayer

BaseLayer

图层基类

Constructor

new BaseLayer(viewer, opt)

Description:
  • 图层基类,一般不直接实例化
Parameters:
Name Type Description
viewer Cesium.Viewer 地图viewer对象
opt Object 基础配置,可将
Properties
Name Type Attributes Default Description
id String | Number 地图服务id
url String 地图服务地址
view Object <optional>
图层定位视角
rectangle Array <optional>
地图服务范围 [117,40,118,41]
srs String <optional>
当前服务的坐标系 / 4326 3857
alpha Number | function <optional>
1.0 图层透明度
nightAlpha Number | function <optional>
1.0 在晚上的图层透明度
dayAlpha Number | function <optional>
1.0 在白天的图层透明度
brightness Number | function <optional>
1.0 图层亮度
contrast Number | function <optional>
1.0 图层对比度
hue Number | function <optional>
0.0 图层色调
saturation Number | function <optional>
1.0 图层饱和度
gamma Number | function <optional>
1.0
show Boolean <optional>
true 是否显示
maximumAnisotropy Number <optional>
maximum supported
minimumTerrainLevel Number <optional>
显示该图层的最小地形层级
maximumTerrainLevel Number <optional>
显示该图层的最大地形层级
colorToAlpha String <optional>
颜色转透明度
colorToAlphaThreshold Number <optional>
0.004

Classes

ArcgiscacheLayer
BaiduLayer
GeojsonLayer
GeojsonLayer
GridLayer
MapserverLayer
MapserverLayer
OSMLayer
SingleImageLayer
TDTLayer
TMSLayer
UrlTemplateLayer
WMSLayer
WMTSLayer
XYZLayer

Members

_layer

Properties:
Name Type Description
layer Cesium.ImageryLayer 图层

_provider

Properties:
Name Type Description
provider Cesium.ImageryProvider 图层

id

Properties:
Name Type Description
id String | Number 图层id

imageryLayerAttr

Properties:
Name Type Description
imageryLayerAttr Object imageryLayer相关配置

providerAttr

Properties:
Name Type Description
providerAttr Object provider相关配置

Methods

hide()

Description:
  • 隐藏

load()

Description:
  • 加载

remove()

Description:
  • 移除

setAlpha(alpha)

Description:
  • 设置透明度
Parameters:
Name Type Description
alpha Number 透明度(0~1)

setVisible(visible)

Parameters:
Name Type Description
visible Boolean 是否显示

show()

Description:
  • 展示

zoomTo()

Description:
  • 缩放至图层