add

fun add(options: Billboard.ConstructorOptions? = definedExternally): Billboard(source)

Creates and adds a billboard with the specified initial properties to the collection. The added billboard is returned so it can be modified or removed from the collection later.

// Example 1:  Add a billboard, specifying all the default values.
const b = billboards.add({
show : true,
position : Cartesian3.ZERO,
pixelOffset : Cartesian2.ZERO,
eyeOffset : Cartesian3.ZERO,
heightReference : HeightReference.NONE,
horizontalOrigin : HorizontalOrigin.CENTER,
verticalOrigin : VerticalOrigin.CENTER,
scale : 1.0,
image : 'url/to/image',
imageSubRegion : undefined,
color : Color.WHITE,
id : undefined,
rotation : 0.0,
alignedAxis : Cartesian3.ZERO,
width : undefined,
height : undefined,
scaleByDistance : undefined,
translucencyByDistance : undefined,
pixelOffsetScaleByDistance : undefined,
sizeInMeters : false,
distanceDisplayCondition : undefined
});
// Example 2:  Specify only the billboard's cartographic position.
const b = billboards.add({
position : Cartesian3.fromDegrees(longitude, latitude, height)
});

Return

The billboard that was added to the collection.

Parameters

options

A template describing the billboard's properties as shown in Example 1.

See also