Class: SurfaceShape

(abstract) SurfaceShape(attributes)

Represents a surface shape. This is an abstract base class and is meant to be instantiated only by subclasses.

Surface shapes other than SurfacePolyline SurfacePolyline have an interior and an outline and utilize the corresponding attributes in their associated ShapeAttributes ShapeAttributes. They do not utilize image-related attributes.

Constructor

(abstract) new SurfaceShape(attributes)

Constructs a surface shape with an optionally specified bundle of default attributes.
Parameters:
Name Type Description
attributes ShapeAttributes The attributes to apply to this shape. May be null, in which case attributes must be set directly before the shape is drawn.
Source:

Extends

Members

(static) DEFAULT_NUM_EDGE_INTERVALS :Number

Default value for the maximum number of edge intervals. This results in a maximum error of 480 m for an arc that spans the entire globe. Other values for this parameter have the associated errors below: Intervals Maximum error (meters) 2 1280253.5 4 448124.5 8 120837.6 16 30628.3 32 7677.9 64 1920.6 128 480.2 256 120.0 512 30.0 1024 7.5 2048 1.8 The errors cited above are upper bounds and the actual error may be lower.
Type:
  • Number
Source:

(static) DEFAULT_POLAR_THROTTLE :Number

The defualt value for the polar throttle, which slows edge traversal near the poles.
Type:
  • Number
Source:

attributes :ShapeAttributes

The shape's attributes. If null and this shape is not highlighted, this shape is not drawn.
Type:
Default Value:
Source:

displayName :String

The shape's display name and label text.
Type:
  • String
Overrides:
Default Value:
  • Surface Shape
Source:

enabled :Boolean

Indicates whether this shape is drawn.
Type:
  • Boolean
Overrides:
Default Value:
  • true
Source:

expirationInterval :Number

Indicates how long to use terrain-specific shape data before regenerating it, in milliseconds. A value of zero specifies that shape data should be regenerated every frame. While this causes the shape to adapt more frequently to the terrain, it decreases performance.
Type:
  • Number
Default Value:
  • 2000 (milliseconds)
Source:

highlightAttributes :ShapeAttributes

The attributes used when this shape's highlighted flag is true. If null and the highlighted flag is true, this shape's normal attributes are used. If they, too, are null, this shape is not drawn.
Type:
Default Value:
  • null
Source:

highlighted :Boolean

Indicates whether this shape displays with its highlight attributes rather than its normal attributes.
Type:
  • Boolean
Default Value:
  • false
Source:

maximumNumEdgeIntervals :Number

The maximum number of intervals an edge will be broken into. This is the number of intervals that an edge that spans to opposite side of the globe would be broken into. This is strictly an upper bound and the number of edge intervals may be lower if this resolution is not needed.
Type:
  • Number
Default Value:
  • SurfaceShape.DEFAULT_NUM_EDGE_INTERVALS
Source:

pathType :String

The path type to used to interpolate between locations on this shape. Recognized values are:
  • WorldWind.GREAT_CIRCLE
  • WorldWind.RHUMB_LINE
  • WorldWind.LINEAR
Type:
  • String
Default Value:
  • WorldWind.GREAT_CIRCLE
Source:

pickDelegate :Object

Indicates the object to return as the owner of this shape when picked.
Type:
  • Object
Overrides:
Default Value:
  • null
Source:

polarThrottle :Number

A dimensionless number that controls throttling of edge traversal near the poles where edges need to be sampled more closely together. A value of 0 indicates that no polar throttling is to be performed.
Type:
  • Number
Default Value:
  • SurfaceShape.DEFAULT_POLAR_THROTTLE
Source:

sector :Sector

Defines the extent of the shape in latitude and longitude. This sector only has valid data once the boundary is defined. Prior to this, it is null.
Type:
Source:

userProperties :Object

An application defined object associated with this renderable. A typical use case is to associate application defined data with a picked renderable.
Type:
  • Object
Inherited From:
Default Value:
  • An empty object
Source:

Methods

area(globe, terrainConformant)

Returns this shape's area in square meters.
Parameters:
Name Type Description
globe Globe The globe on which to compute the area.
terrainConformant Boolean If true, the returned area is that of the terrain, including its hillsides and other undulations. If false, the returned area is the shape's projected area.
Source:

computeExtent(dc) → {BoundingBox}

Computes the extent for the shape based on its sectors.
Parameters:
Name Type Description
dc DrawContext The drawing context containing a globe.
Source:
Returns:
The extent for the shape.
Type
BoundingBox

computeSectors(dc) → {Array.<Sector>}

Computes the bounding sectors for the shape. There will be more than one if the shape crosses the date line, but does not enclose a pole.
Parameters:
Name Type Description
dc DrawContext The drawing context containing a globe.
Source:
Returns:
Bounding sectors for the shape.
Type
Array.<Sector>

(protected) createShapeDataObject() → {Object}

Creates a new shape data object for the current globe state. Subclasses may override this method to modify the shape data object that this method creates, but must also call this method on this base class. Applications do not call this method.
Source:
Returns:
The shape data object.
Type
Object

get()

A hash key of the total visible external state of the surface shape.
Source:

(protected) isShapeDataCurrent(dc, shapeData) → {Boolean}

Indicates whether a specified shape data object is current. Subclasses may override this method to add criteria indicating whether the shape data object is current, but must also call this method on this base class. Applications do not call this method.
Parameters:
Name Type Description
dc DrawContext The current draw context.
shapeData Object The object to validate.
Source:
Returns:
true if the object is current, otherwise false.
Type
Boolean

render(dc)

Render this renderable. Some shapes actually draw themselves during this call, others only add themselves to the draw context's ordered rendering list for subsequent drawing when their renderOrdered method is called. This method is intended to be called by layers such as RenderableLayer and not by applications.
Parameters:
Name Type Description
dc DrawContext The current draw context.
Overrides:
Source:

renderToTexture(dc, ctx2D, xScale, yScale, dx, dy)

Internal use only. Render the shape onto the texture map of the tile.
Parameters:
Name Type Description
dc DrawContext The draw context to render onto.
ctx2D CanvasRenderingContext2D The rendering context for SVG.
xScale Number The multiplicative scale factor in the horizontal direction.
yScale Number The multiplicative scale factor in the vertical direction.
dx Number The additive offset in the horizontal direction.
dy Number The additive offset in the vertical direction.
Source: