Class: ThemeManager service:gmfTreeManager


new ThemeManager($rootScope, gmfThemes, gmfTreeManagerModeFlush, gmfTreeManager, 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.

Name Type Description
$rootScope angular.Scope

Angular rootScope.

gmfThemes gmf.Themes

gmf Themes service.

gmfTreeManagerModeFlush boolean

Flush mode active?

gmfTreeManager gmf.TreeManager

the tree manager.

ngeoStateManager ngeo.StateManager

The ngeo StateManager service.


modeFlush: boolean


addTheme(theme, [opt_silent]opt)

Set the current theme name (mode 'flush' only) and add its children. Add only groups that are not already in the tree.

Name Type Attributes Description
theme !gmfThemes.GmfTheme

A theme object.

[opt_silent] boolean= <optional>

if true it will be no user message if the theme should be added but it's already added.



The theme name. Will be empty on 'not flush' mode.


Remove all groups.

setThemeName(name, [opt_stealth]opt)

Name Type Attributes Description
name string

The new theme name.

[opt_stealth] boolean= <optional>

Don't emit an event is true