<?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 MapImageLayer Graphic's layer is null in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-graphic-s-layer-is-null/m-p/1381483#M83629</link>
    <description>&lt;P&gt;In my application, I have some custom logic that runs when layers are added to / removed from the scene. One such piece of logic involves checking whether features in the popup are from the removed layer. My existing (and working) code is basically this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (feature.layer.id === removedLayer.id) {
  // logic here
}&lt;/LI-CODE&gt;&lt;P&gt;However, after we added a map image layer to the scene, this logic causes an error, because for map image layer features in the popup, the Graphic object's layer field is null, instead of being the MapImageLayer instance, which is the case for most other layers (FeatureLayer, GraphicsLayer, SceneLayer etc). Inspecting the Browser Debugger, I instead see an undocumented sourceLayer property in the Graphic object that correctly points to the MapImageLayer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this intended? Would it be possible to make MapImageLayer consistent with the rest of the layers so i wouldn't need to special-case this?&lt;/P&gt;</description>
    <pubDate>Tue, 13 Feb 2024 09:59:16 GMT</pubDate>
    <dc:creator>average_geo_97</dc:creator>
    <dc:date>2024-02-13T09:59:16Z</dc:date>
    <item>
      <title>MapImageLayer Graphic's layer is null</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-graphic-s-layer-is-null/m-p/1381483#M83629</link>
      <description>&lt;P&gt;In my application, I have some custom logic that runs when layers are added to / removed from the scene. One such piece of logic involves checking whether features in the popup are from the removed layer. My existing (and working) code is basically this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (feature.layer.id === removedLayer.id) {
  // logic here
}&lt;/LI-CODE&gt;&lt;P&gt;However, after we added a map image layer to the scene, this logic causes an error, because for map image layer features in the popup, the Graphic object's layer field is null, instead of being the MapImageLayer instance, which is the case for most other layers (FeatureLayer, GraphicsLayer, SceneLayer etc). Inspecting the Browser Debugger, I instead see an undocumented sourceLayer property in the Graphic object that correctly points to the MapImageLayer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this intended? Would it be possible to make MapImageLayer consistent with the rest of the layers so i wouldn't need to special-case this?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 09:59:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-graphic-s-layer-is-null/m-p/1381483#M83629</guid>
      <dc:creator>average_geo_97</dc:creator>
      <dc:date>2024-02-13T09:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: MapImageLayer Graphic's layer is null</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-graphic-s-layer-is-null/m-p/1381677#M83630</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/666603"&gt;@average_geo_97&lt;/a&gt;,&amp;nbsp;thanks for posting your question here. MapImageLayer is a bit different from other layer types. Typically, you'll want to work with &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers" target="_self"&gt;Sublayers.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Can you share a simplified repro app that shows what's happening?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 16:53:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-graphic-s-layer-is-null/m-p/1381677#M83630</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2024-02-13T16:53:37Z</dc:date>
    </item>
  </channel>
</rss>

