supercluster icon indicating copy to clipboard operation
supercluster copied to clipboard

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

Open y5wang opened this issue 7 years ago • 2 comments
trafficstars

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.

y5wang avatar Mar 09 '18 14:03 y5wang

Same question

StuRuby avatar Apr 01 '19 17:04 StuRuby

You need to mention the extent to vtpbf like: vtpbf.fromGeojsonVt({ clusters }, {version: 2, extent: 8192}).

cosmin-petrescu avatar Jul 22 '21 11:07 cosmin-petrescu