MapLayer

MapLayer

地图图层。

Constructor

new MapLayer(options)

Author:
  • zpc
Example
var osmMap = new MapLayer({
     name : "OSM地图",
     show : true,
     mapLoader : new OpenStreetMapLoader()
 })
Parameters:
Name Type Description
options Object 具有下列属性的对象:
Properties
Name Type Attributes Default Description
id String <optional>
图层ID。
name String <optional>
图层名称。
show Boolean <optional>
true 是否显示该图层。
mapLoader MapLoader 地图加载器。
rectangle Cesium.Rectangle <optional>
imageryProvider.rectangle 该图层的矩形范围,此矩形限制了图像可见范围。
alpha Number | function <optional>
1.0 该图层的alpha混合值,范围是0.0-1.0。
brightness Number | function <optional>
1.0 该图层的亮度。值为1.0表示使用原图;值大于1.0时图像将变亮;值小于1.0时图像将变暗。
contrast Number | function <optional>
1.0 该图层的对比度。值为1.0表示使用原图;值大于1.0表示增加对比度;值小于1.0表示降低对比度。
hue Number | function <optional>
0.0 该图层的色调。值为0.0表示使用原图。
saturation Number | function <optional>
1.0 该图层的饱和度。值为1.0表示使用原图;值大于1.0表示增加饱和度;值小于1.0表示降低饱和度。
gamma Number | function <optional>
1.0 该图层的伽马校正。值为1.0表示使用原图。
splitDirection Cesium.ImagerySplitDirection | function <optional>
Cesium.ImagerySplitDirection.NONE 应用于该图层的图像分割的方法,默认为'NONE'。 'NONE'代表不分割;'LEFT'代表仅在分割条的左边区域显示;'RIGHT'代表在分割条的右边区域显示。
minificationFilter Cesium.TextureMinificationFilter <optional>
Cesium.TextureMinificationFilter.LINEAR 应用于该图层的纹理缩小过滤器。
magnificationFilter Cesium.TextureMagnificationFilter <optional>
Cesium.TextureMagnificationFilter.LINEAR 应用于该图层的纹理放大过滤器。
show Boolean <optional>
true 是否显示该图层。
maximumAnisotropy Number <optional>
maximum supported 用于纹理滤波的最大各向异性级别。 如果未指定此参数,将使用WebGL堆栈支持的最大各向异性。较大的值使图像在地平线上看起来更好。
minimumTerrainLevel Number <optional>
用于显示该图像图层的最小地形细节级别,如果未定义则显示所有级别。
maximumTerrainLevel Number <optional>
用于显示该图像图层的最大地形细节级别,如果未定义则显示所有级别。
cutoutRectangle Cesium.Rectangle <optional>
裁剪此图层的矩形范围。(在图层上挖洞的效果)
colorToAlpha Cesium.Color <optional>
用作alpha的颜色。
colorToAlphaThreshold Number <optional>
0.004 color-to-alpha的归一化(0-1)阈值。

Members

alpha :Number

Default Value:
  • 1.0
该图层的alpha混合值,范围是0.0-1.0。 0.0表示完全透明,1.0表示完全不透明。
Type:
  • Number

brightness :Number

Default Value:
  • 1.0
该图层的亮度值。 值为1.0表示使用原图;值大于1.0时图像将变亮;值小于1.0时图像将变暗。
Type:
  • Number

colorToAlpha :Cesium.Color

应设置为透明的颜色值。
Type:
  • Cesium.Color

colorToAlphaThreshold :Number

color-to-alpha的归一化(0-1)阈值。
Type:
  • Number

contrast :Number

Default Value:
  • 1.0
该图层的对比度。 值为1.0表示使用原图;值大于1.0表示增加对比度;值小于1.0表示降低对比度。
Type:
  • Number

cutoutRectangle :Cesium.Rectangle

裁剪此图层的矩形范围。(在图层上挖洞的效果)
Type:
  • Cesium.Rectangle

gamma :Number

Default Value:
  • 1.0
该图层伽马校正。值为1.0表示使用原图。
Type:
  • Number

hue :Number

Default Value:
  • 0.0
该图层的色调。值为0.0表示使用原图。
Type:
  • Number

(readonly) id :String

图层的ID。
Type:
  • String

(readonly) imageryLayer :Cesium.ImageryLayer

获取该图层包装的imageryLayer实例。
Type:
  • Cesium.ImageryLayer

magnificationFilter :Cesium.TextureMagnificationFilter

Default Value:
  • Cesium.ImageryLayer.DEFAULT_MAGNIFICATION_FILTER
应用于该图层的Cesium.TextureMagnificationFilter
Type:
  • Cesium.TextureMagnificationFilter

(readonly) mapLoader :MapLoader

此图层的tileLoader。
Type:

minificationFilter :Cesium.TextureMinificationFilter

Default Value:
  • Cesium.ImageryLayer.DEFAULT_MINIFICATION_FILTER
应用于该图层的Cesium.TextureMinificationFilter
Type:
  • Cesium.TextureMinificationFilter

(readonly) rectangle :Cesium.Rectangle

获取该图层的矩形显示范围。
Type:
  • Cesium.Rectangle

saturation :Number

Default Value:
  • 1.0
该图层的饱和度。 值为1.0表示使用原图;值大于1.0表示增加饱和度;值小于1.0表示降低饱和度。
Type:
  • Number

show :Boolean

Default Value:
  • true
是否显示该图层。
Type:
  • Boolean

splitDirection :Cesium.ImagerySplitDirection

Default Value:
  • Cesium.ImagerySplitDirection.NONE
应用于该图层的Cesium.ImagerySplitDirection。 可控制瓦片影像图层仅在分割条的左边或右边区域显示。
Type:
  • Cesium.ImagerySplitDirection

Methods

getViewableRectangle() → {Promise.<Cesium.Rectangle>}

获取图层的矩形可见范围。
Example
// 缩放到一个图像图层。
mapLayer.getViewableRectangle().then(function (rectangle) {
    return camera.flyTo({
        destination: rectangle
    });
});
Returns:
矩形的promise,它代表此图层可见范围。
Type
Promise.<Cesium.Rectangle>

isBaseLayer() → {Boolean}

判断此图层是否为MapLayerCollection中的基础图层。基础图层在所有其他图层的之下。
Returns:
如果这是基础图层,则为true;否则,false。
Type
Boolean

isDestroyed() → {Boolean}

See:
  • MapLayer#destroy
如果该对象没被销毁,返回false。
如果该对象已经被销毁,使用isDestroyed 会触发 Cesium.DeveloperError 异常。
Returns:
false
Type
Boolean

Documentation generated by JSDoc 3.6.4 on Thu Aug 06 2020 00:02:05 GMT+0800 (GMT+08:00) using the docdash theme.