<?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 How can I get the renderer for a MapImageLayer sublayer? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-get-the-renderer-for-a-mapimagelayer/m-p/1251024#M80039</link>
    <description>&lt;P&gt;I am building a custom legend and I need to get the renderers for&amp;nbsp;MapImageLayer sublayers. I see renderer under layer.allSublayers._items[1].renderer, but for some reason it is null. See the console for &lt;A href="https://codepen.io/mstayner/pen/QWBmmVr" target="_self"&gt;this codepen&lt;/A&gt;&amp;nbsp;to see what I mean.&lt;/P&gt;&lt;P&gt;So how can I get the renderer for each sublayer show I can show the correct symbol in my legend?&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jan 2023 20:56:00 GMT</pubDate>
    <dc:creator>MattStayner</dc:creator>
    <dc:date>2023-01-24T20:56:00Z</dc:date>
    <item>
      <title>How can I get the renderer for a MapImageLayer sublayer?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-get-the-renderer-for-a-mapimagelayer/m-p/1251024#M80039</link>
      <description>&lt;P&gt;I am building a custom legend and I need to get the renderers for&amp;nbsp;MapImageLayer sublayers. I see renderer under layer.allSublayers._items[1].renderer, but for some reason it is null. See the console for &lt;A href="https://codepen.io/mstayner/pen/QWBmmVr" target="_self"&gt;this codepen&lt;/A&gt;&amp;nbsp;to see what I mean.&lt;/P&gt;&lt;P&gt;So how can I get the renderer for each sublayer show I can show the correct symbol in my legend?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 20:56:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-get-the-renderer-for-a-mapimagelayer/m-p/1251024#M80039</guid>
      <dc:creator>MattStayner</dc:creator>
      <dc:date>2023-01-24T20:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the renderer for a MapImageLayer sublayer?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-get-the-renderer-for-a-mapimagelayer/m-p/1251038#M80040</link>
      <description>&lt;P&gt;The documentation for the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#renderer" target="_self"&gt;Sublayer.renderer&lt;/A&gt; property seems to suggest that the property only exists for the purpose of overriding symbology, and thus doesn't contain the default symbology.&amp;nbsp; This makes sense since the &lt;A href="https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer?f=pjson" target="_self"&gt;service information&lt;/A&gt; used to load your MapImageLayer doesn't contain sublayer renderer information.&amp;nbsp; For that, you have to look at the information from the individual layers (e.g. &lt;A href="https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0?f=pjson" target="_self"&gt;layer 0&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;Therefore, I suppose you have two options for your legend.&amp;nbsp; You can retrieve the information for each sublayer manually, or you could retrieve &lt;A href="https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/legend?f=pjson" target="_self"&gt;the layer's legend information&lt;/A&gt; and use that instead.&amp;nbsp; It doesn't contain the renderer information, but does contain the swatches you could put in your legend.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 21:26:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-get-the-renderer-for-a-mapimagelayer/m-p/1251038#M80040</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-01-24T21:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the renderer for a MapImageLayer sublayer?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-get-the-renderer-for-a-mapimagelayer/m-p/1251046#M80041</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6522"&gt;@JoelBennett&lt;/a&gt;&amp;nbsp;Ah, that makes sense now. The Sublayer.renderer doesn't contain the renderer information for the layer, but rather, the overriding renderer.&lt;/P&gt;&lt;P&gt;I'm going to use &lt;STRONG&gt;/legend&lt;/STRONG&gt; endpoint. For me, that is even better than having the renderer. I just need the image to show in my legend. That will be perfect. Thanks a million!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 21:44:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-get-the-renderer-for-a-mapimagelayer/m-p/1251046#M80041</guid>
      <dc:creator>MattStayner</dc:creator>
      <dc:date>2023-01-24T21:44:25Z</dc:date>
    </item>
  </channel>
</rss>

