OpenLayers.Control.ScaleLine - OpenLayers

# OpenLayers. Control. ScaleLine

Display a small line indicator representing the current map scale on the map.

#### Inherits from

- OpenLayers.Control

#### Is a very close copy of

- OpenLayers.Control.Scale

Summary

OpenLayers. Control. ScaleLine | Display a small line indicator representing the current map scale on the map.
Properties |
maxWidth | {Integer} Maximum width of the scale line in pixels.
topOutUnits | {String} Units for zoomed out on top bar.
topInUnits | {String} Units for zoomed in on top bar.
bottomOutUnits | {String} Units for zoomed out on bottom bar.
bottomInUnits | {String} Units for zoomed in on bottom bar.
eTop | {DOMElement}
eBottom | {DOMElement}
Constructor |
OpenLayers. ScaleLine | Create a new scale line control.
Functions |
draw | {DOMElement}
getBarLen | Given a number, round it down to the nearest 1,2,5 times a power of 10.
update | Update the size of the bars, and the labels they contain.

### Properties

### maxWidth

{Integer} Maximum width of the scale line in pixels. Default is 100.

### topOutUnits

{String} Units for zoomed out on top bar. Default is km.

### topInUnits

{String} Units for zoomed in on top bar. Default is m.

### bottomOutUnits

{String} Units for zoomed out on bottom bar. Default is mi.

### bottomInUnits

{String} Units for zoomed in on bottom bar. Default is ft.

### eTop

{DOMElement}

### eBottom

{DOMElement}

### Constructor

### OpenLayers. ScaleLine

Create a new scale line control.

#### Parameters

options | {Object} An optional object whose properties will be used to extend the control.

### Functions

### draw

> draw: function()

#### Returns

{DOMElement}

### getBarLen

> getBarLen: function( | maxLen | )

Given a number, round it down to the nearest 1,2,5 times a power of 10. That seems a fairly useful set of number groups to use.

#### Parameters

maxLen | {float} the number we’re rounding down from

#### Returns

{Float} the rounded number (less than or equal to maxLen)

### update

> update: function()

Update the size of the bars, and the labels they contain.

> draw: function()

{DOMElement}

> getBarLen: function( | maxLen | )

Given a number, round it down to the nearest 1,2,5 times a power of 10.

> update: function()

Update the size of the bars, and the labels they contain.
Controls affect the display or behavior of the map.
Display a small scale indicator on the map.
Close