clone

Duplicates the contents of this collection into the result collection. Result collection is not resized, and must contain enough space for all primitives in the source collection. Existing polygons in the result collection will be overwritten.

Useful when allocating more space for a collection that has reached its capacity, and efficiently transferring polygons to the new collection.

const result = new BufferPolygonCollection({ ... }); // allocate larger 'result' collection
BufferPolygonCollection.clone(collection, result); // copy polygons from 'collection' into 'result'

See also