Class: ModelList

Core.ModelList ModelList

ModelList

new ModelList()

modules/core/modelList/list.js, line 97
Collection that manages all models. Models can be of type folder, layer, staticlink, tool, viewpoint, ...
Fires:
  • Map#event:RadioRequestMapGetMapMode
  • Map#event:RadioTriggerMapAddLayerToIndex
  • ModelList#event:RadioTriggerModelListUpdatedSelectedLayerList
  • ModelList#event:RadioTriggerModelListUpdateVisibleInMapList
  • ModelList#event:RenderTree
  • ModelList#event:TraverseTree
  • ModelList#event:updateOverlayerView
  • ModelList#event:UpdateOverlayerView
  • ModelList#event:UpdateSelection
Listens to Events:
  • ModelList#event:RadioRequestModelListGetCollection
  • ModelList#event:RadioRequestModelListGetModelsByAttributes
  • ModelList#event:RadioRequestModelListGetModelByAttributes
  • ModelList#event:RadioTriggerModelListSetModelAttributesById
  • ModelList#event:RadioTriggerModelListShowAllFeatures
  • ModelList#event:RadioTriggerModelListHideAllFeatures
  • ModelList#event:RadioTriggerModelListShowFeaturesById
  • ModelList#event:RadioTriggerModelListRemoveModelsByParentId
  • ModelList#event:RadioTriggerModelListRemoveModelsById
  • ModelList#event:RadioTriggerModelListAddInitiallyNeededModels
  • ModelList#event:RadioTriggerModelListAddModelsByAttributes
  • ModelList#event:RadioTriggerModelListSetIsSelectedOnChildLayers
  • ModelList#event:RadioTriggerModelListSetIsSelectedOnParent
  • ModelList#event:RadioTriggerModelListShowModelInTree
  • ModelList#event:RadioTriggerModelListCloseAllExpandedFolder
  • ModelList#event:RadioTriggerModelListSetAllDescendantsInvisible
  • ModelList#event:RadioTriggerModelListRenderTree
  • ModelList#event:RadioTriggerModelListToggleDefaultTool
  • ModelList#event:RadioTriggerModelListReplaceModelById
  • ModelList#event:RadioTriggerModelListAddAlwaysActiveTool
  • ModelList#event:ChangeIsVisibleInMap
  • ModelList#event:ChangeIsExpanded
  • ModelList#event:ChangeIsSelected
  • ModelList#event:ChangeTransparency
  • ModelList#event:ChangeSelectionIDX

Extends

Methods

addAndExpandModelsRecursive(parentId){void}

modules/core/modelList/list.js, line 950
Recursive method thats starts from the bottom of the layer tree Adds all models with same parentId. Then calls itself with the parentId, and so on expands the parend models
Name Type Description
parentId String All layer models with this parentId are added
Fires:
  • Parser#event:RadioRequestParserGetItemsByAttributes
  • Parser#event:RadioRequestParserGetItemByAttributes

addInitiallyNeededModels(){void}

modules/core/modelList/list.js, line 762
Adds in light tree mode all layer models. Otherwise only the layers are added that are initially set to visible
Fires:
  • ParametricUrl#event:RadioRequestParametricURLGetLayerParams
  • Parser#event:RadioRequestParserGetTreeType
  • Parser#event:RadioRequestParserGetItemsByAttributes
  • Parser#event:RadioRequestParserGetItemByAttributes

addModel(model){void}

modules/core/modelList/list.js, line 863
Adds an existing model to the collection ignoring the Parser
Name Type Description
model Backbone.Model model to add

addModelsByAttributes(attrs){void}

modules/core/modelList/list.js, line 874
Requests the light models from the parser by attributes and adds them to the collection
Name Type Description
attrs Object Attributes of which the model to be added is requested from the parser and added to the collection
Fires:
  • Parser#event:RadioRequestparserGetItemsByAttributes

closeAllExpandedFolder(){void}

modules/core/modelList/list.js, line 375
Closes all expanded folders in layertree.

getDefaultTool(){Tool}

modules/core/modelList/list.js, line 367
Returns the default tool of the app
Returns:
tool with the same id as the defaultToolId

getIndexedLayers(){Array.<Layer>}

modules/core/modelList/list.js, line 1132
returns all layers of this collection, which can be sorted like WMS, usw.
Returns:
of layers which can be sorted visibly

getModelById(id){Layer}

modules/core/modelList/list.js, line 1088
Returns layer model by given id
Name Type Description
id String Id of model to be returned

getSortedTreeLayers(){array}

modules/core/modelList/list.js, line 685
Fetches and sorts all selected layers by their indeces. Layers with an initial index of 0 will be put on top in case of normal layer of on top of the first background layer in case of background layer. This behaviour is needed to prevent newly selected background layers from being put on top of all other layers.
Returns:
selected Layers

getTreeLayers(){array}

modules/core/modelList/list.js, line 659
Fetches all selected layers. For light tree, these are all layers of the tree. for custom tree, these are only the ones listed under selected layers.
Fires:
  • Parser#event:RadioRequestParserGetTreeType
Returns:
Layers

hideAllFeatures(id){void}

modules/core/modelList/list.js, line 1068
Hides all features of the vector layer model
Name Type Description
id String Id of the vector layer model

initLayerIndeces(){void}

modules/core/modelList/list.js, line 622
Sets Layer indeces initially. Background layers are treatet seperatly from normal layers to ensure they will be put into background.

mergeParamsToLightModels(lightModels, paramLayers){Array.<Object>}

modules/core/modelList/list.js, line 823
Merges layer config parameters to light models
Name Type Description
lightModels Array.<Object> Light models requested from Parser
paramLayers Array.<Object> Parameters from parametric url
Returns:
models with merged parameters

moveModelInTree(model, movement){void}

modules/core/modelList/list.js, line 592
Moves layer in Tree and accordingly changes drawing index. Always swaps index with target Layer. If no target layer is found, the action is aborted.
Name Type Description
model Layer Layer model to be pulled up
movement Integer Direction and range to move
Fires:
  • ModelList#event:UpdateSelection
  • ModelList#event:UpdateLightTree
  • ModelList#event:ChangeSelectedList

refreshLightTree(){void}

modules/core/modelList/list.js, line 1124
todo

removeLayerById(id){void}

modules/core/modelList/list.js, line 1079
Removes layer from Collection
Name Type Description
id String LayerId to be removed

removeModelsById(id){void}

modules/core/modelList/list.js, line 1015
remove a model by a given id
Name Type Description
id String from model that be remove from ModelList

removeModelsByParentId(parentId){void}

modules/core/modelList/list.js, line 981
Removes all layer models from the map
Name Type Description
parentId String Id of the parent folder

replaceModelById(id, newModel){void}

modules/core/modelList/list.js, line 998
replaces a model by a given id
Name Type Description
id String from model that be replaced in ModelList
newModel Object to add to the ModelList

resetLayerIndeces(layers){array}

modules/core/modelList/list.js, line 639
Sets Layer indeces initially. Background layers are treatet seperatly from normal layers to ensure they will be put into background.
Name Type Description
layers array Array of layers to have their indeces reset
Returns:
with fresh new indeces

retrieveGroupModel(attributes){Object}

modules/core/modelList/list.js, line 1027
Delivers groupModel by a given id
Name Type Description
attributes Object | Number the id from model

scrollToLayer(overlayerName){void}

modules/core/modelList/list.js, line 919
Scrolls to layer in layerTree
Name Type Description
overlayerName String Name of Layer in "Overlayer" to be scrolled to

setActiveToolsToFalse(activatedToolModel){void}

modules/core/modelList/list.js, line 552
Sets all Tools (except the legend, the given tool and the gfi, if the model attribute deactivateGFI is true) to isActive=false
Name Type Description
activatedToolModel Tool Tool model that has to be activated

setAllDescendantsInvisible(parentId, isMobile){void}

modules/core/modelList/list.js, line 423
Sets all models(layer/folder/tools) of a parent id to invisible in the tree in mobile mode folders are closed
Name Type Description
parentId String id of the parent model
isMobile Boolean is the mobile tree visible

setAllDescendantsVisible(parentId){void}

modules/core/modelList/list.js, line 450
Sets all models(layer/folder/tools) of a parent id to visible in the tree
Name Type Description
parentId String id of the parent model

setAllModelsInvisible(){void}

modules/core/modelList/list.js, line 465
Sets all models invisible

setIsSelectedOnChildLayers(model){void}

modules/core/modelList/list.js, line 480
All layer models of a leaf folder (folder with only layers, and no folders) get selected or deselected based on the parends attribute isSelected
Name Type Description
model Folder folderModel

setIsSelectedOnParent(model){void}

modules/core/modelList/list.js, line 531
Checks if all layers in a leaffolder (folder with only layers and no other folders) are selected. If so, the leaf folder is also set to isSelected=true
Name Type Description
model Layer Layer model

setIsSettingVisible(value){void}

modules/core/modelList/list.js, line 746
Sets all models that are of type "layer" the attribute isSettingVisible to given value
Name Type Description
value Boolean Flag if settings have to be visible

setModelAttributesById(id, attrs){void}

modules/core/modelList/list.js, line 850
Sets Attributes to model with given id
Name Type Description
id String Id of the model where the attributes have to be added
attrs Object Attributes to be added

setModelsInvisibleByParentId(parentId){void}

modules/core/modelList/list.js, line 386
Sets all models of given parentId visibleInTree=false
Name Type Description
parentId String The Id of the parent whose children should be set invisible

setVisibleByParentIsExpanded(parentId){void}

modules/core/modelList/list.js, line 405
Sets all children visible or invisible depending on the parents attribute isExpanded
Name Type Description
parentId String The Id of the parent whose children should be set visible

showAllFeatures(id){void}

modules/core/modelList/list.js, line 1045
Shows all features of the vector layer model
Name Type Description
id String Id of the layer whose features have to be shown

showFeaturesById(id, featureIds){void}

modules/core/modelList/list.js, line 1057
Shows all features of the vector layer model that match the given featureIds
Name Type Description
id String Id of vector layer model
featureIds Array.<String> Array of feature ids to be shown

showModelInTree(modelId){void}

modules/core/modelList/list.js, line 889
Opens the layertree, selects the layer model and adds it to selection Gets called from searchbar
Name Type Description
modelId String Id of the layer model
Fires:

sortLayers(childModels, key){Array.<Layer>}

modules/core/modelList/list.js, line 505
Sorts elements from an array by given attribute
Name Type Description
childModels Array.<Layer> Layer models to be sorted by
key String Attribute name to be sorted by
Returns:
Array

toggleCatalogs(id){void}

modules/core/modelList/list.js, line 968
Toggles the layer catalogues. Every catalogue that has neither the given id, nor has isAlwaysExpanded=true gets collapsed
Name Type Description
id String Id of the catalogue

toggleDefaultTool(){void}

modules/core/modelList/list.js, line 571
Sets the default tool to active if no other tool (except the legend) is active

toggleWfsCluster(value){void}

modules/core/modelList/list.js, line 1106
Sets all clustered vector layer models the attribute isClustered to given value Is used when changing the map mode In 3D mode features cannot be clustered
Name Type Description
value Boolean Flag if layer should be clustered or not

updateLayerView(){array}

modules/core/modelList/list.js, line 731
Forces rerendering of all layers. Layers are sorted before rerender.
Fires:
  • Map#event:RadioTriggerMapAddLayerToIndex
Returns:
selected Layers