<?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: Clone GraphicsOverlay in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/clone-graphicsoverlay/m-p/365669#M4343</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your approach ends into the same result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Esri.ArcGISRuntime.ArcGISRuntimeException: 'Object already owned.: Graphic cannot be added - it is already in an owning collection.'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Mar 2019 08:01:43 GMT</pubDate>
    <dc:creator>GonzaloMuöoz</dc:creator>
    <dc:date>2019-03-13T08:01:43Z</dc:date>
    <item>
      <title>Clone GraphicsOverlay</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/clone-graphicsoverlay/m-p/365666#M4340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a map and an overview map, and I'd like to have&amp;nbsp;same graphics on both maps, but when trying to assign a GraphicsOverlay to the GraphicOverlays of both maps, it returns an exception that object is already owned, because both maps have same graphics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can this be done? Can I clone or copy graphics o GraphicOverlays?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gonzalo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2019 11:13:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/clone-graphicsoverlay/m-p/365666#M4340</guid>
      <dc:creator>GonzaloMuöoz</dc:creator>
      <dc:date>2019-02-21T11:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Clone GraphicsOverlay</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/clone-graphicsoverlay/m-p/365667#M4341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gonzalo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can be done.&amp;nbsp; Each map will need to have its own GraphicsOverlay object and its own renderer object.&amp;nbsp; You can however use the same maker symbol for both renderers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2019 00:33:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/clone-graphicsoverlay/m-p/365667#M4341</guid>
      <dc:creator>ChristopherKoenig</dc:creator>
      <dc:date>2019-03-08T00:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Clone GraphicsOverlay</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/clone-graphicsoverlay/m-p/365668#M4342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MapView:GraphicsOverlays is a&amp;nbsp;GraphicsOverlayCollection which has a CopyTo method.&amp;nbsp; This would be similiar to a Clone.&amp;nbsp; You create a new array and then copy into that array and then you can assign the new&amp;nbsp;&lt;SPAN&gt;GraphicsOverlayCollection&amp;nbsp;to the overview MapView&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;LayerCollection operationalLayers &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;LayerCollection&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
Layer&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; tempLayers &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Layer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OperationalLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Count&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OperationalLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CopyTo&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tempLayers&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;foreach&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; operationalLayer &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; tempLayers&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OperationalLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Remove&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;operationalLayer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    operationalLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Add&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;operationalLayer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above is done to replace the OperationalLayers in a map, but the general idea is the same, just using GraphicOverlays.&amp;nbsp; Instead of the .Remove, .Add like above use the temp array and add them to you other MapView&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:59:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/clone-graphicsoverlay/m-p/365668#M4342</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2021-12-11T16:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: Clone GraphicsOverlay</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/clone-graphicsoverlay/m-p/365669#M4343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your approach ends into the same result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Esri.ArcGISRuntime.ArcGISRuntimeException: 'Object already owned.: Graphic cannot be added - it is already in an owning collection.'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Mar 2019 08:01:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/clone-graphicsoverlay/m-p/365669#M4343</guid>
      <dc:creator>GonzaloMuöoz</dc:creator>
      <dc:date>2019-03-13T08:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Clone GraphicsOverlay</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/clone-graphicsoverlay/m-p/365670#M4344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you'll have to copy each graphic and add it to the other graphics overlay.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's how I did it:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;CopyGraphicsButton_Click&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;object&lt;/SPAN&gt; sender&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; RoutedEventArgs e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    GraphicsOverlay go1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; MapView1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GraphicsOverlays&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FirstOrDefault&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    GraphicsOverlay go2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; MapView2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GraphicsOverlays&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FirstOrDefault&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;foreach&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Graphic g &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; go1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Graphics&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        Graphic newGraphic &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;CopyGraphic&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;g&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        go2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Graphics&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Add&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;newGraphic&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; Graphic &lt;SPAN class="token function"&gt;CopyGraphic&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Graphic inGraphic&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    Graphic copyGraphic &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Graphic&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inGraphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Geometry&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; inGraphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Attributes&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; inGraphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Symbol&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; copyGraphic&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that helps! Thad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:59:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/clone-graphicsoverlay/m-p/365670#M4344</guid>
      <dc:creator>ThadTilton</dc:creator>
      <dc:date>2021-12-11T16:59:58Z</dc:date>
    </item>
  </channel>
</rss>

