i create a box and plane by click two button.
the button code is below:
addPlane
addBox
the addPlane()、addBox() codes all is from cesium sandcastle.
function addBox() {
var redBox = viewer.entities.add({
name: “Red box with black outline”,
position: Cesium.Cartesian3.fromDegrees(-107.0, 40.0, 300000.0),
box: {
dimensions: new Cesium.Cartesian3(400000.0, 300000.0, 500000.0),
material: Cesium.Color.RED.withAlpha(0.5),
outline: true,
outlineColor: Cesium.Color.BLACK,
},
});
}
function addPlane() {
var redPlane = viewer.entities.add({
name: “Red plane with black outline”,
position: Cesium.Cartesian3.fromDegrees(-107.0, 40.0, 300000.0),
plane: {
plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_Y, 0.0),
dimensions: new Cesium.Cartesian2(400000.0, 300000.0),
material: Cesium.Color.RED.withAlpha(0.5),
outline: true,
outlineColor: Cesium.Color.BLACK,
},
});
}
when i first click addBox button,and then click addPlane button
attention:click addBox first
then cause a error below
it’s very strange that only this two entity cause error.
if i change to another box,there is no error.
if i first click addPlane,there is no error too.