# Class Controller

#### Hierarchy

- Controller

- Defined in src/layertree/component.js:230

#####
Index

### Properties

$timeout_
dataLayerGroup_
dimensions
gmfDataSourceBeingFiltered
gmfExternalDataSourcesManager
gmfLayerBeingSwipe
gmfPermalink_
gmfSyncLayertreeMap_
gmfThemes_
gmfTreeManager_
groupNodeStates_
layerHelper_
layers
map
ngeoWMSTime_
options
root
scope_

### Methods

$onInit
afterReorder
displayMetadata
getFirstParentWithLayerFunctions
getLayer
getLegendIconURL
getLegendsObject
getNodeState
getNumberOfLegendsObject
getResolutionStyle
getScale_
isFiltrable
isNodeLegendVisible
isSnappingActivated
listeners
nodesCount
removeAllNodes
removeNode
supportsCustomization
supportsLegend
supportsOpacityChange
tagPopup
toggleActive
toggleFiltrableDataSource
toggleNodeLegend
toggleNodeMenu
toggleSnapping
toggleSwipeLayer
updateDimensions_
updateLayerDimensions_
updateTimeData
updateWMSTimeLayerState
zoomToResolution

## Properties

### $timeout_

$timeout_: ITimeoutService

- Defined in src/layertree/component.js:338

### dataLayerGroup_

dataLayerGroup_: LayerGroup

- Defined in src/layertree/component.js:323
- Defined in src/layertree/component.js:350

### dimensions

dimensions: Object

- Defined in src/layertree/component.js:258

### gmfDataSourceBeingFiltered

gmfDataSourceBeingFiltered: any

- Defined in src/layertree/component.js:278

### gmfExternalDataSourcesManager

gmfExternalDataSourcesManager: any

- Defined in src/layertree/component.js:283

### gmfLayerBeingSwipe

gmfLayerBeingSwipe: any

- Defined in src/layertree/component.js:273

### gmfPermalink_

gmfPermalink_: any

- Defined in src/layertree/component.js:288

### gmfSyncLayertreeMap_

gmfSyncLayertreeMap_: any

- Defined in src/layertree/component.js:308

### gmfThemes_

gmfThemes_: any

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

### gmfTreeManager_

gmfTreeManager_: any

- Defined in src/layertree/component.js:293

### groupNodeStates_

groupNodeStates_: Object

- Defined in src/layertree/component.js:318

### layerHelper_

layerHelper_: LayerHelper

- Defined in src/layertree/component.js:268

### layers

layers: BaseLayer[]

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

### map

map: Map

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

### ngeoWMSTime_

ngeoWMSTime_: WMSTime

- Defined in src/layertree/component.js:313

### options

options: any

- Defined in src/layertree/component.js:248

### root

root: any

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

### scope_

scope_: IScope

- Defined in src/layertree/component.js:263

## Methods

### $onInit

- $onInit(): void

- Init the controller,

  #### Returns void

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

### afterReorder

- afterReorder(): void

- Update the layers order in the map and the treeCtrl in the treeManager after a reorder of the first-level groups. Then update the permalink.

  #### Returns void

  - Defined in src/layertree/component.js:757

### displayMetadata

- displayMetadata(treeCtrl: LayertreeController): void

- Opens a openIframePopup with the content of the metadata url of a node.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller, from the current node.

  #### Returns void

  - Defined in src/layertree/component.js:740

### getFirstParentWithLayerFunctions

- getFirstParentWithLayerFunctions(treeCtrl: LayertreeController): LayertreeController

- ### Returns

  first parent that supports opacity change or is filtrable. Or null if there is any parent with layer functions.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    Ngeo tree controller.

  #### Returns LayertreeController

  - Defined in src/layertree/component.js:1015

### getLayer

- getLayer(treeCtrl: LayertreeController): BaseLayer | LayerGroup

- Use the gmfSyncLayertreeMap_ to create and get layer corresponding to this treeCtrl. The layer will be inserted into the map. The layer can be null if the treeCtrl is based on a node inside a mixed node. It this case, the layer will be in the first parent declared as a mixed node.

  ### Returns

  The OpenLayers layer or group for the node.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    tree controller of the node.

  #### Returns BaseLayer | LayerGroup

  - Defined in src/layertree/component.js:452

### getLegendIconURL

- getLegendIconURL(treeCtrl: LayertreeController): string

- Get the icon image URL for the given treeCtrl's layer. It can only return a string for internal WMS layers without multiple childlayers in the node.

  ### Returns

  The icon legend URL or undefined.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller, from the current node.

  #### Returns string

  - Defined in src/layertree/component.js:580

### getLegendsObject

- getLegendsObject(treeCtrl: LayertreeController): Object

- Get the legends object (<LayerName: url> for each layer) for the given treeCtrl.

  ### Returns

  A <layerName: url> object that provides a layer for each layer.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller, from the current node.

  #### Returns Object

  - Defined in src/layertree/component.js:627

### getNodeState

- getNodeState(treeCtrl: LayertreeController): string

- Return the current state of the given treeCtrl's node. Return a class name that match with the current node activation state.

  ### Returns

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

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller, from the current node.

  #### Returns string

  - Defined in src/layertree/component.js:521

### getNumberOfLegendsObject

- getNumberOfLegendsObject(treeCtrl: LayertreeController): number

- Get the number of legends object for this layertree controller.

  ### Returns

  The number of Legends object.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller, from the current node.

  #### Returns number

  - Defined in src/layertree/component.js:682

### getResolutionStyle

- getResolutionStyle(gmfLayer: any): string

- Return 'out-of-resolution' if the current resolution of the map is out of the min/max resolution in the node.

  ### Returns

  'out-of-resolution' or undefined.

  #### Parameters

  - ##### gmfLayer: any

    the GeoMapFish Layer. WMTS layer is also allowed (the type is defined as GmfLayerWMS only to avoid some useless tests to know if a minResolutionHint property can exist on the node).

  #### Returns string

  - Defined in src/layertree/component.js:843

### getScale_

- getScale_(): number

- Return the current scale of the map.

  ### Returns

  Scale.

  #### Returns number

  - Defined in src/layertree/component.js:692

### isFiltrable

- isFiltrable(treeCtrl: LayertreeController): boolean

- ### Returns

  Whether the layer tree controller has a filtrable datasource or not.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    Ngeo tree controller.

  #### Returns boolean

  - Defined in src/layertree/component.js:1005

### isNodeLegendVisible

- isNodeLegendVisible(legendNodeId: string): boolean

- ### Returns

  Whenever the legend is currently displayed.

  #### Parameters

  - ##### legendNodeId: string

    The DOM node legend id

  #### Returns boolean

  - Defined in src/layertree/component.js:949

### isSnappingActivated

- isSnappingActivated(treeCtrl: LayertreeController): boolean

- Is snapping activated for this LayertreeController

  ### Returns

  True if snapping is activated for that layer.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller.

  #### Returns boolean

  - Defined in src/layertree/component.js:712

### listeners

- listeners(scope: IScope, treeCtrl: LayertreeController): void

- Remove layer from this component's layergroup (and then, from the map) on a ngeo layertree destroy event.

  #### Parameters

  - ##### scope: IScope

    treeCtrl scope.

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller, from the current node.

  #### Returns void

  - Defined in src/layertree/component.js:483

### nodesCount

- nodesCount(): number

- ### Returns

  first level node count.

  #### Returns number

  - Defined in src/layertree/component.js:829

### removeAllNodes

- removeAllNodes(): void

- #### Returns void

  - Defined in src/layertree/component.js:820

### removeNode

- removeNode(node: any): void

- #### Parameters

  - ##### node: any

    Layer tree node to remove.

  #### Returns void

  - Defined in src/layertree/component.js:815

### supportsCustomization

- supportsCustomization(treeCtrl: LayertreeController): boolean

- Determines whether the layer tree controller supports being customized. For example, having its layer opacity changed, displaying its legend, etc.

  If any requirement is met, then the treeCtrl is considered supporting "customization", regardless of what it actually is.

  The requirements are:

  - must not be the root controller, any of the following:
    - it supports legend
    - it supports having the layer opacity being changed

  ### Returns

  Whether the layer tree controller supports being "customized" or not.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    Ngeo tree controller.

  #### Returns boolean

  - Defined in src/layertree/component.js:970

### supportsLegend

- supportsLegend(treeCtrl: LayertreeController): boolean

- ### Returns

  Whether the layer tree controller supports having a legend being shown.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    Ngeo tree controller.

  #### Returns boolean

  - Defined in src/layertree/component.js:979

### supportsOpacityChange

- supportsOpacityChange(treeCtrl: LayertreeController): boolean

- ### Returns

  Whether the layer tree controller supports having its layer opacity being changed or not.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    Ngeo tree controller.

  #### Returns boolean

  - Defined in src/layertree/component.js:989

### tagPopup

- tagPopup(node: any): void

- #### Parameters

  - ##### node: any

    Layer tree node to tag popup identifier.

  #### Returns void

  - Defined in src/layertree/component.js:800

### toggleActive

- toggleActive(treeCtrl: LayertreeController): void

- Toggle the state of treeCtrl's node.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller, from the current node.

  #### Returns void

  - Defined in src/layertree/component.js:502

### toggleFiltrableDataSource

- toggleFiltrableDataSource(ds: any): void

- #### Parameters

  - ##### ds: any

    Data source to filter.

  #### Returns void

  - Defined in src/layertree/component.js:937

### toggleNodeLegend

- toggleNodeLegend(legendNodeId: string): void

- Toggle the legend for a node

  #### Parameters

  - ##### legendNodeId: string

    The DOM node legend id to toggle

  #### Returns void

  - Defined in src/layertree/component.js:915

### toggleNodeMenu

- toggleNodeMenu(menuNodeId: string): void

- Toggle the menu for a node

  #### Parameters

  - ##### menuNodeId: string

    The DOM node menu id to toggle

  #### Returns void

  - Defined in src/layertree/component.js:927

### toggleSnapping

- toggleSnapping(treeCtrl: LayertreeController): void

- Toggle snapping for this LayertreeController.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller.

  #### Returns void

  - Defined in src/layertree/component.js:730

### toggleSwipeLayer

toggleSwipeLayer

- Defined in src/layertree/component.js:895

### updateDimensions_

- updateDimensions_(treeCtrl: LayertreeController): void

- #### Parameters

  - ##### treeCtrl: LayertreeController

    Layer tree controller.

  #### Returns void

  - Defined in src/layertree/component.js:388

### updateLayerDimensions_

- updateLayerDimensions_(layer: Layer<Source, LayerRenderer<any>>, node: any): void

- #### Parameters

  - ##### layer: Layer<Source, LayerRenderer<any>>

    Layer to update.

  - ##### node: any

    Layer tree node.

  #### Returns void

  - Defined in src/layertree/component.js:408

### updateTimeData

- updateTimeData(layertreeCtrl: LayertreeController, time: TimeRange): void

- Update the `timeRangeValue` property of the data source bound to the given tree controller and the state of the permalink using the given time.

  LayertreeController.prototype.updateTimeData - description

  #### Parameters

  - ##### layertreeCtrl: LayertreeController

    ngeo layertree controller

  - ##### time: TimeRange

    The start and optionally the end datetime (for time range selection) selected by user

  #### Returns void

  - Defined in src/layertree/component.js:535

### updateWMSTimeLayerState

- updateWMSTimeLayerState(layertreeCtrl: LayertreeController, time: TimeRange): void

- Update the `timeRangeValue` property of the data source bound to the given tree controller using the given time. If the tree controller has no data source, it means that it has children and they might have data sources.

  The setting of the TIME parameter on the layer occurs in the `gmf.datasource.Manager` service

  LayertreeController.prototype.updateWMSTimeLayerState - description

  #### Parameters

  - ##### layertreeCtrl: LayertreeController

    ngeo layertree controller

  - ##### time: TimeRange

    The start and optionally the end datetime (for time range selection) selected by user

  #### Returns void

  - Defined in src/layertree/component.js:555

### zoomToResolution

- zoomToResolution(treeCtrl: LayertreeController): void

- Set the resolution of the map with the max or min resolution of the node.

  #### Parameters

  - ##### treeCtrl: LayertreeController

    ngeo layertree controller, from the current node.

  #### Returns void

  - Defined in src/layertree/component.js:865

Generated using TypeDoc