Geoportal Extension for Itowns API Reference

Class: Widget

itowns.control.Widget

iTowns Widget class.
Every geoportal control inherits of this class.

new Widget(options)

Itowns/Controls/Widget.js, line 26
Name Type Description
options Object

options for function call.

Name Type Description
name String

Name of the widget.

element Object

HTML element of the widget

target Object | String

HTML element or HTML element id where to put the widget

position String

"absolute" or "relative"

Example
var myWidget = new itowns.control.Widget({
     name : "myWidget",
     element : myWidgetDiv,
     target : myWidgetTargetDiv,
     position: "absolute"
});

Members

constructor

Constructor (alias)

Methods

getElement(){HTMLElement}

Itowns/Controls/Widget.js, line 54

Return the widget's container element.

Returns:
container element.

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.

getPosition(){String}

Itowns/Controls/Widget.js, line 94

Return the widget's element position.

Returns:
element position.

getTarget(){HTMLElement}

Itowns/Controls/Widget.js, line 84

Return the widget's target div.

Returns:
target div.

setGlobe(globe)

Itowns/Controls/Widget.js, line 114

Associate a globe to the widget.

Name Type Description
globe Object

Globe to associate to the widget.

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.