new Toggle( [options])
Parameters:
Name | Type | Argument | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Control options. Properties
|
Fires:
- change:active,event: change:disable
Extends
Methods
-
getActive()
-
Test if the control is active.
Returns:
.
- Type
- bool
-
getButtonElement()
-
Get the button element
- Inherited From:
- Overrides:
Returns:
- Type
- Element
-
getDisable()
-
Test if the control is disabled.
Returns:
.
- Type
- bool
-
getInteraction()
-
Get the control interaction
Returns:
interaction associated with the control
- Type
- _ol_interaction_
-
getSubBar()
-
Get the subbar associated with a control
Returns:
- Type
- ol.control.Bar
-
setActive(b)
-
Change control state
Parameters:
Name Type Description b
bool activate or deactivate the control, default false
-
setDisable(b)
-
Disable the control. If disable, the control will be deactivated too.
Parameters:
Name Type Description b
bool disable (or enable) the control, default false (enable)
-
setHtml(html)
-
Set the button html
Parameters:
Name Type Description html
string - Inherited From:
- Overrides:
-
setInteraction(i)
-
Set the control interaction
Parameters:
Name Type Description i
_ol_interaction_ interaction to associate with the control
-
setMap(map)
-
Set the map instance the control is associated with and add interaction attached to it to this map.
Parameters:
Name Type Description map
_ol_Map_ The map instance.
-
setSubBar( [bar])
-
Set the subbar associated with a control
Parameters:
Name Type Argument Description bar
ol.control.Bar <optional>
a subbar if none remove the current subbar
-
setTitle(title)
-
Set the button title
Parameters:
Name Type Description title
string - Inherited From:
- Overrides:
-
setVisible(b)
-
Set the control visibility
Parameters:
Name Type Description b
boolean - Inherited From:
- Overrides:
-
toggle()
-
Toggle control state active/deactive