<?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: How to add legend to dom element in widget in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465576#M12245</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I saw that too, but I also found this&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/jsapi/legend-amd.html" title="https://developers.arcgis.com/javascript/3/jsapi/legend-amd.html"&gt;Legend | API Reference | ArcGIS API for JavaScript 3.33&lt;/A&gt;&amp;nbsp; where feature layer is also listed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got the legend to work, I just have to figure out how to only show for 1 layer. I know there is a way, but if all else fails I will just set the unwanted legend div to display:none! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Sep 2020 20:22:37 GMT</pubDate>
    <dc:creator>FranklinAlexander</dc:creator>
    <dc:date>2020-09-04T20:22:37Z</dc:date>
    <item>
      <title>How to add legend to dom element in widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465566#M12235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have done this before without issue, but for some reason I cannot get my legend to show up in a div element I created in a widget panel. I have looked a all of the esri documentation to try and figure out what's wrong and cannot find anything, so I need some help to figure out what I am missing. I have a custom widget and I just want to show the bathymetry symbols in a legend for a bathymetry layer. Here is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; bathLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;FeatureLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;bathyUrl&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
      id&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Lakes Bathymetry"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
      infoTemplate&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; depthInfo&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
      outFields&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;addLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;bathLayer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;own&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;bathLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;on&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'load'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lang&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hitch&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;evt&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
      &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;_createLegend&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;bathLayer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
      map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setExtent&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;window&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;initExt&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
      loading&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;style&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;display &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"none"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

_createLegend&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
      &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; legendParams &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
            arrangement&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
            autoUpdate&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
            map&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; map&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
            layerInfos&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
              layer&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; layer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
              title&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Lakes Bathymetry"&lt;/SPAN&gt;
            &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
       &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
       &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; legend &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Legend&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;legendParams&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;legendDiv&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
       console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;"legend'&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; legend&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;///only 1 childNode, no legend node&lt;/SPAN&gt;
       legend&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;startup&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;       
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;div&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;id&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;legend-div&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;data-dojo-attach-point&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;legendDiv&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="style-attr language-css token"&gt;&lt;SPAN class="attr-name token"&gt; &lt;SPAN class="attr-name token"&gt;style&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;="&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="property token"&gt;margin-top&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;5px&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="property token"&gt;display&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;block&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="property token"&gt;height&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;250px&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="property token"&gt;width&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;100%&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;div&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.5pt; color: #3d3d3d;"&gt;I thought maybe it was a css issue, but I made sure the div element is set to display: block with height and width set, so that's not the issue. For some reason the legend isn't loading. I should be seeing two child nodes after logging out the legend, but I am only seeing the 'legend-div_msg' node.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.5pt; color: #3d3d3d;"&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="/legacyfs/online/506448_No Legend.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.5pt; color: #3d3d3d;"&gt;The only thing I can think of is that it is a timing/async issue, but I was under the impression that the legend used the layer render to set the legend symbols and if that's the case, the renderer exists since it is being access from the url and so the legend should have access to the symbols. Everything seems to be in order here:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.5pt; color: #3d3d3d;"&gt;&lt;IMG alt="" class="jive-emoji jive-image image-2 j-img-original" src="https://community.esri.com/legacyfs/online/506449_renderer.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Helvetica',sans-serif; color: #3d3d3d;"&gt;I have a feeling I am missing something very obvious, just can't seem to see it.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; overflow-wrap: break-word; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Helvetica',sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; overflow-wrap: break-word; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Helvetica',sans-serif; color: #3d3d3d;"&gt;Thanks!!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:39:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465566#M12235</guid>
      <dc:creator>FranklinAlexander</dc:creator>
      <dc:date>2021-12-11T20:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to add legend to dom element in widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465567#M12236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Franklin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Shouldn't your&amp;nbsp;legendParams have the map property as this.map?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2020 18:35:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465567#M12236</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-09-04T18:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to add legend to dom element in widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465568#M12237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed it to this.map and still doesn't load. I redefined this.map to just 'map' because this.map is sometimes undefined depending on scope. Having said that, both seem to be defined correctly so that doesn't seem to be the issue. This one has me stumped. The only thing I can think of is that something is wrong with the layer, but the layer loads and is visible in the map and I don't see anything in the layer properties that would raise any flags.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2020 19:12:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465568#M12237</guid>
      <dc:creator>FranklinAlexander</dc:creator>
      <dc:date>2020-09-04T19:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to add legend to dom element in widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465569#M12238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Franklin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;And you get no errors in the console?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2020 19:24:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465569#M12238</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-09-04T19:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to add legend to dom element in widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465570#M12239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wish I was getting an error, at least that would give me a direction. All I can see at this point is that if I look under the legend domNode, I should be seeing 2 childnodes, one for the main legend and one for the message, but I only see the message element. That seems to mean that the legend isn't being created (at least the main node), or it isn't creating the node which doesn't make sense. I am wandering if for some reason it can't see the renderer correctly and therefore defaults to the 'No Legend' message. I know it's not a timing issue because I just called the create legend function from within a setTimeout function and set the time until well after the graphics fully loaded, but still no legend.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2020 19:37:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465570#M12239</guid>
      <dc:creator>FranklinAlexander</dc:creator>
      <dc:date>2020-09-04T19:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to add legend to dom element in widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465571#M12240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you do &lt;STRONG&gt;NOT&lt;/STRONG&gt; provide the&amp;nbsp;layerInfos property to the legend dijit does it show all layers with their legends?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2020 19:48:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465571#M12240</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-09-04T19:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to add legend to dom element in widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465572#M12241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;I removed the layerInfos property and the legend still does not show. There is another property called 'layers', however, which now shows an array with 3 layers. 1 is the basemap, 1 is the bathymetry layer that I wish to show in the legend, and the other is a contours layer that I do NOT wish to show in the legend.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2020 20:04:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465572#M12241</guid>
      <dc:creator>FranklinAlexander</dc:creator>
      <dc:date>2020-09-04T20:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to add legend to dom element in widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465573#M12242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert, never mind, now both of the operational layers are showing, so that's progress!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2020 20:06:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465573#M12242</guid>
      <dc:creator>FranklinAlexander</dc:creator>
      <dc:date>2020-09-04T20:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to add legend to dom element in widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465574#M12243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;is there a property I can set so that only the desired layer will show up?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2020 20:07:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465574#M12243</guid>
      <dc:creator>FranklinAlexander</dc:creator>
      <dc:date>2020-09-04T20:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to add legend to dom element in widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465575#M12244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I noticed in the docs that the &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/legend-amd.html#layerinfos"&gt;layerInfos object&lt;/A&gt; layer property list two valid layer types.&lt;/P&gt;&lt;BLOCKQUOTE&gt;A layer to add to the legend. Valid layer types are: ArcGISTiledMapServiceLayer,ArcGISDynamicMapServiceLayer.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2020 20:16:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465575#M12244</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-09-04T20:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to add legend to dom element in widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465576#M12245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I saw that too, but I also found this&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/jsapi/legend-amd.html" title="https://developers.arcgis.com/javascript/3/jsapi/legend-amd.html"&gt;Legend | API Reference | ArcGIS API for JavaScript 3.33&lt;/A&gt;&amp;nbsp; where feature layer is also listed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got the legend to work, I just have to figure out how to only show for 1 layer. I know there is a way, but if all else fails I will just set the unwanted legend div to display:none! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2020 20:22:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465576#M12245</guid>
      <dc:creator>FranklinAlexander</dc:creator>
      <dc:date>2020-09-04T20:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to add legend to dom element in widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465577#M12246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add your layer as an ArcGISDynamicMapServiceLayer and then use the&amp;nbsp;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt;hideLayers property of the legends LayerInfos object.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2020 20:34:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465577#M12246</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-09-04T20:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to add legend to dom element in widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465578#M12247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I will look into that tomorrow, but I have about 14 layers in that map service and two other widgets that pull data from the same service. That may be a lot of rewriting of code which I don't want to do for one legend. I think I am close to a solution, but will let you know what I come up with. Thanks, you got me on the right track!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gene&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2020 20:44:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465578#M12247</guid>
      <dc:creator>FranklinAlexander</dc:creator>
      <dc:date>2020-09-04T20:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to add legend to dom element in widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465579#M12248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gene,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry I just noticed the issue in the code. LayerInfos is expecting an array not a single object.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;_createLegend&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
      &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; legendParams &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
            arrangement&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
            autoUpdate&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
            map&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; map&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
            layerInfos&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
              layer&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; layer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
              title&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Lakes Bathymetry"&lt;/SPAN&gt;
            &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
       &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
       &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; legend &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Legend&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;legendParams&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;legendDiv&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
       console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;"legend'&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; legend&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;///only 1 childNode, no legend node&lt;/SPAN&gt;
       legend&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;startup&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;       
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:39:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465579#M12248</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T20:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to add legend to dom element in widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465580#M12249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That fixed it! I completely missed that in the API Reference.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2020 12:47:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-legend-to-dom-element-in-widget/m-p/465580#M12249</guid>
      <dc:creator>FranklinAlexander</dc:creator>
      <dc:date>2020-09-08T12:47:24Z</dc:date>
    </item>
  </channel>
</rss>

