Class: uiLayer

geo.gui. uiLayer

new geo.gui.uiLayer(arg){geo.gui.uiLayer}

Create a new instance of class uiLayer.

Name Type Description
arg geo.layer.spec optional

Specification for the new layer.

Returns:
Type Description
geo.gui.uiLayer

Extends

Members

inherited idle

Getter for the idle state. Read only.

Properties:
Name Type Description
idle boolean

true if the object is idle (onIdle would call a handler immediately).

inherited protectednewLayerId

Gets a new id number for a layer.

Methods

inherited active(arg){boolean|this}

Get/Set whether or not the layer is active. An active layer will receive native mouse when the layer is on top. Non-active layers will never receive native mouse events.

Name Type Description
arg boolean optional

If specified, the new active value.

Returns:
Type Description
boolean | this

inherited addChild(child){this}

Add a child (or an array of children) to the object.

Name Type Description
child geo.object | Array.<geo.object>

A child object or array of child objects.

Returns:
Type Description
this

inherited addPromise(promise){this}

Add the promise here and also propagate up the scene tree.

Name Type Description
promise Promise

A promise object.

Returns:
Type Description
this

inherited attribution(arg){string|this}

Get or set the attribution html content that will displayed with the layer. By default, nothing will be displayed. Note, this content is not html escaped, so care should be taken when renderering user provided content.

Name Type Description
arg string nullable

An html fragment

Returns:
Type Description
string | this Chainable as a setter

inherited autoshareRenderer(){boolean|string}

Get the setting of autoshareRenderer.

Returns:
Type Description
boolean | string

inherited canvas(){HTMLCanvasElement}

Get canvas of the layer.

Returns:
Type Description
HTMLCanvasElement The canvas element associated with the layer.

Get an array of the child objects.

Returns:
Type Description
Array.<geo.object> A copy of the array of child objects.

createWidget(widgetName, arg){geo.gui.widget}

Create a new ui control.

Name Type Description
widgetName string

The name of the widget.

arg object

Options for the widget.

Name Type Description
parent geo.object optional

A parent object for the widget.

Returns:
Type Description
geo.gui.widget The new widget.

Return last time data got changed.

Returns:
Type Description
geo.timestamp The data time.

deleteWidget(widget){this}

Delete a ui control.

Name Type Description
widget geo.gui.widget

The widget to remove.

Returns:
Type Description
this

inherited draw(arg){this}

Force redraw of a scene object, to be implemented by subclasses. Base class just calls draw of child objects.

Name Type Description
arg object

Options to pass to the child draw functions.

Returns:
Type Description
this

Transform coordinates from a local coordinate system to world coordinates.

Name Type Description
input geo.geoPosition

Renderer coordinates.

Returns:
Type Description
geo.geoPosition World coordinates.

inherited geoIsOn(event, handler){boolean}

Report if an event handler is bound to this object.

Name Type Description
event string | Array.<string>

An event or list of events to check.

handler function optional

A function that might be bound. If undefined, this will report true if there is any handler for the specified event.

Returns:
Type Description
boolean true if any of the specified events are bound to the specified handler.

inherited geoOff(event, arg){this}

Remove handlers from one event or an array of events. If no event is provided all handlers will be removed.

Name Type Description
event string | Array.<string> optional

An event or a list of events from geo.event or defined by the user, or undefined to remove all events (in which case arg is ignored).

arg function | Array.<function()> optional nullable

A function or array of functions to remove from the events or a falsy value to remove all handlers from the events.

Returns:
Type Description
this

inherited geoOn(event, handler){this}

Bind an event handler to this object.

Name Type Description
event string

An event from geo.event or a user-defined value.

handler function

A function that is called when event is triggered. The function is passed a geo.event object.

Returns:
Type Description
this

inherited geoTrigger(event, args, childrenOnly){this}

Trigger an event (or events) on this object and call all handlers.

Name Type Description
event string

The event to trigger.

args object

Arbitrary argument to pass to the handler.

childrenOnly boolean optional

If truthy, only propagate down the tree.

Returns:
Type Description
this

inherited height(){number}

Return the height of the layer in pixels.

Returns:
Type Description
number The height of the parent map in pixels.

inherited id(val){string|this}

Get/Set id of the layer.

Name Type Description
val string | null optional

If null, generate a new layer id. Otherwise, if specified, the new id of the layer.

Returns:
Type Description
string | this

inherited initialized(val){boolean|this}

Get/Set if the layer has been initialized.

Name Type Description
val boolean optional

If specified, update the intialized value. Otherwise, return the current instance.

Returns:
Type Description
boolean | this Either the initialized value or this.

Get the map associated with this layer.

Returns:
Type Description
geo.map The map associated with the layer.

inherited modified(){this}

Update the timestamp to the next global timestamp value.

Returns:
Type Description
this

inherited moveDown(n){this}

Bring the layer below the given number of layers. This will rotate the current z-indices for this and the previous n layers.

Name Type Default Description
n number 1 optional

The number of positions to move.

Returns:
Type Description
this

inherited moveToBottom(){this}

Bring the layer to the bottom of the map layers.

Returns:
Type Description
this

inherited moveToTop(){this}

Bring the layer to the top of the map layers.

Returns:
Type Description
this

inherited moveUp(n){this}

Bring the layer above the given number of layers. This will rotate the current z-indices for this and the next n layers.

Name Type Default Description
n number 1 optional

The number of positions to move.

Returns:
Type Description
this

inherited name(val){string|this}

Get/Set name of the layer.

Name Type Description
val string optional

If specified, the new name of the layer.

Returns:
Type Description
string | this

inherited node(){div}

Get root node of the layer.

Returns:
Type Description
div

inherited onIdle(handler){this}

Bind a handler that will be called one time when all internal promises are resolved. If there are no outstanding promises, this is invoked synchronously.

Name Type Description
handler function

A function taking no arguments.

Returns:
Type Description
this

inherited opacity(opacity){number|this}

Get or set the current layer opacity. The opacity is in the range [0-1]. An opacity of 0 is not the same as setting visible(false), as interactions can still occurr with the layer.

Name Type Description
opacity number optional

If specified, set the opacity. Otherwise, return the opacity.

Returns:
Type Description
number | this The current opacity or the current layer.

Get/set parent of the object.

Name Type Description
arg geo.sceneObject optional

The new parant or undefined to get the current parent.

Returns:
Type Description
this | geo.sceneObject

inherited removeChild(child){this}

Remove a child (or array of children) from the object.

Name Type Description
child geo.object | Array.<geo.object>

A child object or array of child objects.

Returns:
Type Description
this

Get the renderer for the layer.

Returns:
Type Description
geo.renderer The renderer associated with the layer or null if there is no renderer.

inherited rendererName(){string}

Get the name of the renderer.

Returns:
Type Description
string

inherited selectionAPI(val){boolean|this}

Get/Set selectionAPI of the layer.

Name Type Description
val boolean optional

If specified, set the selectionAPI state, otherwise return it.

Returns:
Type Description
boolean | this Either the selectionAPI state or the layer.

inherited sticky(){boolean}

Get whether or not the layer is sticky (navigates with the map).

Returns:
Type Description
boolean

inherited timestamp(){number}

Get time.

Returns:
Type Description
number The timestamp. This is 0 if the timestamp has never been modified.

Transform coordinates from world coordinates into a local coordinate system specific to the underlying renderer. This method is exposed to allow direct access the rendering context, but otherwise should not be called directly. The default implementation is the identity operator.

Name Type Description
input geo.geoPosition

World coordinates.

Returns:
Type Description
geo.geoPosition Renderer coordinates.

Return the modified time for the last update that did something.

Returns:
Type Description
geo.timestamp The update time.

inherited visible(val){boolean|this}

Get/Set visibility of the layer.

Name Type Description
val boolean optional

If specified, change the visibility. Otherwise, get it.

Returns:
Type Description
boolean | this either the visibility (if getting) or the layer (if setting).

inherited width(){number}

Return the width of the layer in pixels.

Returns:
Type Description
number The width of the parent map in pixels.

inherited zIndex(zIndex, allowDuplicate){number|this}

Get or set the z-index of the layer. The z-index controls the display order of the layers in much the same way as the CSS z-index property.

Name Type Description
zIndex number optional

The new z-index, or undefined to return the current z-index.

allowDuplicate boolean optional

When setting the z index, if this is truthy, allow other layers to have the same z-index. Otherwise, ensure that other layers have distinct z-indices from this one.

Returns:
Type Description
number | this