can cesium support kml directly without converting to czml?

I am working on developing a website where we would like to have some kml files developed elsewhere pre-loaded onto the virtual globe.
How do I add kml or czml files by code so that the user does not have to drag and drop?

Thanks in advance.

Not yet, but it’s on the roadmap. More likely than not, one of our Google Summer of Code candidates will be implementing it, but the decision on exactly who has not been made. In either case, expect lots of work in this area soon. Obviously we are happy to have as may people help as interested in doing so.

For the time being, you can use the offline converter in czml-writer to convert the KML to CZML and then use the CZML files.

Thank you for the quick reply. I noticed the offline converter and I have not figured it out yet. Is there a step-by-step tutorial for this anywhere?

Not that I know off, it has been mostly used by developers so far so people tend to build it themselves. It’s a command line tool, so you should just be able to pass it the kml file on the command line. Kristian Calhoun may be able to chime in with some additional help.

On a side note, we should probably provide pre-built executables for the entire czml-writer project, but we haven’t done that yet.

I plan using the offline converter to get my kml files into czml but that still leaves me wondering how to add those files by code so that I can create some ui to toggle them on and off.

That’s something you’ll need to do yourself for now, it shouldn’t be that hard for simple toggling that you’re talking about. For example, see this demo with code: http://cesium.agi.com/Cesium/Apps/Sandcastle/index.html?src=Simple%20CZML%20Demo.html

Eventually we will have a Table of Contents widget just like many other GIS apps have, but that is still a few months away.

Hi Derek,

Some basic instructions for the command line tool can be found near the bottom of the Quick Start page of the czml-writer wiki: https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/Quick-Start

Let us know if you run into any issues.

-Kristian

I don't think I will have a problem adding my own ui to toggle. I just wanted the code. The link was helpful. I think I can go from here.
Thanks for the help and the quick responses.

Thanks again for the links. I am working with another student and we are hoping to create on online conversion tool for our website using this tool.
I will let you know if it turns out.

depends what features of KML you need

I did an initial implementation of KML LineString, see here:
http://akos.maroy.hu/~akos/cc/ (follow the yellow line)