AnsweredAssumed Answered

Toolkit 100.x - MeasureToolbar - Programmatically Clearing Feature Selection

Question asked by williamknapp on Jul 24, 2018
Latest reply on Jul 24, 2018 by JNery-esristaff

In adapting an ArcEngine-based program to ArcGIS Runtime, the Toolkit has been handy in providing a nice implementation for the Measure tool and Compass capability that was present before.  In our case, when we're purposefully hiding the MeasureToolbar, we want to ensure that whatever the user was doing is not visible anymore.  The MeasureToolbar makes its SketchEditors for the Length and Area measurement available through LineSketchEditor and AreaSketchEditor, so it's possible to just call ClearGeometry() on those, or just use the MapView's SketchEditor's ClearGeometry() method.

 

On the other hand, the Feature measurement option works a bit differently.  I took a peek at the code, and it appears to create a GraphicsOverlay upon demand and add it to the MapView whenever the user first selects a feature.  The problem is that there appears to be no simple way to make changes to this GraphicsOverlay without either rudimentary determinations or more complex determinations to ensure you know which GraphicsOverlay is the correct one.  Fortunately, in our case, we don't add GraphicsOverlays to the MapView, so it's always the first one -- if any exist.

 

Ultimately, what I'm wondering is if it's possible to either:

  1. Retrieve the specific GraphicsOverlay that the MeasureToolbar uses.
  2. Request that the MeasureToolbar execute the same functionality as pressing the Clear button.

 

To note, we're using 100.2.1-beta3, but I've also tested 100.3.0-beta4 to see if it has any fixes to lingering feature selections, and I don't see anything with a cursory glance and some test runs.

Outcomes