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]);
THE END
posted @   ZerlinM  阅读(373)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
· 写一个简单的SQL生成工具
点击右上角即可分享
微信分享提示