CesiumGS / CesiumGS/cesium

EntityCluster broken when adding new entities

Open
#9,571 5 comments 1 reaction 0 assignees View on GitHub
category - clustering category - entity type - bug
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

Hi,

We're trying to use the clustering functionality on a project I'm working on and I seem to have run into an issue with labels appearing when they shouldn't. We have EntityCluster.clusterLabels=true (the default), but we still see labels for the clustered entities appearing on the map. This only seems to happen when you add additional entities to a map that has clustering turned on. I created a quick prototype in sandcastle, (see below), to reproduce the issue click the 'inject' button once, and you should see everything work properly:
![image](https://user-images.githubusercontent.com/5799862/119847778-459c8b80-bed9-11eb-8ead-c107be0bcb88.png)
If you click the inject button again, you should see labels for all of the clustered entities (but no billboards):
![image](https://user-images.githubusercontent.com/5799862/119848128-8eecdb00-bed9-11eb-8150-92273afaa2bc.png)
It seems to be behaving as if EntityCluster.clusterLabels was set to false the second time you inject entities. Our current workaround is to turn clustering off and back on when we add entities, but it causes the entities to flash briefly, which isn't ideal.

Sandcastle example:
https://sandcastle.cesium.com/#c=tVdZb+M2EP4rbPogqXFpp9sUC8c2unFsrNFcWBspFjCwoKWxzS5FCSLlJFv4v3eo25KP7ALViw7OfDP85uBowyKy4fAMEekTCc9kCIrHPn1KvtnzMzd5HwZSMy4hmp85V3M5l24glSYhl9cxF15d+7H4bjtzmeJTj2k2DeLIhRuuQsFeqQdLFgt9UyxQV8RKQ8TlioJkCwEeAusohrkk+ZUb5/IfcPUwiKUecxBG0gvc2Aep6Qr0SIB5vH6deLblGinLuJ7qZnam/Buc1i1lmwifmFydhgj5C4hE1ErpO2IMWHStpeVQ5nmjDS7ccjSE1JtF7n61WiQRGknNNQflHEFLKToFl0o5R72qULAPaZ3srUXiEKMMwyKKx0CrpHwn5lwuY+lqHsjMedsh/6YpIgBjY6KN8QhZpGAsAqbterLQDRMxmGAYJb60fyL3sb/ANOVqzCXXYCcoTgFsrhz4otPpkHabZAlMdJD5QS6+EsgCk6ptS22zx2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3T98RoX1OXXYqXnVStyr/FG/wKpG2Bo/mRhKtwy7to7XXrqVxLmS4Nv7s+X0epDL/AQ

Browser: FireFox, Chrome, Edge

Operating System: Windows Linux

Contributor guide

Open the contributing guide

Research direction

Start with the linked Sandcastle reproduction and the EntityCluster configuration, then trace what happens when the inject action adds entities a second time. The issue is done when repeated additions keep clusterLabels enabled without requiring clustering to be toggled off and on, and clustered entity labels no longer appear individually.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.