Namespace: control

bu. control

This namespace contains definitions for controls. A control is just a user interface object that is added to the DOM and triggers events, but has no code in response to that events. As in popular development frameworks as JDK or .NET, controls here are just visual elements that produce events. The code needed to respond to that events should be outside the controls, in actions or in external handlers to the given events.

Source:
bu/controls/control.jsdoc

Classes

Attribution
BaselayerTypeSwitcher
BaselayerTypeSwitcherEvent
Brightness
CheckBox
Contrast
Control
DataSources
DoubleButton
Dropdown
DropdownEvent
FileSelect
FileSelectEvent
Goto
Label
LayerSwitcher
LayerSwitcherAddEvent
LayerSwitcherEvent
Login
LoginEvent
Logout
MainMenu
MainMenuEvent
MeasurementSwitcherEvent
ObliqueLabel
OrientationEvent
ProgressLabel
ScaleLine
Search
SearchEvent
Select
SelectEvent
SideBar
SideBarButton
SingleButton
Slider
SliderEvent
Spinner
SpinnerEvent
StatusBar
Switcher
SwitcherEvent
TextBox
Toggle
ToolsMenu
Zoom
ZoomEvent
ZoomSlider

Type Definitions


AttributionOptions

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

collapsible boolean | undefined

If the control can collapse when not enough space.

collapsed boolean | undefined

initial state.

tipLabel string | undefined

tooltip for the button.

label string | Node | undefined

label for the button. Empty for icon.

collapseLabel string | Node | undefined

label for collapsed button.

handler function | undefined

function called in click.

Source:
bu/typedefs.js

CheckBoxOptions

Options for bu.control.CheckBox.

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

tipLabel string | undefined

Tooltip.

label string | Node | undefined

Label.

checked boolean | undefined

Initial value. False by default.

handler function | undefined

Function called in click.

Source:
bu/typedefs.js

ControlOptions

Options for bu.control.Control.

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

The HTML element where the control is drawn.

target Element | string | bu.Viewer | undefined

The HTML element where the control is appended. If a bu.Viewer is provided then it will be an HTML element inside the viewer viewport.

controls Array.<bu.ControlDefinition> | undefined

The control definitions to add to this control.

Source:
bu/typedefs.js

DataSourcesOptions

Options for bu.control.DataSources.

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

filesFilter string | undefined

The files filter to show in the 'Open files' dialog, as for example '.geojson, .kml'.

Source:
bu/typedefs.js

DoubleButtonEventType

Types of events for a bu.control.DoubleButton.

BUTTON1CLICK: 'button1click' // Triggered when a button 1 in double button control is clicked.
BUTTON2CLICK: 'button2click' // Triggered when a button 2 in double button control is clicked.
Type:
  • string
Source:
bu/enums.js

DoubleButtonOptions

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

className1 string | undefined

The class name for the HTML button 1 element.

className2 string | undefined

The class name for the HTML button 2 element.

delta number | undefined

The number for value that increases or decreases using the buttons.

button1Label string | undefined

The label or the icon for the button 1 element.

button2Label string | undefined

The label or the icon for the button 2 element.

button1TipLabel string | undefined

The tool tip text for the button 1 element.

button2TipLabel string | undefined

The tool tip text for the button 2 element.

button1Handler function | undefined

The Function called in the click of the button 1 with a param delta.

button2Handler function | undefined

The Function called in the click of the button 2 with a param delta.

Source:
bu/typedefs.js

DropdownOptions

Options for bu.control.Dropdown.

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

buttonTipLabel string | undefined

Tooltip.

buttonLabelClass string | undefined

This the class name for the label HTML element.

list Array.<string> | undefined

List of strings to be shown as content of items.

listValues Array.<string> | undefined

List of strings to be shown as values of items.

selectedItem number | undefined

Index of the initial selected item. Items starts in zero.

style bu.control.DropdownStyle | undefined

The type of dropdown, if it is a list of buttons or a listbox.

Source:
bu/typedefs.js

DropdownStyle

Styles for a bu.control.Dropdown.

BUTTONS: 'button' // The Dropdown is shown as a collection of buttons with no scrolling.
LISTBOX: 'listbox' // The Dropdown is shown as a listbox with scrolling
Type:
  • string
Source:
bu/enums.js

EventType

Types of events for a bu.control.Control.

CHANGE: 'change' // Triggered when the value that contains a control is changed.
CLICK: 'click' // Triggered when an control is clicked.
DBLCLICK: 'dblclick'
DRAGENTER: 'dragenter'
DRAGOVER: 'dragover'
DROP: 'drop'
ENDCHANGE: 'endchange' // Triggered when a change is ended.
ERROR: 'error'
FILESELECTED: 'fileselected' // Triggered when a file is selected.
INPUT: 'input' // Triggered when a input, select or textarea control changes.
KEYUP: 'keyup'
KEYDOWN: 'keydown'
KEYPRESS: 'keypress'
LOAD: 'load' // Triggered when a document is loaded.
MOUSEDOWN: 'mousedown'
MOUSEENTER: 'mouseenter'
MOUSELEAVE: 'mouseleave'
MOUSEMOVE: 'mousemove'
MOUSEOUT: 'mouseout'
MOUSEUP: 'mouseup'
MOUSEWHEEL: 'mousewheel'
MSPOINTERDOWN: 'mspointerdown'
RESIZE: 'resize'
SEARCH: 'search'
STARTCHANGE: 'startchange' // Triggered when a change is started.
TOUCHSTART: 'touchstart'
TOUCHMOVE: 'touchmove'
TOUCHEND: 'touchend'
WHEEL: 'wheel'
ORTHOLAYER: 'ortholayer'
MOSAICLAYER: 'mosaiclayer'
DRAGGERSTART: 'draggerstart'
DRAGGERDRAG: 'draggerdrag'
DRAGGEREND: 'draggerend'
TOOLSELECTED: 'toolselected' // Triggered when a control that is a tool has been
 //selected
Type:
  • string
Source:
bu/enums.js

FileSelectOptions

Options for bu.control.FileSelect.

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

upperLabel string | undefined

Text above the rest of the controls.

textboxLabel string | undefined

Text tip appearing inside the textbox element.

buttonLabel string | undefined

Label for the button element.

buttonTipLabel string | undefined

Tip label for the button element.

filesFilter string | undefined

string with filter for files to select. This string follows the rules of HTML accept attribute for input tag with type='file'.

Source:
bu/typedefs.js

GotoOptions

Options for bu.control.Goto.

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

textboxLabel string | undefined

Text tip appearing inside the textbox element.

buttonLabel string | undefined

Label for the button element.

buttonTipLabel string | undefined

Tip label for the button element.

Source:
bu/typedefs.js

LabelOptions

Options for bu.control.Label.

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

textContent string | undefined

The text content for the HTML element.

Source:
bu/typedefs.js

LayerSwitcherEventType

Types of events for a bu.control.LayerSwitcher.

LISTITEMCLICK: 'listitemclick' // Triggered when a checkbox or radio button is clicked.
ADDLAYERCLICK: 'addlayerclick' // Triggered when add layer button is clicked.
REMOVELAYERCLICK: 'removelayerclick' // Triggered when remove layer button is clicked.
ZOOMTOEXTENTCLICK: 'zoomtoextentclick' // Triggered when zoom to extent button is clicked.
Type:
  • string
Source:
bu/enums.js

LayerSwitcherOptions

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

addButtonLabel string | undefined

Label for the add button.

removeButtonLabel string | undefined

Label for the remove button.

zoomToExtentButtonLabel string | undefined

Label for the 'zoom to extent' button.

addButtonTipLabel string | undefined

Tooltip for the add button.

removeButtonTipLabel string | undefined

Tooltip for the remove button.

zoomToExtentButtonTipLabel string | undefined

Tooltip for the 'zoom to extent' button.

filesFilter string | undefined

The files filter to show in the 'Open files' dialog, as for example '.geojson, .kml'.

allowUncheckBaselayers boolean | undefined

If baselayers can be unchecked when their input button is clicked or not. Default is false.

Source:
bu/typedefs.js

MainMenuOptions

Options for bu.control.MainMenu.

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

buttonLabelClass string | undefined

This the class name for the label HTML element.

buttonLabel string | undefined

The label or the icon for the button element.

buttonTipLabel string | undefined

The tool tip text for the button element.

buttonHandler function | undefined

The Function called in the click of the button.

controls Array.<(bu.control.Control|bu.control.ControlDefinition)> | undefined

The array of controls to append to the menu.

Source:
bu/typedefs.js

MeasurementSwitcherEventType

Types of events for a bu.control.MeasurementSwitcher.

LISTITEMCLICK: 'listitemclick' // Triggered when a radio button is clicked.
Type:
  • string
Source:
bu/enums.js

ScaleLineOptions

Options for bu.control.ScaleLine.

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

minWidth number | undefined

Minimum width.

units ol.control.ScaleLineUnits | string | undefined

Units.

Source:
bu/typedefs.js

ScaleLineProperty

Properties of a bu.control.ScaleLine.

UNITS: 'units'
Type:
  • string
Source:
bu/enums.js

SearchOptions

Options for bu.control.Search.

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

showCollapsableButton boolean | undefined

true shows control as collapsable.

collapsableButtonLabel string | undefined

label for using a text in the collapsable button. Empty for icon.

collapsableButtonTipLabel string | undefined

tooltip label for collapsable button.

searchButtonLabel string | undefined

label for using a text in the search button. Empty for icon.

searchButtonTipLabel string | undefined

tooltip label for search button.

usertoken string | undefined

usertoken to use in BlomURBEX services.

showProviderDropdown boolean | undefined

true shows the provider dropdown. False is useful when only one provider is used.

minLength number | undefined

minimum number of chars to type and start a search.

maxItems number | undefined

maximum number of gecoding results to show in the autocomplete list.

typingTimeout number | undefined

number of milliseconds between typings to launch a new search.

Source:
bu/typedefs.js

SelectOptions

Options for bu.control.Select.

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

upperLabel string | undefined

Text above the rest of the controls.

textboxLabel string | undefined

Text tip appearing inside the textbox element.

initialText string | undefined

Initial text for the textbox.

buttonLabel string | undefined

Label for the button element.

buttonTipLabel string | undefined

Tip label for the button element.

buttonHandler function | undefined

An optional function to execute when the selection changes.

Source:
bu/typedefs.js

SideBarButtonOptions

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

buttonLabelClass string | undefined

This the class name for the label HTML element.

buttonLabel string | undefined

The label or the icon for the button element.

buttonTipLabel string | undefined

The tool tip text for the button element.

buttonHandler function | undefined

The Function called in the click of the button.

sideBar bu.control.SideBar | undefined

The SideBar to open.

Source:
bu/typedefs.js

SingleButtonOptions

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

buttonLabelClass string | undefined

This the class name for the label HTML element.

buttonLabel string | undefined

The label or the icon for the button element.

buttonTipLabel string | undefined

The tool tip text for the button element.

buttonHandler function | undefined

The Function called in the click of the button.

Source:
bu/typedefs.js

SliderOptions

Options for bu.control.Slider.

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

maxValue number | undefined

The number for max value. Default is 100.

minValue number | undefined

The number for min value. Default is 0.

step number | undefined

The number for step value. Default is 1.

initialValue number | undefined

The number for initial value. Default is 100.

isVertical boolean | undefined

true to show the control vertically. Default is false.

showButton1 boolean | undefined

If the slider has a first button or not.

showButton2 boolean | undefined

If the slider has a second button or not.

button1Label string | undefined

label of first button. Leave blank to use icon.

button1ClassName string | undefined

class of the first button element.

button1LabelClass string | undefined

class for first button label. Use it for an icon.

button1TipLabel string | undefined

tip label of first button.

button2Label string | undefined

label of second button. Leave blank to use icon.

button2ClassName string | undefined

class of the second button element.

button2LabelClass string | undefined

class for second button label. Use it for an icon.

button2TipLabel string | undefined

tip label of second button.

changeHandler function | undefined

The handler to call when a drag in the control changes or the track is clicked. The handler is passed a parameter with the value of the slider inside the minValue and maxValue.

button1Handler function | undefined

The handler to call when the first button is clicked.

button2Handler function | undefined

The handler to call when the second button is clicked.

loadHandler function | undefined

The handler to call when the control is finally loaded.

Source:
bu/typedefs.js

SwitcherOptions

Options for bu.control.Switcher.

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

list Array.<string> | undefined

List of strings to be shown as content of items.

listValues Array.<string> | undefined

List of strings to be shown as values of items.

listName string | undefined

A unique name for the radio buttons.

selectedItem string | undefined

index of the initial element to be checked. Only one element can be selected.

Source:
bu/typedefs.js

TextBoxOptions

Options for bu.control.TextBox.

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

type string | undefined

type of the input HTML element.

label string | undefined

The placeholder text for the textbox element. This is a text that disappears once you start typing.

initialText string | undefined

The initial text for the textbox.

Source:
bu/typedefs.js

ToggleOptions

Options for bu.control.Toggle.

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

label string | undefined

The label or the icon for the button element.

tipLabel string | undefined

The tool tip text for the button element.

checked boolean | undefined

If initially checked or not. False by default.

rounded boolean | undefined

The visual style of control, if rounded (true, default) or squared (false).

handler function | undefined

The Function called in the click of the button.

Source:
bu/typedefs.js

ZoomOptions

Options for bu.control.Zoom.

Type:
  • Object
Properties:
Name Type Description
element Element | undefined

As in bu.control.ControlOptions.

target Element | string | bu.Viewer | undefined

As in bu.control.ControlOptions.

controls Array.<bu.ControlDefinition> | undefined

As in bu.control.ControlOptions.

className string | undefined

The class name for the HTML element.

delta number | undefined

The number for value that increases or decreases using the buttons.

button1Label string | undefined

The label or the icon for the button 1 element.

button2Label string | undefined

The label or the icon for the button 2 element.

button1TipLabel string | undefined

The tool tip text for the button 1 element.

button2TipLabel string | undefined

The tool tip text for the button 2 element.

button1Handler function | undefined

The Function called in the click of the button 1 with a param delta.

button2Handler function | undefined

The Function called in the click of the button 2 with a param delta.

Source:
bu/typedefs.js