<?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: Changing the Order of Legends in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-order-of-legends/m-p/1280773#M80928</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/676486"&gt;@HHAO&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Can you please provide more information about how you are adding the layer and observing this behavior?&lt;/P&gt;&lt;P&gt;By default when using the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#add" target="_self"&gt;map.add()&lt;/A&gt; method the new layer should be added on top of the older layers as shown in this &lt;A href="https://codepen.io/sagewall/pen/YzJpQvz" target="_self"&gt;codepen&lt;/A&gt;.&amp;nbsp; The codepen initially loads with a map and one layer, then after a five second delay adds a second layer which appears at the top of the legend and layer list.&amp;nbsp; You can also set an optional index parameter in the map.add() method to explicitly specify where the new layer is added in the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers" target="_self"&gt;layers&lt;/A&gt; collection.&amp;nbsp; The order of the layers in the layers property on the map object is what determines the order of the layers displayed in the legend.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Apr 2023 15:01:34 GMT</pubDate>
    <dc:creator>Sage_Wall</dc:creator>
    <dc:date>2023-04-20T15:01:34Z</dc:date>
    <item>
      <title>Changing the Order of Legends</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-order-of-legends/m-p/1280617#M80923</link>
      <description>&lt;P&gt;When there is already a legend, I will add another layer to show the legend of this layer as the first one instead of the last one.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 03:59:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-order-of-legends/m-p/1280617#M80923</guid>
      <dc:creator>HHAO</dc:creator>
      <dc:date>2023-04-20T03:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the Order of Legends</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-order-of-legends/m-p/1280773#M80928</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/676486"&gt;@HHAO&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Can you please provide more information about how you are adding the layer and observing this behavior?&lt;/P&gt;&lt;P&gt;By default when using the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#add" target="_self"&gt;map.add()&lt;/A&gt; method the new layer should be added on top of the older layers as shown in this &lt;A href="https://codepen.io/sagewall/pen/YzJpQvz" target="_self"&gt;codepen&lt;/A&gt;.&amp;nbsp; The codepen initially loads with a map and one layer, then after a five second delay adds a second layer which appears at the top of the legend and layer list.&amp;nbsp; You can also set an optional index parameter in the map.add() method to explicitly specify where the new layer is added in the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers" target="_self"&gt;layers&lt;/A&gt; collection.&amp;nbsp; The order of the layers in the layers property on the map object is what determines the order of the layers displayed in the legend.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 15:01:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-order-of-legends/m-p/1280773#M80928</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2023-04-20T15:01:34Z</dc:date>
    </item>
  </channel>
</rss>

