get

operator fun get(index: Int): Label(source)

Returns the label in the collection at the specified index. Indices are zero-based and increase as labels are added. Removing a label shifts all labels after it to the left, changing their indices. This function is commonly used with LabelCollection.length to iterate over all the labels in the collection.

// Toggle the show property of every label in the collection
const len = labels.length;
for (let i = 0; i < len; ++i) {
const l = billboards.get(i);
l.show = !l.show;
}

Return

The label at the specified index.

Parameters

index

The zero-based index of the billboard.

See also