# PropertyStack

Extends PropertyComposite

# Properties

# getLayers

Get all available layers.

Returns Array (opens new window)<Layer>

# hasLayers

Check if the property has layers.

Returns Boolean (opens new window)

# getLayer

Get layer by index.

# Parameters

# Examples

// Get the first layer
const layerFirst = property.getLayer(0);
// Get the last layer
const layers = this.getLayers();
const layerLast = property.getLayer(layers.length - 1);

Returns (Layer | null)

# getSelectedLayer

Get selected layer.

Returns (Layer | undefined (opens new window))

# selectLayer

Select layer. Without a selected layer any update made on inner properties has no effect.

# Parameters

  • layer Layer Layer to select

# Examples

const layer = property.getLayer(0);
property.selectLayer(layer);

# selectLayerAt

Select layer by index.

# Parameters

# Examples

property.selectLayerAt(1);

# moveLayer

Move layer by index.

# Parameters

# Examples

const layer = property.getLayer(1);
property.moveLayer(layer, 0);

# addLayer

Add new layer to the stack.

# Parameters

# Examples

// Add new layer at the beginning of the stack with custom values
property.addLayer({ 'sub-prop1': 'value1', 'sub-prop2': 'value2' }, { at: 0 });

Returns Layer Added layer.

# removeLayer

Remove layer.

# Parameters

  • layer Layer Layer to remove.

# Examples

const layer = property.getLayer(0);
property.removeLayer(layer);

Returns Layer Removed layer

# removeLayerAt

Remove layer by index.

# Parameters

# Examples

property.removeLayerAt(0);

Returns (Layer | null) Removed layer

# getLayerLabel

Get the layer label. The label can be customized with the layerLabel property.

# Parameters

# Examples

const layer = this.getLayer(1);
const label = this.getLayerLabel(layer);

Returns String (opens new window)

# getStyleFromLayer

Get style object from the layer.

# Parameters

Returns Object (opens new window) Style object

# getStylePreview

Get preview style object from the layer. If the property has preview: false the returned object will be empty.

# Parameters

Returns Object (opens new window) Style object

# getLayerSeparator

Get layer separator.

Returns RegExp (opens new window)

# hasEmptyValue

Check if the property is with an empty value.

Returns Boolean (opens new window)