Class: BillboardGraphics

BillboardGraphics

new BillboardGraphics(options)

Represents a two-dimensional icon, with its position specified by the position property of the Entity.


Example billboards

Name Type Description
options Object optional

The Object parameter object has the following properties:

Name Type Default Description
show Property true optional

Boolean property, specifying the visibility of the bulletin board.

image Property optional

Specify the image resources to be used for the bulletin board, such as Image, URI, or Canvas.

scale Property 1.0 optional

Numerical attribute, specifying the scaling ratio of the image size.

pixelOffset Property Cartesian2.ZERO optional

A Cartesian2 specifies the Cartesian2 attribute for pixel offset.

eyeOffset Property Cartesian3.ZERO optional

A Cartesian3 attribute that specifies the viewpoint offset.

horizontalOrigin Property HorizontalOrigin.CENTER optional

Specify the properties of HorizontalOrigin

verticalOrigin Property VerticalOrigin.CENTER optional

Specify the properties of VerticalOrigin

heightReference Property HeightReference.NONE optional

Specify the attribute of the height relative to the position.

color Property Color.WHITE optional

Specify the properties of the color tone for the bulletin board.

rotation Property 0 optional

Numerical attribute, specifying the rotation around the alignment axis.

alignedAxis Property Cartesian3.ZERO optional

Cartesian3 specifies the rotation axis, which must be a unit vector.

sizeInMeters Property optional

Boolean property, used to specify whether the size of the bulletin board is measured in meters.

width Property optional

Numerical attribute, specifying the width of the bulletin board in pixels, overriding the native size.

height Property optional

Numerical attribute, specifying the height of the bulletin board in pixels, covering the native size.

scaleByDistance Property optional

The attribute used to scale points based on their distance from the camera.

translucencyByDistance Property optional

NearFarScalar is used to set the attribute of translucency based on the distance from the camera.

pixelOffsetScaleByDistance Property optional

NearFarScalar is a property used to set pixel offset based on the distance from the camera.

imageSubRegion Property optional

Specify the BoundingRectangle property to define the use of image subregions instead of the entire image to fill the bulletin board, with the bottom left corner as the origin and in pixels.

distanceDisplayCondition Property optional

Specify a distance, and display the bulletin board when the distance between the bulletin board and the camera is less than this distance.

disableDepthTestDistance Property optional

Specify a distance, and turn off the depth test of the bulletin board when the distance between the bulletin board and the camera is less than this distance.

Members

alignedAxisProperty

Get or set Cartesian3 properties. This attribute specifies the rotation axis. When set to Cartesian3.ZERO, rotation will start from the top of the screen.

Default Value:
Cartesian3.ZERO

colorColor

Get or set the property of Color. This attribute is multiplied by the color of the image. This attribute has two uses: firstly, many different bulletin boards can use the same white texture (each texture has a different color) to create colored bulletin boards. Secondly, the alpha component of color can be used to make the bulletin board semi transparent, as shown in the following figure. When the Alpha value is 0.0, the bulletin board is completely transparent; When the Alpha value is 1.0, the bulletin board is completely opaque.

default
alpha : 0.5

Default Value:
Color.WHITE

readonly definitionChangedEvent

Get events. This event is thrown when the value of a property or sub property is modified, or when the definition is modified.

disableDepthTestDistanceProperty

Get or set the distance between the bulletin board and the camera. When the distance between the bulletin board and the camera is less than this distance, turn off depth detection. For example, to prevent being cut off due to terrain obstruction. When the value is 0, always enable depth detection. The value is Number. POSITIVE.INFINITY, and depth detection is always turned off.

distanceDisplayConditionProperty

Get or set the distance between the bulletin board and the camera. When the distance between the bulletin board and the camera is less than this distance, display the bulletin board.

eyeOffsetProperty

Get or set a Cartesian3 property that specifies the offset of the bulletin board in camera space. The camera space is a left-hand coordinate system space. The x-axis points to the right of the observer, the y-axis points to the top of the observer, and the z-axis points inside the screen.

EyeOffset is commonly used to arrange multiple bulletin boards in the same location, such as placing one bulletin board above its corresponding model

The figure below shows a billboard placed at the center of the Earth.However, eyeOffset allows the billboard to always appear above the Earth, regardless of the observer's or Earth's orientation.

b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);

Default Value:
Cartesian3.ZERO

heightProperty

Get or set the height of the bulletin board. The type is number, and the unit is pixel. When undefined, use local height.

heightReferenceProperty

Get or set the property of the specified HeightReference.

Default Value:
HeightReference.NONE

horizontalOriginProperty

Gets or sets the property of the specified HorizontalOrigin.

Default Value:
HorizontalOrigin.CENTER

imageProperty

Get or set the image resources to be used on the bulletin board, which can be of type Image, URI, or Canvas.

imageSubRegionProperty

Gets or sets a BoundingRectangle property that defines the use of image subregions instead of the entire image to fill the bulletin board, with the bottom left corner as the origin and in pixels.

pixelOffsetProperty

Get or set the Cartesian2 property. Specify the pixel offset of the bulletin board from its origin in screen space. This is typically used to align multiple bulletin boards and labels (such as images and text) in the same position. The origin of screen space is the upper left corner of the canvas; The value of x increases from left to right, and the value of y increases from top to bottom.

default
b.pixeloffset = new Cartesian2(50, 25);
The billboard's origin is indicated by the yellow point.

Default Value:
Cartesian2.ZERO

pixelOffsetScaleByDistanceProperty

Get or set the value of NearFarScalar. This attribute specifies the pixel offset of the bulletin board based on the distance between the bulletin board and the camera. When the distance between the camera and the bulletin board is between NearFarScalar # near and NearFarScalar # far, the pixel offset of the bulletin board will be interpolated between NearFarScalar # nearValue and NearFarScalar # farValue. When the distance between the camera and the bulletin board is outside of NearFarScalar # near and NearFarScalar # far, the pixel offset of the bulletin board will be the closest value.

rotationProperty

Get or set the counterclockwise rotation angle of the image around the rotation axis BillboardGraphic.aligned Axis, with the type of number. Gets or sets a numerical attribute that specifies the image to rotate counterclockwise from the alignment axis.

Default Value:
0

scaleProperty

Get or set a uniform scaling ratio that is used to scale the size of the image. A ratio greater than 1.0 will enlarge the bulletin board, while a ratio less than 1.0 will shrink the bulletin board.


From left to right in the above image, the scales are 0.5, 1.0, and 2.0.

Default Value:
1.0

scaleByDistanceProperty

Get or set the value of NearFarScalar. This attribute specifies the scaling ratio of the bulletin board based on the distance between the bulletin board and the camera. When the distance between the camera and the bulletin board is between NearFarScalar # near and NearFarScalar # far, the scaling ratio of the bulletin board will be interpolated between NearFarScalar # nearValue and NearFarScalar # farValue. When the distance between the camera and the bulletin board is outside of NearFarScalar # near and NearFarScalar # far, the scaling ratio of the bulletin board will be the closest value.

showProperty

Get the visibility of the bulletin board settings, of type boolean.

Default Value:
true

sizeInMetersProperty

Get or set whether the size of the bulletin board is measured in meters and of type boolean.

Default Value:
false

translucencyByDistanceProperty

Get or set the value of NearFarScalar. This attribute specifies the transparency of the bulletin board based on the distance between the bulletin board and the camera. When the distance between the camera and the bulletin board is between NearFarScalar # near and NearFarScalar # far, the transparency of the bulletin board will be interpolated between NearFarScalar # nearValue and NearFarScalar # farValue. When the distance between the camera and the bulletin board is outside of NearFarScalar # near and NearFarScalar # far, the transparency of the bulletin board will be the closest value.

verticalOriginProperty

Gets or sets the property of the specified VerticalOrigin.

Default Value:
VerticalOrigin.CENTER

widthProperty

Get or set the width of the bulletin board. When the type is number and the unit is pixel undefined, use local height.

Methods

clone(result){BillboardGraphics}

Copy this instance

Name Type Description
result BillboardGraphics optional

The object that stores the copied results

Returns:
Type Description
BillboardGraphics If input parameters are provided, return the modified input parameter object. If no input parameters are provided, return a new instance.

merge(source)

Assign the attribute values corresponding to the source object to all unspecified attributes of this instance

Name Type Description
source BillboardGraphics

Object providing attribute values