mapbox / supercluster

A very fast geospatial point clustering library for browsers and Node.
ISC License
2.12k stars 300 forks source link

Avoid creating new objects for same clusters across zooms #190

Closed mourner closed 3 years ago

mourner commented 3 years ago

Currently, we always create a new cluster object even if the existing cluster origin had no neighbors to merge with on lower zoom level. This is redundant for memory footprint, and also makes it impossible to identify the same cluster across multiple zooms by the same cluster_id. This PR fixes this by carrying cluster objects (that don't receive new points) onto lower zooms. Closes #189.