LayerGroup Class
Imports RAMP Modules:
Uses RAMP Templates:
templates/layer_selector_template.json
Constructor
LayerGroup
-
layers
-
[options]
Parameters:
-
layers
Arrayan array of layer config definitions to be added to the group
-
[options]
Object optionalAdditional options
-
[groupType]
String optionalSpecifies type of this LayerGroup and the name of the layer group template to use
-
[layerState]
String optionalSpecifies the initial state of any LyerItem added to this group; must be one of the
LayerItem.state
defaults -
[layerType]
String optionalSpecifies type of any LayerItem added to this group and the name of the layer item template to use
-
[stateMatrix]
Object optionaladditional state matrix records to be mixed into the default
-
[transitionMatrix]
Object optionaladditional state transition matrix records to be mixed into the default
-
Returns:
A control object representing a group of layers allowing to dynamically change their states.
Item Index
Methods
_constructStateMatrix
-
layerConfig
-
[stateMatrix]
Modifies the state matrix of the layer to accommodate types of layers that might not use/have all the default controls or have extra controls.
Returns:
modified layer state matrix
_template
-
key
-
data
Populates a template specified by the key with the supplied data.
Returns:
a string template filled with supplied data
addLayerItem
-
layer
-
options
Constructs and adds a LayerItem to the LayerGroup.
Parameters:
Returns:
the item that was added
getLayerItem
-
layerId
Finds and returns a LayerItem object with the specified id. If none found, returns null.
Parameters:
-
layerId
Stringan id of the LayerItem to return
Returns:
a LayerItem with the specified id
Properties
groupType
String
Specifies type of this LayerGroup and the name of the layer group template to use; is set by groupType
value;
Default: "layer_group"
layers
Array
An array of layer config definitions to be added to the group during initialization; is set to layers
value.
Default: []
node
JObject
A node of the LayerGroup.
Default: null
node
JObject
private
A node of the list in the LayerGroup.
Default: null
state
String
State of any LayerItem added to this group during its initialization; is set by layerSate
value; can be overwritten when adding individual layers by options.state
.
Default: LayerItem.state.DEFAULT
templates
Object
Templates to be used in construction of the layer nodes.
Default: layer_selector_template.json
type
String
Specifies type of any LayerItem added to this group during initialization and the name of the layer item template to use; is set by layerType
value;; can be overwritten when adding individual layers by options.type
.
Default: null