### Hierarchy

- LayertreeTreeManager

## Index

### Properties

- $injector_
- $timeout_
- gettextCatalog_
- gmfThemes_
- groupsToAddInThisDigestLoop_
- initialLevelFirstGroups_
- layerHelper_
- ngeoStateManager_
- numberOfGroupsToAddInThisDigestLoop
- ogcServers_
- promiseForGroupsToAddInThisDigestLoop_
- root
- rootCtrl
- rootScope_

### Methods

- addFirstLevelGroup_
- addFirstLevelGroups
- addGroupByLayerName
- addGroupByName
- addSecondLevelGroups
- getFirstLevelGroupFullState_
- getOgcServer
- getTreeCtrlByNodeId
- handleThemesChange_
- notifyCantAddGroups_
- parseTreeNodes
- refreshFirstLevelGroups_
- removeAll
- removeGroup
- removePopup_
- reorderChild_
- setFirstLevelGroupFullState_
- setFirstLevelGroups
- setInitialFirstLevelGroups
- setSearchedChild
- toggleNodeCheck_
- updateTreeGroupsState_

## Properties

### $injector_

$injector_: IInjectorService

- Defined in src/layertree/TreeManager.js:91

### $timeout_

$timeout_: ITimeoutService

- Defined in src/layertree/TreeManager.js:86

### gettextCatalog_

gettextCatalog_: gettextCatalog

- Defined in src/layertree/TreeManager.js:96

### gmfThemes_

gmfThemes_: any

- Defined in src/layertree/TreeManager.js:106

### groupsToAddInThisDigestLoop_

groupsToAddInThisDigestLoop_: any[]

- Defined in src/layertree/TreeManager.js:140

### initialLevelFirstGroups_

initialLevelFirstGroups_: any[]

- Defined in src/layertree/TreeManager.js:155

### layerHelper_

layerHelper_: LayerHelper

- Defined in src/layertree/TreeManager.js:101

### ngeoStateManager_

ngeoStateManager_: StatemanagerService

- Defined in src/layertree/TreeManager.js:150

### numberOfGroupsToAddInThisDigestLoop

numberOfGroupsToAddInThisDigestLoop: number

- Defined in src/layertree/TreeManager.js:135

Number of groups to add to the layertree during one single Angular digest loop.

### ogcServers_

ogcServers_: any

- Defined in src/layertree/TreeManager.js:162

A reference to the OGC servers loaded by the theme service.

### promiseForGroupsToAddInThisDigestLoop_

promiseForGroupsToAddInThisDigestLoop_: IPromise<void>

- Defined in src/layertree/TreeManager.js:145

### root

root: any

- Defined in src/layertree/TreeManager.js:115

The root node and its children used to generate the layertree (with the same ordre).

### rootCtrl

rootCtrl: LayertreeController

- Defined in src/layertree/TreeManager.js:126

The controller of the (unique) root layer tree. The array of top level layer trees is available through `rootCtrl.children`. The order doesn't match with the ordre of the displayed layertree.

### rootScope_

rootScope_: IScope

- Defined in src/layertree/TreeManager.js:81

## Methods

### addFirstLevelGroup_

- addFirstLevelGroup_(group: any): boolean

- - Defined in src/layertree/TreeManager.js:370

  Add a group as tree's children without consideration of this service 'mode'. Add it only if it's not already in the tree.

  #### Parameters

  - ##### group: any

    The group to add.

  #### Returns boolean

  true if the group has been added.

### addFirstLevelGroups

- addFirstLevelGroups(firstLevelGroups: any[], opt_add: boolean, opt_silent: boolean): boolean

- - Defined in src/layertree/TreeManager.js:212

  Add some groups as tree's children. If the service use mode 'flush', the previous tree's children will be removed. Add only groups that are not already in the tree.

  #### Parameters

  - ##### firstLevelGroups: any[]

    An array of gmf theme group.

  - ##### opt_add: boolean

  - ##### opt_silent: boolean

  #### Returns boolean

  True if the group has been added. False otherwise.

### addGroupByLayerName

- addGroupByLayerName(layerName: string, opt_add: boolean, opt_silent: boolean): void

- - Defined in src/layertree/TreeManager.js:469

  Retrieve a group by the name of a layer that is contained in this group (first found). This group will be added in the tree. Do nothing if any corresponding group is found.

  #### Parameters

  - ##### layerName: string

    Name of the layer inside the group to add.

  - ##### opt_add: boolean

  - ##### opt_silent: boolean

  #### Returns void

### addGroupByName

- addGroupByName(groupName: string, opt_add: boolean): void

- - Defined in src/layertree/TreeManager.js:445

  Retrieve a group (first found) by its name and add in the tree. Do nothing if any corresponding group is found.

  #### Parameters

  - ##### groupName: string

    Name of the group to add.

  - ##### opt_add: boolean

  #### Returns void

### addSecondLevelGroups

- addSecondLevelGroups(firstLevelGroups: any[], groupName: string, opt_add: boolean, opt_silent: boolean): boolean

- - Defined in src/layertree/TreeManager.js:245

  Add some groups as tree's children. If the service use mode 'flush', the previous tree's children will be removed. Add only groups that are not already in the tree.

  NB: The first level group is added, second-level tree is set active when it corresponds to the searched group.

  #### Parameters

  - ##### firstLevelGroups: any[]

    An array of gmf theme group.

  - ##### groupName: string

    The group's name to add.

  - ##### opt_add: boolean

  - ##### opt_silent: boolean

  #### Returns boolean

  True if the group has been added. False otherwise.

### getFirstLevelGroupFullState_

- getFirstLevelGroupFullState_(treeCtrl: LayertreeController): TreeManagerFullState

- - Defined in src/layertree/TreeManager.js:714

  Return a TreeManagerFullState that keeps the state of the given treeCtrl including the state of its children.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    the ngeo layertree controller to save.

  #### Returns TreeManagerFullState

  the fullState object.

### getOgcServer

- getOgcServer(treeCtrl: LayertreeController): any

- - Defined in src/layertree/TreeManager.js:630

  Get the OGC server.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller, from the current node.

  #### Returns any

  The OGC server.

### getTreeCtrlByNodeId

- getTreeCtrlByNodeId(id: number): LayertreeController

- - Defined in src/layertree/TreeManager.js:609

  Get a treeCtrl based on it's node id.

  #### Parameters

  - ##### id: number

    the id of a GMFThemesGroup or a GMFThemesLeaf.

  #### Returns LayertreeController

  treeCtrl The associated controller or null.

### handleThemesChange_

- handleThemesChange_(): void

- - Defined in src/layertree/TreeManager.js:172

  Called when the themes change. Get the OGC servers, then listen to the tree manager Layertree controllers array changes. The themes could have been changed so it also call a refresh of the layertree.

  #### Returns void

### notifyCantAddGroups_

- notifyCantAddGroups_(groups: any[]): void

- - Defined in src/layertree/TreeManager.js:584

  Display a notification that informs that the given groups are already in the tree.

  #### Parameters

  - ##### groups: any[]

    An array of groups that already in the tree.

  #### Returns void

### parseTreeNodes

- parseTreeNodes(node: any): void

- - Defined in src/layertree/TreeManager.js:310

  #### Parameters

  - ##### node: any

    Layer tree node to remove.

  #### Returns void

### refreshFirstLevelGroups_

- refreshFirstLevelGroups_(themes: any[]): void

- - Defined in src/layertree/TreeManager.js:663

  Keep the state of each existing first-level-groups in the layertree then remove it and recreate it with nodes that come from the new theme and the corresponding saved state (when possible, otherwise, juste take the corresponding new node). FIXME: Currently doesn't save nor restore the opacity.

  #### Parameters

  - ##### themes: any[]

    the array of themes to be based on.

  #### Returns void

### removeAll

- removeAll(): void

- - Defined in src/layertree/TreeManager.js:529

  Remove all groups.

  #### Returns void

### removeGroup

- removeGroup(group: any): void

- - Defined in src/layertree/TreeManager.js:509

  Remove a group from this tree's children. The first group that is found ( based on its name) will be removed. If any is found, nothing will append.

  #### Parameters

  - ##### group: any

    The group to remove.

  #### Returns void

### removePopup_

- removePopup_(node: any): void

- - Defined in src/layertree/TreeManager.js:328

  #### Parameters

  - ##### node: any

    Layer tree node to remove.

  #### Returns void

### reorderChild_

- reorderChild_(array: any[], old_index: number, new_index: number): void

- - Defined in src/layertree/TreeManager.js:339

  #### Parameters

  - ##### array: any[]

    An array of groups.

  - ##### old_index: number

    The old index before reorder (the current one).

  - ##### new_index: number

    The new index after reorder.

  #### Returns void

### setFirstLevelGroupFullState_

- setFirstLevelGroupFullState_(treeCtrl: LayertreeController, fullState: TreeManagerFullState): void

- - Defined in src/layertree/TreeManager.js:761

  Restore state of the given treeCtrl including the state of its children from passed TreeManagerFullState.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    the ngeo layertree controller.

  - ##### fullState: TreeManagerFullState

    the fullState object.

  #### Returns void

### setFirstLevelGroups

- setFirstLevelGroups(firstLevelGroups: any[]): boolean

- - Defined in src/layertree/TreeManager.js:192

  Set some groups as tree's children. If the service use mode 'flush', the previous tree's children will be removed. Add only groups that are not already in the tree.

  #### Parameters

  - ##### firstLevelGroups: any[]

    An array of gmf theme group.

  #### Returns boolean

  True if the group has been added. False otherwise.

### setInitialFirstLevelGroups

- setInitialFirstLevelGroups(firstGroups: any[]): void

- - Defined in src/layertree/TreeManager.js:303

  #### Parameters

  - ##### firstGroups: any[]

    The groups we add to the layertree

  #### Returns void

### setSearchedChild

- setSearchedChild(node: any, enabled: boolean): void

- - Defined in src/layertree/TreeManager.js:289

  Enable/disable the tree child (node) and apply it to children if present.

  #### Parameters

  - ##### node: any

    The child object in the tree.

  - ##### enabled: boolean

    If the child is active or not in the layer-tree.

  #### Returns void

### toggleNodeCheck_

- toggleNodeCheck_(node: any, names: string[]): void

- - Defined in src/layertree/TreeManager.js:562

  Set the child nodes metadata `isChecked` if its name is among the list of given names. If a child node also has children, check those instead.

  #### Parameters

  - ##### node: any

    The original node.

  - ##### names: string[]

    Array of node names to check (i.e. that should have their checkbox checked)

  #### Returns void

### updateTreeGroupsState_

- updateTreeGroupsState_(groups: any[], removedGroups: any[]): void

- - Defined in src/layertree/TreeManager.js:349

  Update the application state with the list of first level groups in the tree.

  #### Parameters

  - ##### groups: any[]

    current firstlevel groups of the tree.

  - ##### removedGroups: any[]

    groups removed within this operation.

  #### Returns void

Generated using TypeDoc