<?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: Compose, Object Already Owned in Kotlin Maps SDK Questions</title>
    <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/compose-object-already-owned/m-p/1364888#M313</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;If you have already instantiated a FeatureLayer with a feature table, that feature table cannot be used by another instance of Feature layer, that's when you will receive Object Already Owned exception.&amp;nbsp; You can always create a new instance.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Rama&lt;/P&gt;</description>
    <pubDate>Thu, 28 Dec 2023 22:26:47 GMT</pubDate>
    <dc:creator>RamaChintapalli</dc:creator>
    <dc:date>2023-12-28T22:26:47Z</dc:date>
    <item>
      <title>Compose, Object Already Owned</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/compose-object-already-owned/m-p/1363809#M312</link>
      <description>&lt;P&gt;Hi, I'm trying to toggle between a Scene and Map using compose. I want to display the same Geodatabase feature table on the Scene or Map (2d) &amp;nbsp;when displayed. However on creating the feature layer I receive the Object already owned exception and I can't seem to free the table from the existing layers.&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;private suspend fun &lt;/SPAN&gt;&lt;SPAN&gt;loadMobileScenePackage&lt;/SPAN&gt;(tables: List&amp;lt;GeodatabaseFeatureTable&amp;gt;) {&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;// Load the Mil Symbols &lt;/SPAN&gt;&lt;SPAN&gt;TODO: move to track manager&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;val &lt;/SPAN&gt;dictionarySymbolStyle = DictionarySymbolStyle.createFromFile(&lt;SPAN&gt;styleFile&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;// Load the symbols&lt;BR /&gt;&lt;/SPAN&gt;    dictionarySymbolStyle.load().&lt;SPAN&gt;onFailure &lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;/SPAN&gt;error &lt;SPAN&gt;-&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;        Log.e(&lt;SPAN&gt;"Mapping"&lt;/SPAN&gt;, error.&lt;SPAN&gt;cause&lt;/SPAN&gt;.&lt;SPAN&gt;toString&lt;/SPAN&gt;() + &lt;SPAN&gt;": " &lt;/SPAN&gt;+ &lt;SPAN&gt;styleFile&lt;/SPAN&gt;)&lt;BR /&gt;    &lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;mobileScenePackage&lt;/SPAN&gt;.load().&lt;SPAN&gt;onSuccess &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;// update the mutable state holder with the first scene from the MobileScenePackage&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;val &lt;/SPAN&gt;scene = &lt;SPAN&gt;mobileScenePackage&lt;/SPAN&gt;.&lt;SPAN&gt;scenes&lt;/SPAN&gt;.&lt;SPAN&gt;first&lt;/SPAN&gt;()&lt;BR /&gt;&lt;BR /&gt;        &lt;SPAN&gt;// Setup the scene with the renderer and geodb features&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;        tables.&lt;SPAN&gt;forEach &lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;/SPAN&gt;ft &lt;SPAN&gt;-&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;            ...&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;            ft.load().&lt;SPAN&gt;onFailure &lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;/SPAN&gt;error &lt;SPAN&gt;-&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;                Log.e(&lt;SPAN&gt;"SVC"&lt;/SPAN&gt;, error.&lt;SPAN&gt;cause&lt;/SPAN&gt;.&lt;SPAN&gt;toString&lt;/SPAN&gt;())&lt;BR /&gt;            &lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;            &lt;SPAN&gt;val &lt;/SPAN&gt;featureLayer = FeatureLayer.createWithFeatureTable(ft)&lt;BR /&gt;            featureLayer.load().&lt;SPAN&gt;onFailure &lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;/SPAN&gt;error &lt;SPAN&gt;-&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;                Log.e(&lt;SPAN&gt;"SVC"&lt;/SPAN&gt;, error.&lt;SPAN&gt;cause&lt;/SPAN&gt;.&lt;SPAN&gt;toString&lt;/SPAN&gt;())&lt;BR /&gt;            &lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;            scene.&lt;SPAN&gt;operationalLayers&lt;/SPAN&gt;.add(featureLayer)&lt;BR /&gt;            ...&lt;BR /&gt;        &lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;_firstScene&lt;/SPAN&gt;.&lt;SPAN&gt;update &lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;/SPAN&gt;scene &lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    }&lt;/SPAN&gt;.&lt;SPAN&gt;onFailure &lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;/SPAN&gt;error &lt;SPAN&gt;-&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;      ...&lt;BR /&gt;  &lt;SPAN&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;@Composable&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;fun &lt;/SPAN&gt;&lt;SPAN&gt;createSceneViewInstance&lt;/SPAN&gt;(lifecycleOwner: LifecycleOwner, sceneViewModel: SceneViewModel = &lt;SPAN&gt;hiltViewModel&lt;/SPAN&gt;()): SceneView {&lt;BR /&gt;    &lt;SPAN&gt;val &lt;/SPAN&gt;sceneView = SceneView(&lt;SPAN&gt;LocalContext&lt;/SPAN&gt;.&lt;SPAN&gt;current&lt;/SPAN&gt;)&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;DisposableEffect&lt;/SPAN&gt;(lifecycleOwner) &lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;        lifecycleOwner.&lt;SPAN&gt;lifecycle&lt;/SPAN&gt;.addObserver(sceneView)&lt;BR /&gt;        onDispose &lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;            lifecycleOwner.&lt;SPAN&gt;lifecycle&lt;/SPAN&gt;.removeObserver(sceneView)&lt;BR /&gt;            sceneView.onDestroy(lifecycleOwner)&lt;BR /&gt;        &lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    }&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;return &lt;/SPAN&gt;sceneView&lt;BR /&gt;}&lt;/PRE&gt;&lt;/DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Dec 2023 22:34:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/compose-object-already-owned/m-p/1363809#M312</guid>
      <dc:creator>LeighWoolley</dc:creator>
      <dc:date>2023-12-21T22:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Compose, Object Already Owned</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/compose-object-already-owned/m-p/1364888#M313</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;If you have already instantiated a FeatureLayer with a feature table, that feature table cannot be used by another instance of Feature layer, that's when you will receive Object Already Owned exception.&amp;nbsp; You can always create a new instance.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Rama&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 22:26:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/compose-object-already-owned/m-p/1364888#M313</guid>
      <dc:creator>RamaChintapalli</dc:creator>
      <dc:date>2023-12-28T22:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Compose, Object Already Owned</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/compose-object-already-owned/m-p/1364898#M314</link>
      <description>&lt;P&gt;Thanks is there a correct method to destroy the feature layer or remove it from a Scene?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2023 00:07:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/compose-object-already-owned/m-p/1364898#M314</guid>
      <dc:creator>LeighWoolley</dc:creator>
      <dc:date>2023-12-29T00:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Compose, Object Already Owned</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/compose-object-already-owned/m-p/1364900#M315</link>
      <description>&lt;P&gt;You can remove the featurelayer from the operational layers list of the geomodel (i.e map or scene) to be able to use the same instance of feature layer&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2023 00:19:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/compose-object-already-owned/m-p/1364900#M315</guid>
      <dc:creator>RamaChintapalli</dc:creator>
      <dc:date>2023-12-29T00:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Compose, Object Already Owned</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/compose-object-already-owned/m-p/1380744#M341</link>
      <description>&lt;P&gt;Actually, the same issue with the Basemap -&amp;gt; one have to re-create Basemap from scratch or call Basemap.clone(). We need a better mechanism to release basemap from MapView&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2024 16:44:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/compose-object-already-owned/m-p/1380744#M341</guid>
      <dc:creator>dev4567</dc:creator>
      <dc:date>2024-02-10T16:44:51Z</dc:date>
    </item>
  </channel>
</rss>

