Hi,
I created a small implementation that supports KML files with Placemark
elements that have a LineString in them. Please see the KML class file
here:
https://github.com/OpenAviationMap/oam-WebGL/blob/master/lib/OpenAviationMap/KML.js
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:
http://akos.maroy.hu/wp-content/uploads/2013/07/oam-WebGL/ - which is
an un-packged version of Cesium, so it takes a while to load. but it
shows the usage and functionality:
http://akos.maroy.hu/wp-content/uploads/2013/07/oam-WebGL/main.js
var viewer = widget.cesiumWidget;
KML.fromUrls(['../130730_0600-LHTL-EDDE-HADAW.kml',
'../130730_1100-EDDE-EHLE-HADAW.kml',
'../130805_1130-EHLE-EGKB-HADAW.kml',
'../130808_1200-EGKB-EGHQ-HADAW.kml',
'../130810_0900-EGHQ-LFOZ-HADAW.kml',
'../130810_1100-LFOZ-LSZH-HADAW.kml',
'../130812_1000-LSZH-LSZL-HADAW.kml',
'../130814_0800-LSZL-LJPZ-HADAW.kml',
'../130814_1130-LJPZ-LHTL-HADAW.kml'],
viewer
);
I also created a drag-and-drop mixin that handles KML files:
https://github.com/OpenAviationMap/oam-WebGL/blob/master/lib/OpenAviationMap/viewerDragDropMixin.js
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
gx:Tour.
I'd be glad to contribute the above eventually into Cesium itself. (as
you see, the KML script does not reference anything but Cesium)
Akos