Expecting the scene to be done entirely in cesium

when the datasource kml is loaded, I want to display the loading image until it is rendered in the viewer or scene. I tried to handle:

  • viewer.dataSources.dataSourceAdded

    but it starts very early i.e. the loading image disappears before the data source can be rendered.
  • the problem is the same:

    viewer.dataSources.add(datasource).then(function(){ clearLoader(); } )

Please, someone can help thanks to Relationship

+3


source to share


1 answer


Try this instead:

viewer.dataSource.add(datasource); // add empty datasource.
datasource.load(url).then(function () { clearLoader(); });

      



The function .add

returns immediately, even with an empty data source. But the function .load

returns a promise that will be resolved after the data source is loaded.

+1


source







All Articles