get

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

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

// Toggle the show property of every point in the collection
const len = pointPrimitives.length;
for (let i = 0; i < len; ++i) {
const p = pointPrimitives.get(i);
p.show = !p.show;
}

Return

The point at the specified index.

Parameters

index

The zero-based index of the point.

See also