Class: BaseLayer

ol/layer/Base~BaseLayer


import BaseLayer from 'ol/layer/Base';

Abstract base class; normally only used for creating subclasses and not instantiated in apps. Note that with module:ol/layer/Base~BaseLayer and all its subclasses, any property set in the options is set as a module:ol/Object~BaseObject property on the layer object, so is observable, and has get/set accessors.

new BaseLayer(options)

layer/Base.js, line 35
Name Type Description
options

Layer options.

Name Type Default Description
opacity number 1

Opacity (0, 1).

visible boolean true

Visibility.

extent module:ol/extent~Extent

The bounding extent for layer rendering. The layer will not be rendered outside of this extent.

zIndex number 0

The z-index for layer rendering. At rendering time, the layers will be ordered, first by Z-index and then by position.

minResolution number

The minimum resolution (inclusive) at which this layer will be visible.

maxResolution number

The maximum resolution (exclusive) below which this layer will be visible.

Methods

getExtent(){module:ol/extent~Extent|undefined}

layer/Base.js, line 124

Return the extent of the layer or undefined if it will be visible regardless of extent.

Returns:
The layer extent.

getMaxResolution(){number}

layer/Base.js, line 136

Return the maximum resolution of the layer.

Returns:
The maximum resolution of the layer.

getMinResolution(){number}

layer/Base.js, line 146

Return the minimum resolution of the layer.

Returns:
The minimum resolution of the layer.

getOpacity(){number}

layer/Base.js, line 156

Return the opacity of the layer (between 0 and 1).

Returns:
The opacity of the layer.

getVisible(){boolean}

layer/Base.js, line 172

Return the visibility of the layer (true or false).

Returns:
The visibility of the layer.

getZIndex(){number}

layer/Base.js, line 183

Return the Z-index of the layer, which is used to order layers before rendering. The default Z-index is 0.

Returns:
The Z-index of the layer.

setExtent(extent)

layer/Base.js, line 194

Set the extent at which the layer is visible. If undefined, the layer will be visible at all extents.

Name Type Description
extent module:ol/extent~Extent | undefined

The extent of the layer.

setMaxResolution(maxResolution)

layer/Base.js, line 204

Set the maximum resolution at which the layer is visible.

Name Type Description
maxResolution number

The maximum resolution of the layer.

setMinResolution(minResolution)

layer/Base.js, line 214

Set the minimum resolution at which the layer is visible.

Name Type Description
minResolution number

The minimum resolution of the layer.

setOpacity(opacity)

layer/Base.js, line 224

Set the opacity of the layer, allowed values range from 0 to 1.

Name Type Description
opacity number

The opacity of the layer.

setVisible(visible)

layer/Base.js, line 234

Set the visibility of the layer (true or false).

Name Type Description
visible boolean

The visibility of the layer.

setZIndex(zindex)

layer/Base.js, line 245

Set Z-index of the layer, which is used to order layers before rendering. The default Z-index is 0.

Name Type Description
zindex number

The z-index of the layer.