<?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: ArcGIS Pro SDK add FeatureLayer to map in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-add-featurelayer-to-map/m-p/1330201#M10420</link>
    <description>&lt;P&gt;Does this automatically add the copied layer to the current map? Accrding to ChatGPT, it does not but every suggestion it has is wrong,&amp;nbsp;i.e.,&amp;nbsp;&lt;SPAN&gt;map.AddLayer(copiedLayer); as Class Map does not have a AddLayer method. Same goes for MapView.Add. etc.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Sep 2023 15:42:47 GMT</pubDate>
    <dc:creator>CarlosPiccirillo2</dc:creator>
    <dc:date>2023-09-19T15:42:47Z</dc:date>
    <item>
      <title>ArcGIS Pro SDK add FeatureLayer to map</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-add-featurelayer-to-map/m-p/867475#M5015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know this is a very simple question, however, I find it difficult to find an answer. How do I add an existing layer to my map using ArcGIS Pro SDK? I saw several examples where the layer is added while being created (for example&lt;/P&gt;&lt;PRE style="color: #24292e; background-color: #f6f8fa; padding: 16px;"&gt;&lt;SPAN class="" style="color: #24292e;"&gt;LayerFactory&lt;/SPAN&gt;.&lt;SPAN class="" style="color: #24292e;"&gt;Instance&lt;/SPAN&gt;.&lt;SPAN class="" style="color: #6f42c1;"&gt;CreateFeatureLayer&lt;/SPAN&gt;(&lt;SPAN class="" style="color: #d73a49;"&gt;new&lt;/SPAN&gt; &lt;SPAN class="" style="color: #6f42c1;"&gt;Uri&lt;/SPAN&gt;(&lt;SPAN class="" style="color: #24292e;"&gt;strUri&lt;/SPAN&gt;), &lt;SPAN class="" style="color: #24292e;"&gt;map&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;), however, how this is being done&amp;nbsp;using the existing FeatureLayer?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2020 17:34:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-add-featurelayer-to-map/m-p/867475#M5015</guid>
      <dc:creator>FilipKuzman</dc:creator>
      <dc:date>2020-05-18T17:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK add FeatureLayer to map</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-add-featurelayer-to-map/m-p/867476#M5016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

 int indexNumber = 0;
&amp;nbsp;shp_path = "C:\path to your shapefile"
 var mapView = MapView.Active;

 if (mapView != null)//Check if there is a map
 {
 &amp;nbsp;&amp;nbsp;&amp;nbsp;System.Uri shp_uri = new System.Uri(@shp_path); //creating uri for the shpfile
 &amp;nbsp;&amp;nbsp;&amp;nbsp;QueuedTask.Run(() =&amp;gt;
 &amp;nbsp;&amp;nbsp;&amp;nbsp;{
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Layer shp_layer = LayerFactory.Instance.CreateLayer(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;shp_uri, mapView.Map, indexNumber, "YourlayerName");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var selectedLayer = mapView.GetSelectedLayers()[0] as FeatureLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//Do something with selected layer
 &amp;nbsp;&amp;nbsp;&amp;nbsp;});
 }


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:48:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-add-featurelayer-to-map/m-p/867476#M5016</guid>
      <dc:creator>Amadeus111</dc:creator>
      <dc:date>2021-12-12T10:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK add FeatureLayer to map</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-add-featurelayer-to-map/m-p/867477#M5017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you already have a reference to your Layer, try using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;LayerFactory.Instance.CopyLayer(sourceLayer, map);&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2020 20:15:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-add-featurelayer-to-map/m-p/867477#M5017</guid>
      <dc:creator>serbanmarin1</dc:creator>
      <dc:date>2020-05-19T20:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK add FeatureLayer to map</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-add-featurelayer-to-map/m-p/867478#M5018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you guys,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have succeeded with Serban's answer. That is what I was looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 May 2020 16:11:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-add-featurelayer-to-map/m-p/867478#M5018</guid>
      <dc:creator>FilipKuzman</dc:creator>
      <dc:date>2020-05-24T16:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK add FeatureLayer to map</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-add-featurelayer-to-map/m-p/1205688#M8640</link>
      <description>&lt;P&gt;If you have a featureclass:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var layerParams = new FeatureLayerCreationParams(fc);
var layer = LayerFactory.Instance.CreateLayer&amp;lt;FeatureLayer&amp;gt;(layerParams, MapView.Active.Map);&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Aug 2022 05:43:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-add-featurelayer-to-map/m-p/1205688#M8640</guid>
      <dc:creator>DavidWilton</dc:creator>
      <dc:date>2022-08-24T05:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK add FeatureLayer to map</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-add-featurelayer-to-map/m-p/1330201#M10420</link>
      <description>&lt;P&gt;Does this automatically add the copied layer to the current map? Accrding to ChatGPT, it does not but every suggestion it has is wrong,&amp;nbsp;i.e.,&amp;nbsp;&lt;SPAN&gt;map.AddLayer(copiedLayer); as Class Map does not have a AddLayer method. Same goes for MapView.Add. etc.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 15:42:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-add-featurelayer-to-map/m-p/1330201#M10420</guid>
      <dc:creator>CarlosPiccirillo2</dc:creator>
      <dc:date>2023-09-19T15:42:47Z</dc:date>
    </item>
  </channel>
</rss>

