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.
Parameters:
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. |
Members
modeFlush: boolean
Methods
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.
Parameters:
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. |
getThemeName()
Returns:
The theme name. Will be empty on 'not flush' mode.
isLoading()
Returns:
true if the theme is loading.
removeAll()
Remove all groups.
setThemeName(name, [opt_silent]opt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | The new theme name. |
|
[opt_silent] |
boolean= |
<optional> |
Don't emit a theme change event, default is false. |