Select to view content in your preferred language

Clear 2D measurement graphics when using components instead of widgets

1299
10
Jump to solution
03-11-2025 10:16 AM
LMFGeospatial
Occasional Contributor

In the 4.32 SDK, the 3D measurement components have both clear and start methods - along with componentReady and destroy methods. But the 2D measurement components (both Area and Distance) only have the latter two methods - I do not see a clear or a start method. I am looking for a way to clear the graphics that are created when measuring distance/area in 2D. In the 3D sample code, it uses components; the 2D sample code is still using widgets (rather than arcgis-distance-measurement-2d or arcgis-area-measurement-2d). I already have a way to remove graphics when 2D widgets are used; I'm looking for a way to clear when using components. I already have a button in place that could do the clearing (vs clearing when the tools are no longer expanded). But I'm just not seeing the methods for the actual action.

0 Kudos
10 Replies
Noah-Sager
Esri Regular Contributor

Nice, thanks for sharing that @Edvinas_S! You beat me to it.

@EricErtl maybe you were doing what I was doing with watching the arcgisPropertyChange event. I'm not sure if you need that as part of your workflow, or if the clear button approach works. But let us know as there may be more room for improvements with events etc. and components.