Closed javier-lopez-1s closed 1 week ago
Hi @javier-lopez-1s, thank you for confirming this is effecting other data sources!
I've updated https://github.com/CesiumGS/cesium/issues/2891 to include all data sources since that appears to be the root issue. I'm going to close your issue to keep the discussion in one place. If you have any further input on this, please post it there instead.
What happened?
The entities in a CzmlDataSource can be shown/hidden without problems after being loaded for the first time. However, they can no longer be hidden if they are reloaded (with the same entity IDs). In fact, if a new data load includes entities with both previously loaded IDs and new IDs, the outcome is that the former can no longer be hidden while the latter can. CzmlDataSource's
load()
function callsentityCollection.removeAll();
internally. I believe the bug is in the functionEntityCollection.removeAll()
, specifically where the IDs of added and existing entities are checked, or a consequence of calling that function while the EntityCollection events are suspended. This was first observed on GeoJson data sources, reported in #12283, and closed as it was a duplicate of #2891. However, I believe it is worth creating a new issue given that the CZML data sources are also impacted, and the problem seems to be related toEntityCollection
.Reproduction steps
Sandcastle example
https://sandcastle.cesium.com/#c=3VXbjtowEP2VKU9BYk24absUULvs40qVyqpSRfbBcQxYODayHehuxb93nBAIl6q0+1IVIScez5wzM8d2mFbWAXtNJQxhGimAH34AEEkfolqiWZZy5aJaozArmnK/EOvve9uaGyu08uYWCXfmbeMMzC7oirfOoO5lxqGKt9JWuBxwFw7AqHF6buhqIdgDnxvObR+mN61Wl4QN6IZ+7IT+R8LnHcx290ToClIisB6frq0YCwJuBUXSaXcHdIBsQO8E/AAPkFLHjaDyCNBqKZKxltocmZHpgg3AzGOK1MiE/3avlw8HsmPC6vv2qNpfdb191vUvPPGdgY1wC4glZUvQmZNC8b/RIbz9v3TIFSjEaLXf/4kOULaxD85k/NR6nsmR8uGJ7tep2zlT9xuXUm9ygd+iavgPqDoTEhWdUWn5G1tcHqtr2vz8IVKRYvntuBZ8ww3ej4pvYIx1ZCn5mtuCqMby+VgrR5HbRLV6JTKhjk50Zhg/jh7jffuwXwt8SEFCDhGW0CQJDvOKE0OVDSVS6+UnF/iUS9yyzx0yMzrdaRmgkr1SyXpeYjWXfUyQa3HTvb3bK3TXKV59VFHYhKqEUesk9/k9aS1jau4z57TCbjxqmuRV43aDWaaY32kQ1As1DsVg7jQJ/GfHo26vgX7S87nkKIYVsZDCvfyOwi7wBAzh3Ymp5Ks1agPrXiQflbvgo0hX2jjIjAwIaTqeriReKbYZZ2zJHWHW+kDvOmhWQweJWON5HF7YDcAktRZXZpmUE/GK53A0aKL/WajviFDzz/g1lfTFuy1ao8fCSAgZNHF6OdIVnaogFx4/AQ
Environment
Browser: Chrome 130, Edge 130, Firefox 132 CesiumJS Version: 1.123 Operating System: Windows 11