arcgis api for javascript 4.x, 删除绘制的点、线、面

1,在视图mapView 上添加的点线面

// 删除所有
mapView.graphics.removeAll();

// 删除一个
const pointGraphic = new Graphic({
     geometry, symbol})
mapView.graphics.remove(pointGraphic);

// 删除多个
mapView.graphics.removeMany([pointGraphic, polylineGraphic]);

2, GraphicsLayer图层上的点线面

const pointGraphicLayer= new GraphicsLayer();  // 图层

// 删除所有
pointGraphicLayer.removeAll();

// 删除一个
const pointGraphic = new Graphic({
     geometry, symbol})
pointGraphicLayer.remove(pointGraphic);

// 删除多个
pointGraphicLayer.removeMany([pointGraphic, polylineGraphic]);

你可能感兴趣的:(ArcGis,Api,For,JavaScript,arcgis,for,Js)