<?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: Cannot find nested sublayers in a MapImageLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-find-nested-sublayers-in-a-mapimagelayer/m-p/122624#M11454</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This should work. I would make sure that you have the correct order when searching for nested sublayers, as this has thrown me for a loop in the past. Here is a working sample that prints out nested sublayer info in the console:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://codepen.io/noash/pen/WNbWdyO" title="https://codepen.io/noash/pen/WNbWdyO"&gt;https://codepen.io/noash/pen/WNbWdyO&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using this MapServer (with a couple levels of nested sublayers):&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://sampleserver6.arcgisonline.com/arcgis/rest/services/Military/MapServer" title="https://sampleserver6.arcgisonline.com/arcgis/rest/services/Military/MapServer"&gt;Military (MapServer)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Jan 2020 22:24:21 GMT</pubDate>
    <dc:creator>Noah-Sager</dc:creator>
    <dc:date>2020-01-27T22:24:21Z</dc:date>
    <item>
      <title>Cannot find nested sublayers in a MapImageLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-find-nested-sublayers-in-a-mapimagelayer/m-p/122623#M11453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to create my own custom layer-list component with an integrated legend (I'm not using the APIs LayerList widget as I need more functionality). When trying to integrate MapImageLayers into my component, I also need to accommodate nested sublayers (sublayers within a sublayer).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However,&amp;nbsp;if I create a MapImageLayer using a service that has nested sublayers, i.e.:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let layer = new MapImageLayer(...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then retrieve the sublayer that I know has nested sublayers:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let sublayer = layer.sublayers.items[1]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then that sublayer does not have any nested sublayers, even though it should:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let nestedSublayer = sublayer.sublayers.items[0]&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead, sublayer.sublayers is null.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how/where I can find the hierarchy of the MapService when loaded into a MapImageLayer?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: Seemingly the sublayers property contain a flat collection of all sublayers in the layer (i.e. they are on the same level regardless of whether they are nested within other sublayers or not).&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Jan 2020 20:44:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-find-nested-sublayers-in-a-mapimagelayer/m-p/122623#M11453</guid>
      <dc:creator>ae</dc:creator>
      <dc:date>2020-01-26T20:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find nested sublayers in a MapImageLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-find-nested-sublayers-in-a-mapimagelayer/m-p/122624#M11454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This should work. I would make sure that you have the correct order when searching for nested sublayers, as this has thrown me for a loop in the past. Here is a working sample that prints out nested sublayer info in the console:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://codepen.io/noash/pen/WNbWdyO" title="https://codepen.io/noash/pen/WNbWdyO"&gt;https://codepen.io/noash/pen/WNbWdyO&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using this MapServer (with a couple levels of nested sublayers):&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://sampleserver6.arcgisonline.com/arcgis/rest/services/Military/MapServer" title="https://sampleserver6.arcgisonline.com/arcgis/rest/services/Military/MapServer"&gt;Military (MapServer)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2020 22:24:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-find-nested-sublayers-in-a-mapimagelayer/m-p/122624#M11454</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2020-01-27T22:24:21Z</dc:date>
    </item>
  </channel>
</rss>

