"Clustering" for Polygons by distanceDisplayCondition Doesn't Show All Billboards In Cluster


I’m trying to make clustering for polygons work by chaining a distanceDisplayCondition to a billboard and setting clustering to true on the datasource. Here is the code used to construct the entities:

polygon: new Cesium.PolygonGraphics({
hierarchy: {
positions: [Cesium.Cartesian3.fromDegrees(0.5, 0.5),
Cesium.Cartesian3.fromDegrees(1, 0.5),
Cesium.Cartesian3.fromDegrees(0.5, 0)]
show: true,
material: Cesium.Color.LIME,
fill: true,
distanceDisplayCondition : new Cesium.DistanceDisplayCondition(0, 250000.0)
position: Cesium.Cartesian3.fromDegrees(0.5, 0.5),
billboard : {
image : ‘…/images/facility.gif’,
distanceDisplayCondition : new Cesium.DistanceDisplayCondition(500000.0)

I’m able without to much trouble, using this sandcastle, to get this display, which I would expect should be impossible. This issue can also be seen at this other sandcastle.

In the triangle over the ocean sandcastle, I’m trying to get the distance display condition wired in such that you never see the clustering numbers and the polygons at the same time.

I’m a little confused over two points:

  1. Why are the billboards clustering at all when the polygons are visible?

  2. Why is the clustering display “2” here, without displaying third billboard?

Am I missing something here?



We do not currently have clustering implemented for Polygons. We only have clustering for labels, billboards and points.



Hi Hannah,

Do you have any news about polygon clustering with Cesium ? I'm working on an voronoi diagram map on Cesium. And I'd like to cluster some voronoi polygons.

Shengda Liu

Hi Shengda,

We don’t yet have functionality for clustering beyond points, labels and billboards. However, if you really need the clustering, you can probably create your own by creating a set of points at the centers of your polygons, enable clustering and use information from the clusters to set visibility of your polygons.

See our clustering sandcastle example: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Clustering.html&label=Showcases

Hope that helps,

  • Rachel

mmmm… yes clustering or replacing of billboards should be a nice option to add and use during displaying of billboards.

check the image I attached. I do have 29 billboards in my system for the town of Patras, Greece. As you see, it’s a bit cluttered to show the billboards on the globe.

So what to do?:

#1. What I’m thinking about is to ‘move’ the billboards so that they do not overlap anymore from visual point of the camera. This is a complicated because when the camera is moving the location in X,Y,Z of all the billboards needs to recalculated comparing to the camera view point.

#2. Option is to use the ‘scalebydistance’ and / or the ‘translucencyByDistance’ of the billboards more ‘tight’ so, only the close by will be visible

#3. What I did now in my situation is to make a variable height of the billboards + labels, and put them on the globe. But this is only for my POC to see if this is usefull.

What to do?

I will combine #3 and #2 together and see how this will look like. Option #1. is very nice, but complicated.

Maybe someone does have an idea about option #1?

Richard Zijlstra

Director & owner Geoneer