Handle invalid input more gracefully
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.4k
- Forks
- 304
- PR merge metrics
- No merged PRs in 30d
Description
Some of my zoom levels are returning an empty list cluster, while other zoom levels are properly returning a list of clusters.

```javascript
const index = new Supercluster({
radius: 200,
maxZoom: 16,
});
index.load(markers);
const clusterResponse = {};
const ZOOM_LEVELS = [9, 10, 11, 12, 13, 14, 15];
ZOOM_LEVELS.forEach((zoomLevel) => {
const clusters = index.getClusters([-180, -85, 180, 85], zoomLevel);
clusterResponse[zoomLevel.toString()] = clusters
.map(cluster => ({
id: cluster.id || cluster.properties.id,
count: cluster.properties.cluster ? cluster.properties.point_count : 1,
longitude: cluster.geometry.coordinates[0],
latitude: cluster.geometry.coordinates[1],
}));
});
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the example in issue #128 with the supplied markers, world-spanning bounds, and zoom levels 9–15. Inspect the getClusters entry point and compare its returned values at the failing zoom levels. Done means the reported input no longer produces an unexpected empty cluster list, with regression coverage for the case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100