Class: module:TreeManager service:gmfTreeManager

gmf.layertree.module:TreeManager.gmf.layertree.module:TreeManager

new module:TreeManager($timeout, $injector, gettextCatalog, ngeoLayerHelper, ngeoNotification, gmfThemes, ngeoStateManager)

Manage a tree with children. This service can be used in mode 'flush' (default) or not (mode 'add'). In mode 'flush', each theme, group or group by layer that you add will replace the previous children's array. In mode 'add', children will be just pushed in this array. The default state can be changed by setting the value gmfTreeManagerModeFlush, e.g.:

let module = angular.module('app');
module.value('gmfTreeManagerModeFlush', false);

This service's theme is a GmfTheme with only children and a name. Thought to be the tree source of the gmf layertree directive.

Parameters:
Name Type Description
$timeout angular.$timeout

Angular timeout service.

$injector angular.$injector

Angular injector service.

gettextCatalog angularGettext.Catalog

Gettext catalog.

ngeoLayerHelper ngeo.map.LayerHelper

Ngeo Layer Helper.

ngeoNotification ngeo.message.Notification

Ngeo notification service.

gmfThemes gmf.theme.Themes

gmf Themes service.

ngeoStateManager ngeo.statemanager.Service

The ngeo statemanager service.

Members

numberOfGroupsToAddInThisDigestLoop: number

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

root: gmfThemes.GmfRootNode

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

rootCtrl: ngeo.layertree.Controller

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