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 27
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 55

Return the widget's container element.

Returns:
container element.

getElement(){HTMLElement}

Itowns/Controls/Widget.js, line 95

Return the widget's element div.

Returns:
element div.

getGlobe(){Object}

Itowns/Controls/Widget.js, line 115

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

getOptions(){Object}

Itowns/Controls/Widget.js, line 135

Get the options associated with the widget.

getPosition(){String}

Itowns/Controls/Widget.js, line 105

Return the widget's element position.

Returns:
element position.

getTarget(){HTMLElement}

Itowns/Controls/Widget.js, line 85

Return the widget's target div.

Returns:
target div.

setGlobe(globe)

Itowns/Controls/Widget.js, line 125

Associate a globe to the widget.

Name Type Description
globe Object

Globe to associate to the widget.

setOptions(options)

Itowns/Controls/Widget.js, line 145

Set the options of the control

Name Type Description
options Object

Options to associate to the widget.

setTarget(target, position)

Itowns/Controls/Widget.js, line 66

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.