1

I am loading some geometries through a datasource load promise like above:

Cesium.when(Cesium.CzmlDataSource.load(environment.apiBaseURL + `/geometry/all`), result => {
    this.dataSources = result;
    this.viewer.dataSources.add(this.dataSources);
});

and I am trying to switch their visibility with this callback above:

this.visibilitySubscription = this.store.visibility.subscribe(visibility=>{
        this.dataSources.show = visibility;
    });

but unfortunately the show/hide of the objects has a weird delay and I must scroll the mouse in order to see them hide or show

chatzich
  • 1,083
  • 2
  • 11
  • 26

1 Answers1

0

I managed to solve this by adding the:

this.viewer.scene.requestRender();

right after

this.dataSources.show = visibility;

so the final solution is:

this.visibilitySubscription = this.store.visibility.subscribe(visibility=>{
        this.dataSources.show = visibility;
        this.viewer.scene.requestRender();
    });
chatzich
  • 1,083
  • 2
  • 11
  • 26