Class: ModelList

Core.ModelList ModelList

ModelList

new ModelList()

modules/core/modelList/list.js, line 102
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:ChangeLayerOrder

Extends

Methods

addAndExpandModelsRecursive(parentId){void}

modules/core/modelList/list.js, line 854
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 693
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 767
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 778
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 388
Closes all expanded folders in layertree.

getDefaultTool(){Tool}

modules/core/modelList/list.js, line 380
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 1028
returns all layers of this collection, which can be sorted like WMS, usw.
Returns:
of layers which can be sorted visibly

getLength(treeId){Number}

modules/core/modelList/list.js, line 608
Get the total length of items in the given model collection
Name Type Description
treeId string treeId
Returns:
total length

getModelById(id){Layer}

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

hideAllFeatures(id){void}

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

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

modules/core/modelList/list.js, line 727
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

removeLayerById(id){void}

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

removeModelsById(id){void}

modules/core/modelList/list.js, line 919
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 885
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 902
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

resetLayerOrder(){void}

modules/core/modelList/list.js, line 599
reset layer order

retrieveGroupModel(attributes){Object}

modules/core/modelList/list.js, line 931
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 823
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 565
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 436
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 463
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 478
Sets all models invisible

setIsSelectedOnChildLayers(model){void}

modules/core/modelList/list.js, line 493
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 544
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 677
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

setLayerOrderOnModels(treeId, length){Number}

modules/core/modelList/list.js, line 626
Sets the `layerOrder` property on all items in the given collection, respecting childs by recursive method calls.
Name Type Description
treeId string The collection to set the index for
length Number The number used as index to start from
Returns:
next index to use

setModelAttributesById(id, attrs){void}

modules/core/modelList/list.js, line 754
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 399
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 418
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 949
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 961
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 793
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 518
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 872
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 584
Sets the default tool to active if no other tool (except the legend) is active

toggleWfsCluster(value){void}

modules/core/modelList/list.js, line 1010
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 658
Forces rerendering of all layers. Layers are sorted before rerender.
Fires:
  • Map#event:RadioTriggerMapAddLayerToIndex
Returns:
selected Layers