# Class LayertreeController

#### Hierarchy

- LayertreeController

- Defined in src/layertree/Controller.js:41

#####
Index

### Properties

children
dataSource_
depth
isRoot
layer
listenersExpr
map
node
nodelayerExpr
parent
properties
rootScope_
state_
uid

### Methods

getCalculateState
getDataSource
getSetActive
getState
refreshState
setDataSource
setState
setStateInternal_
traverseDepthFirst

## Properties

### children

children: LayertreeController[]

- Defined in src/layertree/Controller.js:95

### dataSource_

dataSource_: DataSource

- Defined in src/layertree/Controller.js:162
- Defined in src/layertree/Controller.js:362

### depth

depth: number

- Defined in src/layertree/Controller.js:117

### isRoot

isRoot: boolean

- Defined in src/layertree/Controller.js:47

### layer

layer: LayerGroup | Layer<Source, LayerRenderer<any>>

- Defined in src/layertree/Controller.js:150
- Defined in src/layertree/Controller.js:155

### listenersExpr

listenersExpr: string

- Defined in src/layertree/Controller.js:193

### map

map: Map

- Defined in src/layertree/Controller.js:130

### node

node: any

- Defined in src/layertree/Controller.js:69
- Defined in src/layertree/Controller.js:77

### nodelayerExpr

nodelayerExpr: string

- Defined in src/layertree/Controller.js:144

### parent

parent: LayertreeController

- Defined in src/layertree/Controller.js:90

### properties

properties: Object

- Defined in src/layertree/Controller.js:59

### rootScope_

rootScope_: IScope

- Defined in src/layertree/Controller.js:54

### state_

state_: string

- Defined in src/layertree/Controller.js:64
- Defined in src/layertree/Controller.js:245
- Defined in src/layertree/Controller.js:295

### uid

uid: string

- Defined in src/layertree/Controller.js:112

## Methods

### getCalculateState

- getCalculateState(): string

- Return the current state, calculate on all its children recursively.

  ### Returns

  'on', 'off' or 'indeterminate'.

  #### Returns string

  - Defined in src/layertree/Controller.js:306

### getDataSource

- getDataSource(): DataSource

- ### Returns

  dataSource The data source bound to this layer tree controller.

  #### Returns DataSource

  - Defined in src/layertree/Controller.js:354

### getSetActive

- getSetActive(val: boolean): boolean

- ### Returns

  Value.

  #### Parameters

  - ##### val: boolean

    Value.

  #### Returns boolean

  - Defined in src/layertree/Controller.js:333

### getState

- getState(): string

- Return the current state.

  ### Returns

  'on', 'off', 'indeterminate'.

  #### Returns string

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

### refreshState

- refreshState(opt_onChild?: LayertreeController, opt_broadcast?: boolean): void

- Refresh the state of this treeCtrl based on it's children value. The call its parent to do the same.

  #### Parameters

  - ##### `Optional` opt_onChild: LayertreeController

    Child tree controller that had its state changed to 'on'.

  - ##### `Optional` opt_broadcast: boolean

    Broadcast.

  #### Returns void

  - Defined in src/layertree/Controller.js:274

### setDataSource

- setDataSource(dataSource: DataSource): void

- #### Parameters

  - ##### dataSource: DataSource

    Data source or null.

  #### Returns void

  - Defined in src/layertree/Controller.js:361

### setState

- setState(state: string, opt_broadcast?: boolean): void

- Set the state of this treeCtrl. Update its children with its value and then ask its parent to refresh its state.

  #### Parameters

  - ##### state: string

    'on' or 'off'.

  - ##### `Optional` opt_broadcast: boolean

    Broadcast.

  #### Returns void

  - Defined in src/layertree/Controller.js:220

### setStateInternal_

- setStateInternal_(state: string): void

- #### Parameters

  - ##### state: string

    'on' or 'off'.

  #### Returns void

  - Defined in src/layertree/Controller.js:243

### traverseDepthFirst

- traverseDepthFirst(visitor: Visitor): boolean

- Recursive method to traverse the layertree controller graph.

  ### Returns

  whether to stop traversing.

  #### Parameters

  - ##### visitor: Visitor

    A visitor called for each node.

  #### Returns boolean

  - Defined in src/layertree/Controller.js:402

Generated using TypeDoc