Class: Bar

ol.control. Bar


new Bar( [options])

Control bar for OL3 The control bar is a container for other controls. It can be used to create toolbars. Control bars can be nested and combined with ol.control.Toggle to handle activate/deactivate.

Parameters:
Name Type Argument Description
options Object <optional>

Control options.

Properties
Name Type Description
className String

class of the control

group bool

is a group, default false

toggleOne bool

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

autoDeactivate bool

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

controls Array.<_ol_control_>

a list of control to add to the bar

Extends

Methods


addControl(c)

Add a control to the bar

Parameters:
Name Type Description
c _ol_control_

control to add


deactivateControls(except)

Deativate all controls in a bar

Parameters:
Name Type Description
except _ol_control_

a control


getControls()

Get controls in the panel

Parameters:
Type Description
Array.<_ol_control_>

getVisible()

Get the control visibility

Returns:

b

Type
boolean

onActivateControl_(e)

Post-process an activated/deactivated control

Parameters:
Name Type Description
e ol.event

:an object with a target {_ol_control_} and active flag {bool}


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 top | left | bottom | right

setVisible(b)

Set the control visibility

Parameters:
Name Type Description
b boolean