Methods
addContextMenuEntry_(item)
bind context menu events to a layer
Parameters:
Name | Type | Description |
---|---|---|
item |
object |
- Source:
addFolder(parent, layer, position)
Add folder to the LayerTree. {@code layer}
can be uniqueId or a layer-object
Parameters:
Name | Type | Description |
---|---|---|
parent |
string | HTMLElement | |
layer |
string | Object | |
position |
string | top, bottom (default: bottom) |
- Source:
addItem(parent, layer, role, position)
Add an item (layer or folder) to the LayerTree.
{@code layer} can be uniqueId or a layer-object
Parameters:
Name | Type | Description |
---|---|---|
parent |
string | HTMLElement | |
layer |
string | Object | |
role |
string | layer or folder |
position |
string | top, bottom (default: bottom) |
- Source:
addLayer(parent, layer, position)
Add layer to the LayerTree. {@code layer}
can be uniqueId or a layer-object
Parameters:
Name | Type | Description |
---|---|---|
parent |
string | HTMLElement | |
layer |
string | Object | |
position |
string | top, bottom (default: bottom) |
- Source:
addStructuredLayers(layers, structure, position)
Add layers according to a predefined directory structure
Parameters:
Name | Type | Description |
---|---|---|
layers |
object | |
structure |
object | |
position |
string | top, bottom (default=bottom). Only relevant for root level layers |
- Source:
deselectNodes(target)
Deselect a node by passing a uniqueId or
an instance of a HTMLElement list-item
Parameters:
Name | Type | Description |
---|---|---|
target |
string/HTMLElement |
- Source:
disableNodes(target)
Disable a node by passing a uniqueId or
an instance of a HTMLElement list-item
Parameters:
Name | Type | Description |
---|---|---|
target |
string/HTMLElement |
- Source:
editTitle(span)
Method to edit Layer and Folder names
Parameters:
Name | Type | Description |
---|---|---|
span |
HTMLElement |
- Source:
enableNodes(target)
Enable a node by passing a uniqueId or
an instance of a HTMLElement list-item
Parameters:
Name | Type | Description |
---|---|---|
target |
string/HTMLElement |
- Source:
getChildrenElements(item) → {Array.<HTMLElement>}
returns the children elements of an item
Parameters:
Name | Type | Description |
---|---|---|
item |
HTMLElement |
- Source:
Returns:
Array of children Elements
- Type
- Array.<HTMLElement>
getItem(target)
Get a layerManager list-Item by passing a uniqueId or
an instance of a HTMLElement list-item
Parameters:
Name | Type | Description |
---|---|---|
target |
string | HTMLElement |
- Source:
getItems() → {Array.<Object>}
- Source:
Returns:
Array of all items
- Type
- Array.<Object>
getLayerIndex(target) → {number}
Parameters:
Name | Type | Description |
---|---|---|
target |
string | HTMLElement |
- Source:
Returns:
get the z-index of a layer
- Type
- number
getNodes() → {NodeList}
- Source:
Returns:
NodeList containing all list-item elements
- Type
- NodeList
getOptions()
Get the layertree's options-object
- Source:
getParentElements(element) → {HTMLElement}
returns all parent elements of a given element
Parameters:
Name | Type | Description |
---|---|---|
element |
HTMLElement |
- Source:
Returns:
parent
- Type
- HTMLElement
getSelectedItems() → {Array.<Object>}
- Source:
Returns:
Array of selected items
- Type
- Array.<Object>
getSelectedNodes() → {NodeList}
- Source:
Returns:
NodeList containing all selected list-item elements
- Type
- NodeList
getStructure() → {Array.<object>}
Get the Layer order structure of the LayerTree
- Source:
Returns:
structure
- Type
- Array.<object>
hasEntry(id)
Checks if an entry already exists in layerTree
returns true if yes
Parameters:
Name | Type | Description |
---|---|---|
id |
String |
- Source:
hideLoadingIcon(target)
hide loading animation for a given target layer.
uses recursion for handling folders
Parameters:
Name | Type | Description |
---|---|---|
target |
string/HTMLElement |
- Source:
moveItem(item, steps)
Moves Items up and down by the given amount of steps
Parameters:
Name | Type | Description |
---|---|---|
item |
object | |
steps |
number |
- Source:
removeContextMenuEntry_(item)
remove context menu events from a layer
Parameters:
Name | Type | Description |
---|---|---|
item |
object |
- Source:
removeItem(target)
Remove a Layer or Folder from the layertree
Parameters:
Name | Type | Description |
---|---|---|
target |
string | HTMLElement |
- Source:
resetSearch()
reset structure without clearing the selected layer or folder
- Source:
selectNodes(target)
Select a node by passing a uniqueId or
an instance of a HTMLElement list-item
Parameters:
Name | Type | Description |
---|---|---|
target |
string/HTMLElement |
- Source:
showLoadingIcon(target)
show loading animation for a given target layer.
uses recursion for handling folders
Parameters:
Name | Type | Description |
---|---|---|
target |
string/HTMLElement |
- Source:
showMessages(target, messages)
Display a message icon with a hover text
Parameters:
Name | Type | Description |
---|---|---|
target |
string/HTMLElement | |
messages |
Array.<object> |
- Source: