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 37
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

The z-index for layer rendering. At rendering time, the layers will be ordered, first by Z-index and then by position. When undefined, a zIndex of 0 is assumed for layers that are added to the map's layers collection, or Infinity when the layer's setMap() method was used.

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 125

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 137

Return the maximum resolution of the layer.

Returns:
The maximum resolution of the layer.

getMinResolution(){number}

layer/Base.js, line 147

Return the minimum resolution of the layer.

Returns:
The minimum resolution of the layer.

getOpacity(){number}

layer/Base.js, line 157

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

Returns:
The opacity of the layer.

getVisible(){boolean}

layer/Base.js, line 173

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

Returns:
The visibility of the layer.

getZIndex(){number}

layer/Base.js, line 184

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 195

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 205

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 215

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 225

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 235

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 246

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.