Classes
Members
-
module:ol/control/ScaleLine.Units{string}
-
Units for the scale line. Supported values are
'degrees'
,'imperial'
,'nautical'
,'metric'
,'us'
.
Type Definitions
-
Options{Object}
-
Properties:
Name Type Argument Default Description className
string <optional>
'ol-scale-line' CSS Class name.
minWidth
number <optional>
64 Minimum width in pixels at the OGC default dpi. The width will be adjusted to match the dpi used.
render
function <optional>
Function called when the control should be re-rendered. This is called in a
requestAnimationFrame
callback.target
HTMLElement | string <optional>
Specify a target if you want the control to be rendered outside of the map's viewport.
units
module:ol/control/ScaleLine~Units | string <optional>
'metric' Units.
bar
boolean <optional>
false Render scalebars instead of a line.
steps
number <optional>
4 Number of steps the scalebar should use. Use even numbers for best results. Only applies when
bar
istrue
.text
boolean <optional>
false Render the text scale above of the scalebar. Only applies when
bar
istrue
.dpi
number | undefined <optional>
dpi of output device such as printer. Only applies when
bar
istrue
. If undefined the OGC default screen pixel size of 0.28mm will be assumed.