<?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: How do I select a list on a map? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-select-a-list-on-a-map/m-p/1151604#M7899</link>
    <description>&lt;P&gt;I understood what you meant, but it's still not. But thank you.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Mar 2022 08:17:46 GMT</pubDate>
    <dc:creator>DavidMrázek</dc:creator>
    <dc:date>2022-03-08T08:17:46Z</dc:date>
    <item>
      <title>How do I select a list on a map?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-select-a-list-on-a-map/m-p/1151170#M7890</link>
      <description>&lt;P&gt;Good day,&lt;BR /&gt;in my application I would like to search for some elements in the map, and then add them to the list. After going through all the elements, I would mark all the elements from the list on the map. but I don't know how to choose elements from the list.&lt;/P&gt;&lt;P&gt;Here is a code sample:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; private async Task DeletePolygonInPolygon(CancelableProgressorSource cps, uint steps, FeatureLayer polygonLayer, QueryFilter queryFilter)
        {
            await QueuedTask.Run(async () =&amp;gt;
            {
                var polyCursor = polygonLayer.Search(queryFilter);
                cps.Progressor.Max = (uint)steps;
                cps.Progressor.Message = "Probíhá ";
                List&amp;lt;Row&amp;gt; features = new List&amp;lt;Row&amp;gt;();
                while (polyCursor.MoveNext() &amp;amp;&amp;amp; !cps.Progressor.CancellationToken.IsCancellationRequested)
                {
                    cps.Progressor.Value += 1;
                    cps.Progressor.Status = cps.Progressor.Value + @" z " + cps.Progressor.Max + @" hotovo.";
                    var lineFeature = polyCursor.Current as Feature;
                    var polygonGeometry = lineFeature.GetShape() as Polygon;
                    long oid = polyCursor.Current.GetObjectID();
                    var spatialQuery = new SpatialQueryFilter()
                    { FilterGeometry = polygonGeometry, SpatialRelationship = SpatialRelationship.Within };
                    spatialQuery.WhereClause = "OBJECTID &amp;lt;&amp;gt; " + oid;
                    
                    var rowCursor = polygonLayer.Search(spatialQuery);
                    while (rowCursor.MoveNext())
                    {
                        features.Add(rowCursor.Current);
                    }
                }
                mv.Map.SetSelection(features);//here I dont know,how to write it
                object[] listOfPara = { polygonLayer };
                await StartATask("management.DeleteFeatures", listOfPara);
            }, cps.Progressor);
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 08:58:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-select-a-list-on-a-map/m-p/1151170#M7890</guid>
      <dc:creator>DavidMrázek</dc:creator>
      <dc:date>2022-03-07T08:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select a list on a map?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-select-a-list-on-a-map/m-p/1151306#M7892</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can select direct from layer:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;await QueuedTask.Run(async () =&amp;gt;
{
    polygonLayer.Select(queryFilter, SelectionCombinationMethod.New);
    object[] listOfPara = { polygonLayer };
    await StartATask("management.DeleteFeatures", listOfPara);
}, cps.Progressor);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 15:41:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-select-a-list-on-a-map/m-p/1151306#M7892</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2022-03-07T15:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select a list on a map?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-select-a-list-on-a-map/m-p/1151596#M7897</link>
      <description>&lt;P&gt;Thanks for the advice, but this code definitely won't display the list.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 07:31:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-select-a-list-on-a-map/m-p/1151596#M7897</guid>
      <dc:creator>DavidMrázek</dc:creator>
      <dc:date>2022-03-08T07:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select a list on a map?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-select-a-list-on-a-map/m-p/1151600#M7898</link>
      <description>&lt;P&gt;Sorry. I think you will understand that you can select layer by query directly. Full code for your realization could be like this:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private async Task DeletePolygonInPolygon(CancelableProgressorSource cps, uint steps, FeatureLayer polygonLayer, QueryFilter queryFilter)
        {
            await QueuedTask.Run(async () =&amp;gt;
            {
                polygonLayer.ClearSelection();
                var polyCursor = polygonLayer.Search(queryFilter);
                cps.Progressor.Max = (uint)steps;
                cps.Progressor.Message = "Probíhá ";
                List&amp;lt;Row&amp;gt; features = new List&amp;lt;Row&amp;gt;();
                while (polyCursor.MoveNext() &amp;amp;&amp;amp; !cps.Progressor.CancellationToken.IsCancellationRequested)
                {
                    cps.Progressor.Value += 1;
                    cps.Progressor.Status = cps.Progressor.Value + @" z " + cps.Progressor.Max + @" hotovo.";
                    var lineFeature = polyCursor.Current as Feature;
                    var polygonGeometry = lineFeature.GetShape() as Polygon;
                    long oid = polyCursor.Current.GetObjectID();
                    var spatialQuery = new SpatialQueryFilter()
                    { FilterGeometry = polygonGeometry, SpatialRelationship = SpatialRelationship.Within };
                    spatialQuery.WhereClause = "OBJECTID &amp;lt;&amp;gt; " + oid;
                    
                    polygonLayer.Select(spatialQuery, SelectionCombinationMethod.Add);
                }
                object[] listOfPara = { polygonLayer };
                await StartATask("management.DeleteFeatures", listOfPara);
            }, cps.Progressor);
        }&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 08 Mar 2022 07:54:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-select-a-list-on-a-map/m-p/1151600#M7898</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2022-03-08T07:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select a list on a map?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-select-a-list-on-a-map/m-p/1151604#M7899</link>
      <description>&lt;P&gt;I understood what you meant, but it's still not. But thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 08:17:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-select-a-list-on-a-map/m-p/1151604#M7899</guid>
      <dc:creator>DavidMrázek</dc:creator>
      <dc:date>2022-03-08T08:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select a list on a map?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-select-a-list-on-a-map/m-p/1151607#M7900</link>
      <description>&lt;P&gt;I'm sorry, you were right, it's correct and functional, I didn't notice that I was already rewriting things in the code ... Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 08:31:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-select-a-list-on-a-map/m-p/1151607#M7900</guid>
      <dc:creator>DavidMrázek</dc:creator>
      <dc:date>2022-03-08T08:31:18Z</dc:date>
    </item>
  </channel>
</rss>

