How to check an entity is clustered or declustered?

286 views
Skip to first unread message

zxue

unread,
Aug 4, 2017, 11:24:26 AM8/4/17
to cesium-dev
1. A concise explanation of the problem you're experiencing.

I am looking for a way to check whether an entity gets clustered or declustered from a cluster.

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
I am using the clusterEvent callback function. What should I do from this point:

markersDataSource.clustering.clusterEvent.addEventListener(function(clusteredEntities, cluster) {
   
// check an entity is clustered or declustered
}



3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I have different behavior for entities and clusters on my map.

4. The Cesium version you're using, your operating system and browser.

I am using ceisum 1.35, windows, and chrome browser

zxue

unread,
Aug 7, 2017, 1:10:01 PM8/7/17
to cesium-dev
Or say, is there any way to divide the markers into two groups (clustered markers vs single makers) in the callback function? 

zxue

unread,
Aug 10, 2017, 10:24:26 AM8/10/17
to cesium-dev
Is there any event I could know that the markers get declustered?

Gabby Getz

unread,
Aug 17, 2017, 3:22:31 PM8/17/17
to cesium-dev
Hi,

So the clusterEvent callback function parameter only includes the entities that are included clustered. (https://cesiumjs.org/Cesium/Build/Documentation/EntityCluster.html#~newClusterCallback)

I have opened a new issue in the cesium repo to request declustered entities in the callback function: https://github.com/AnalyticalGraphicsInc/cesium/issues/5760. Please add comments there if you have any additional information to include.

Thanks!
Gabby

zxue

unread,
Aug 17, 2017, 3:45:52 PM8/17/17
to cesium-dev
Hi Gabby,

Thanks so much for help!
Reply all
Reply to author
Forward
0 new messages