KML Placemark/LineString support


I created a small implementation that supports KML files with Placemark
elements that have a LineString in them. Please see the KML class file

of note are the contructor and KML.fromUrls(), which is a convenience
function to add KMLs to a Cesium Viewer by specifying URLs to the KML files.

a sample usage can be found here: - which is
an un-packged version of Cesium, so it takes a while to load. but it
shows the usage and functionality:

    var viewer = widget.cesiumWidget;


I also created a drag-and-drop mixin that handles KML files:

and actually the above sample does handle KML files dropped into it as
well - do give it a try! after the file is loaded, it will animate the
camera view to show the KML LineString just loaded.

I'd be glad to broaden the supported KML features. I wonder if anyone is
aware of a comprehensive set of KML test documents that would serve as a
comprehensive test harness for KML features?

I also started to work on gx:Tour support for KML, but I got stuck with
orienting the camera (see a previous question of mine on this regard).
as soon as I get that, I could finish a simple initial implementation of

I'd be glad to contribute the above eventually into Cesium itself. (as
you see, the KML script does not reference anything but Cesium)


Hi Ákos,

Some how I missed this post when you first wrote it.

KML support for Cesium is also currently being worked by one of our Google Summer of Code participants, André Nunes. You can see the implementation roadmap we have in placed on Github here: and check out his branch on linked from there. There’s still a ton of stuff to do, but we’re hoping to have something ready for an initial pull request by the end of the September.

This implementation varies greatly from yours in that it is based on the DynamicScene layer of Cesium (which I hope to eventually rename to DataSource). Rather than creating primitives directly, we create a generic representation of the KML features in memory first, and then create primitives for them via our Visualizer system. The reason for this is two-fold. First it allows various data sources, KML/GeoJSON/CZML/etc… to use the same visualization code and architecture; and second, it allows for us to maintain the objects in memory so that users can interact with them similarly to how they can interact with the KML tree shown in Google Earth. The actual Data Source Browser GUI is being worked separately by Scott in the DataSourceBrowser branch. The entire effort is a ton of work, but in the long run we think it will provide the best overall architecture for generic data sources in Cesium/

KML is definitely something we want, and if you’re interested, we can definitely work together to make it happen. I just wanted to give you a heads up now so you avoid doing a bunch duplicate work in the mean time. You are obviously free to continue your KML.js work if you want as well, but I wouldn’t expect to bring that into Cesium master in it’s current form, though we could end up incorporating parts of it into the system I laid out above.