Class: CompassLayer

CompassLayer()

Displays a compass. Compass layers cannot be shared among WorldWindows. Each WorldWindow if it is to have a compass layer must have its own. See the MultiWindow example for guidance.

Constructor

new CompassLayer()

Constructs a compass layer.
Source:

Extends

Members

compass :Compass

The compass to display.
Type:
Default Value:
Source:

displayName :String

This layer's display name.
Type:
  • String
Inherited From:
Default Value:
  • "Layer"
Source:

enabled :Boolean

Indicates whether to display this layer.
Type:
  • Boolean
Inherited From:
Default Value:
  • true
Source:

(readonly) inCurrentFrame :Boolean

Indicates whether elements of this layer were drawn in the most recently generated frame.
Type:
  • Boolean
Inherited From:
Source:

maxActiveAltitude :Number

The eye altitude below which this layer is displayed, in meters.
Type:
  • Number
Inherited From:
Default Value:
  • Number.MAX_VALUE (always displayed)
Source:

minActiveAltitude :Number

The eye altitude above which this layer is displayed, in meters.
Type:
  • Number
Inherited From:
Default Value:
  • -Number.MAX_VALUE (always displayed)
Source:

opacity :Number

This layer's opacity, which is combined with the opacity of shapes within layers. Opacity is in the range [0, 1], with 1 indicating fully opaque.
Type:
  • Number
Inherited From:
Default Value:
  • 1
Source:

pickEnabled :Boolean

Indicates whether this layer is pickable.
Type:
  • Boolean
Inherited From:
Default Value:
  • true
Source:

(readonly) renderables :Array

The array of renderables;
Type:
  • Array
Inherited From:
Source:

time :Date

The time to display. This property selects the layer contents that represents the specified time. If null, layer-type dependent contents are displayed.
Type:
  • Date
Inherited From:
Source:

timeRange :Array.<Date>

An array with two elements: start time and end time of the visible range.
Type:
  • Array.<Date>
Inherited From:
Source:

Methods

addRenderable(renderable)

Adds a renderable to this layer.
Parameters:
Name Type Description
renderable Renderable The renderable to add.
Inherited From:
Source:
Throws:
If the specified renderable is null or undefined.
Type
ArgumentError

addRenderables(renderables)

Adds an array of renderables to this layer.
Parameters:
Name Type Description
renderables Array.<Renderable> The renderables to add.
Inherited From:
Source:
Throws:
If the specified renderables array is null or undefined.
Type
ArgumentError

(protected) doRender(dc)

Subclass method called to display this layer. Subclasses should implement this method rather than the render method, which determines enable, pick and active altitude status and does not call this doRender method if the layer should not be displayed.
Parameters:
Name Type Description
dc DrawContext The current draw context.
Inherited From:
Source:

(protected) isLayerInView(dc) → {boolean}

Indicates whether this layer is within the current view. Subclasses may override this method and when called determine whether the layer contents are visible in the current view frustum. The default implementation always returns true.
Parameters:
Name Type Description
dc DrawContext The current draw context.
Inherited From:
Source:
Returns:
true If this layer is within the current view, otherwise false.
Type
boolean

refresh()

Refreshes the data associated with this layer. The behavior of this function varies with the layer type. For image layers, it causes the images to be re-retrieved from their origin.
Inherited From:
Source:

removeAllRenderables()

Removes all renderables from this layer. Does not call dispose on those renderables.
Inherited From:
Source:

removeRenderable(renderable)

Removes a renderable from this layer.
Parameters:
Name Type Description
renderable Renderable The renderable to remove.
Inherited From:
Source:

render(dc)

Displays this layer. Subclasses should generally not override this method but should instead override the doRender method. This method calls that method after verifying that the layer is enabled, the eye point is within this layer's active altitudes and the layer is in view.
Parameters:
Name Type Description
dc DrawContext The current draw context.
Inherited From:
Source:

solveTimeVisibility()

Internal function for solving the visibility based on time. The element is visible when its whole range is inside the selected time range.
Inherited From:
Source: