<?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: Since 4.33 - Graphic.clone() does not clone the layer - Bug? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/since-4-33-graphic-clone-does-not-clone-the-layer/m-p/1649490#M87608</link>
    <description>&lt;P&gt;Hey&lt;BR /&gt;Thanks for the info.&lt;BR /&gt;&lt;BR /&gt;Though I dont get the reason:&lt;BR /&gt;"&lt;SPAN&gt;This is because the cloned graphic is not associated with any layer.&lt;/SPAN&gt;"&lt;BR /&gt;&lt;BR /&gt;For me that sound like:&lt;BR /&gt;"The layer is not included because the layer is not included".&lt;/P&gt;</description>
    <pubDate>Wed, 10 Sep 2025 19:26:15 GMT</pubDate>
    <dc:creator>SebastianKrings</dc:creator>
    <dc:date>2025-09-10T19:26:15Z</dc:date>
    <item>
      <title>Since 4.33 - Graphic.clone() does not clone the layer - Bug?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/since-4-33-graphic-clone-does-not-clone-the-layer/m-p/1648500#M87593</link>
      <description>&lt;P&gt;We are using Graphic.clone().&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const leftGraphic = originalGraphic.clone();&lt;/LI-CODE&gt;&lt;P&gt;Since the upgrade to 4.33 the layer attribute of the cloned object is null (not undefined) while the layer is set correctly for the original graphic.&lt;/P&gt;&lt;P&gt;Prior to the update the clone also contained a valid layer.&lt;BR /&gt;&lt;SPAN&gt;This leads to problems when doing applyEdits on the clones without layer information.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Since it worked before, I assume this is a bug. Can anyone confirm that or show me further info about that? The 4.33 docs only say that clone is doing a deep copy of the graphic. So no hint the layer may is excluded.&lt;BR /&gt;Only the fact that the layer is set to null instead of undefined let me imagine this may be intended for some reason.&lt;BR /&gt;&lt;BR /&gt;My workaround is to set the layer manually:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const leftGraphic = originalGraphic.clone();
leftGraphic.layer = originalGraphic.layer;&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 08 Sep 2025 10:24:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/since-4-33-graphic-clone-does-not-clone-the-layer/m-p/1648500#M87593</guid>
      <dc:creator>SebastianKrings</dc:creator>
      <dc:date>2025-09-08T10:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Since 4.33 - Graphic.clone() does not clone the layer - Bug?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/since-4-33-graphic-clone-does-not-clone-the-layer/m-p/1649359#M87602</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;This was a breaking change introduced in version 4.33, as noted in the release notes here:&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/release-notes/#core-api-breaking-changes" target="_new" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/release-notes/#core-api-breaking-changes&lt;/A&gt;&lt;/P&gt;&lt;P&gt;To summarize:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Cloning a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#clone" target="_blank" rel="noopener"&gt;Graphic&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;no longer populates the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;layer&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;property of the cloned graphic. This is because the cloned graphic is not associated with any layer. If you need to clone a graphic and associate it with a specific layer, set the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;layer&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;property manually after cloning. This affects any workflows that result in cloned graphics, such as search result graphics.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;BR /&gt;To help address this, we’re introducing a new origin property on Graphic which will be cloned automatically. This can be used to indicate where the graphic originally came from, offering a more appropriate way to track its source. I will update you once this property is&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if you have any questions or need further clarification.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Sep 2025 15:02:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/since-4-33-graphic-clone-does-not-clone-the-layer/m-p/1649359#M87602</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2025-09-10T15:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Since 4.33 - Graphic.clone() does not clone the layer - Bug?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/since-4-33-graphic-clone-does-not-clone-the-layer/m-p/1649490#M87608</link>
      <description>&lt;P&gt;Hey&lt;BR /&gt;Thanks for the info.&lt;BR /&gt;&lt;BR /&gt;Though I dont get the reason:&lt;BR /&gt;"&lt;SPAN&gt;This is because the cloned graphic is not associated with any layer.&lt;/SPAN&gt;"&lt;BR /&gt;&lt;BR /&gt;For me that sound like:&lt;BR /&gt;"The layer is not included because the layer is not included".&lt;/P&gt;</description>
      <pubDate>Wed, 10 Sep 2025 19:26:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/since-4-33-graphic-clone-does-not-clone-the-layer/m-p/1649490#M87608</guid>
      <dc:creator>SebastianKrings</dc:creator>
      <dc:date>2025-09-10T19:26:15Z</dc:date>
    </item>
  </channel>
</rss>

