Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tileVisible triggers before style is applied #11245

Open
jbo023 opened this issue Apr 21, 2023 · 3 comments
Open

tileVisible triggers before style is applied #11245

jbo023 opened this issue Apr 21, 2023 · 3 comments

Comments

@jbo023
Copy link
Contributor

jbo023 commented Apr 21, 2023

We are using the tileVisible Event on the Cesium3DTileset to style features based on some externally managed maps. This was working fine with the old Model Code. The new Model Code now applies the style after calling tileVisible.

The documentation also states that The style is applied to a tile before the [Cesium3DTileset#tileVisible](https://cesium.com/learn/cesiumjs/ref-doc/Cesium3DTileset.html#tileVisible) event is raised

the relevant code is the following in Cesium3DTileset.js raises the Event before Update. If i call update before tileVisible.raiseEvent it works as expected.

Sandcastle example

@ggetz
Copy link
Contributor

ggetz commented Apr 21, 2023

Thanks for the report @jbo023! Taking a quick look at this, it doesn't appear that the order of applyStyle and raising the tileVisible event has changed, but rather how model applies the style.

@jbo023
Copy link
Contributor Author

jbo023 commented Apr 22, 2023

@ggetz thanks for the quick reply.

One solution would be to already apply the style to the tiles during processing.
I implemented this solution with the following commit: virtualcitySYSTEMS@97e72e7

But i am not sure what kind of different consequences this could have. Is this a valid approach, and should i open a Merge request ?

@ggetz
Copy link
Contributor

ggetz commented Apr 24, 2023

Thanks @jbo023!

In practice, applyStyle just signals to the model that the style will need an update next frame, which will not happen if resources aren't loaded and the model is ready to be styled. So I don't believe the solution you provided here would hurt, but I am concerned this issue may be a symptom of a larger problem within the refactored model code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Planning / Needs triage
Development

No branches or pull requests

2 participants