Showing Selection Rectangle

426
3
05-05-2023 08:10 AM
RussellSuter
New Contributor II

Hi all,

I'm currently running ArcGIS Pro 3.0.2.

When I use the rectangle "Select" tool in the Maps tab, a rectangle is continuously displayed and when the pointer is in the area, there are resize boxes available:

RussellSuter_0-1683299189607.png

How do I get this box in my custom tool?  My code is:

   internal class SelectByRectangleMapTool : MapTool
   {
      public SelectByRectangleMapTool()
      {
         IsSketchTool = true;
         CompleteSketchOnMouseUp = true;
         SketchType = SketchGeometryType.Rectangle;
         SketchOutputMode = SketchOutputMode.Map;
      }

      protected override Task OnToolActivateAsync(bool active)
      {
         return base.OnToolActivateAsync(active);
      }

      protected override Task<bool> OnSketchCompleteAsync(Geometry geometry)
      {
         return QueuedTask.Run(() =>
         {
            ActiveMapView.SelectFeatures(geometry);

            return true;
         });
      }
   }

I've tried a few resources like IsWYSIWG with no joy.  Any help is appreciated.



0 Kudos
3 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Just to clarify: This behavior requires the following options setting in ArcGIS Pro:

Wolf_0-1683635986434.png

I was not able to get this to work either, i passed the question on to team.   I will let you know what we find.

 

RussellSuter
New Contributor II

Hi Wolf,

Anymore info on this question?

0 Kudos
RussellSuter
New Contributor II

Is this possibly an implementation of an OverlayControl?

0 Kudos