mapbox / mapbox/mapbox-gl-js

Clusters not dividing correctly

Open
#13,318 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

Mapbox does not seem to be honoring supercluster clusters (or there's a bug in supercluster) at some zoom levels.

**mapbox-gl-js version**: 3.7.0

**browser**: All

### Steps to Trigger Behavior

Max Zoom set to 21
Cluster Max Zoom set to 21
Cluster Radius set to 50

The features set contains some points in the exact same location.

When reaching zoom level 20 the 4 points cluster should be divided in 2 subclusters but it doesn't.

Google Maps which uses the same supercluster library correctly divides the clusters at all zoom levels, the only big difference seems to be that it uses getClusters instead of getTile.

For more specific details see the links below.

### Link to Demonstration

Mapbox: https://jsfiddle.net/yhd8491q
Google Maps: https://jsfiddle.net/zdonchu6

### Expected Behavior
Clusters should be divided according to supercluster computation

### Actual Behavior
Clusters are not divided according to supercluster computation

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in Mapbox GL JS 3.7.0 using the stated cluster settings and the linked Mapbox and Google Maps fiddles, focusing on zoom level 20 with four coincident points. Compare the supercluster getTile and getClusters paths; done means the four points divide into two subclusters according to the expected computation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.