Skip to content

Conversation

javagl
Copy link
Contributor

@javagl javagl commented Sep 25, 2025

Fixes #12923

Description

When removing draped imagery, then the rendered representation was not updated - i.e. the imagery was still displayed on the tileset.

As correctly identified by @na9da , the reason for that was that the whole update of the ModelImagery was skipped when there was no imagery in the tileset. The change here makes sure that when there is no imagery, then any rendered representation of that (ModelPrimitiveImagery objects) will be deleted.

Issue number and link

#12923

Testing plan

The following sandcastles are basically the one from the linked issue, with an additional "Add layer" button for further tests.

1. The test on the current main state: Pressing the "Remove layers" button has no visible effect.

https://sandcastle.cesium.com/#c=jVVbc9o4FP4rGl4KneArxrgJmaU0TZwNkAAp2wwvsiywQJY8koCYnfz3lW1oSZPO9oXB53zn9p2LTBNcY4YFVBhAIBMoMFjjHCy4ABAhLCVQHEAGyHRHGNgRlfCNAqPeRiVzZpogUSqTn0wzxltMeYaFEWGmKM4NxFMTZkSalZ8m4kwJTptbxyxwUBHOpIkE1rGbRGn3zTK+OWd9LMkmNcIi5j2FSmeTGjFewA1VkwLzt06xO2cAzGs4v02ia0RG5DZ83If2kIQyZGMP9cN2uM7++da/DQwNyr7dxFm0putwxclwOrC/T0Pr+3SgRrMwH00s62ka7u9mt2Q4e9CyIX26Du3Barwa7h/2IdkROHvQQUJnOL3aDfaP+wGxnEH66N5Nx+nTdWUzzG0y+hI+f0+v8kEaesPVgNz1bym+6ZHR6sod7tFuOH1sDaZJYDwEg6WczdaoHUX2/ubx1ofJ0+r5XsHp7GqVDbdjyvzhxF3Awbx2PmdzpimUCmwJ3mEBuoDhHThQ9a2U1ec1VH73NdeQ6L7Oa2fg34IoRVJMteQTWEAq8Vkhg4ykZRtOhRLpeRjwGN8TtMbiVBVBie9gjsWvqpeGTq9KyyjtDbnOeyrlMkuw0F8J3+l8ldjgkzoUoVhipRVwB4kCp13/AhU0qtmYVrCvXIwxpETlhS6M62VZ5ViG8Sc9CJ7rQacF3WYQOUGzhR23GUVe3AwQjiPPaSG/5Wo6Citx6qiw7XidwLcCq+lGCDVbvhU1I4z8pmNFUdsNELKjoLR9W2kmSEoU2WJpwDiuH4oqYIe/RgqfSbpJJ7oczCYZRPhKCF400CnZ0FvULysFKsFAt2SJRQ5oQXS5h58JW4IBzCSoUxhhKgFnNG8caSxlYWVVdkc7PlJ5IjUWgqf3gm9JjEVP5gzVCyqOSM4O4COkxPekLkBz7bRs2w3shmbgtDJy4r8q/00yBdw0XzH2h1ZzNoEsRlDqa1Kgpny5pPjzRinO6tXuT4q5qjg5dPaNp3L2StViw1Ax7KCOEqznN25Um/E7I03jAXhewF4Otb9Ni9MIild5jXHKt7hq4TGzn+F/xAVFA7l2Q/my/uGV0YfG+QHzPteiBPcorZc7WKFf/jzDXhxXkf40ux8GPzMjC1B/PzuK2VIloNvtAuunv9/V8tsJKG1eXlVWbssd52sAFbhPCIUxpllC4C9biWCqnxhDBysuY3UrYiwVYYeDd3I7+1Ao/Q8yt17FtB3PcTqB4fkdR1+VwPLOKoW+DK7T6fiGb1m2Y7mWc1C0LN+zLc9wA8/p+L7ru6WiUf5yQfST+DbuDYaxXu17olAy5rqVla+2YbtWq922HN9p+5brH4PbWmFr/65lex2n3bE7Z0cLLbRbvuN5dtBpeb73I/pLRZv5UZ/JmO8KQqb6JdBveF13untZNedVp6vRen2HDk3/v1ksUC9nwLEsq3H+UT/ktbPahVQ5xZfHGfiLpBkXCmwErRuGqXCa6QceSzPa6FVTBpLy2PoL89T0IiZbQOLuO08cQBRKqTWLDaUTssfz2uWFqfFvTCkvKR9tsdB1FbDEvryrhIZhXJj6831LVS3RL57/Aw

2. The test on the state from this PR: When pressing the "Remove layers" button, the rendered state is updated to no longer show the draped imagery. (Adding and removing several times also works).

https://ci-builds.cesium.com/cesium/fix-draped-imagery-removal/Apps/Sandcastle/index.html#c=jVVbc9o4FP4rGl4KneArxrgJmaU0TZwNkAAp2wwvsiywQJY8koCYnfz3lW1oSZPO9oXB53zn9p2LTBNcY4YFVBhAIBMoMFjjHCy4ABAhLCVQHEAGyHRHGNgRlfCNAqPeR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C9biWCqnxhDBysuY3UrYiwVYYeDd3I7+1Ao/Q8yt17FtB3PcTqB4fkdR1+VwPLOKoW+DK7T6fiGb1m2Y7mWc1C0LN+zLc9wA8/p+L7ru6WiUf5yQfST+DbuDYaxXu17olAy5rqVla+2YbtWq922HN9p+5brH4PbWmFr/65lex2n3bE7Z0cLLbRbvuN5dtBpeb73I/pLRZv5UZ/JmO8KQqb6JdBveF13untZNedVp6vRen2HDk3/v1ksUC9nwLEsq3H+UT/ktbPahVQ5xZfHGfiLpBkXCmwErRuGqXCa6QceSzPa6FVTBpLy2PoL89T0IiZbQOLuO08cQBRKqTWLDaUTssfz2uWFqfFvTCkvKR9tsdB1FbDEvryrhIZhXJj6831LVS3RL57/Aw

A simple spec has been added that ensures that the rendered representation (the ModelPrimitiveImagery objects) are indeed deleted when the imagery layer is removed.

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

Copy link

Thank you for the pull request, @javagl!

✅ We can confirm we have a CLA on file for you.

@javagl
Copy link
Contributor Author

javagl commented Sep 26, 2025

The exact conditions under which a test can be run in CI when it ~"involves GL" are not really clear. The test that creates the rendered representation claims to pass. The one that deletes it did not pass. It passes locally, and the linked sandcastles indicate that it "works". I now disabled that test in CI, using the if (!scene.context.webgl2) { return; } check.

@mzschwartz5 mzschwartz5 self-requested a review September 26, 2025 19:14
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.

Removing draped imagery does not update the rendered state
2 participants