arcgis api for javascript 4.x, 删除绘制的点、线、面
1,在视图mapView 上添加的点线面// 删除所有mapView.graphics.removeAll();// 删除一个const pointGraphic = new Graphic({geometry, symbol})mapView.graphics.remove(pointGraphic);// 删除多个mapView.graphics.removeMany([pointGraphi
·
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]);
更多推荐

所有评论(0)