Hello folks,
Can any one help me figure out why view.graphics.remove(pointGraphic) does not work; until i remove all view.graphics.removeAll(); yet I want to remove only pointGraphic not any other of the added graphics.
const pointGraphic = new Graphic({
geometry,
symbol: {
type: "point-3d", // autocasts as new PointSymbol3D()
symbolLayers: [{
type: "object", // autocasts as new ObjectSymbol3DLayer()
width: 50, // diameter of the object from east to west in meters
height: 50, // height of object in meters
depth: 50, // diameter of the object from north to south in meters
resource: { primitive: "sphere" },
material: { color: "red" }
}],
scale:0.5
},
});
view.graphics.remove(pointGraphic);
I actually want to remove it before I add a new one of the same type, to avoid the redundancy.
Thank you for your help