@JsType(isNative=true, namespace="Cesium", name="Label") public class Label extends Object
Modifier and Type | Field and Description |
---|---|
Color |
backgroundColor
Gets or sets the background color of this label.
|
Cartesian2 |
backgroundPadding
Gets or sets the background padding, in pixels, of this label.
|
double |
disableDepthTestDistance
Gets or sets the distance from the camera at which to disable the depth test to, for example,
prevent clipping against terrain.
|
DistanceDisplayCondition |
distanceDisplayCondition
Gets or sets the condition specifying at what distance from the camera that this label will be displayed.
|
static boolean |
enableRightToLeftDetection
Determines whether or not run the algorithm, that match the text of the label to right-to-left languages
Default: false
|
Cartesian3 |
eyeOffset
Gets and sets the 3D Cartesian offset applied to this label in eye coordinates.
|
Color |
fillColor
Gets or sets the fill color of this label.
|
String |
font
Gets or sets the font used to draw this label.
|
int |
heightReference
Gets or sets the height reference of this billboard.
|
Number |
horizontalOrigin
Gets or sets the horizontal origin of this label, which determines if the label is drawn to the left, center, or right of its position.
|
Object |
id
Gets or sets the user-defined object returned when the label is picked.
|
Color |
outlineColor
Gets or sets the outline color of this label.
|
int |
outlineWidth
Gets or sets the outline width of this label.
|
Cartesian2 |
pixelOffset
Gets or sets the pixel offset in screen space from the origin of this label.
|
NearFarScalar |
pixelOffsetScaleByDistance
Gets or sets near and far pixel offset scaling properties of a Label based on the Label's distance from the camera.
|
Cartesian3 |
position
Gets or sets the Cartesian position of this label.
|
double |
scale
Gets or sets the uniform scale that is multiplied with the label's size in pixels.
|
NearFarScalar |
scaleByDistance
Gets or sets near and far scaling properties of a Label based on the label's distance from the camera.
|
boolean |
show
Determines if this label will be shown.
|
Number |
style
Gets or sets the style of this label.
|
String |
text
Gets or sets the text of this label.
|
NearFarScalar |
translucencyByDistance
Gets or sets near and far translucency properties of a Label based on the Label's distance from the camera.
|
Number |
verticalOrigin
Gets or sets the vertical origin of this label, which determines if the label is to the above, below,
or at the center of its position.
|
Modifier | Constructor and Description |
---|---|
protected |
Label()
A Label draws viewport-aligned text positioned in the 3D scene.
|
Modifier and Type | Method and Description |
---|---|
Cartesian2 |
computeScreenSpacePosition(Scene scene,
Cartesian2 result)
Computes the screen-space position of the label's origin, taking into account eye and pixel offsets.
|
boolean |
equals(Label other)
Determines if this label equals another label.
|
boolean |
isDestroyed()
Returns true if this object was destroyed; otherwise, false.
|
@JsProperty public static boolean enableRightToLeftDetection
@JsProperty public Color backgroundColor
@JsProperty public Cartesian2 backgroundPadding
@JsProperty public double disableDepthTestDistance
@JsProperty public DistanceDisplayCondition distanceDisplayCondition
@JsProperty public Cartesian3 eyeOffset
@JsProperty public Color fillColor
@JsProperty public String font
@JsProperty public int heightReference
HeightReference
@JsProperty public Number horizontalOrigin
HorizontalOrigin
@JsProperty public Object id
@JsProperty public Color outlineColor
@JsProperty public int outlineWidth
@JsProperty public Cartesian2 pixelOffset
@JsProperty public NearFarScalar pixelOffsetScaleByDistance
Example:
// Example 1.
// Set a label's pixel offset scale to 0.0 when the
// camera is 1500 meters from the label and scale pixel offset to 10.0 pixels
// in the y direction the camera distance approaches 8.0e6 meters.
text.pixelOffset = new Cartesian2(0.0, 1.0);
text.pixelOffsetScaleByDistance = new NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0);
// Example 2.
// disable pixel offset by distance
text.pixelOffsetScaleByDistance = undefined;
@JsProperty public Cartesian3 position
@JsProperty public double scale
@JsProperty public NearFarScalar scaleByDistance
NearFarScalar.nearValue
and NearFarScalar.farValue
while
the camera distance falls within the upper and lower bounds of the specified NearFarScalar.near
and NearFarScalar.far
.
Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined, scaleByDistance will be disabled.@JsProperty public boolean show
public Number style
LabelStyle
@JsProperty public String text
public NearFarScalar translucencyByDistance
@JsProperty public Number verticalOrigin
VerticalOrigin
@JsConstructor protected Label()
LabelCollection.add(org.cesiumjs.cs.scene.options.LabelOptions)
.@JsMethod public Cartesian2 computeScreenSpacePosition(Scene scene, Cartesian2 result)
scene
- The scene the label is in.result
- The object onto which to store the result.eyeOffset
,
pixelOffset
@JsMethod public boolean equals(Label other)
other
- The label to compare for equality.@JsMethod public boolean isDestroyed()
Copyright © 2019. All rights reserved.