Commit bfd517ff by Corey Koval

Switch from Cesium.when to JS Promise

parent e1bea665
...@@ -293,7 +293,8 @@ ...@@ -293,7 +293,8 @@
} }
console.log(parameter); console.log(parameter);
let promise1 = transmittersDataSource.load('/output.czml?'+parameter); let promise1 = transmittersDataSource.load('/output.czml?'+parameter);
Cesium.when(promise1, function(dataSource1){ promise1.then(
function(dataSource1) {
spinner.style.visibility = "hidden"; spinner.style.visibility = "hidden";
spinner.style.zIndex = "0"; spinner.style.zIndex = "0";
}); });
...@@ -305,22 +306,12 @@ ...@@ -305,22 +306,12 @@
receiversDataSource.load('/receivers.czml'); receiversDataSource.load('/receivers.czml');
viewer.dataSources.add(receiversDataSource); viewer.dataSources.add(receiversDataSource);
return receiversDataSource; return receiversDataSource;
// let promise1 = Cesium.CzmlDataSource.load('/receivers.czml');
// Cesium.when(promise1, function(dataSource1){
// viewer.dataSources.add(dataSource1);
// return dataSource1;
// });
} }
function loadAoiCzml() { function loadAoiCzml() {
aoiDataSource.load('/aoi.czml'); aoiDataSource.load('/aoi.czml');
viewer.dataSources.add(aoiDataSource); viewer.dataSources.add(aoiDataSource);
return aoiDataSource; return aoiDataSource;
// let promise1 = Cesium.CzmlDataSource.load('/aoi.czml');
// Cesium.when(promise1, function(dataSource1){
// viewer.dataSources.add(dataSource1);
// return dataSource1;
// });
} }
function loadAllCzml() { function loadAllCzml() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment