uiLayer

geo.gui. uiLayer

new uiLayer(argopt) → {geo.gui.uiLayer}

Description:
  • Create a new instance of class uiLayer.

Source:
Parameters:
Name Type Attributes Description
arg geo.layer.spec <optional>

Specification for the new layer.

Returns:
Type
geo.gui.uiLayer

Extends

Members

idle

Description:
  • Getter for the idle state. Read only.

Source:
Inherited From:
Properties:
Name Type Description
idle boolean

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

Getter for the idle state. Read only.

(protected) newLayerId

Description:
  • Gets a new id number for a layer.

Source:
Inherited From:

Gets a new id number for a layer.

Methods

active(argopt) → {boolean|this}

Description:
  • 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.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
arg boolean <optional>

If specified, the new active value.

Returns:
Type
boolean | this

addChild(child) → {this}

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

Source:
Inherited From:
Parameters:
Name Type Description
child geo.object | Array.<geo.object>

A child object or array of child objects.

Returns:
Type
this

addPromise(promise) → {this}

Description:
  • Add the promise here and also propagate up the scene tree.

Source:
Inherited From:
Parameters:
Name Type Description
promise Promise

A promise object.

Returns:
Type
this

attribution(argnullable) → {string|this}

Description:
  • 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 rendering user provided content.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
arg string <nullable>

An html fragment

Returns:

Chainable as a setter

Type
string | this

autoshareRenderer() → {boolean|string}

Description:
  • Get the setting of autoshareRenderer.

Source:
Inherited From:
Returns:
Type
boolean | string

canvas() → {HTMLCanvasElement}

Description:
  • Get canvas of the layer.

Source:
Inherited From:
Returns:

The canvas element associated with the layer.

Type
HTMLCanvasElement

children() → {Array.<geo.object>}

Description:
  • Get an array of the child objects.

Source:
Inherited From:
Returns:

A copy of the array of child objects.

Type
Array.<geo.object>

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

Description:
  • Create a new ui control.

Source:
Parameters:
Name Type Description
widgetName string

The name of the widget.

arg object

Options for the widget.

Properties
Name Type Attributes Description
parent geo.object <optional>

A parent object for the widget.

Returns:

The new widget.

Type
geo.gui.widget

dataTime() → {geo.timestamp}

Description:
  • Return last time data got changed.

Source:
Inherited From:
Returns:

The data time.

Type
geo.timestamp

deleteWidget(widget) → {this}

Description:
  • Delete a ui control.

Source:
Parameters:
Name Type Description
widget geo.gui.widget

The widget to remove.

Returns:
Type
this

draw(arg) → {this}

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

Source:
Inherited From:
Parameters:
Name Type Description
arg object

Options to pass to the child draw functions.

Returns:
Type
this

fromLocal(input) → {geo.geoPosition}

Description:
  • Transform coordinates from a local coordinate system to world coordinates.

Source:
Inherited From:
Parameters:
Name Type Description
input geo.geoPosition

Renderer coordinates.

Returns:

World coordinates.

Type
geo.geoPosition

geoIsOn(event, handleropt) → {boolean}

Description:
  • Report if an event handler is bound to this object.

Source:
Inherited From:
Parameters:
Name Type Attributes 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:

true if any of the specified events are bound to the specified handler.

Type
boolean

geoOff(eventopt, argopt, nullable) → {this}

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

Source:
Inherited From:
Parameters:
Name Type Attributes 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
this

geoOn(event, handler) → {this}

Description:
  • Bind an event handler to this object.

Source:
Inherited From:
Parameters:
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
this

geoOnce(event, handler) → {function}

Description:
  • Bind an event handler to this object that will fire once and then deregister itself.

Source:
Inherited From:
Parameters:
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:

The actual bound handler. This is a wrapper around the handler that was passed to the function.

Type
function

geoTrigger(event, args, childrenOnlyopt) → {this}

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

Source:
Inherited From:
Parameters:
Name Type Attributes 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
this

height() → {number}

Description:
  • Return the height of the layer in pixels.

Source:
Inherited From:
Returns:

The height of the parent map in pixels.

Type
number

id(valopt) → {string|this}

Description:
  • Get/Set id of the layer.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
val string | null <optional>

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

Returns:
Type
string | this

initialized(valopt) → {boolean|this}

Description:
  • Get/Set if the layer has been initialized.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
val boolean <optional>

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

Returns:

Either the initialized value or this.

Type
boolean | this

map() → {geo.map}

Description:
  • Get the map associated with this layer.

Source:
Inherited From:
Returns:

The map associated with the layer.

Type
geo.map

modified() → {this}

Description:
  • Update the timestamp to the next global timestamp value.

Source:
Inherited From:
Returns:
Type
this

moveDown(nopt) → {this}

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

Source:
Inherited From:
Parameters:
Name Type Attributes Default Description
n number <optional>
1

The number of positions to move.

Returns:
Type
this

moveToBottom() → {this}

Description:
  • Bring the layer to the bottom of the map layers.

Source:
Inherited From:
Returns:
Type
this

moveToTop() → {this}

Description:
  • Bring the layer to the top of the map layers.

Source:
Inherited From:
Returns:
Type
this

moveUp(nopt) → {this}

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

Source:
Inherited From:
Parameters:
Name Type Attributes Default Description
n number <optional>
1

The number of positions to move.

Returns:
Type
this

name(valopt) → {string|this}

Description:
  • Get/Set name of the layer.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
val string <optional>

If specified, the new name of the layer.

Returns:
Type
string | this

node() → {HTMLDivElement}

Description:
  • Get root node of the layer.

Source:
Inherited From:
Returns:
Type
HTMLDivElement

onIdle(handler) → {this}

Description:
  • 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.

Source:
Inherited From:
Parameters:
Name Type Description
handler function

A function taking no arguments.

Returns:
Type
this

opacity(opacityopt) → {number|this}

Description:
  • 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 occur with the layer.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
opacity number <optional>

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

Returns:

The current opacity or the current layer.

Type
number | this

parent(argopt) → {this|geo.sceneObject}

Description:
  • Get/set parent of the object.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
arg geo.sceneObject <optional>

The new parent or undefined to get the current parent.

Returns:
Type
this | geo.sceneObject

removeChild(child) → {this}

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

Source:
Inherited From:
Parameters:
Name Type Description
child geo.object | Array.<geo.object>

A child object or array of child objects.

Returns:
Type
this

removePromise(promise) → {this}

Description:
  • Remove the promise here and also propagate up the scene tree.

Source:
Inherited From:
Parameters:
Name Type Description
promise Promise

A promise object.

Returns:
Type
this

renderer() → {geo.renderer}

Description:
  • Get the renderer for the layer.

Source:
Inherited From:
Returns:

The renderer associated with the layer or null if there is no renderer.

Type
geo.renderer

rendererName() → {string}

Description:
  • Get the name of the renderer.

Source:
Inherited From:
Returns:
Type
string

selectionAPI(valopt) → {boolean|this}

Description:
  • Get/Set selectionAPI of the layer.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
val boolean <optional>

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

Returns:

Either the selectionAPI state or the layer.

Type
boolean | this

sticky() → {boolean}

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

Source:
Inherited From:
Returns:
Type
boolean

timestamp() → {number}

Description:
  • Get time.

Source:
Inherited From:
Returns:

The timestamp. This is 0 if the timestamp has never been modified.

Type
number

toLocal(input) → {geo.geoPosition}

Description:
  • 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.

Source:
Inherited From:
Parameters:
Name Type Description
input geo.geoPosition

World coordinates.

Returns:

Renderer coordinates.

Type
geo.geoPosition

updateTime() → {geo.timestamp}

Description:
  • Return the modified time for the last update that did something.

Source:
Inherited From:
Returns:

The update time.

Type
geo.timestamp

visible(valopt) → {boolean|this}

Description:
  • Get/Set visibility of the layer.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
val boolean <optional>

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

Returns:

either the visibility (if getting) or the layer (if setting).

Type
boolean | this

width() → {number}

Description:
  • Return the width of the layer in pixels.

Source:
Inherited From:
Returns:

The width of the parent map in pixels.

Type
number

zIndex(zIndexopt, allowDuplicateopt) → {number|this}

Description:
  • 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.

Source:
Inherited From:
Parameters:
Name Type Attributes 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
number | this