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:

(readonly) canvas :HTMLElement

The HTML canvas associated with this WorldWindow.
Type:
  • HTMLElement
Inherited From:
Source:

deepPicking :boolean

Indicates that picking will return all objects at the pick point, if any. The top-most object will have its isOnTop flag set to true. If deep picking is false, the default, only the top-most object is returned, plus the picked-terrain object if the pick point is over the terrain.
Type:
  • boolean
Inherited From:
Default Value:
  • false
Source:

(readonly) depthBits :number

The number of bits in the depth buffer associated with this WorldWindow.
Type:
  • number
Inherited From:
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:

frameStatistics :FrameStatistics

Performance statistics for this WorldWindow.
Type:
Inherited From:
Source:

globe :Globe

The globe displayed.
Type:
Inherited From:
Source:

goToAnimator :GoToAnimator

The GoToAnimator used by this WorldWindow to respond to its goTo method.
Type:
Inherited From:
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) layers :Array.<Layer>

The layers to display in this WorldWindow. This property is read-only. Use addLayer or insertLayer to add layers to this WorldWindow. Use removeLayer to remove layers from this WorldWindow.
Type:
Inherited From:
Source:
The navigator used to manipulate the globe.
Type:
Inherited From:
Default Value:
Source:

(readonly) orderedRenderingFilters :Array.<function()>

An array of functions to call during ordered rendering prior to rendering the ordered renderables. Each function is passed one argument, the current draw context. The function may modify the ordered renderables in the draw context's ordered renderable list, which has been sorted from front to back when the filter function is called. Ordered rendering filters are typically used to apply decluttering. The default set of filter functions contains one function that declutters shapes with declutter group ID of 1 (GeographicText by default) and one function that declutters shapes with declutter group ID 2 (Placemark by default). Applications can add functions to this array or remove them.
Type:
  • Array.<function()>
Inherited From:
Default Value:
Source:

panIncrement :Number

The scale factor governing the pan speed. Increased values cause faster panning.
Type:
  • Number
Default Value:
  • 0.001
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:

(readonly) redrawCallbacks :Array.<function()>

The list of callbacks to call immediately before and immediately after performing a redraw. The callbacks have two arguments: this WorldWindow and the redraw stage, e.g., redrawCallback(worldWindow, stage);. The stage will be either WorldWind.BEFORE_REDRAW or WorldWind.AFTER_REDRAW indicating whether the callback has been called either immediately before or immediately after a redraw, respectively. Applications may add functions to this array or remove them.
Type:
  • Array.<function()>
Inherited From:
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:

subsurfaceMode :boolean

Indicates whether this WorldWindow should be configured for sub-surface rendering. If true, shapes below the terrain can be seen when the terrain is made transparent. If false, sub-surface shapes are not visible, however, performance is slightly increased.
Type:
  • boolean
Inherited From:
Default Value:
  • false
Source:

surfaceOpacity :Number

The opacity to apply to terrain and surface shapes. This property is typically used when viewing the sub-surface. It modifies the opacity of the terrain and surface shapes as a whole. It should be a number between 0 and 1. It is compounded with the individual opacities of the image layers and surface shapes on the terrain.
Type:
  • Number
Inherited From:
Default Value:
  • 1
Source:

tiltIncrement :Number

The incremental amount to increase or decrease the tilt each cycle, in degrees.
Type:
  • Number
Source:

verticalExaggeration :Number

The vertical exaggeration to apply to the terrain.
Type:
  • Number
Inherited From:
Source:

(readonly) viewport :Rectangle

The current viewport of this WorldWindow.
Type:
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

addEventListener(type, listener)

Registers an event listener for the specified event type on this WorldWindow's canvas. This function delegates the processing of events to the WorldWindow's canvas. For details on this function and its arguments, see the W3C EventTarget documentation. Registering event listeners using this function enables applications to prevent the WorldWindow's default navigation behavior. To prevent default navigation behavior, call the Event's preventDefault method from within an event listener for any events the navigator should not respond to. When an event occurs, this calls the registered event listeners in order of reverse registration. Since the WorldWindow registers its navigator event listeners first, application event listeners are called before navigator event listeners.
Parameters:
Name Type Description
type The event type to listen for.
listener The function to call when the event occurs.
Inherited From:
Source:
Throws:
If any argument is null or undefined.
Type
ArgumentError

addLayer(layer)

Adds a specified layer to the end of this WorldWindow.
Parameters:
Name Type Description
layer Layer The layer to add. May be null or undefined, in which case this WorldWindow is not modified.
Inherited From:
Source:

canvasCoordinates(x, y) → {Vec2}

Converts window coordinates to coordinates relative to this WorldWindow's canvas.
Parameters:
Name Type Description
x Number The X coordinate to convert.
y Number The Y coordinate to convert.
Inherited From:
Source:
Returns:
The converted coordinates.
Type
Vec2

declutter(dc, groupId)

Declutters the current ordered renderables with a specified group ID. This function is not called by applications directly. It's meant to be invoked as an ordered rendering filter in this WorldWindow's orderedRenderingFilters property.

The function operates by setting the target visibility of occluded shapes to 0 and unoccluded shapes to 1.

Parameters:
Name Type Description
dc DrawContext The current draw context.
groupId Number The ID of the group to declutter. Must not be null, undefined or 0.
Inherited From:
Source:
Throws:
If the specified group ID is null, undefined or 0.
Type
ArgumentError

goTo(position, completionCallback)

Moves this WorldWindow's navigator to a specified location or position.
Parameters:
Name Type Description
position Location | Position The location or position to move the navigator to. If this argument contains an "altitude" property, as Position does, the end point of the navigation is at the specified altitude. Otherwise the end point is at the current altitude of the navigator. This function uses this WorldWindow's GoToAnimator property to perform the move. That object's properties can be specified by the application to modify its behavior during calls to this function. It's cancel method can also be used to cancel the move initiated by this function.
completionCallback function If not null or undefined, specifies a function to call when the animation completes. The completion callback is called with a single argument, this animator.
Inherited From:
Source:
Throws:
If the specified location or position is null or undefined.
Type
ArgumentError

insertLayer(index, layer)

Inserts a specified layer at a specified position in this WorldWindow's layer list.
Parameters:
Name Type Description
index number The index at which to insert the layer. May be negative to specify the position from the end of the array.
layer Layer The layer to insert. This WorldWindow's layer list is not changed if the specified layer is null or undefined.
Inherited From:
Source:

pick(pickPoint) → {PickedObjectList}

Requests the WorldWind objects displayed at a specified screen-coordinate point. If the point intersects the terrain, the returned list contains an object identifying the associated geographic position. This returns an empty list when nothing in the WorldWind scene intersects the specified point.
Parameters:
Name Type Description
pickPoint The point to examine in this WorldWindow's screen coordinates.
Inherited From:
Source:
Throws:
If the specified pick point is null or undefined.
Type
ArgumentError
Returns:
A list of picked WorldWind objects at the specified pick point.
Type
PickedObjectList

pickShapesInRegion(rectangle) → {PickedObjectList}

Requests the WorldWind objects displayed within a specified screen-coordinate region. This returns all objects that intersect the specified region, regardless of whether or not an object is actually visible, and marks objects that are visible as on top.
Parameters:
Name Type Description
rectangle Rectangle The screen coordinate rectangle identifying the region to search.
Inherited From:
Source:
Throws:
If the specified rectangle is null or undefined.
Type
ArgumentError
Returns:
A list of visible WorldWind objects within the specified region.
Type
PickedObjectList

pickTerrain(pickPoint) → {PickedObjectList}

Requests the position of the WorldWind terrain at a specified screen-coordinate point. If the point intersects the terrain, the returned list contains a single object identifying the associated geographic position. Otherwise this returns an empty list.
Parameters:
Name Type Description
pickPoint The point to examine in this WorldWindow's screen coordinates.
Inherited From:
Source:
Throws:
If the specified pick point is null or undefined.
Type
ArgumentError
Returns:
A list containing the picked WorldWind terrain position at the specified point, or an empty list if the point does not intersect the terrain.
Type
PickedObjectList

redraw()

Causes this WorldWindow to redraw itself at the next available opportunity. The redraw occurs on the main thread at a time of the browser's discretion. Applications should call redraw after changing the World Window's state, but should not expect that change to be reflected on screen immediately after this function returns. This is the preferred method for requesting a redraw of the WorldWindow.
Inherited From:
Source:

removeEventListener(type, listener)

Removes an event listener for the specified event type from this WorldWindow's canvas. The listener must be the same object passed to addEventListener. Calling removeEventListener with arguments that do not identify a currently registered listener has no effect.
Parameters:
Name Type Description
type Indicates the event type the listener registered for.
listener The listener to remove. Must be the same function object passed to addEventListener.
Inherited From:
Source:
Throws:
If any argument is null or undefined.
Type
ArgumentError

removeLayer(layer)

Removes the first instance of a specified layer from this WorldWindow.
Parameters:
Name Type Description
layer Layer The layer to remove. May be null or undefined, in which case this WorldWindow is not modified. This WorldWindow is also not modified if the specified layer does not exist in this world window's layer list.
Inherited From:
Source: