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
After CallbackProperty is used in the hierarchy value of polygon, two polygons will be rendered if the hightreference attribute value of Polygon is modified again.
`
const viewer = new Cesium.Viewer("cesiumContainer");
The workaround @Fav suggests seems to work. But I don't think it makes sense that this is required for the behavior to work as expected. So I'll leave this issue open.
What happened?
After CallbackProperty is used in the hierarchy value of polygon, two polygons will be rendered if the hightreference attribute value of Polygon is modified again.
`
const viewer = new Cesium.Viewer("cesiumContainer");
const redPolygon = viewer.entities.add({
name: "Red polygon on surface",
polygon: {
hierarchy: new Cesium.CallbackProperty(() => {
const hierarchy = new Cesium.PolygonHierarchy();
hierarchy.positions = [
Cesium.Cartesian3.fromDegrees(-115.0, 37.0, 50000),
Cesium.Cartesian3.fromDegrees(-115.0, 32.0, 50000),
Cesium.Cartesian3.fromDegrees(-107.0, 33.0, 50000),
Cesium.Cartesian3.fromDegrees(-102.0, 31.0, 50000),
Cesium.Cartesian3.fromDegrees(-102.0, 35.0, 50000),
];
hierarchy.holes = [];
return hierarchy;
}, false),
heightReference: Cesium.HeightReference.NONE,
perPositionHeight:true,
material: Cesium.Color.RED,
},
});
setTimeout(()=>{
redPolygon.polygon.material=Cesium.Color.BLUE;
redPolygon.polygon.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND;
redPolygon.polygon.perPositionHeight=false;
},3000);
viewer.zoomTo(viewer.entities);
`
Reproduction steps
Sandcastle example
No response
Environment
Browser:
CesiumJS Version:
Operating System:
The text was updated successfully, but these errors were encountered: