ImageryLayer

new Cesium.ImageryLayer(imageryProvider, options)

The imagery layer class is used to display the tile imagery data of the imagery provider.
Name Type Description
imageryProvider SuperMapImageryProvider The specified imagery provider.
options Object optional The object has the following properties:
Name Type Default Description
rectangle Rectangle imageryProvider.rectangle optional The rectangle range of the layer, this rectangle limits the visible range of the image.
alpha Number | function 1.0 optional The layer transparency value, the value range is 0.0~1.0.
brightness Number | function 1.0 optional The brightness value of the layer. A value of 1.0 means the original image is used; when the value is greater than 1.0, the image will become brighter; when the value is less than 1.0, the image will become darker.
contrast Number | function 1.0 optional Layer contrast. A value of 1.0 means using the original image; a value greater than 1.0 means increasing the contrast; a value less than 1.0 means reducing the contrast.
hue Number | function 0.0 optional Layer tone. A value of 0.0 means the original image is used.
saturation Number | function 1.0 optional Layer saturation. A value of 1.0 means using the original image; a value greater than 1.0 means increasing the saturation; a value less than 1.0 means reducing the saturation.
gamma Number | function 1.0 optional Layer gamma correction. A value of 1.0 means the original imagery is used.
show Boolean true optional Specify whether to display the layer, true means to display this layer, false means not to display.
splitDirection ImagerySplitDirection | function ImagerySplitDirection.NONE optional Specify the direction of image layer division.
minimumTerrainLevel Number optional Minimum level of detail of terrain. Level 0 is the minimum level of detail.
maximumTerrainLevel Number optional Maximum terrain level of detail.
Example:
var  imageryProvider = new Cesium.SuperMapImageryProvider({
		    url : ‘http://localhost:8090/iserver/services/datas/China’
     });
     //Create imagery layer through imagery provider
var imageryLayer = new Cesium.ImageryLayer(imageryProvider);

Members

alpha : Number

The layer transparency value, the value range is 0.0~1.0. 0.0 means completely transparent; 1.0 means completely opaque.
Default Value: 1.0

brightness : Number

The brightness value of the layer. A value of 1.0 means the original image is used; when the value is greater than 1.0, the image will become brighter; when the value is less than 1.0, the image will become darker.
Default Value: ImageryLayer.DEFAULT_BRIGHTNESS

contrast : Number

Layer contrast. A value of 1.0 means using the original image; a value greater than 1.0 means increasing the contrast; a value less than 1.0 means reducing the contrast.
Default Value: ImageryLayer.DEFAULT_CONTRAST

enableUpsample : Boolean

When the image request of the child tile fails, the image of the parent tile will be used, the default value: true (when only part of the four child tiles have data, it can be set to false to prevent image confusion

gamma : Number

Layer gamma correction. A value of 1.0 means the original image is used.
Default Value: ImageryLayer.DEFAULT_GAMMA

hue : Number

Layer tone. A value of 0.0 means the original image is used.
Default Value: ImageryLayer.DEFAULT_HUE

indexedDBSetting : Object

Get or set whether the indexedDB cache of the image is turned on (IE browser does not support)
Example:
//Set whether to save the image cache to the indexedDB database of the browser
var imageryLayer = viewer.imageryLayers.get(1);
imageryLayer.indexedDBSetting.isOpen = true;

lodOffset : Number

Gets or sets the offset when loading the image layer. The offset here refers to the offset in the level of detail. The larger the value, the more the detail layer shifts upward, the finer the loaded image layer, the clearer the image, and the more blurry the image is when the value is negative. Note: The value here can only be set as an integer. The default value is 0, no offset.
Default Value: 0

saturation : Number

Layer saturation. A value of 1.0 means using the original image; a value greater than 1.0 means increasing the saturation; a value less than 1.0 means reducing the saturation.
Default Value: ImageryLayer.DEFAULT_SATURATION

show : Boolean

Specify whether the current layer is displayed.
Default Value: true

splitDirection : ImagerySplitDirection

Specify the split direction ImagerySplitDirection of the image layer to control the image layer to be displayed only on the left or right area of the split bar.
Default Value: ImageryLayer.DEFAULT_SPLIT

swipeEnabled : Boolean

Get or set whether to turn on the shutter function.

swipeRegion : Rectangle

Gets or sets the quadrilateral area of the rolling shutter.

transparentBackColor : Color

Set the imagery transparency color.
Default Value: ImageryLayer.DEFAULT_TRANSPARENTBACKCOLOR

transparentBackColorTolerance : Number

Set the image transparency tolerance, the value range is 0.0~1.0. 0.0 means completely transparent, 1.0 means completely opaque.
Default Value: ImageryLayer.DEFAULT_TRANSPARENTBACKCOLORTOLERANCE

Methods

destroy()undefined

Release the resources occupied by the object.
Returns:
Example:
imageryLayer = imageryLayer && imageryLayer.destroy();
See:

getViewableRectangle()Promise

Get the visible range of the layer.
Returns:
Rectangle object, representing the visible range of the layer.
Example:
// Zoom to an imagery layer.
imageryLayer.getViewableRectangle().then(function (rectangle) {
    return camera.flyTo({
        destination: rectangle
    });
});

isBaseLayer()Boolean

Determine whether the layer is the basic layer in the image layer set ImageryLayerCollection.

The base layer is special, it is considered to have a global rectangle.
Returns:
True means the base layer; false means the non-base layer.
Example:
var isBaseLayer = imageryLayer.isBaseLayer();

isDestroyed()Boolean

Returns whether to release the resources occupied by the object.
Returns:
Whether to release the occupied resources.
See:

setVisibleInViewport(index, visible)

Set the layer corresponding to the viewport visibility according to the index.
Name Type Description
index Number Index of the viewport
visible Boolean Visibility of the viewport
Throws: