3

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

1 Answer 1

2

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();
    });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.