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 primitives in the result collection will be overwritten.

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

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

See also