Constructor
new LayerSwitch(opt_options)
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opt_options |
object | Options to initialize
Properties
|
Classes
Methods
getCollapsed() → {boolean}
- Source:
Gets the collapsed state of the control
Returns:
True if the control is currently collapsed
- Type
- boolean
getLayersVisibility() → {Array.<Object>|string|boolean}
- Source:
Gets the visibility of the specified layers
Returns:
-
options - An array of options
- Type
- Array.<Object>
-
options.name - The name of the layer to change the visibility
- Type
- string
-
options.visible - Whether to show or hide the specified layer
- Type
- boolean
setCollapsed(collapsed)
- Source:
Sets the collapsed state of the control
Parameters:
Name | Type | Description |
---|---|---|
collapsed |
boolean | True to collapse the control, otherwise false |
setLayersVisibility(options)
- Source:
Changes the visibility of the specified layers
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Array.<Object> | An array of options
Properties
|
setMap(map)
- Source:
Sets the OpenLayers map this control handles. This is automatically called by OpenLayers
Parameters:
Name | Type | Description |
---|---|---|
map |
ol.Map |