get

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

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

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

Return

The polyline at the specified index.

Parameters

index

The zero-based index of the polyline.

See also