Maps SDK for Web

tt.ScaleControl

A ScaleControl control displays the ratio of a distance on the map to the corresponding distance on the ground.

Constructor

tt.ScaleControl([options])

Example
var scale = new tt.ScaleControl({
  maxWidth: 80,
  unit: 'imperial'
});
map.addControl(scale);
scale.setUnit('metric');
Parameters
Name Description
options
Object
default:None
Object with options
options.maxWidth
Number
default:100
The maximum length of the scale control in pixels.
options.unit
String
default:metric
Unit of the distance ( 'imperial' , 'metric' or 'nautical' ).

Methods

setUnit(unit)

Set the scale's unit of the distance

Parameters
Name Description
unit
String
default:None
Unit of the distance ( 'imperial' , 'metric' or 'nautical' ).