Geoportal Extension for Itowns API Reference

Class: Scale


Control to display the scalebar with itowns

new Scale(options)

Itowns/Controls/Scale.js, line 22
Name Type Description
options Object

widget options

Name Type Description
target String

HTML target element or HTML target element id

position String

"absolute" or "relative"

var scale = new itowns.control.Scale();



inherited getElement(){HTMLElement}

Itowns/Controls/Widget.js, line 54

Return the widget's container element.

container element.

inherited getGlobe(){Object}

Itowns/Controls/Widget.js, line 104

Get the globe associated with the widget. Undefined if the widget is not added to a globe.

inherited getPosition(){String}

Itowns/Controls/Widget.js, line 94

Return the widget's element position.

element position.

inherited getTarget(){HTMLElement}

Itowns/Controls/Widget.js, line 84

Return the widget's target div.

target div.


Itowns/Controls/Scale.js, line 69

Bind globe to control

Name Type Description
globe GlobeViewExtended

the globe

inherited setTarget(target, position)

Itowns/Controls/Widget.js, line 65

Associates the widget to a specified target div.

Name Type Description
target HTMLElement | String

widget target div html element or target div id.

position String

html position attribute.