There are several different ways to download KML data, the easiest way is to pass it the URL of the KML or KMZ file you want to read:
var kmlDataSource = new Cesium.KmlDataSource(); kmlDataSource.loadUrl('path/to/kml/or/kmz'); viewer.dataSources.add(kmlDataSource);
You cannot read local files this way, this path should be on the server, but if you want to drag and drop KML or KMZ files into your application, you can enable this by calling
viewer.extend(Cesium.viewerDragDropMixin);
Finally, about 30 seconds ago, I just added the ability to create a KmlDataSource and load the URL at the same time. If you sync to the branch head, you can do this on one line.
viewer.dataSources.add(KmlDataSource.fromUrl('path/to/kml/or/kmz'));
source share