# 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:363

### 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:246
- Defined in src/layertree/Controller.js:296

### 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 string

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

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

### getDataSource

- getDataSource(): DataSource

- #### Returns DataSource

  dataSource The data source bound to this layer tree controller.

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

### getSetActive

- getSetActive(val): boolean

- #### Parameters

  - ##### val: boolean

    Value.

  #### Returns boolean

  Value.

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

### getState

- getState(): string

- Return the current state.

  #### Returns string

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

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

### refreshState

- refreshState(opt_onChild?, opt_broadcast?): 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:275

### setDataSource

- setDataSource(dataSource): void

- #### Parameters

  - ##### dataSource: DataSource

    Data source or null.

  #### Returns void

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

### setState

- setState(state, opt_broadcast?): 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): void

- #### Parameters

  - ##### state: string

    'on' or 'off'.

  #### Returns void

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

### traverseDepthFirst

- traverseDepthFirst(visitor): boolean

- Recursive method to traverse the layertree controller graph.

  #### Parameters

  - ##### visitor: Visitor

    A visitor called for each node.

  #### Returns boolean

  whether to stop traversing.

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

Generated using TypeDoc