Class: LayerGroup

ol/layer/Group~LayerGroup


import LayerGroup from 'ol/layer/Group';

A module:ol/Collection~Collection of layers that are handled together.

A generic change event is triggered when the group/Collection changes.

new LayerGroup(opt_options)

layer/Group.js, line 51
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.

layers Array.<module:ol/layer/Base~BaseLayer> | module:ol/Collection~Collection.<module:ol/layer/Base~BaseLayer>

Child layers.

Methods

getLayers(){module:ol/Collection~Collection.<module:ol/layer/Base~BaseLayer>}

layer/Group.js, line 169

Returns the collection of layers in this group.

Returns:
Collection of layers that are part of this group.

setLayers(layers)

layer/Group.js, line 183

Set the collection of layers in this group.

Name Type Description
layers module:ol/Collection~Collection.<module:ol/layer/Base~BaseLayer>

Collection of layers that are part of this group.