Class: LayersConfig

Layer.LayersConfig(cfg)

Class representing the layers config accessor

Constructor

new LayersConfig(cfg)

Create a layers config accessor instance based on a config object

Parameters:
Name Type Description
cfg object

the lizmap config object for layers

Source:

Members

layerConfigs :Array.<LayerConfig>

The copy of the layer configs

Type:
  • Array.<LayerConfig>
Source:

layerIds :Array.<string>

The copy of the layer ids

Type:
  • Array.<string>
Source:

layerNames :Array.<string>

The copy of the layer names

Type:
  • Array.<string>
Source:

Methods

getLayerConfigByLayerId(id) → {LayerConfig}

Get a layer config by layer id

Parameters:
Name Type Description
id string

the layer id

Source:
Throws:

The layer name is unknown or the config has been corrupted

Type
RangeError | Error
Returns:

The layer config associated to the id

Type
LayerConfig

getLayerConfigByLayerName(name) → {LayerConfig}

Get a layer config by layer name

Parameters:
Name Type Description
name string

the layer name

Source:
Throws:

The layer name is unknown or the config has been corrupted

Type
RangeError | Error
Returns:

The layer config associated to the name

Type
LayerConfig

getLayerConfigByWmsName(name) → (nullable) {LayerConfig}

Get a layer config by layer WMS name

Parameters:
Name Type Description
name string

the layer WMS name

Source:
Throws:

The layer name is unknown or the config has been corrupted

Type
RangeError | Error
Returns:

The layer config associated to the WMS name

Type
LayerConfig

(generator) getLayerConfigs() → {LayerConfig}

Iterate through layer configs

Source:
Yields:
The next layer config
Type
LayerConfig

(generator) getLayerIds() → {string}

Iterate through layer ids

Source:
Yields:
The next layer id
Type
string

(generator) getLayerNames() → {string}

Iterate through layer names

Source:
Yields:
The next layer name
Type
string