<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Map Control for User Selection in Dialog Box or WPF Window in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/map-control-for-user-selection-in-dialog-box-or/m-p/1351533#M10720</link>
    <description>&lt;P&gt;Explore Esri ArcGIS Pro sdk community samples.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/IdentifyWithSketchTool" target="_blank"&gt;arcgis-pro-sdk-community-samples/Map-Exploration/IdentifyWithSketchTool at master · Esri/arcgis-pro-sdk-community-samples · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Nov 2023 16:25:17 GMT</pubDate>
    <dc:creator>GKmieliauskas</dc:creator>
    <dc:date>2023-11-20T16:25:17Z</dc:date>
    <item>
      <title>Map Control for User Selection in Dialog Box or WPF Window</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/map-control-for-user-selection-in-dialog-box-or/m-p/1350931#M10708</link>
      <description>&lt;P&gt;I am evaluating moving an existing ArcMap project to ArcGIS Pro.&amp;nbsp; &amp;nbsp;I need to see if there is an example of how to do this with the ArcGIS Pro SDK.&amp;nbsp; &amp;nbsp;I have a wizard in ArcMap where one of the steps is a screen display with a map with a layer for the user to select features for the particular polygon layer.&amp;nbsp; &amp;nbsp;I used the AxMapControl and AxToolbarControl to allow the user to do this selection.&amp;nbsp; &amp;nbsp;If I move it over to ArcGIS Pro, I would need to have the same capabilities.&amp;nbsp; &amp;nbsp; I was wondering if this is possible to do, or if I need to look at an additional developer api to make this work in the application.&amp;nbsp; &amp;nbsp;Is there any examples or documentation on how to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 16:46:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/map-control-for-user-selection-in-dialog-box-or/m-p/1350931#M10708</guid>
      <dc:creator>spaplanus2</dc:creator>
      <dc:date>2023-11-17T16:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Map Control for User Selection in Dialog Box or WPF Window</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/map-control-for-user-selection-in-dialog-box-or/m-p/1351073#M10711</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Take a look at these links:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-sdk-questions/arcmap-addin-migration-to-pro/td-p/809374" target="_blank"&gt;ArcMap addin migration to Pro - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-sdk-questions/arcobjects-sdk-to-arcgis-pro-sdk-conversion-guide/td-p/1050958" target="_blank"&gt;Solved: ArcObjects SDK To ArcGIS Pro SDK Conversion Guide - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;ArcGIS Pro has &lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic12546.html" target="_self"&gt;MapControl&lt;/A&gt; too.&lt;/P&gt;&lt;P&gt;Esri ArcGIS Pro sdk community samples with MapControl here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/MapControl" target="_blank"&gt;arcgis-pro-sdk-community-samples/Framework/MapControl at master · Esri/arcgis-pro-sdk-community-samples · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/MagnifierWindow" target="_blank"&gt;arcgis-pro-sdk-community-samples/Map-Exploration/MagnifierWindow at master · Esri/arcgis-pro-sdk-community-samples · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/OverviewMapControl" target="_blank"&gt;arcgis-pro-sdk-community-samples/Map-Exploration/OverviewMapControl at master · Esri/arcgis-pro-sdk-community-samples · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 20:29:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/map-control-for-user-selection-in-dialog-box-or/m-p/1351073#M10711</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-11-17T20:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Map Control for User Selection in Dialog Box or WPF Window</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/map-control-for-user-selection-in-dialog-box-or/m-p/1351249#M10715</link>
      <description>&lt;P&gt;Thank you for the suggested articles, they were helpful, but I am now stuck with how to enable the selection of an item on the map.&amp;nbsp; If I can figure out how to get something similar to the identify tool to work with the map control, then I think I have a complete path in order to get 90% of the functionality I need.&amp;nbsp; &amp;nbsp;I appreciate the help you have given me on this.&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Sun, 19 Nov 2023 05:02:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/map-control-for-user-selection-in-dialog-box-or/m-p/1351249#M10715</guid>
      <dc:creator>SusanPaplanus</dc:creator>
      <dc:date>2023-11-19T05:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Map Control for User Selection in Dialog Box or WPF Window</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/map-control-for-user-selection-in-dialog-box-or/m-p/1351533#M10720</link>
      <description>&lt;P&gt;Explore Esri ArcGIS Pro sdk community samples.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/IdentifyWithSketchTool" target="_blank"&gt;arcgis-pro-sdk-community-samples/Map-Exploration/IdentifyWithSketchTool at master · Esri/arcgis-pro-sdk-community-samples · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 16:25:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/map-control-for-user-selection-in-dialog-box-or/m-p/1351533#M10720</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-11-20T16:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Map Control for User Selection in Dialog Box or WPF Window</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/map-control-for-user-selection-in-dialog-box-or/m-p/1357763#M10818</link>
      <description>&lt;P&gt;OK, I looked at the code you suggested, which was helped a little bit further.&amp;nbsp; Now, I have the following code:&lt;/P&gt;&lt;P&gt;var uri = new Uri(out_feature_class);&amp;nbsp; // out_feature_class = 'C:\db\test.gdb\resultsInfo'&lt;BR /&gt;var featureLayerParams = new FeatureLayerCreationParams(uri);&lt;BR /&gt;FeatureLayer featureLayer = null;&lt;/P&gt;&lt;P&gt;Map currentMap = null;&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;await QueuedTask.Run(() =&amp;gt;&lt;BR /&gt;{&lt;BR /&gt;currentMap = MapFactory.Instance.CreateMap("tempMap", basemap: Basemap.None);&lt;BR /&gt;//TODO: use the map...&lt;BR /&gt;});&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;System.Diagnostics.Debug.WriteLine(ex.Message);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// now I assign the map I just created to the ViewContent of mapcontrol to display it&lt;/P&gt;&lt;P&gt;mapControl.ViewContent = MapControlContentFactory.Create(currentMap,initialExtent, MapViewingMode.Map);&lt;BR /&gt;&lt;BR /&gt;await QueuedTask.Run(() =&amp;gt;&lt;BR /&gt;{&lt;BR /&gt;featureLayer = LayerFactory.Instance.CreateLayer&amp;lt;FeatureLayer&amp;gt;(featureLayerParams, currentMap);&lt;BR /&gt;});&amp;nbsp; // to add the layer to the created map that was added to the mapcontrol&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The next step was to create a tool to allow for selecting one or more polygons from the results layer:&lt;/P&gt;&lt;P&gt;I took the code from the above example:&lt;/P&gt;&lt;P&gt;class SelectAndZoom : MapTool&lt;BR /&gt;{&lt;BR /&gt;/// &amp;lt;summary&amp;gt;&lt;BR /&gt;/// Constructor&lt;BR /&gt;/// &amp;lt;/summary&amp;gt;&lt;BR /&gt;public SelectAndZoom()&lt;BR /&gt;{&lt;BR /&gt;IsSketchTool = true;&lt;BR /&gt;SketchType = SketchGeometryType.Rectangle; // rectangle sketch tool&lt;BR /&gt;SketchOutputMode = SketchOutputMode.Screen;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/// &amp;lt;summary&amp;gt;&lt;BR /&gt;/// On sketch completion select the intersecting features and zoom&lt;BR /&gt;/// &amp;lt;/summary&amp;gt;&lt;BR /&gt;/// &amp;lt;param name="geometry"&amp;gt;&amp;lt;/param&amp;gt;&lt;BR /&gt;/// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;BR /&gt;protected override Task&amp;lt;bool&amp;gt; OnSketchCompleteAsync(Geometry geometry)&lt;BR /&gt;{&lt;BR /&gt;return QueuedTask.Run(() =&amp;gt;&lt;BR /&gt;{&lt;BR /&gt;//select features that intersect the sketch geometry&lt;BR /&gt;var selection = MapView.Active.SelectFeatures(geometry, SelectionCombinationMethod.New);&lt;/P&gt;&lt;P&gt;//zoom to selection&lt;BR /&gt;return MapView.Active.ZoomToAsync(selection, TimeSpan.FromSeconds(1.5), true);&lt;BR /&gt;});&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;However, the OnSketchCompleteAsync never executes, even if I just try to change this to be just a single point select by changing SketchType to Point and CompleteSketchOnMouseUp= true. I believe the problem is that it does not capture the map control's map view (which is defined in its own dialog box).&amp;nbsp; It appears that I need to have it attach to the mapcontrol's map or mapview, but I do see how to change it from MapView.Active to the mapControl.GetMap() or mapControl.GetMapView() or even to&amp;nbsp;mapControl.GetMapView().ToMapView().&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;I am stuck at this juncture, since all this does, including setting ActivateSelectAsync(true) in the constructor of the tool and cause the mapcontrol to pan and zoom.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 23:04:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/map-control-for-user-selection-in-dialog-box-or/m-p/1357763#M10818</guid>
      <dc:creator>SusanPaplanus</dc:creator>
      <dc:date>2023-12-06T23:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Map Control for User Selection in Dialog Box or WPF Window</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/map-control-for-user-selection-in-dialog-box-or/m-p/1357832#M10819</link>
      <description>&lt;P&gt;Take a look at &lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/blob/master/Map-Exploration/MagnifierWindow/Magnifier_MapTool.cs" target="_self"&gt;Magnifier_MapTool&lt;/A&gt; how to bind your tool to mapcontrol&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 06:25:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/map-control-for-user-selection-in-dialog-box-or/m-p/1357832#M10819</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-12-07T06:25:05Z</dc:date>
    </item>
  </channel>
</rss>

