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.
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+r5XsHp7GqVDbdjyvzhxF3Awbx2PmdzpimUCmwJ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j6831LVS3RL57/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=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
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
CONTRIBUTORS.md
CHANGES.md
with a short summary of my change