Constructor
new LayerSwitch(opt_options)
- Source:
Parameters:
Name |
Type |
Description |
opt_options |
object
|
Options to initialize
Properties
Name |
Type |
Attributes |
Description |
className |
string
|
<optional>
|
The css class to apply to this control |
tipLabel |
string
|
<optional>
|
Label for the button |
collapsed |
boolean
|
<optional>
|
Whether the control starts collapsed |
collapseLabel |
string
|
<optional>
|
The label to show when collapsed |
stateManager |
Object
|
<optional>
|
The state manager to keep settings in sync |
|
Classes
- LayerSwitch
Methods
getCollapsed() → {boolean}
- Source:
Gets the collapsed state of the control
Returns:
True if the control is currently collapsed
-
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 |
setMap(map)
- Source:
Sets the OpenLayers map this control handles. This is automatically called by OpenLayers
Parameters:
Name |
Type |
Description |
map |
ol.Map
|
|
showLayers(options)
- Source:
Changes the visibility of the specified layers
Parameters:
Name |
Type |
Description |
options |
Array.<Object>
|
An array of options
Properties
Name |
Type |
Description |
name |
string
|
The name of the layer to change the visibility |
visible |
boolean
|
Whether to show or hide the specified layer |
|