Improve ImageryLayer.cancelReprojections() handling #9163
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.
Same as #9161 but in the main cesium repo, since I don't have commit access to @chris-cooper's branch. Also updates CHANGES.md.
This looks good to me, but someone else should review because I wrote it a year-ish ago.
We reproject web mercator imagery to geographic using a ComputeCommand. When the reproject command is created, we flip the imagery tile to the
TRANSITIONING
state. When the command completes, the state becomesREADY
. The problem is, when a new terrainProvider is set,cancelReprojections
gets called, which simply throws away all pending imagery layer compute commands. If that happens after the reproject command is created but before it executes, then the imagery tile will never exit theTRANSITIONING
state and any terrain tiles that its attached to will never be able to render.So this PR extends a
ComputeCommand
with acanceled
callback, and calls the callback before the command is thrown away. That way the imagery tile knows that it still needs to be reprojected later with a new command.Fixes #6021