Class: ViewControlsLayer

ViewControlsLayer(worldWindow)

Displays and manages view controls.

Constructor

new ViewControlsLayer(worldWindow)

Constructs a view controls layer.
Parameters:
Name Type Description
worldWindow WorldWindow The WorldWindow associated with this layer. This layer may not be associated with more than one WorldWindow. Each WorldWindow must have it's own instance of this layer if each window is to have view controls.

Placement of the controls within the WorldWindow is defined by the placement and alignment properties. The default values of these properties place the view controls at the lower left corner of the WorldWindow. The placement property specifies the overall position of the controls within the WorldWindow. The alignment property specifies the alignment of the controls collection relative to the placement position. Some common combinations are:

Location Placement Alignment
Bottom Left WorldWind.OFFSET_FRACTION, 0, WorldWind.OFFSET_FRACTION, 0 WorldWind.OFFSET_FRACTION, 0, WorldWind.OFFSET_FRACTION, 0
Top Right WorldWind.OFFSET_FRACTION, 1, WorldWind.OFFSET_FRACTION, 1 WorldWind.OFFSET_FRACTION, 1, WorldWind.OFFSET_FRACTION, 1
Top Left WorldWind.OFFSET_FRACTION, 0, WorldWind.OFFSET_FRACTION, 1 WorldWind.OFFSET_FRACTION, 0, WorldWind.OFFSET_FRACTION, 1
Bottom Center WorldWind.OFFSET_FRACTION, 0.5, WorldWind.OFFSET_FRACTION, 0 WorldWind.OFFSET_FRACTION, 0.5, WorldWind.OFFSET_FRACTION, 0
Southeast WorldWind.OFFSET_FRACTION, 1, WorldWind.OFFSET_FRACTION, 0.25 WorldWind.OFFSET_FRACTION, 1, WorldWind.OFFSET_FRACTION, 0.5

Source:
Throws:
If the specified WorldWindow is null or undefined.
Type
ArgumentError

Extends

Members

activeOpacity :Number

The opacity of the controls when they are in use. The opacity should be a value between 0 and 1, with 1 indicating fully opaque.
Type:
  • Number
Default Value:
  • 1
Source:

alignment :Offset

An Offset indicating the alignment of the control collection relative to the placement position. A value of {WorldWind.FRACTION, 0, WorldWind.Fraction 0} places the bottom left corner of the control collection at the placement position.
Type:
Default Value:
  • The lower left corner of the control collection.
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:

exaggerationIncrement :Number

The incremental vertical exaggeration to apply each cycle.
Type:
  • Number
Default Value:
  • 0.01
Source:

fieldOfViewIncrement :Number

The incremental amount to narrow or widen the field of view each cycle, in degrees.
Type:
  • Number
Default Value:
  • 0.1
Source:

headingIncrement :Number

The incremental amount to increase or decrease the heading each cycle, in degrees.
Type:
  • Number
Default Value:
  • 1.0
Source:

inactiveOpacity :Number

The opacity of the controls when they are not in use. The opacity should be a value between 0 and 1, with 1 indicating fully opaque.
Type:
  • Number
Default Value:
  • 0.5
Source:

(readonly) inCurrentFrame :Boolean

Indicates whether elements of this layer were drawn in the most recently generated frame.
Type:
  • Boolean
Overrides:
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:

panIncrement :Number

The scale factor governing the pan speed. Increased values cause faster panning.
Type:
  • Number
Default Value:
  • 0.001
Source:

pickEnabled :Boolean

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

placement :Offset

An Offset indicating where to place the controls on the screen.
Type:
Default Value:
  • The lower left corner of the window.
Source:

showExaggerationControl :Boolean

Indicates whether to display the vertical exaggeration control.
Type:
  • Boolean
Default Value:
  • true
Source:

showFieldOfViewControl :Boolean

Indicates whether to display the field of view control.
Type:
  • Boolean
Default Value:
  • false
Source:

showHeadingControl :Boolean

Indicates whether to display the heading control.
Type:
  • Boolean
Default Value:
  • true
Source:

showPanControl :Boolean

Indicates whether to display the pan control.
Type:
  • Boolean
Default Value:
  • true
Source:

showTiltControl :Boolean

Indicates whether to display the tilt control.
Type:
  • Boolean
Default Value:
  • true
Source:

showZoomControl :Boolean

Indicates whether to display the zoom control.
Type:
  • Boolean
Default Value:
  • true
Source:

tiltIncrement :Number

The incremental amount to increase or decrease the tilt each cycle, in degrees.
Type:
  • Number
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:

(readonly) wwd :WorldWindow

The WorldWindow associated with this layer.
Type:
Source:

zoomIncrement :Number

The incremental amount to increase or decrease the eye distance (for zoom) each cycle.
Type:
  • Number
Default Value:
  • 0.04 (4%)
Source:

Methods

(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.
Overrides:
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:

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: