<?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>idea Expose layer legend utils in ArcGIS JavaScript Maps SDK Ideas</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/expose-layer-legend-utils/idi-p/1687033</link>
    <description>&lt;P&gt;Currently it is difficult to generate a custom implementation of&amp;nbsp;a&amp;nbsp;legend for a map layer without relying directly on the Legend map component/widget. To build a bespoke legend UI, an application developer typically has to:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Add significant custom logic to process a renderer into HTML for display, or&lt;/LI&gt;&lt;LI&gt;For OGC services, make additional calls to external services to obtain legend information.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;At the same time, there is clearly existing logic in the Legend view model for producing HTML (or DOM structure) for&amp;nbsp;different layer types, but this logic is not programmatically exposed&amp;nbsp;for&amp;nbsp;reuse.&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Proposed solution&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Introduce&amp;nbsp;a&amp;nbsp;set of reusable utilities (similar&amp;nbsp;in&amp;nbsp;spirit to&amp;nbsp;existing&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/references/core/symbols/support/symbolUtils/" target="_self"&gt;symbolUtils&lt;/A&gt;) to generate legend content for&amp;nbsp;a&amp;nbsp;given layer. For example a&amp;nbsp;function&amp;nbsp;that, given a&amp;nbsp;Layer&amp;nbsp;(or renderer), returns a structured or HTML representation&amp;nbsp;of&amp;nbsp;its&amp;nbsp;legend items.&lt;/P&gt;&lt;P&gt;The utility would be similar to the &lt;A href="https://developers.arcgis.com/javascript/latest/references/core/symbols/support/symbolUtils/#renderPreviewHTML" target="_self"&gt;renderPreviewHTML&lt;/A&gt; function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-02-26 at 18.06.14.png" style="width: 491px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/149008iD5154D2CA8BA0C5D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2026-02-26 at 18.06.14.png" alt="Screenshot 2026-02-26 at 18.06.14.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Feb 2026 18:06:39 GMT</pubDate>
    <dc:creator>JonathanDawe_BAS</dc:creator>
    <dc:date>2026-02-26T18:06:39Z</dc:date>
    <item>
      <title>Expose layer legend utils</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/expose-layer-legend-utils/idi-p/1687033</link>
      <description>&lt;P&gt;Currently it is difficult to generate a custom implementation of&amp;nbsp;a&amp;nbsp;legend for a map layer without relying directly on the Legend map component/widget. To build a bespoke legend UI, an application developer typically has to:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Add significant custom logic to process a renderer into HTML for display, or&lt;/LI&gt;&lt;LI&gt;For OGC services, make additional calls to external services to obtain legend information.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;At the same time, there is clearly existing logic in the Legend view model for producing HTML (or DOM structure) for&amp;nbsp;different layer types, but this logic is not programmatically exposed&amp;nbsp;for&amp;nbsp;reuse.&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Proposed solution&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Introduce&amp;nbsp;a&amp;nbsp;set of reusable utilities (similar&amp;nbsp;in&amp;nbsp;spirit to&amp;nbsp;existing&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/references/core/symbols/support/symbolUtils/" target="_self"&gt;symbolUtils&lt;/A&gt;) to generate legend content for&amp;nbsp;a&amp;nbsp;given layer. For example a&amp;nbsp;function&amp;nbsp;that, given a&amp;nbsp;Layer&amp;nbsp;(or renderer), returns a structured or HTML representation&amp;nbsp;of&amp;nbsp;its&amp;nbsp;legend items.&lt;/P&gt;&lt;P&gt;The utility would be similar to the &lt;A href="https://developers.arcgis.com/javascript/latest/references/core/symbols/support/symbolUtils/#renderPreviewHTML" target="_self"&gt;renderPreviewHTML&lt;/A&gt; function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-02-26 at 18.06.14.png" style="width: 491px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/149008iD5154D2CA8BA0C5D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2026-02-26 at 18.06.14.png" alt="Screenshot 2026-02-26 at 18.06.14.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Feb 2026 18:06:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/expose-layer-legend-utils/idi-p/1687033</guid>
      <dc:creator>JonathanDawe_BAS</dc:creator>
      <dc:date>2026-02-26T18:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Expose layer legend utils - Status changed to: Needs Clarification</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/expose-layer-legend-utils/idc-p/1687055#M512</link>
      <description>&lt;P data-unlink="true"&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/833978"&gt;@JonathanDawe_BAS&lt;/a&gt;&amp;nbsp;, Thanks for submitting this idea.&amp;nbsp; I'm hoping to get a little more information about the HTML structure desired.&amp;nbsp; Recently with the 5.0 release we have documented a lot more of the legend view model.&amp;nbsp; Could you possible take a look at the view models &lt;A href="https://developers.arcgis.com/javascript/latest/references/core/widgets/Legend/LegendViewModel/#activeLayerInfos" target="_self"&gt;activeLayerInfos&lt;/A&gt; and the newly documented&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/references/core/widgets/Legend/support/ActiveLayerInfo/" target="_self"&gt;ActiveLayerInfo&lt;/A&gt; &lt;A href="https://developers.arcgis.com/javascript/latest/references/core/widgets/Legend/support/ActiveLayerInfo/#legendElements" target="_self"&gt;legendElements&lt;/A&gt;&amp;nbsp;&amp;nbsp;they might provide the functionality you are looking for.&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/references/core/widgets/types/#LegendElement" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/references/core/widgets/types/#LegendElement&lt;/A&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;BR /&gt;If not, this sounds like a good idea if you offer a bit more detail on what you would like to see implemented and what's currently missing.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Feb 2026 18:42:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/expose-layer-legend-utils/idc-p/1687055#M512</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2026-02-26T18:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Expose layer legend utils</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/expose-layer-legend-utils/idc-p/1687629#M514</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/507049"&gt;@Sage_Wall&lt;/a&gt;&amp;nbsp;- I had completely missed this subtle addition! The new Legend Elements is most likely exactly what I was looking for - I composed this idea based on feedback pre 5.0&lt;/P&gt;&lt;P&gt;I'll go away and do some testing and see whether this meets the requirements we have!&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2026 10:47:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/expose-layer-legend-utils/idc-p/1687629#M514</guid>
      <dc:creator>JonathanDawe_BAS</dc:creator>
      <dc:date>2026-03-02T10:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Expose layer legend utils</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/expose-layer-legend-utils/idc-p/1687732#M515</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/507049"&gt;@Sage_Wall&lt;/a&gt;&amp;nbsp;- After some testing this works perfectly and provides exactly the api I was hoping for! A huge thanks to the whole Esri Development team!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Genuinely delighted &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2026 17:27:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/expose-layer-legend-utils/idc-p/1687732#M515</guid>
      <dc:creator>JonathanDawe_BAS</dc:creator>
      <dc:date>2026-03-02T17:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Expose layer legend utils - Status changed to: Already Offered</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/expose-layer-legend-utils/idc-p/1687749#M516</link>
      <description>&lt;P&gt;Awesome, I'm so glad this helped.&amp;nbsp; I'll go ahead and close down this idea for now, but I'm really happy the new public api will work for your needs.&amp;nbsp; Also very interested in seeing what you are creating if it happens to be a publicly available application or if your attending the Developers summit next week.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2026 18:06:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/expose-layer-legend-utils/idc-p/1687749#M516</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2026-03-02T18:06:28Z</dc:date>
    </item>
  </channel>
</rss>

