mapbox / mapbox/mapbox-gl-js

Duplicate Features Shown in Vector Tiles

Open
#11,052 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

mapbox-gl-js version: 2.4.1 (CDN)

browser: Edge

Steps to Trigger Behavior
  1. Open page
Link to Demonstration

https://gpi.services/serverside.clusters/

Expected Behavior

Single cluster should be shown representing the constituent points.

Actual Behavior

At certain zoom levels (e.g. 12) there are duplicate features in the clusters, but they don't exist in clusters returned from the server side query. I have included the point identifiers (crashids) in the cluster attributes for reference. I am using ST_AsMVT to create the proto buffer on the server side currently.

I have added a screenshot of what the map looks like loading on my 1080p monitor below:
overlapping_points

P.S. I don't know if it is related, but I noticed the same behavior when vectorizing clusters using Supercluster on the server side as well. For that implementation I was using vt-pbf to create the proto buffers.

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

Start by reproducing the behavior in the linked demonstration with mapbox-gl-js 2.4.1 in Edge, focusing on zoom level 12 and the displayed cluster attributes. Compare the rendered features with the server-side results generated through ST_AsMVT, and also consider the reported Supercluster and vt-pbf setup. Done means the duplicate features no longer appear and the single displayed cluster matches the constituent points.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.