设置铯中一个刻度线的时间

Set time for one tick mark in cesium

有没有办法设置Cesium时间线上的一个刻度线等于多少时间?我知道 viewer.timeline.zoomTo() 设置了整个时间线的时间范围。

这里没有 public API,但是如果您愿意进行一些黑客攻击,您可以在 Timeline.js around line 490. The line I've identified here is just a blank line between two sections of code: the code above this line is the last bit of logic to modify tinyTic (possibly resetting it to minSize on line 485), and then on line 493 中的局部变量 tinyTic 中找到这个答案您可以看到 tic = getNextTic(tic, tinyTic) 用于生成最小的抽动。

例如,您可以在 L490 上添加一行代码,将 tinyTic 的值保存到某个您可以从外部代码访问的对象。此处的值以秒为单位(因此 5 表示 5 秒,300 表示 5 分钟,依此类推)。