CesiumGS/cesium

clockTrackedDataSource tracks non-clock dataSources

Open

#11,738 opened on 2024年1月4日

GitHub で見る
 (1 comment) (0 reactions) (0 assignees)JavaScript (11,758 stars) (3,324 forks)batch import
good first issueneeds feedbacktype - bug

説明

What happened?

Not sure if this is intended behavior or not. And if so, a bug vs feature request.

When adding dataSources, the latest dataSource appears to be setting clockTrackedDataSource even if it's a geoJSON or kml source. Since the clock isn't being updated, I'd expect the clockTrackedDataSource value to also not change. It's possible it behaves this way for other file structures I'm not aware of that have clocks that may be set outside the area I was looking in.

https://github.com/CesiumGS/cesium/blob/1.113/packages/widgets/Source/Viewer/Viewer.js#L1561 sets the value

However, the function trackDataSourceClock checks if there's a clock. It seems like a clock check should happen (if possible) before setting the tracked data source.

Reproduction steps

We have a page where you can drag/drop files onto a map.

These files can be removed. However, if a user attempts to remove a dataSource we wanted to stop the animation IF the clockTrackedDataSource matched the dataSource we were trying to remove. This is difficult since the tracked data source doesn't match the currently running animation.

  1. Added GeoJSON file
  2. Added CZML file with a clock
  3. Added GeoJSON file
  4. The clockTrackedDataSource updated each time a new file was added, I'd expect it to only change on the second one.

The sandcastle example just has a CZML that's loaded, then a GeoJSON loaded right after. It console.logs the clockTrackedDataSource value.

Sandcastle example

https://sandcastle.cesium.com/#c=zVZZb+M2EP4rhJ9swJYoibq8SdA2aYstEvRI0IfEgcBItM0NRRoklTRb+L93KNmODy0a9KmC40hzfPPN4aFKJY1F5ddaoHP0MJMI/e2+EOLVFM0GlSqbmkk7G4w7saQ1c4rL+5trdKMqJnaqF6YNV9JpAw/vxKVQ5fN0CwvA0jL9QoWzC3EQT3AAnzuMp+3n3j8Rhvh+hwZ4jdbA6I53RPog9qzrRli+EpzpKQrxRrxu/3ffB+nWBwmtlOG2zWhHvqTaqoWmqyUvr9hCM2am6GGSpmMUwV+A3fV4EAYKw9nrT1rVRzjMcArYD8SLxgh7wRiFXnLs2zLac1wIO3dMPc+/pfVKsCtqqd9aGf8SIJv6hsrNXQG33kI87dVDN/J7yWvq8gLqcyoM2yklwNxpKs1c6Z3JLjRCt89MMKtkQXVdfFHQyeK6KKLiwAhiKEuP6tZdbKXK5Qea1l2N5Pb3hsK0yBbs4VCNEB4fSybYC6MoC/IQZ1ka4SgK8z6jJMd5liVpFgaEBHHSZ4PzKIsyksUki6I0CE9sACZN4yjNkiyISUpwdmIS9FIkeUhwmjiGJI2TuJdhhEkekThPcB6EQdITPcRJDMEJBqMoBB49NnECJUjjOIBsAezEIvy/1/Dx4Hm997R/3zOYfxRF+OHB/NdRc0XJCCZhmEQBSUiah72dxWEQ5JiQkGQEunvaWt9HzAggOKm4oU+CTST7y05AwuDnNxHKmImaT1aaldxt0562x0EaZ65saZTnOOsbjRQnUZZleRZEIdT1vxR1fbIrHz/NgE7ZHhhupTENR4Zkr6hbNt6frWw4G5Tt86WSlkJaGn7YXb3NUjWi6tYP7G6rG7d61qM93Aq22a1qdMl+g4XJDYMQXSzvXWU8WlVDh7iJfAnH19VO7QlFq6E70kYz2YGfwDpnzy6ZHM4bWbqZQMN3o9F2PjahrablM6t+lJbbN2D0bukxJ+NAacHsD2+fgdb2EHGR21XfJrZg6hej5FVPfpskfj626PLY9uN45UtWBLguGlMYGGogYNVKfQGA2aBz2cb/VuQPpI++Vfs92w5mOELnF22qSjjii+HGsz3977r6vVMYbcmtu5v1qG1ISW253KPEtFZ6x+aVy0q9elQwbTeqjfMnNBgPzox9E+xiy/w7Xq+UtqjRYgiVswwq5+rkPzXAxXqlMVsSZ/6+61nFX+B14LxnjuFdhhoDmnkjxC3/ymaDizMf7E9cXeu4XPwK70SCvjmzZXBx3Qk9zzvz4bHf0yolnqg+Qv4H

Environment

Browser: Edge/Chrome CesiumJS Version: 1.113/1.112 Operating System: Windows 10/Ubuntu 20

コントリビューターガイド