I have uploaded KML files with Polygon and Points to cesium ion account. I want to render these KML files on globe. When i will try to render KML asset type in my application it didn't work. I will try following code.
1.
var options = {
camera: viewer.scene.camera,
canvas: viewer.scene.canvas
};
var kmlFile = viewer.dataSources.add(Cesium.KmlDataSource.load('fileName.kml', options));
viewer.zoomTo(kmlFile);
2.
Cesium.IonResource.fromAssetId(assetID).then(function(resource) {
var options = {
camera: viewer.scene.camera,
canvas: viewer.scene.canvas
};
viewer.dataSources.add(Cesium.KmlDataSource.load(resource, options));
});
Thanks