Class: Bar

ol.control. Bar


new Bar( [options])

Parameters:
Name Type Argument Description
options Object <optional>

Control options.

Properties
Name Type Description
className String

class of the control

group boolean

is a group, default false

toggleOne boolean

only one toggle control is active at a time, default false

autoDeactivate boolean

used with subbar to deactivate all control when top level control deactivate, default false

controls Array.<ol.control.Control>

a list of control to add to the bar

Fires:
  • control:active
  • control:add

Extends

Methods


addControl(c)

Add a control to the bar

Parameters:
Name Type Description
c ol.control.Control

control to add


deactivateControls( [except])

Deativate all controls in a bar

Parameters:
Name Type Argument Description
except ol.control.Control <optional>

a control


getActiveControls()

Get active control in the bar

Returns:
Type
Array.<ol.control.Control>

getControls()

Get controls in the panel

Parameters:
Type Description
Array.<ol.control.Control>

getControlsByName(name)

Parameters:
Name Type Description
name string

of the control to search

Returns:
Type
ol.control.Control

getVisible()

Get the control visibility

Returns:

b

Type
boolean

removeControl(c)

Remove a control from the bar

Parameters:
Name Type Description
c ol.control.Control

control to remove


setActive(b)

Auto activate/deactivate controls in the bar

Parameters:
Name Type Description
b boolean

activate/deactivate


setMap(map)

Set the map instance the control is associated with and add its controls associated to this map.

Parameters:
Name Type Description
map ol.Map

The map instance.


setPosition(pos)

Set tool bar position

Parameters:
Name Type Description
pos string

a combinaison of top|left|bottom|right separated with -


setVisible(val)

Set the control visibility

Parameters:
Name Type Description
val boolean