CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.98k stars 3.5k forks source link

Clustering does not trigger initially for billboards for undefined width/height #8060

Closed HapDragon closed 5 years ago

HapDragon commented 5 years ago

I have just found that when entity has billboard property but not set width and height, the datasource clustering will not run when its data firstly added. It is because in entitycluster function: createDeclutterCallback, the variable bbox needs the width and height properties, if it is undefined, everty property in bbox will be NaN.

So I think it is probablely need to set _width and _height a defined value in entity billboard object, or modify some code in entitycluster object.

Sandcastle example: https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=tVhtb9s2EP4rRPbB0uJIsp0Ame0YS1KvC+bUQZx2GOZioCTaJiJLAkk5yQb/9x0l6l2K03QzWlsij/fcHY/PHbPDDO0oeSIMXSCfPKFrwmm0Nb7EY1rHiV+vA19g6hPW0UdLf+nvYFUQChr4HJb9s/QRfBy8JQyjodJncIf4xEhGu6kILOV1ETm69PeZbhcLvAgi5pA7FmwpJxdqQT7BDey6WsHi64iLYPshE9D0xNaaLkNsiK+tIt+RDmj5vJ56sgqYJs2gF9aIjgcWfB8f68mcEpGffKVBfEEFVUYVROQnDDiVSMPMUswEPGF/YKzApA9kzQjh2i0WG4Nh3w22mv5j79zqovLQTzBi6d2ydpt6nh1g5g5RBVd+6BavyRAtjwzDzP5dhiE3F3gbekSGy1xRRozQXy+PunUNpvlEXbEZ9iyra5p0heJXBDahDaHrjUCUI05ElwqY8jzkeLARkE5OwBhxhEfQE8Q7DhYCJC6QF2CXuDUo01QaJVbdkMrIvnEuF9qr/donP/F38ih3NqTPxLvH/ppA/vbORvnMlvp0CxmfeLGgf0uJQUGA+Nj2iAujgkUkTrFKMqgIUH9t5MLqafSadMmq/OXVNY321gczO6ULjGyDHZlRmIQzXZoKqX8VUc+t8sFdNq7po5L4mRUbm07HKf1AnoXWObOOO90s6QMvYMb99EMXnZ7rhghk6n2+n1XVnbaqO62rm99ffvo4PaBx0KpxUNf4x3Q2m/9+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OzxLgh5TsCr7awI1rFkCXPERsbWPttA99vfpvGefFrQwh3yGth+g0fC4M2wGDi8MJwy6NeHFyX4GlMutKyaV6xhPs0bUvmd2FDK0jnoggHKJ+CTWdsgM4etviLMCOzTREY5fuoC3AnF8sj1aR58X14gj2Fd4rfyFbHk3GJsiny2IZ+RcPwJmDrR5+kSKb3mSWDBqGMTbhtb5KuQziiU1jIXllkps/FnbgvkzGgk3KWTIW7uROEiWKmXJswntdop5s4yS6AhIH8JlcC24Cl8JbTz7hZ3jqWxY8A9uFaljS4IkNxQved5LjS4UYxUOfQ5CCiU4M0cmcaocXcIGUOBBrCXoIp6ax4jW8slLsmoJ2m5QNpOoGkhv9n0SvX4jeweDVi9f/G8SGZugbg2kmmajy1EwTNc3pfwE

Browser: Chrome 64

Operating System: win10

OmarShehata commented 5 years ago

I actually think this is the same issue as https://github.com/AnalyticalGraphicsInc/cesium/issues/7767. Your Sandcastle highlights the fact that it is indeed the width/height that's the issue here.

I'm going to close this and add your Sandcastle there. Thanks again for reporting this.