# ImageryLayer

#### new Cesium.ImageryLayer(imageryProvider, options)
Scene/ImageryLayer.js 129

An imagery layer that displays tiled image data from a single imagery provider on a `Globe`.

Name | Type | Description
--- | --- | ---
`imageryProvider` | ImageryProvider | The imagery provider to use.

`options`

Object

optional Object with the following properties:

Name | Type | Default | Description
--- | --- | --- | ---
`rectangle` | Rectangle | `imageryProvider.rectangle` | optional The rectangle of the layer. This rectangle can limit the visible portion of the imagery provider.

`alpha`

Number | function

`1.0`

optional The alpha blending value of this layer, from 0.0 to 1.0. This can either be a simple number or a function with the signature `function(frameState, layer, x, y, level)`. The function is passed the current frame state, this layer, and the x, y, and level coordinates of the imagery tile for which the alpha is required, and it is expected to return the alpha value to use for the tile.

`nightAlpha`

Number | function

`1.0`

optional The alpha blending value of this layer on the night side of the globe, from 0.0 to 1.0. This can either be a simple number or a function with the signature `function(frameState, layer, x, y, level)`. The function is passed the current frame state, this layer, and the x, y, and level coordinates of the imagery tile for which the alpha is required, and it is expected to return the alpha value to use for the tile. This only takes effect when `enableLighting` is `true`.

`dayAlpha`

Number | function

`1.0`

optional The alpha blending value of this layer on the day side of the globe, from 0.0 to 1.0. This can either be a simple number or a function with the signature `function(frameState, layer, x, y, level)`. The function is passed the current frame state, this layer, and the x, y, and level coordinates of the imagery tile for which the alpha is required, and it is expected to return the alpha value to use for the tile. This only takes effect when `enableLighting` is `true`.

`brightness`

Number | function

`1.0`

optional The brightness of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 makes the imagery darker while greater than 1.0 makes it brighter. This can either be a simple number or a function with the signature `function(frameState, layer, x, y, level)`. The function is passed the current frame state, this layer, and the x, y, and level coordinates of the imagery tile for which the brightness is required, and it is expected to return the brightness value to use for the tile. The function is executed for every frame and for every tile, so it must be fast.

`contrast`

Number | function

`1.0`

optional The contrast of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the contrast while greater than 1.0 increases it. This can either be a simple number or a function with the signature `function(frameState, layer, x, y, level)`. The function is passed the current frame state, this layer, and the x, y, and level coordinates of the imagery tile for which the contrast is required, and it is expected to return the contrast value to use for the tile. The function is executed for every frame and for every tile, so it must be fast.

`hue`

Number | function

`0.0`

optional The hue of this layer. 0.0 uses the unmodified imagery color. This can either be a simple number or a function with the signature `function(frameState, layer, x, y, level)`. The function is passed the current frame state, this layer, and the x, y, and level coordinates of the imagery tile for which the hue is required, and it is expected to return the contrast value to use for the tile. The function is executed for every frame and for every tile, so it must be fast.

`saturation`

Number | function

`1.0`

optional The saturation of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the saturation while greater than 1.0 increases it. This can either be a simple number or a function with the signature `function(frameState, layer, x, y, level)`. The function is passed the current frame state, this layer, and the x, y, and level coordinates of the imagery tile for which the saturation is required, and it is expected to return the contrast value to use for the tile. The function is executed for every frame and for every tile, so it must be fast.

`gamma`

Number | function

`1.0`

optional The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color. This can either be a simple number or a function with the signature `function(frameState, layer, x, y, level)`. The function is passed the current frame state, this layer, and the x, y, and level coordinates of the imagery tile for which the gamma is required, and it is expected to return the gamma value to use for the tile. The function is executed for every frame and for every tile, so it must be fast.

`splitDirection` | ImagerySplitDirection | function | `ImagerySplitDirection.NONE` | optional The `ImagerySplitDirection` split to apply to this layer.
`minificationFilter` | TextureMinificationFilter | `TextureMinificationFilter.LINEAR` | optional The texture minification filter to apply to this layer. Possible values are `TextureMinificationFilter.LINEAR` and `TextureMinificationFilter.NEAREST`.
`magnificationFilter` | TextureMagnificationFilter | `TextureMagnificationFilter.LINEAR` | optional The texture minification filter to apply to this layer. Possible values are `TextureMagnificationFilter.LINEAR` and `TextureMagnificationFilter.NEAREST`.
`show` | Boolean | `true` | optional True if the layer is shown; otherwise, false.
`maximumAnisotropy` | Number | `maximum supported` | optional The maximum anisotropy level to use for texture filtering. If this parameter is not specified, the maximum anisotropy supported by the WebGL stack will be used. Larger values make the imagery look better in horizon views.
`minimumTerrainLevel` | Number |  | optional The minimum terrain level-of-detail at which to show this imagery layer, or undefined to show it at all levels. Level zero is the least-detailed level.
`maximumTerrainLevel` | Number |  | optional The maximum terrain level-of-detail at which to show this imagery layer, or undefined to show it at all levels. Level zero is the least-detailed level.
`cutoutRectangle` | Rectangle |  | optional Cartographic rectangle for cutting out a portion of this ImageryLayer.
`colorToAlpha` | Color |  | optional Color to be used as alpha.
`colorToAlphaThreshold` | Number | `0.004` | optional Threshold for color-to-alpha.

### Members

#### static Cesium.ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD : Number
Scene/ImageryLayer.js 384

This value is used as the default threshold for color-to-alpha if one is not provided during construction or by the imagery provider.

Default Value: `0.004`

#### static Cesium.ImageryLayer.DEFAULT_BRIGHTNESS : Number
Scene/ImageryLayer.js 324

This value is used as the default brightness for the imagery layer if one is not provided during construction or by the imagery provider. This value does not modify the brightness of the imagery.

Default Value: `1.0`

#### static Cesium.ImageryLayer.DEFAULT_CONTRAST : Number
Scene/ImageryLayer.js 331

This value is used as the default contrast for the imagery layer if one is not provided during construction or by the imagery provider. This value does not modify the contrast of the imagery.

Default Value: `1.0`

#### static Cesium.ImageryLayer.DEFAULT_GAMMA : Number
Scene/ImageryLayer.js 352

This value is used as the default gamma for the imagery layer if one is not provided during construction or by the imagery provider. This value does not modify the gamma of the imagery.

Default Value: `1.0`

#### static Cesium.ImageryLayer.DEFAULT_HUE : Number
Scene/ImageryLayer.js 338

This value is used as the default hue for the imagery layer if one is not provided during construction or by the imagery provider. This value does not modify the hue of the imagery.

Default Value: `0.0`

#### static Cesium.ImageryLayer.DEFAULT_MAGNIFICATION_FILTER : TextureMagnificationFilter
Scene/ImageryLayer.js 376

This value is used as the default texture magnification filter for the imagery layer if one is not provided during construction or by the imagery provider.

Default Value: `TextureMagnificationFilter.LINEAR`

#### static Cesium.ImageryLayer.DEFAULT_MINIFICATION_FILTER : TextureMinificationFilter
Scene/ImageryLayer.js 368

This value is used as the default texture minification filter for the imagery layer if one is not provided during construction or by the imagery provider.

Default Value: `TextureMinificationFilter.LINEAR`

#### static Cesium.ImageryLayer.DEFAULT_SATURATION : Number
Scene/ImageryLayer.js 345

This value is used as the default saturation for the imagery layer if one is not provided during construction or by the imagery provider. This value does not modify the saturation of the imagery.

Default Value: `1.0`

#### static Cesium.ImageryLayer.DEFAULT_SPLIT : ImagerySplitDirection
Scene/ImageryLayer.js 360

This value is used as the default split for the imagery layer if one is not provided during construction or by the imagery provider.

Default Value: `ImagerySplitDirection.NONE`

#### alpha : Number
Scene/ImageryLayer.js 141

The alpha blending value of this layer, with 0.0 representing fully transparent and 1.0 representing fully opaque.

Default Value: `1.0`

#### brightness : Number
Scene/ImageryLayer.js 168

The brightness of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 makes the imagery darker while greater than 1.0 makes it brighter.

Default Value: ``ImageryLayer.DEFAULT_BRIGHTNESS``

#### colorToAlpha : Color
Scene/ImageryLayer.js 281

Color value that should be set to transparent.

#### colorToAlphaThreshold : Number
Scene/ImageryLayer.js 288

Normalized (0-1) threshold for color-to-alpha.

#### contrast : Number
Scene/ImageryLayer.js 177

The contrast of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the contrast while greater than 1.0 increases it.

Default Value: ``ImageryLayer.DEFAULT_CONTRAST``

#### cutoutRectangle : Rectangle
Scene/ImageryLayer.js 274

Rectangle cutout in this layer of imagery.

#### dayAlpha : Number
Scene/ImageryLayer.js 159

The alpha blending value of this layer on the day side of the globe, with 0.0 representing fully transparent and 1.0 representing fully opaque. This only takes effect when `Globe#enableLighting` is `true`.

Default Value: `1.0`

#### gamma : Number
Scene/ImageryLayer.js 202

The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.

Default Value: ``ImageryLayer.DEFAULT_GAMMA``

#### hue : Number
Scene/ImageryLayer.js 185

The hue of this layer in radians. 0.0 uses the unmodified imagery color.

Default Value: ``ImageryLayer.DEFAULT_HUE``

#### readonly imageryProvider : ImageryProvider
Scene/ImageryLayer.js 298

Gets the imagery provider for this layer.

#### magnificationFilter : TextureMagnificationFilter
Scene/ImageryLayer.js 236

The `TextureMagnificationFilter` to apply to this layer. Possible values are `TextureMagnificationFilter.LINEAR` (the default) and `TextureMagnificationFilter.NEAREST`. To take effect, this property must be set immediately after adding the imagery layer. Once a texture is loaded it won't be possible to change the texture filter used.

Default Value: ``ImageryLayer.DEFAULT_MAGNIFICATION_FILTER``

#### minificationFilter : TextureMinificationFilter
Scene/ImageryLayer.js 223

The `TextureMinificationFilter` to apply to this layer. Possible values are `TextureMinificationFilter.LINEAR` (the default) and `TextureMinificationFilter.NEAREST`. To take effect, this property must be set immediately after adding the imagery layer. Once a texture is loaded it won't be possible to change the texture filter used.

Default Value: ``ImageryLayer.DEFAULT_MINIFICATION_FILTER``

#### nightAlpha : Number
Scene/ImageryLayer.js 150

The alpha blending value of this layer on the night side of the globe, with 0.0 representing fully transparent and 1.0 representing fully opaque. This only takes effect when `Globe#enableLighting` is `true`.

Default Value: `1.0`

#### readonly rectangle : Rectangle
Scene/ImageryLayer.js 311

Gets the rectangle of this layer. If this rectangle is smaller than the rectangle of the `ImageryProvider`, only a portion of the imagery provider is shown.

#### saturation : Number
Scene/ImageryLayer.js 194

The saturation of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the saturation while greater than 1.0 increases it.

Default Value: ``ImageryLayer.DEFAULT_SATURATION``

#### show : Boolean
Scene/ImageryLayer.js 244

Determines if this layer is shown.

Default Value: `true`

#### splitDirection : ImagerySplitDirection
Scene/ImageryLayer.js 210

The `ImagerySplitDirection` to apply to this layer.

Default Value: ``ImageryLayer.DEFAULT_SPLIT``

### Methods

#### destroy()
Scene/ImageryLayer.js 429

Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.
Once an object is destroyed, it should not be used; calling any function other than `isDestroyed` will result in a `DeveloperError` exception. Therefore, assign the return value (`undefined`) to the object as done in the example.

##### Throws:

- DeveloperError : This object was destroyed, i.e., destroy() was called.

##### Example:

    imageryLayer = imageryLayer && imageryLayer.destroy();

##### See:

- ImageryLayer#isDestroyed

#### getViewableRectangle() → Promise.<Rectangle>
Scene/ImageryLayer.js 452

Computes the intersection of this layer's rectangle with the imagery provider's availability rectangle, producing the overall bounds of imagery that can be produced by this layer.

##### Returns:

A promise to a rectangle which defines the overall bounds of imagery that can be produced by this layer.

##### Example:

    // Zoom to an imagery layer.
    imageryLayer.getViewableRectangle().then(function (rectangle) {
        return camera.flyTo({
            destination: rectangle
        });
    });

#### isBaseLayer() → Boolean
Scene/ImageryLayer.js 395

Gets a value indicating whether this layer is the base layer in the `ImageryLayerCollection`. The base layer is the one that underlies all others. It is special in that it is treated as if it has global rectangle, even if it actually does not, by stretching the texels at the edges over the entire globe.

##### Returns:

true if this is the base layer; otherwise, false.

#### isDestroyed() → Boolean
Scene/ImageryLayer.js 409

Returns true if this object was destroyed; otherwise, false.
If this object was destroyed, it should not be used; calling any function other than `isDestroyed` will result in a `DeveloperError` exception.

##### Returns:

True if this object was destroyed; otherwise, false.

##### See:

- ImageryLayer#destroy