cesium icon indicating copy to clipboard operation
cesium copied to clipboard

`time` param of CallbackProperty.Callback should be optional

Open anne-gropler opened this issue 9 months ago • 1 comments

Feature

According to the current signature, the callback has 2 params:

  1. time, of type JulianDate
  2. result, an optional object

This implies that every CallbackProperty is time dependent. But this is not necessarily the case, as shown in this Sandcastle.

In my local app, I have the use case that sometimes, I need to get the current value of such a property elsewhere. I can do this using getValue(time), although I don't need time, so I just pass undefined instead. However, I am using Typescript strict type checking, so the ts compiler does not allow me to pass null or undefined or anything other than a JulianDate. My current workaround is to write getValue(undefined!) , which is syntactically correct, but looks confusing at best, but mostly it looks wrong.

Would it be possible to make the time parameter optional, just as the result parameter? Or would that break something?

anne-gropler avatar May 31 '24 12:05 anne-gropler