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

Improve ImageryLayer.cancelReprojections() handling #9163

Merged
merged 4 commits into from
Oct 1, 2020

Conversation

kring
Copy link
Member

@kring kring commented Sep 21, 2020

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 becomes READY. 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 the TRANSITIONING state and any terrain tiles that its attached to will never be able to render.

So this PR extends a ComputeCommand with a canceled 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

@cesium-concierge
Copy link

Thanks for the pull request @kring!

  • ✔️ Signed CLA found.
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

@mramato
Copy link
Contributor

mramato commented Oct 1, 2020

@IanLilleyT @lilleyse @likangning93 any chance one of you can review/merge this for the release tomorrow? (Only if it's the clear cut good change we think it is of course)

@lilleyse
Copy link
Contributor

lilleyse commented Oct 1, 2020

I can't seem to trigger the problem where half the globe is missing but I do occasionally see lower-res imagery get stuck, which is fixed on this branch.

globe-side

@lilleyse
Copy link
Contributor

lilleyse commented Oct 1, 2020

I pushed a small style fix: 3f81df1

@lilleyse lilleyse merged commit 08cfbf9 into master Oct 1, 2020
@lilleyse lilleyse deleted the contrib-imagery-layers-change branch October 1, 2020 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some tiles not get loaded when switching terrainProvider
5 participants