You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updating a hidden polygon can cause other hidden polygons to be shown. It appears this only affects polygons that have a defined height (either zero or non-zero).
Sandcastle example:
var viewer = new Cesium.Viewer('cesiumContainer');
var greenPolygon = viewer.entities.add({
id : 'GreenPolygon',
name : 'Green polygon',
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArray([-108.0, 42.0,
-100.0, 42.0,
-104.0, 40.0]),
material : Cesium.Color.GREEN,
height: 0
}
});
var bluePolygon = viewer.entities.add({
id : 'BluePolygon',
name : 'Blue polygon',
polygon : {
hierarchy : {
positions : Cesium.Cartesian3.fromDegreesArray([-99.0, 30.0,
-85.0, 30.0,
-85.0, 40.0,
-99.0, 40.0]),
},
material : Cesium.Color.BLUE,
height: 0
}
});
viewer.entities.add({
id : 'RedPolygon',
polygon : {
hierarchy : {
positions : Cesium.Cartesian3.fromDegreesArray([-108.0, 30.0,
-100.0, 30.0,
-104.0, 32.0]),
},
material : Cesium.Color.RED,
//height: 0
}
});
Sandcastle.addToolbarButton('Hide', function(){
viewer.entities.values.forEach(function (entity) {
entity.show = false;
});
});
Sandcastle.addToolbarButton('Update green polygon', function(){
var entity = viewer.entities.getById('GreenPolygon');
entity.polygon = new Cesium.PolygonGraphics({
hierarchy : Cesium.Cartesian3.fromDegreesArray([-108.0, 42.0,
-100.0, 42.0,
-104.0, 40.0]),
material : Cesium.Color.GREEN,
height: 0
});
});
viewer.zoomTo(viewer.entities);
• Click Hide button to hide all the polygons
• Click Update green polygon button
• The blue polygon (which has a defined height) is incorrectly shown. The red polygon (which does not have a defined height) is correctly not shown. The green polygon correctly remains hidden.
#2909 appears related, but it's not clear whether this is the same issue.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this @pjaustin! It looks like I might have broken this with other fixes I made regarding polygon show in the 1.48 release. I'll try to get a fix in for the next release.
Meanwhile, if you use entity.polygon.show = false instead of entity.show = false it should work as expected. You'll just need to pass show: false to the new PolygonGraphics in your update function.
Thanks again for reporting this @pjaustin! The fix in #7156 has been merged into master and will be included in the 1.51 release available November 1st.
Updating a hidden polygon can cause other hidden polygons to be shown. It appears this only affects polygons that have a defined height (either zero or non-zero).
Sandcastle example:
• Click Hide button to hide all the polygons
• Click Update green polygon button
• The blue polygon (which has a defined height) is incorrectly shown. The red polygon (which does not have a defined height) is correctly not shown. The green polygon correctly remains hidden.
#2909 appears related, but it's not clear whether this is the same issue.
The text was updated successfully, but these errors were encountered: