Class: LayertreeController controller:gmfLayertreeController

gmf.LayertreeController

new LayertreeController($element, $http, $sce, $scope, ngeoCreatePopup, ngeoLayerHelper, gmfDataSourceBeingFiltered, gmfPermalink, gmfTreeManager, gmfSyncLayertreeMap, ngeoSyncArrays, ngeoWMSTime, gmfThemes)

Parameters:
Name Type Description
$element angular.JQLite

Element.

$http !angular.$http

Angular http service.

$sce !angular.$sce

Angular sce service.

$scope !angular.Scope

Angular scope.

ngeoCreatePopup !ngeo.CreatePopup

Popup service.

ngeoLayerHelper !ngeo.LayerHelper

Ngeo Layer Helper.

gmfDataSourceBeingFiltered gmf.DataSourceBeingFiltered

The Gmf value service that determines the data source currently being filtered.

gmfPermalink !gmf.Permalink

The gmf permalink service.

gmfTreeManager !gmf.TreeManager

gmf Tree Manager service.

gmfSyncLayertreeMap !gmf.SyncLayertreeMap

gmfSyncLayertreeMap service.

ngeoSyncArrays !ngeo.SyncArrays

ngeoSyncArrays service.

ngeoWMSTime !ngeo.WMSTime

wms time service.

gmfThemes !gmf.Themes

The gmf Themes service.

Members

(nullable) dimensions: Object:.<string:, string:>

gmfDataSourceBeingFiltered: gmf.DataSourceBeingFiltered

(non-null) layers: Array:.<!ol.layer.Base:>

(nullable) map: ol.Map

openLinksInNewWindow: boolean|undefined

openLinksInNewWindowFn: function|undefined

(non-null) root: gmfThemes.GmfRootNode

Methods

(static) getSnappingConfig(treeCtrl)

Get the snapping configuration object from a Layertree controller

Parameters:
Name Type Description
treeCtrl ngeo.LayertreeController

Layertree controller,

Returns:
?gmfThemes.GmfSnappingConfig

Snapping configuration, if found.

$onInit()

Init the controller,

afterReorder()

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.

displayMetadata(treeCtrl)

Display a ngeo.infoPopup with the content of the metadata url of a node.

Parameters:
Name Type Description
treeCtrl ngeo.LayertreeController

ngeo layertree controller, from the current node.

getLayer(treeCtrl)

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.

Parameters:
Name Type Description
treeCtrl ngeo.LayertreeController

tree controller of the node

Returns:
ol.layer.Base|ol.layer.Group|null

The OpenLayers layer or group for the node.

getLegendIconURL(treeCtrl)

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.

Parameters:
Name Type Description
treeCtrl ngeo.LayertreeController

ngeo layertree controller, from the current node.

Returns:
string|undefined

The icon legend URL or undefined.

getLegendURL(treeCtrl)

Get the legend URL for the given treeCtrl.

Parameters:
Name Type Description
treeCtrl ngeo.LayertreeController

ngeo layertree controller, from the current node.

Returns:
string|undefined

The legend URL or undefined.

getNodeState(treeCtrl)

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

Parameters:
Name Type Description
treeCtrl ngeo.LayertreeController

ngeo layertree controller, from the current node.

Returns:
string

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

getResolutionStyle(gmfLayerWMS)

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

Parameters:
Name Type Description
gmfLayerWMS gmfThemes.GmfLayerWMS

the GeoMapFish Layer WMS.

Returns:
string|undefined

'out-of-resolution' or undefined.

isNodeLegendVisible(legendNodeId)

Parameters:
Name Type Description
legendNodeId string

The DOM node legend id

Returns:
boolean

Whenever the legend is currently displayed.

listeners(scope, treeCtrl)

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

Parameters:
Name Type Description
scope angular.Scope

treeCtrl scope.

treeCtrl ngeo.LayertreeController

ngeo layertree controller, from the current node.

nodesCount()

Returns:
number

first level node count.

removeAllNodes()

removeNode(node)

Parameters:
Name Type Description
node gmfThemes.GmfGroup

Layer tree node to remove.

supportsCustomization(treeCtrl)

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
Parameters:
Name Type Description
treeCtrl !ngeo.LayertreeController

Ngeo tree controller.

Returns:
boolean

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

supportsLegend(treeCtrl)

Parameters:
Name Type Description
treeCtrl !ngeo.LayertreeController

Ngeo tree controller.

Returns:
boolean

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

supportsOpacityChange(treeCtrl)

Parameters:
Name Type Description
treeCtrl !ngeo.LayertreeController

Ngeo tree controller.

Returns:
boolean

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

toggleActive(treeCtrl)

Toggle the state of treeCtrl's node.

Parameters:
Name Type Description
treeCtrl ngeo.LayertreeController

ngeo layertree controller, from the current node.

toggleFiltrableDataSource(ds)

Parameters:
Name Type Description
ds gmf.DataSource

Data source to filter.

toggleNodeLegend(legendNodeId)

Toggle the legend for a node

Parameters:
Name Type Description
legendNodeId string

The DOM node legend id to toggle

updateWMSTimeLayerState(layertreeCtrl, time)

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.DataSourcesManager service

LayertreeController.prototype.updateWMSTimeLayerState - description

Parameters:
Name Type Description
layertreeCtrl ngeo.LayertreeController

ngeo layertree controller

time {start : number, end : number

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

zoomToResolution(treeCtrl)

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

Parameters:
Name Type Description
treeCtrl ngeo.LayertreeController

ngeo layertree controller, from the current node.