Class: Scale

ol.control. Scale


new Scale( [options])

Scale Control. A control to display the scale of the center on the map

Parameters:
Name Type Argument Description
options Object <optional>
Properties
Name Type Description
className string

control class name

ppi string

screen ppi, default 96

editable string

make the control editable, default true

Fires:
  • event:select
  • change:input

Extends

Methods


_showScale()

Display the scale


formatScale(d)

Format the scale 1/d

Parameters:
Name Type Description
d Number
Returns:

formated string

Type
string

setMap(map)

Remove the control from its current map and attach it to the new map. Subclasses may set up event handlers to get notified about changes to the map here.

Parameters:
Name Type Description
map ol.Map

Map.


setScale(value)

Set the current scale (will change the scale of the map)

Parameters:
Name Type Description
value Number

the scale factor