# Class SyncLayertreeMap

#### Hierarchy

- SyncLayertreeMap

- Defined in src/layertree/SyncLayertreeMap.js:49

#####
Index

### Properties

layerHelper_
ngeoWMSTime_
ogcServersObject_

### Methods

createGroup_
createLayer
createLayerFromGroup_
createLeafInAMixedGroup_
createWMTSLayer_
getFirstLevelGroupCtrl_
getTimeParam_
initGmfLayerInANotMixedGroup_
isOneParentNotMixed_
sync_
updateLayerReferences_
updateLayerState_

## Properties

### layerHelper_

layerHelper_: LayerHelper

- Defined in src/layertree/SyncLayertreeMap.js:53

### ngeoWMSTime_

ngeoWMSTime_: WMSTime

- Defined in src/layertree/SyncLayertreeMap.js:58

### ogcServersObject_

ogcServersObject_: any

- Defined in src/layertree/SyncLayertreeMap.js:69
- Defined in src/layertree/SyncLayertreeMap.js:72

## Methods

### createGroup_

- createGroup_(treeCtrl: LayertreeController, map: Map, dataLayerGroup: LayerGroup, opt_position?: number): LayerGroup | ImageLayer<ImageSource>

- Create insert and return a layer group (for not mixed case) or a wmsLayer (for mixed case). Take care about the insertion order in the map in case of first level group.

  ### Returns

  a new layer.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller.

  - ##### map: Map

    A map that contains the group to insert the not first level group layer.

  - ##### dataLayerGroup: LayerGroup

    the layer group to insert the first level group layer.

  - ##### `Optional` opt_position: number

    for first level Group, you can precise the position to add the group in the array of layers of the dataLayerGroup.

  #### Returns LayerGroup | ImageLayer<ImageSource>

  - Defined in src/layertree/SyncLayertreeMap.js:209

### createLayer

- createLayer(treeCtrl: LayertreeController, map: Map, dataLayerGroup: LayerGroup, opt_position?: number): BaseLayer | LayerGroup

- Create, insert (or update) and return a layer from the GmfGroup or the GmfLayer of the given treeCtrl.

  ### Returns

  a new layer.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller.

  - ##### map: Map

    A map that contains the group to insert the not first level group layer.

  - ##### dataLayerGroup: LayerGroup

    the layer group to insert the first level group layer.

  - ##### `Optional` opt_position: number

    for first level Group, you can precise the position to add the group in the array of layers of the dataLayerGroup.

  #### Returns BaseLayer | LayerGroup

  - Defined in src/layertree/SyncLayertreeMap.js:94

### createLayerFromGroup_

- createLayerFromGroup_(treeCtrl: LayertreeController, mixed: boolean): LayerGroup | ImageLayer<ImageSource>

- Create, insert and return a layer group (for not mixed case) or a wmsLayer for mixed case).

  ### Returns

  a new layer.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller.

  - ##### mixed: boolean

    True for a group layer, false for a WMS layer.

  #### Returns LayerGroup | ImageLayer<ImageSource>

  - Defined in src/layertree/SyncLayertreeMap.js:253

### createLeafInAMixedGroup_

- createLeafInAMixedGroup_(treeCtrl: LayertreeController, map: Map): any

- Create and insert a layer from a leaf in a mixed group.

  ### Returns

  a new layer.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller.

  - ##### map: Map

    A map that contains the group to insert the layer.

  #### Returns any

  - Defined in src/layertree/SyncLayertreeMap.js:319

### createWMTSLayer_

- createWMTSLayer_(gmfLayerWMTS: any): any

- Create and return a Tile layer.

  ### Returns

  a Tile WMTS layer. (Source and capabilities can come later).

  #### Parameters

  - ##### gmfLayerWMTS: any

    A leaf node.

  #### Returns any

  - Defined in src/layertree/SyncLayertreeMap.js:417

### getFirstLevelGroupCtrl_

- getFirstLevelGroupCtrl_(treeCtrl: LayertreeController): LayertreeController

- Return the first parent, from the root parent, that is not mixed.

  ### Returns

  The first not mixed parent.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller.

  #### Returns LayertreeController

  - Defined in src/layertree/SyncLayertreeMap.js:530

### getTimeParam_

- getTimeParam_(treeCtrl: LayertreeController): string

- Get the time parameter for a WMS Layer. If it's a group and it doesn't have time, get the first time parameter available in any child.

  ### Returns

  A wms time param.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller.

  #### Returns string

  - Defined in src/layertree/SyncLayertreeMap.js:480

### initGmfLayerInANotMixedGroup_

- initGmfLayerInANotMixedGroup_(treeCtrl: LayertreeController, map: Map): void

- Update a WMS layer with the given treeCtrl node information. Assumes that the first parent with ogcServer information is linked to the layer to update and that this treeCtrl node is a leafNode.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller.

  - ##### map: Map

    A map that contains the layer to update.

  #### Returns void

  - Defined in src/layertree/SyncLayertreeMap.js:387

### isOneParentNotMixed_

- isOneParentNotMixed_(treeCtrl: LayertreeController): boolean

- Return true if a parent tree is mixed, based on its node.

  ### Returns

  True is any parent is mixed. False Otherwise.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller.

  #### Returns boolean

  - Defined in src/layertree/SyncLayertreeMap.js:513

### sync_

- sync_(treeCtrl: LayertreeController): void

- Synchronize the state of each layers corresponding to the given tree and all its children.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller.

  #### Returns void

  - Defined in src/layertree/SyncLayertreeMap.js:128

### updateLayerReferences_

- updateLayerReferences_(node: any, layer: BaseLayer): void

- Update properties of a layer with the node of a given leafNode.

  #### Parameters

  - ##### node: any

    a tree node.

  - ##### layer: BaseLayer

    A layer.

  #### Returns void

  - Defined in src/layertree/SyncLayertreeMap.js:451

### updateLayerState_

- updateLayerState_(layer: any, treeCtrl: LayertreeController): void

- Set the active state of a layer based on its treeCtrl state.

  #### Parameters

  - ##### layer: any

    A layer.

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller.

  #### Returns void

  - Defined in src/layertree/SyncLayertreeMap.js:149

Generated using TypeDoc