ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapTool Class / OverlayControlPositionRatio Property
Example

In This Topic
    OverlayControlPositionRatio Property
    In This Topic
    Gets or sets the position of the embeddable control on the map view as a ratio.
    Syntax
    Protected Property OverlayControlPositionRatio As Point
    protected Point OverlayControlPositionRatio {get; set;}
    Example
    How to position an embeddable control inside a MapView
    public ProSnippetMapTool()
    {
      //Set the MapTool base class' OverlayControlID to the DAML id of your embeddable control in the constructor
      OverlayControlID = "ProAppModule1_EmbeddableControl1";
    }
    
    // Override the MapTool base class' OverlayControlPositionRatio property to set the position of the embeddable control
    protected static void OnToolMouseDown(MapViewMouseButtonEventArgs e)
    {
      if (e.ChangedButton == MouseButton.Left)
        e.Handled = true;
    }
    
    // Override the MapTool base class' HandleMouseDownAsync method to set the position of the embeddable control
    protected static Task HandleMouseDownAsync(MapViewMouseButtonEventArgs e)
    {
      return QueuedTask.Run(() =>
      {
        Point
              //assign the screen coordinate clicked point to the MapTool base class' OverlayControlLocation property.
              OverlayControlPositionRatio = e.ClientPoint;
      });
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also