<?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 Layer Index in addLayer(layer, index) in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-index-in-addlayer-layer-index/m-p/1137664#M76113</link>
    <description>&lt;P&gt;I'm using the ArcGIS API for JavaScript v. 3.x and I want to us the map.addLayer(layer, index) function, however, the documentation is fairly weak.&amp;nbsp; From my experience, I believe it is the index from bottom to top of the layer in all operational layers.&amp;nbsp; However, I don't see a good function to retrieve the index of a layer.&amp;nbsp; Since I am programmatically inserting layers into the map and since I have a large number of layers, I need to be able to look up a layer by its ID and get its index.&amp;nbsp; Is there anything OOTB for this?&amp;nbsp; Also, is the index for all operational layers or just within map.layerIds or map.graphicsLayerIds?&amp;nbsp; I notice it's easier to handle in the 4.x API, so I am guessing this is a weakness in the API or my knowledge.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/3/jsapi/map-amd.html#addlayer" target="_self"&gt;https://developers.arcgis.com/javascript/3/jsapi/map-amd.html#addlayer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H4&gt;addLayer(layer, index?)&lt;/H4&gt;</description>
    <pubDate>Wed, 26 Jan 2022 22:11:55 GMT</pubDate>
    <dc:creator>NathanHeickLACSD</dc:creator>
    <dc:date>2022-01-26T22:11:55Z</dc:date>
    <item>
      <title>Layer Index in addLayer(layer, index)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-index-in-addlayer-layer-index/m-p/1137664#M76113</link>
      <description>&lt;P&gt;I'm using the ArcGIS API for JavaScript v. 3.x and I want to us the map.addLayer(layer, index) function, however, the documentation is fairly weak.&amp;nbsp; From my experience, I believe it is the index from bottom to top of the layer in all operational layers.&amp;nbsp; However, I don't see a good function to retrieve the index of a layer.&amp;nbsp; Since I am programmatically inserting layers into the map and since I have a large number of layers, I need to be able to look up a layer by its ID and get its index.&amp;nbsp; Is there anything OOTB for this?&amp;nbsp; Also, is the index for all operational layers or just within map.layerIds or map.graphicsLayerIds?&amp;nbsp; I notice it's easier to handle in the 4.x API, so I am guessing this is a weakness in the API or my knowledge.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/3/jsapi/map-amd.html#addlayer" target="_self"&gt;https://developers.arcgis.com/javascript/3/jsapi/map-amd.html#addlayer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H4&gt;addLayer(layer, index?)&lt;/H4&gt;</description>
      <pubDate>Wed, 26 Jan 2022 22:11:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-index-in-addlayer-layer-index/m-p/1137664#M76113</guid>
      <dc:creator>NathanHeickLACSD</dc:creator>
      <dc:date>2022-01-26T22:11:55Z</dc:date>
    </item>
  </channel>
</rss>

