new StyleList()
modules/vectorStyle/list.js, line 39
Collection that stores all the vector styles contained in style.json.
Only the styles of the configured layers are kept.
If a tool has an attribute "styleId", then also this style is kept.
The styleId can be a string or an array of strings or an array of objects that need to have the attribute "id".
example "myStyleId", ["myStyleId2", "myStyleId3"], [{"id": "myStyleId4", "name": "I am not relevant for the style"}]
Fires:
- Core.ConfigLoader#event:RadioRequestParserGetItemsByAttributes
- Alerting#event:RadioTriggerAlertAlert
Listens to Events:
Extends
Methods
-
fetchStyles(url){void}
modules/vectorStyle/list.js, line 57 -
Fetches the style.json
Name Type Description url
String Url to style.json -
getStyleIdForMapMarkerPoint(){String}
modules/vectorStyle/list.js, line 218 -
gets style id from MapMarker
Returns:
Style id of mapMarker.
-
getStyleIdForZoomToFeature(){String}
modules/vectorStyle/list.js, line 205 -
Gets styleId from config for zoomToFeature
Returns:
Style id
-
getStyleIdsFromLayers(layers){Array.<Sting>}
modules/vectorStyle/list.js, line 149 -
Gathers the styleIds of the layers.
Name Type Description layers
Array.<Object> The configured layers. Returns:
StyleIds from layers.
-
getStyleIdsFromTools(tools){Array.<String>}
modules/vectorStyle/list.js, line 176 -
Gathers the styleIds of the configured tools.
Name Type Description tools
Array.<Object> The configured tools. Returns:
StyleIds of Tools
-
model(attrs, options){object}
modules/vectorStyle/list.js, line 12 -
Returns style model according to Config setting.
Name Type Description attrs
object Attribute from collection options
object Attribute from collection - Deprecated
- since new styleModel. Should be removed with version 3.0.
Returns:
model
-
parseStyles(data){Array.<object>}
modules/vectorStyle/list.js, line 116 -
overwrite parse function so that only the style-models are saved whose layers are configured in the config.json After that these models are automatically added to the collection
Name Type Description data
Array.<object> parsed style.json Fires:
Returns:
style.json objects
-
returnModelById(layerId){object}
modules/vectorStyle/list.js, line 99 -
Returns model or by styleId or by layerId
Name Type Description layerId
string layerId - Deprecated
- since new styleModel. Should be adjusted with version 3.0. Should always deliver .styleId
Returns:
model