<?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: legendElements is empty for FeatureLayers in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legendelements-is-empty-for-featurelayers/m-p/1550591#M85926</link>
    <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; to unique value groups.&amp;nbsp; Sorry about the confusion around legendElements, I guess that is documented...&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Oct 2024 19:22:46 GMT</pubDate>
    <dc:creator>Sage_Wall</dc:creator>
    <dc:date>2024-10-21T19:22:46Z</dc:date>
    <item>
      <title>legendElements is empty for FeatureLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legendelements-is-empty-for-featurelayers/m-p/1550358#M85917</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a Legend in v4.30 which works fine, it is based on a Map with multiple FeatureLayers.&lt;/P&gt;&lt;P&gt;I am trying to modify the Legend by updating the legendElements (I have duplicate symbology with same title and I want to merge them) but when displaying activeLayerInfos I can see my list of layers but legendElements is always empty.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this a classic behavior with FeatureLayer or am I missing something?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 07:57:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legendelements-is-empty-for-featurelayers/m-p/1550358#M85917</guid>
      <dc:creator>LittleTurtle</dc:creator>
      <dc:date>2024-10-21T07:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: legendElements is empty for FeatureLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legendelements-is-empty-for-featurelayers/m-p/1550392#M85920</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/800805"&gt;@LittleTurtle&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;legendOptions is not part of the public API and shouldn't be used in this way.&amp;nbsp; If you want to control the layer's that are displayed in the Legend take a look at the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#legendEnabled" target="_self"&gt;legendEnabled&lt;/A&gt; property on the layer or the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#layerInfos" target="_self"&gt;layerInfos&lt;/A&gt; property on the Legend. They are both part of the public API.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 11:14:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legendelements-is-empty-for-featurelayers/m-p/1550392#M85920</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2024-10-21T11:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: legendElements is empty for FeatureLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legendelements-is-empty-for-featurelayers/m-p/1550489#M85921</link>
      <description>&lt;P&gt;Thank you for your response&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/507049"&gt;@Sage_Wall&lt;/a&gt;, I saw &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#legendElements" target="_self"&gt;legendElements&lt;/A&gt;&lt;SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#legendElements" target="_self"&gt;&amp;nbsp;&lt;/A&gt;in the documentation that's why I thought it could be a solution but it must be readonly only&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So my problem is that I am not able to reproduce the behavior I had with the v3 API which is that when the symbol and label are the same for 2 values (for example for a list of &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-UniqueValueInfo.html" target="_self"&gt;UniqueValuInfo&lt;/A&gt;) it is only displayed once in the legend, in v4 it is displayed twice.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 15:28:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legendelements-is-empty-for-featurelayers/m-p/1550489#M85921</guid>
      <dc:creator>LittleTurtle</dc:creator>
      <dc:date>2024-10-21T15:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: legendElements is empty for FeatureLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legendelements-is-empty-for-featurelayers/m-p/1550539#M85923</link>
      <description>&lt;P&gt;If I'm understanding this correctly, and you're using a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html" target="_self"&gt;UniqueValueRenderer&lt;/A&gt;, then using &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueGroups" target="_self"&gt;uniqueValueGroups&lt;/A&gt; rather than &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos" target="_self"&gt;uniqueValueInfos&lt;/A&gt; might solve this problem.&amp;nbsp; &amp;nbsp;This was a fairly recent addition that didn't make it into 3.x at the time. As it says in the documentation, "&lt;SPAN&gt;&lt;EM&gt;Unique value groups also allow you to combine or merge multiple unique values to a single class so they are represented by one symbol and one label.&lt;/EM&gt;"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 17:15:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legendelements-is-empty-for-featurelayers/m-p/1550539#M85923</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2024-10-21T17:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: legendElements is empty for FeatureLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legendelements-is-empty-for-featurelayers/m-p/1550591#M85926</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; to unique value groups.&amp;nbsp; Sorry about the confusion around legendElements, I guess that is documented...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 19:22:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legendelements-is-empty-for-featurelayers/m-p/1550591#M85926</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2024-10-21T19:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: legendElements is empty for FeatureLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legendelements-is-empty-for-featurelayers/m-p/1550867#M85930</link>
      <description>&lt;P&gt;Ok thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6522"&gt;@JoelBennett&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/507049"&gt;@Sage_Wall&lt;/a&gt;, I think&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueGroups" target="_self" rel="nofollow noopener noreferrer"&gt;uniqueValueGroups&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;is indeed the solution.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We are using a JSON config file but I'm having some trouble&amp;nbsp; to make it work ;&amp;nbsp; the legend works great now but my layer does not show on the map (everything shows up as defaultSymbol):&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;...&lt;BR /&gt;"render"&l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/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;      &lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;      &lt;SPAN&gt;255&lt;BR /&gt;&lt;/SPAN&gt;    ]&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;"size"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;24&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;"outline"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;{&lt;BR /&gt;      &lt;SPAN&gt;"color"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;[&lt;BR /&gt;        &lt;SPAN&gt;100&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;100&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;100&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;255&lt;BR /&gt;&lt;/SPAN&gt;      ]&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;      &lt;SPAN&gt;"width"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;BR /&gt;&lt;/SPAN&gt;    }&lt;BR /&gt;  }&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;  &lt;SPAN&gt;"uniqueValueGroups"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;[&lt;BR /&gt;    {&lt;BR /&gt;      &lt;SPAN&gt;"heading"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;" "&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;      &lt;SPAN&gt;"classes"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;[&lt;BR /&gt;        {&lt;BR /&gt;          &lt;SPAN&gt;"label"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"OK"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;          &lt;SPAN&gt;"values"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;[&lt;BR /&gt;            {&lt;BR /&gt;              &lt;SPAN&gt;"value"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"OK"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;              &lt;SPAN&gt;"value2"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"value1"&lt;BR /&gt;&lt;/SPAN&gt;            }&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;            {&lt;BR /&gt;              &lt;SPAN&gt;"value"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"OK"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;              &lt;SPAN&gt;"value2"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"value2"&lt;BR /&gt;&lt;/SPAN&gt;            }&lt;BR /&gt;          ]&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;          &lt;SPAN&gt;"symbol"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;{&lt;BR /&gt;            &lt;SPAN&gt;"type"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"esriSMS"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;            &lt;SPAN&gt;"style"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"esriSMSCircle"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;            &lt;SPAN&gt;"color"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;[&lt;BR /&gt;              &lt;SPAN&gt;50&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;              &lt;SPAN&gt;200&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;              &lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;              &lt;SPAN&gt;255&lt;BR /&gt;&lt;/SPAN&gt;            ]&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;            &lt;SPAN&gt;"outline"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;{&lt;BR /&gt;              &lt;SPAN&gt;"color"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;[&lt;BR /&gt;                &lt;SPAN&gt;10&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;                &lt;SPAN&gt;10&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;                &lt;SPAN&gt;10&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;                &lt;SPAN&gt;255&lt;BR /&gt;&lt;/SPAN&gt;              ]&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;              &lt;SPAN&gt;"width"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;BR /&gt;&lt;/SPAN&gt;            }&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;            &lt;SPAN&gt;"size"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;24&lt;BR /&gt;&lt;/SPAN&gt;          }&lt;BR /&gt;        }&lt;BR /&gt;      ]&lt;BR /&gt;    }&lt;SPAN&gt;,&lt;BR /&gt;...&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;I have found this &lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/renderer-objects/" target="_self"&gt;documentation&lt;/A&gt;&amp;nbsp;but it does not cover univalueGroups&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 22 Oct 2024 13:33:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legendelements-is-empty-for-featurelayers/m-p/1550867#M85930</guid>
      <dc:creator>LittleTurtle</dc:creator>
      <dc:date>2024-10-22T13:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: legendElements is empty for FeatureLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legendelements-is-empty-for-featurelayers/m-p/1551131#M85939</link>
      <description>&lt;P&gt;You'll probably have better luck looking at &lt;A href="https://developers.arcgis.com/web-map-specification/objects/uniqueValueRenderer/" target="_self"&gt;the documentation for UniqueValueRenderer&lt;/A&gt; under the Web Map Specification.&lt;/P&gt;&lt;P&gt;This is not the first time this has come up (&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-with-using-unique-value-groups-with-field/m-p/1324590/highlight/true#M82132" target="_self"&gt;example&lt;/A&gt;)...it would be good if the SDK documentation could link to it or something.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 23:12:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legendelements-is-empty-for-featurelayers/m-p/1551131#M85939</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2024-10-22T23:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: legendElements is empty for FeatureLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legendelements-is-empty-for-featurelayers/m-p/1551169#M85942</link>
      <description>&lt;P&gt;Yes it is what I was looking for, it is working fine now, thank you for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 07:54:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legendelements-is-empty-for-featurelayers/m-p/1551169#M85942</guid>
      <dc:creator>LittleTurtle</dc:creator>
      <dc:date>2024-10-23T07:54:28Z</dc:date>
    </item>
  </channel>
</rss>

