CZML Type Definition

I do a lot of work with czml and one thing that really bothered me for a long time was having to constantly refer back and forth to the czml-writer docs and such on github when trying to remember the params on an object in czml. I understand that they are a pretty close match to the constructor options for each type but… I wanted something else. I wanted a type definition for czml so I could get autocompletes and such when working with czml. I went through and made my own but, because if the inherent flexibility of some of these values, it’s a little biased.

For instance… a property with a numeric value (a line width for example) could be a numeric value, it could be a Double which is an object with a number property and the value on it, or that number property could be an array of time tagged values. For simplicity, I chose the longer form as the standard. It can’t be just a numeric value, it will always be an object Double. It keeps the interface consistent as opposed to having a multiple potential value types on every property. That’s just… that’s a mess.

Anyway, would the Cesium team be interested in looking over that and potentially including it as part of Cesium?

1 Like

I don’t work with czml often, but I am currently doing so for work. I’m finding it excessively difficult to determine what constitutes a czml json object. It just feels like I’m guessing. The CzmlDataSource documentation gives very little insight into what a czml object actually is.

Could you please link those resources you were using for reference? I would greatly appreciate it.

Sure, it’s on npm as @jdfwarrior/czml

That was my motivation for it as well. I got tired of having to constantly refer back and forth to docs to remember property names and stuff like that when working with czml

Thanks for sharing! Having the type definitions makes working with CZML much, much more straightforward. I appreciate you taking the time to help, thank you.

No prob. Glad to help. Between different projects, I had done this 2-3 times and decided I’d finally just make a module of it so I never have to do it again ha