Constructor
new LayersAndGroupsCollection(layerTreeGroupCfg, layersOrder, hideGroupCheckbox)
Creating the collection of layers and groups state
Parameters:
Name | Type | Description |
---|---|---|
layerTreeGroupCfg |
LayerTreeGroupConfig | the layer item config |
layersOrder |
Array.<number> | the layers order |
hideGroupCheckbox |
boolean | the hideGroupCheckbox option instance from lizMap configuration |
- Source:
Extends
Members
groupNames :Array.<string>
The group names
Type:
- Array.<string>
- Source:
groups :Array.<LayerGroupState>
The groups
Type:
- Array.<LayerGroupState>
- Source:
layerNames :Array.<string>
The layer names
Type:
- Array.<string>
- Source:
layers :Array.<(LayerVectorState|LayerRasterState)>
The layers state
Type:
- Array.<(LayerVectorState|LayerRasterState)>
- Source:
root :LayerGroupState
The root group state
Type:
- LayerGroupState
- Source:
Methods
findLayerOrGroupByName(name) → {LayerVectorState|LayerRasterState|LayerGroupState|null}
Find a layer or group state by name
Parameters:
Name | Type | Description |
---|---|---|
name |
string | the name |
- Source:
Returns:
The layer or group state associated to the name or null
- Type
- LayerVectorState | LayerRasterState | LayerGroupState | null
findLayerOrGroupByWmsName(wmsName) → {LayerVectorState|LayerRasterState|LayerGroupState|null}
Find a layer or group state by WMS Name
Parameters:
Name | Type | Description |
---|---|---|
wmsName |
string | the WMS Name |
- Source:
Returns:
The layer or group state associated to the WMS Name or null
- Type
- LayerVectorState | LayerRasterState | LayerGroupState | null
getGroupByName(name) → {LayerVectorState|LayerRasterState}
Get a group state by group name
Parameters:
Name | Type | Description |
---|---|---|
name |
string | the group name |
- Source:
Throws:
-
The group name is unknown
- Type
- RangeError
Returns:
The group state associated to the name
- Type
- LayerVectorState | LayerRasterState
getGroupByWmsName(wmsName) → {LayerGroupState}
Get a group state by WMS Name
Parameters:
Name | Type | Description |
---|---|---|
wmsName |
string | the group WMS Name |
- Source:
Throws:
-
The group WMS Name is unknown
- Type
- RangeError
Returns:
The group state associated to the WMS Name
- Type
- LayerGroupState
(generator) getGroups() → {LayerGroupState}
Iterate through group states
- Source:
Yields:
The next group state
- Type
- LayerGroupState
getLayerById(layerId) → {LayerVectorState|LayerRasterState}
Get a layer state by layer id
Parameters:
Name | Type | Description |
---|---|---|
layerId |
string | the layer id |
- Source:
Throws:
-
The layer id is unknown
- Type
- RangeError
Returns:
The layer state associated to the id
- Type
- LayerVectorState | LayerRasterState
getLayerByName(name) → {LayerVectorState|LayerRasterState}
Get a layer state by layer name
Parameters:
Name | Type | Description |
---|---|---|
name |
string | the layer name |
- Source:
Throws:
-
The layer name is unknown
- Type
- RangeError
Returns:
The layer state associated to the name
- Type
- LayerVectorState | LayerRasterState
getLayerByWmsName(wmsName) → {LayerVectorState|LayerRasterState}
Get a layer state by WMS Name
Parameters:
Name | Type | Description |
---|---|---|
wmsName |
string | the layer WMS Name |
- Source:
Throws:
-
The layer WMS Name is unknown
- Type
- RangeError
Returns:
The layer state associated to the WMS Name
- Type
- LayerVectorState | LayerRasterState
getLayerOrGroupByName(name) → {LayerVectorState|LayerRasterState|LayerGroupState}
Get a layer or group state by name
Parameters:
Name | Type | Description |
---|---|---|
name |
string | the name |
- Source:
Throws:
-
The name is unknown
- Type
- RangeError
Returns:
The layer or group state associated to the name
- Type
- LayerVectorState | LayerRasterState | LayerGroupState
getLayerOrGroupByWmsName(wmsName) → {LayerVectorState|LayerRasterState|LayerGroupState}
Get a layer or group state by WMS Name
Parameters:
Name | Type | Description |
---|---|---|
wmsName |
string | the WMS Name |
- Source:
Throws:
-
The WMS Name is unknown
- Type
- RangeError
Returns:
The layer or group state associated to the WMS Name
- Type
- LayerVectorState | LayerRasterState | LayerGroupState
(generator) getLayers() → {LayerVectorState|LayerRasterState}
Iterate through layer states
- Source:
Yields:
The next layer state
- Type
- LayerVectorState | LayerRasterState