mapbox / mapbox/supercluster

Question - the right way to serve cluster vector tiles to the client

Open
#79 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
JavaScript
Stars
2.4k
Forks
304
PR merge metrics
No merged PRs in 30d

Description

I'm new to mapbox/supercluster and have a question on the best / right way to serve vector tiles with clusters to the client on the server side.

Once I get the clusters as
`let index = supercluster({
minZoom: 0,
maxZoom: 16,
radius: 40,
extent: 8192,
log: true
}).load(points.features)`

I can get a tile by
`let clusters = index.getTile(tile.z, tile.x, tile.y);`

My question is how do I serve it to the client. From online documents, looks I need to convert it to pbf through vt-pbf package, as
`vtpbf.fromGeojsonVt({ clusters }, {version: 2})`
but the results seem wrong (duplicated clusters on map at the client side, and jumpy points while zooming). Can somebody point me to the right direction? Thanks.

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 with the issue's use of index.getTile(tile.z, tile.x, tile.y) and vtpbf.fromGeojsonVt({ clusters }, {version: 2}). Investigate how supercluster tiles are expected to be serialized and served to a client, including the reported duplicated clusters and jumpy zoom behavior. Done would require documented, validated guidance, but the issue names no repository files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend, web-dev
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.