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

If there are multiple entities walls using different kinds of ImageMaterialProperty, then the entities cannot be removed. #7160

Closed
emloxe opened this issue Oct 17, 2018 · 2 comments

Comments

@emloxe
Copy link

emloxe commented Oct 17, 2018

Sandcastle example:

var base64_1 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAgCAYAAAB3j6rJAAABW0lEQVRYR2NkIBLIhT/u/M/EYE6kcoiy/4z/H6+QcSRGDyMxikBqZCMeb2dkZPQgVj1M3aPlMkTZQZQiZIf8Z/h/ivE/w3Z8DvrPwKDKyMgYBVJDM4cwMPyf/Gi5bB4+h8hEPfZi+s+4ddQhsFAa2iEiF/nkP6k5gRbqGQedQ/4x/C9n+M9wCuTbMvZpmtEcm9IZ/jP81/+0o5AaIbCbNyZNjOmN1q2/SgdDv0xbDzOTiZFxP4gND5F///57PVkpCy4f/qfLeDEwQbIf4/THRJc1eMuWTJntDAygAvH/ZMbpT6DZ/z+jXOTTf6MOGQ0RcLobTSNoWWg0RNDLlNEQGQ0RQhXjaBoZTSOjaYRQCJCdRhgY/i9l+M9wB2SABfNZoVj2dXoMjIz/s7+2HCTVUmzqSzmm6yowPRE+91fnydyfkWB7wICRsR6lqUgNyygxg1E28vEBSgygll4AWBkKyHvUenkAAAAASUVORK5CYII=';
var base64_2 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAgCAYAAACcuBHKAAAD6ElEQVRYR+2WXWhbZRjHf/+TnG7iqusUR9skcytsOnSK80JU3GB4sfmBiLVJKgO9sODF2unslc4pDFFXaacX0hvRuaS1FyJzMnA4EMdUHMomopsrcppahmjdKi1tkvNIklbSJdOdWnHIzt05z8f7O//3fZ73USyRMao9RpvXF+mtagv4MZbItAFvVAvz0hHpooIwlDTzRxzUhbiFf0eJo77ZN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ErQELIDjGY7WYqYdLuQNmB2LWgU7CQOndqb/awA9wf7xz/BtK9LlgAAAABJRU5ErkJggg==';

var viewer = new Cesium.Viewer('cesiumContainer');
for (var i = 0; i < 10; i++) {
    var redWall = viewer.entities.add({
        name: 'Red wall at height',
        wall: {
            positions: Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 40.0, 200000.0, -90.0, 40.0, 200000.0]),
            minimumHeights: [100000.0, 100000.0],
            material: new Cesium.ImageMaterialProperty({
                image: base64_1,
                transparent: false,
                color: new Cesium.Color(1.0, 1.0, 1.0, 1.0)
            })
        }
    });

    var greenWall = viewer.entities.add({
        name: 'Green wall from surface with outline',
        wall: {
            positions: Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 43.0, 100000.0, -90.0, 43.0, 100000.0]),
            material: new Cesium.ImageMaterialProperty({
                image: base64_2,
                transparent: false,
                color: new Cesium.Color(1.0, 1.0, 1.0, 1.0)
            }),
            outline: true
        }
    });

    var blueWall = viewer.entities.add({
        name: 'Blue wall with sawtooth heights and outline',
        wall: {
            positions: Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 50.0, 100000.0, -90.0, 50.0, 100000.0]),
            material: new Cesium.ImageMaterialProperty({
                image: base64_1,
                transparent: false,
                color: new Cesium.Color(1.0, 1.0, 1.0, 1.0)
            }),
            outline: true,
        }
    });

}
viewer.zoomTo(viewer.entities);


setTimeout(function () {
    viewer.entities.removeAll()
}, 20000)

Browser: Google Chrome 69.0.3497.100

Operating System: win 10

@hpinkos
Copy link
Contributor

hpinkos commented Oct 17, 2018

Thanks for including the code example @emloxe! I'll try to figure out the problem soon.

This is the code example I was testing with:

var viewer = new Cesium.Viewer('cesiumContainer');
for (var i = 0; i < 2; i++) {
    viewer.entities.add({
        wall: {
            positions: Cesium.Cartesian3.fromDegreesArray([-115.0, 43.0 + i, -90.0, 43.0]),
            maximumHeights: [100000.0, 100000.0],
            material: new Cesium.ImageMaterialProperty({
                image: '../images/bumpmap.png'
            })
        }
    });
    
    viewer.entities.add({
        wall: {
            positions: Cesium.Cartesian3.fromDegreesArray([-115.0, 40.0 + i, -90.0, 40.0]),
            maximumHeights: [100000.0, 100000.0],
            material: new Cesium.ImageMaterialProperty({
                image: '../images/Cesium_Logo_Color.jpg'
            })
        }
    });

}
viewer.zoomTo(viewer.entities);

Sandcastle.addToolbarButton('Remove', function() {
    viewer.entities.removeAll();
});

hpinkos pushed a commit that referenced this issue Oct 17, 2018
@hpinkos
Copy link
Contributor

hpinkos commented Oct 22, 2018

Thanks again for reporting this @emloxe! This was fixed in #7163 and will be included in the 1.51 release available on November 1st.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants