Label

open class Label @JvmOverloads constructor(position: Position, var text: String? = null, var attributes: TextAttributes = TextAttributes()) : AbstractRenderable, Highlightable, Movable

Represents a label at a geographic position. Labels display one or more lines of text, separated by '\n', according to specified TextAttributes. Lines are aligned inside the text block by the horizontal fraction of TextAttributes.textOffset anchor: 0 = left, 0.5 = center, 1 = right.

Constructors

Link copied to clipboard
constructor(position: Position, text: String? = null, attributes: TextAttributes = TextAttributes())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override var altitudeMode: AltitudeMode

The label's altitude mode. See AltitudeMode

Link copied to clipboard

Indicates this label's "normal" attributes, that is the attributes used when the label's highlighted flag is false. If null and this label is not highlighted, this label displays nothing.

Link copied to clipboard

The amount of screen depth offset applied to this label's text during rendering. Values less than zero bias depth values toward the viewer, causing the text to appear above nearby terrain rather than being clipped by it. The offset is applied only while the label is within the horizon distance. Defaults to DEFAULT_DEPTH_OFFSET.

Link copied to clipboard
open override var displayName: String?
Link copied to clipboard

The attributes used when this label's highlighted flag is true. If null and the highlighted flag is true, this label's normal attributes are used. If they, too, are null, this label displays nothing.

Link copied to clipboard

Indicates whether this placemark has visual priority over other shapes in the scene.

Link copied to clipboard
open override var isEnabled: Boolean
Link copied to clipboard
open override var isHighlighted: Boolean

Determines whether the normal or highlighted attributes should be used.

Link copied to clipboard
open override var isPickEnabled: Boolean
Link copied to clipboard
open override val isPointShape: Boolean

true when this shape's referencePosition coincides with where the user actually sees the shape (Placemark, Label, sightlines — the reference is the rendered location). false for shapes whose reference is computed from extended geometry and may sit far from where the user grabbed (Polygon centroid, Path centroid, Mesh).

Link copied to clipboard

Optional lambda to control current label visibility based on its attributes, frame render context and camera distance

Link copied to clipboard
open override var pickDelegate: Any?
Link copied to clipboard

The label's geographic position.

Link copied to clipboard
open override val referencePosition: Position

A position associated with the object that indicates its aggregate geographic position. For a Label, this is simply it's position property.

Link copied to clipboard

Indicates the rotation applied to this label. The rotation represents clockwise clockwise degrees relative to this label's labelRotationMode.

Link copied to clipboard

Indicates the orientation mode used to interpret this label's rotation. Label rotation may be either relative to the screen or relative to the globe, as indicated by the following allowable values: OrientationMode.RELATIVE_TO_SCREEN - The label's orientation is fixed relative to the screen. Rotation indicates clockwise degrees relative to the screen's vertical axis. This is the default mode. OrientationMode.RELATIVE_TO_GLOBE - The label's orientation is fixed relative to the globe. Rotation indicates clockwise degrees relative to North.

Link copied to clipboard
var text: String?

Indicates the text displayed by this label. The returned string may be null, indicating that this label displays nothing.

Link copied to clipboard

Sets the eye altitude, in meters, above which this label is not displayed.

Link copied to clipboard
open override var zOrder: Double

Functions

Link copied to clipboard

Apply label-scale to a Label's text attributes.

Link copied to clipboard
open override fun <T> getUserProperty(key: Any): T?
Link copied to clipboard
open override fun hasUserProperty(key: Any): Boolean
Link copied to clipboard
open override fun moveTo(globe: Globe, position: Position)

Moves the shape over the globe's surface. For a Label, this simply change its position.

Link copied to clipboard
open override fun putUserProperty(key: Any, value: Any): Any?
Link copied to clipboard
open override fun removeUserProperty(key: Any): Any?
Link copied to clipboard
open override fun render(rc: RenderContext)