new ScaleLine( [opt_options])
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
opt_options |
bu.control.ScaleLineOptions |
<optional> |
Options. |
- Source:
- bu/controls/scaleline.js
Fires:
- ol.events.Event#event:afterrender
- ol.events.Event#event:afterscreenshot
- ol.events.Event#event:baselayerchanged
- ol.events.Event#event:beforerender
- ol.events.Event#event:camerachanged
- ol.events.Event#change:layergroup
- ol.Object.Event#event:change:units
- ol.events.Event#change:rotation
- ol.events.Event#change:imageid
- ol.events.Event#event:cubicpanoramaadded
- ol.events.Event#event:gridloaded
- ol.events.Event#change:roll
- ol.events.Event#event:imageadded
- ol.events.Event#change:yaw
- ol.events.Event#change:center
- ol.events.Event#change:fov
- ol.events.Event#change:maxresolution
- ol.events.Event#change:brightness
- ol.events.Event#change:maxzoom
- ol.events.Event#change:contrast
- ol.events.Event#change:projection
- ol.events.Event#change:layergroup
- ol.events.Event#change:resolutions
- ol.events.Event#change:layer
- ol.events.Event#change:zoom
- ol.events.Event#change:enablerotation
- ol.events.Event#change:center
- ol.events.Event#change:imageopened
- ol.events.Event#change:imageid
- ol.events.Event#change:layergroup
- ol.events.Event#change:extent
- ol.events.Event#event:renderinvalid
- ol.events.Event#change:pitch
- ol.events.Event#event:resize
- ol.events.Event#change:minzoom
- ol.events.Event#change:layer
- ol.events.Event#change:rotation
- ol.events.Event#event:imageopened
- ol.events.Event#event:objectchanged
- ol.events.Event#event:ready
- ol.events.Event#change:resolution
- ol.events.Event#change:rotation
- ol.events.Event#change:center
- ol.events.Event#change:zoomfactor
- ol.events.Event#change:resolution
- ol.events.Event#change:minresolution
- ol.events.Event#change:constrainrotation
Extends
Members
-
controldefs :Array.<bu.ControlDefinition>
-
Array of control definitions this control contains.
Type:
- Array.<bu.ControlDefinition>
- Inherited From:
- Source:
- bu/controls/control.js
-
<nullable> element :Element
-
This is the HTML element where the control is drawn. Do not modify this property directly. Use only in the constructor.
Type:
- Element
- Inherited From:
- Source:
- bu/controls/control.js
-
<nullable> target :Element
-
This is the HTML element where the control is appended. Do not modify this property directly. Use constructor or setTarget to set this value.
Type:
- Element
- Inherited From:
- Source:
- bu/controls/control.js
Methods
-
addControlDefinition(controldef)
-
Adds a control definition to the control. By default the control in the control definition is changed its target to the element of this control. Override this behaviour in inherited classes to change the target to another one.
Parameters:
Name Type Description controldef
* Control definition.
- Inherited From:
- Source:
- bu/controls/control.js
-
addControlDefinitions(controldefs)
-
Adds an array of control definitions to the control. Controls in the control definition array shouldn't have a target set.
Parameters:
Name Type Description controldefs
Array.<bu.control.ControlDefinition> Array of control definitions to add.
- Inherited From:
- Source:
- bu/controls/control.js
-
containsControlDefinition(controldef)
-
Checks if a control definition is already added.
Parameters:
Name Type Description controldef
bu.ControlDefinition Control definition to check.
- Inherited From:
- Source:
- bu/controls/control.js
Returns:
True if it is added.
- Type
- boolean
-
getControlDefinitions()
-
Return the array of control definitions this control has inside.
- Inherited From:
- Source:
- bu/controls/control.js
Returns:
- Type
- Array.<bu.ControlDefinition>
-
getUnits()
-
Return the units to use in the scale line.
- Source:
- bu/controls/scaleline.js
Returns:
The units to use in the scale line.
- Type
- ol.control.ScaleLineUnits | undefined
-
getUnitValues(units, pointResolution)
-
Return the unit values: the unit suffix, the final pointResolution and the nominalCount.
Parameters:
Name Type Description units
ol.control.ScaleLineUnits Type of unit.
pointResolution
number Point resolution.
- Source:
- bu/controls/scaleline.js
Returns:
Object with keys suffix, resolution and nominalCount.
- Type
- Object
-
isTool()
-
Returns true if this control is a tool. A tool is a control that contains one or several options in a list (for example a
bu.control.Switcher
) that are linked to a viewer and only one of them can be active at a time. Tools are usually related to interactions in a way that only one interaction can be active at a time in a viewer.- Inherited From:
- Source:
- bu/controls/control.js
Returns:
- Type
- boolean
-
setTarget(target)
-
This function is used to set a target element for the control.
Parameters:
Name Type Description target
Element | string | bu.Viewer Target.
- Inherited From:
- Source:
- bu/controls/control.js
-
setUnits(units)
-
Set the units to use in the scale line.
Parameters:
Name Type Description units
ol.control.ScaleLineUnits The units to use in the scale line.
- Source:
- bu/controls/scaleline.js
-
<abstract> unselectTool()
-
If this control is a tool the unselects the tool.
- Inherited From:
- Source:
- bu/controls/control.js
-
<abstract> updateLanguage()
-
Updates the control for the current language in the bu.Globalization singleton.
- Inherited From:
- Source:
- bu/controls/control.js