<?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: Add two layers to MapView control from same feature class in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/add-two-layers-to-mapview-control-from-same/m-p/1479826#M12737</link>
    <description>&lt;P&gt;Thank you very much for your assistance.&amp;nbsp; I was able to modify this example to get exactly what I wanted.&amp;nbsp; &amp;nbsp;I really appreciate your help.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Susan&lt;/P&gt;</description>
    <pubDate>Tue, 28 May 2024 20:58:47 GMT</pubDate>
    <dc:creator>SusanPaplanus</dc:creator>
    <dc:date>2024-05-28T20:58:47Z</dc:date>
    <item>
      <title>Add two layers to MapView control from same feature class</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/add-two-layers-to-mapview-control-from-same/m-p/1479192#M12735</link>
      <description>&lt;P&gt;I need to display upto 3 separate views of feature class that is located inside of a mobile geodatabase on a MapView.&amp;nbsp; &amp;nbsp;The feature class/dataset needs to be displayed on three separate layers, which each layer will be using a different field that is symbolized (in this case to show fire, vegetation, and drought conditions).&amp;nbsp; &amp;nbsp;I can add the first layer using:&lt;/P&gt;&lt;P&gt;featureLayer = new Esri.ArcGISRuntime.Mapping.FeatureLayer(Workspace.GetGeodatabaseFeatureTable(ActualFeatureClassName)&lt;/P&gt;&lt;P&gt;I create a classbreaks renderer, and then add the layer to the map :&lt;/P&gt;&lt;P&gt;Dispatcher.Invoke(() =&amp;gt; MainMapView.Map.OperationalLayers.Add(myLayer));&lt;/P&gt;&lt;P&gt;and it adds ok.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to create a new second layer using the same command, I get an error, "Object is already owned: Already Owned".&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the user may create one, two, or three layers (but it could be more in the future).&amp;nbsp; Is there any way to handle the case where we need to have more than one layer to be displayed off of the same feature dataset/feature class.&lt;/P&gt;&lt;P&gt;Susan&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 21:57:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/add-two-layers-to-mapview-control-from-same/m-p/1479192#M12735</guid>
      <dc:creator>SusanPaplanus</dc:creator>
      <dc:date>2024-05-27T21:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: Add two layers to MapView control from same feature class</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/add-two-layers-to-mapview-control-from-same/m-p/1479311#M12736</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You need to create new layer from scratch. I have modified ArcGIS Maps SDK sample to work without Already Owner fail. Code below:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;            #region FeatureLayer

            // Get the full path for the mobile geodatabase.
            string geodatabasePath = DataManager.GetDataFolder("e12b54ea799f4606a2712157cf9f6e41", "ContingentValuesBirdNests.geodatabase");

            // Load the geodatabase.
            Geodatabase geodatabase = await Geodatabase.OpenAsync(geodatabasePath);

            // Load the Geodatabase, GeodatabaseFeatureTable and the ContingentValuesDefinition.
            // Get the 'BirdNests' geodatabase feature table from the mobile geodatabase.
            _geodatabaseFeatureTable = geodatabase.GetGeodatabaseFeatureTable("BirdNests");

            // Asynchronously load the 'BirdNests' geodatabase feature table.
            await _geodatabaseFeatureTable.LoadAsync();

            // Asynchronously load the contingent values definition.
            await _geodatabaseFeatureTable.ContingentValuesDefinition.LoadAsync();

            // Create a FeatureLayer based on the GeoDatabaseFeatureTable.
            FeatureLayer nestLayer = new FeatureLayer(_geodatabaseFeatureTable);

            // Add the FeatureLayer to the OperationalLayers.
            MyMapView.Map.OperationalLayers.Add(nestLayer);

            try
            {
                Geodatabase geodatabase1 = await Geodatabase.OpenAsync(geodatabasePath);
                var table = geodatabase1.GetGeodatabaseFeatureTable("BirdNests");

                // Create a FeatureLayer based on the GeoDatabaseFeatureTable.
                FeatureLayer nestLayer1 = new FeatureLayer(table);

                // Add the FeatureLayer to the OperationalLayers.
                MyMapView.Map.OperationalLayers.Add(nestLayer1);
            }
            catch (Exception ex)
            {

                throw;
            }

            #endregion FeatureLayer&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 28 May 2024 07:06:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/add-two-layers-to-mapview-control-from-same/m-p/1479311#M12736</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2024-05-28T07:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Add two layers to MapView control from same feature class</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/add-two-layers-to-mapview-control-from-same/m-p/1479826#M12737</link>
      <description>&lt;P&gt;Thank you very much for your assistance.&amp;nbsp; I was able to modify this example to get exactly what I wanted.&amp;nbsp; &amp;nbsp;I really appreciate your help.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Susan&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 20:58:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/add-two-layers-to-mapview-control-from-same/m-p/1479826#M12737</guid>
      <dc:creator>SusanPaplanus</dc:creator>
      <dc:date>2024-05-28T20:58:47Z</dc:date>
    </item>
  </channel>
</rss>

