Class: Text

Text(text)

Represents a string of text displayed at a specified geographic or screen position. This is an abstract class meant to be subclassed and not meant to be instantiated directly. See GeographicText and ScreenText for concrete classes.

Constructor

new Text(text)

Constructs a text shape. This constructor is intended to be called only by subclasses.
Parameters:
Name Type Description
text String The text to display.
Source:
Throws:
If the specified text is null or undefined.
Type
ArgumentError

Extends

Members

altitudeMode

This text's altitude mode. May be one of
  • WorldWind.ABSOLUTE
  • WorldWind.RELATIVE_TO_GROUND
  • WorldWind.CLAMP_TO_GROUND
Default Value:
  • WorldWind.ABSOLUTE
Source:

alwaysOnTop :Boolean

Indicates whether this text has visual priority over other shapes in the scene.
Type:
  • Boolean
Default Value:
  • false
Source:

attributes :TextAttributes

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

(readonly) currentVisibility :Number

This shape's current visibility, a value between 0 and 1. This property scales the shape's effective opacity. It is incremented or decremented each frame according to the draw context's fade velocity property in order to achieve this shape's current target visibility. This current visibility and target visibility are used to control the fading in and out of this shape.
Type:
  • Number
Default Value:
  • 1
Source:

declutterGroup :Number

Indicates the group ID of the declutter group to include this Text shape. If non-zer0, this shape is decluttered relative to all other shapes within its group.
Type:
  • Number
Default Value:
  • 0
Source:

displayName :String

The display name of the renderable.
Type:
  • String
Inherited From:
Default Value:
  • "Renderable"
Source:

enabled :boolean

Indicates whether this text is drawn.
Type:
  • boolean
Overrides:
Default Value:
  • true
Source:

highlightAttributes :TextAttributes

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

highlighted :boolean

Indicates whether this text uses its highlight attributes rather than its normal attributes.
Type:
  • boolean
Default Value:
  • false
Source:

markerImageScale :Number

The scale to apply to the markerImageSource.
Type:
  • Number
Default Value:
  • 0.1
Source:

markerImageSource :String

The image to display when this text shape is eliminated from the scene due to decluttering.
Type:
  • String
Default Value:
  • A round dot drawn in this shape's text color.
Source:

pickDelegate :Object

Indicates the object to return as the userObject of this text when picked. If null, then this text object is returned as the userObject.
Type:
  • Object
Overrides:
Default Value:
  • null
Source:
See:

(readonly) screenBounds :Rectangle

Indicates the screen coordinate bounds of this shape during ordered rendering.
Type:
Source:

targetVisibility :Number

This shape's target visibility, a value between 0 and 1. During ordered rendering this shape modifies its current visibility towards its target visibility at the rate specified by the draw context's fadeVelocity property. The target visibility and current visibility are used to control the fading in and out of this shape.
Type:
  • Number
Default Value:
  • 1
Source:

text :String

This shape's text. If null or empty, no text is drawn.
Type:
  • String
Default Value:
  • null
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

(protected) computeScreenPointAndEyeDistance(dc) → {Boolean}

Computes this shape's screen point and eye distance. Subclasses must override this method.
Parameters:
Name Type Description
dc DrawContext The current draw context.
Source:
Returns:
true if the screen point can be computed, otherwise false.
Type
Boolean

copy(that)

Copies the contents of a specified text object to this text object.
Parameters:
Name Type Description
that Text The text object to copy.
Source:

render(dc)

Renders this text. This method is typically not called by applications but is called by RenderableLayer during rendering. For this shape this method creates and enques an ordered renderable with the draw context and does not actually draw the text.
Parameters:
Name Type Description
dc DrawContext The current draw context.
Overrides:
Source:

renderOrdered(dc)

Draws this shape as an ordered renderable. Applications do not call this function. It is called by WorldWindow during rendering. Implements the OrderedRenderable interface.
Parameters:
Name Type Description
dc DrawContext The current draw context.
Source: