Fix style colors interfering across tilesets #8051
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this Sandcastle, there are two tilesets, each has a different color style. But if you zoom out so both are in view, they will be colored the same.
If you zoom in to one or the other, they will each have the right color. This is happening because a scratch variable is being re-used across all b3dm's:
https://github.com/AnalyticalGraphicsInc/cesium/blob/54acd32f50c332605615a7b37b774c04690ef55c/Source/Scene/Batched3DModel3DTileContent.js#L458
This only happens for tilesets that have 0 features.
I'm not sure if a more elaborate fix is needed here - should
model.color
have a setter, and use the underlying._color
to keep track of when it changes etc? I noticed there was amodel._color
that wasn't being used for anything, which I've removed in this commit.This came up in this forum thread.
Todo: