<?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 group web map layers in layer list by topic? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-group-web-map-layers-in-layer-list-by-topic/m-p/1066172#M73433</link>
    <description>&lt;P&gt;Thank you so much! It worked like a charm. I really appreciate it.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Jun 2021 20:40:01 GMT</pubDate>
    <dc:creator>RYANCARL</dc:creator>
    <dc:date>2021-06-08T20:40:01Z</dc:date>
    <item>
      <title>How to group web map layers in layer list by topic?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-group-web-map-layers-in-layer-list-by-topic/m-p/1065802#M73425</link>
      <description>&lt;P&gt;Hello all,&lt;BR /&gt;&lt;BR /&gt;I have created a &lt;STRONG&gt;web map&lt;/STRONG&gt; in ArcGIS Portal from multiple data sources, these are all based on regions of the USA.&amp;nbsp;I would like to have them grouped&amp;nbsp; for visual organization when the map is displayed in the &lt;STRONG&gt;ArcGIS JS&lt;/STRONG&gt; web app that I am building.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently the layer list looks like this:&lt;BR /&gt;&lt;BR /&gt;North West - Buildings&amp;nbsp;&lt;BR /&gt;North West - Harbors&amp;nbsp;&lt;BR /&gt;North West - Land&lt;BR /&gt;South West - Buildings&amp;nbsp;&lt;BR /&gt;South West - Harbors&amp;nbsp;&lt;BR /&gt;South West - Land&lt;BR /&gt;&lt;BR /&gt;I would like to have these items displayed like this:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; North West&lt;BR /&gt;North West - Buildings&amp;nbsp;&lt;BR /&gt;North West - Harbors&amp;nbsp;&lt;BR /&gt;North West - Land&lt;/P&gt;&lt;P&gt;&amp;gt; South West&amp;nbsp;&lt;BR /&gt;South West - Buildings&amp;nbsp;&lt;BR /&gt;South West - Harbors&amp;nbsp;&lt;BR /&gt;South West - Land&lt;BR /&gt;&lt;BR /&gt;I would like this to allow the user to do the usual toggle on and off of the &lt;STRONG&gt;layer list items&lt;/STRONG&gt;, but I would like them to be collapsible into the region.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This is the code that I have so far:&lt;/P&gt;&lt;PRE&gt;const webmap = new WebMap({&lt;BR /&gt;        portalItem: {&lt;BR /&gt;          id: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"&lt;BR /&gt;        }&lt;BR /&gt;      });      const view = new MapView({&lt;BR /&gt;        container: mapDiv.current,&lt;BR /&gt;        map: webmap&lt;BR /&gt;      });      view.when(function() {&lt;BR /&gt;        const layerList = new LayerList({&lt;BR /&gt;          view,&lt;BR /&gt;        });&lt;BR /&gt;        view.ui.add(layerList, 'bottom-left');&lt;BR /&gt;      });&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I have not seen an example of a &lt;STRONG&gt;"Group Layer List"&amp;nbsp;&lt;/STRONG&gt;used like this yet.&amp;nbsp;Is this possible to do with a single portal item (&lt;STRONG&gt;webmap&lt;/STRONG&gt;) that provides all of the data?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jun 2021 23:37:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-group-web-map-layers-in-layer-list-by-topic/m-p/1065802#M73425</guid>
      <dc:creator>RYANCARL</dc:creator>
      <dc:date>2021-06-07T23:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to group web map layers in layer list by topic?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-group-web-map-layers-in-layer-list-by-topic/m-p/1065847#M73426</link>
      <description>&lt;P&gt;What version of Portal are you using? If you have access to the Map Viewer Beta, (now simply the Map Viewer on the AGOL side), you can configure group layers at the map level.&lt;/P&gt;&lt;P&gt;Here's a bit of one of my maps' JSON that covers the group layers, so you can see what it looks like.&lt;/P&gt;&lt;LI-CODE lang="java"&gt;{
    "operationalLayers": [
        {
            "id": "179e9600976-layer-17",
            "title": "Group A",
            "layers": [
                {
                    "id": "179e95fd1a6-layer-16",
                    "title": "USA Protected Areas - Fee Managers",
                    "url": "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/Fee_Managers/FeatureServer/0",
                    "itemId": "b198973417044e00ab32ec23e69cbc99",
                    "layerType": "ArcGISFeatureLayer"
                },
                {
                    "id": "179e95f82d3-layer-10",
                    "title": "USA 116th Congressional Districts",
                    "url": "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/USA_116th_Congressional_Districts/FeatureServer/0",
                    "itemId": "cc6a869374434bee9fefad45e291b779",
                    "layerType": "ArcGISFeatureLayer"
                },
                {
                    "id": "179e95fc0e5-layer-15",
                    "title": "USA Federal Lands",
                    "url": "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/USA_Federal_Lands/FeatureServer/0",
                    "itemId": "5e92f2e0930848faa40480bcb4fdc44e",
                    "layerType": "ArcGISFeatureLayer"
                }
            ],
            "layerType": "GroupLayer"
        },
        {
            "id": "179e9606638-layer-18",
            "title": "Group B",
            "layers": [
                {
                    "id": "179e95f98a8-layer-13",
                    "title": "ACS Geographical Mobility Variables - Centroids - County",
                    "url": "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/ACS_Geographical_Mobility_Centroids/FeatureServer/1",
                    "itemId": "0226dc77a29049a69aecf2d6ef5246d4",
                    "layerType": "ArcGISFeatureLayer"
                },
                {
                    "id": "179e95f98a5-layer-12",
                    "title": "ACS Geographical Mobility Variables - Centroids - Tract",
                    "url": "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/ACS_Geographical_Mobility_Centroids/FeatureServer/2",
                    "itemId": "0226dc77a29049a69aecf2d6ef5246d4",
                    "layerType": "ArcGISFeatureLayer"
                },
                {
                    "id": "179e95f98a9-layer-14",
                    "title": "ACS Geographical Mobility Variables - Centroids - State",
                    "url": "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/ACS_Geographical_Mobility_Centroids/FeatureServer/0",
                    "itemId": "0226dc77a29049a69aecf2d6ef5246d4",
                    "layerType": "ArcGISFeatureLayer"
                }
            ],
            "layerType": "GroupLayer"
        }
    ],
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a handful of other posts that touch on this topic (&lt;A href="https://community.esri.com/t5/arcgis-api-for-javascript/adding-feature-layers-to-a-group-layer-in-a-layer-list-widget/m-p/288887#M26573" target="_self"&gt;this one seems both recent and relevant&lt;/A&gt;). But again, if you're using a pre-configured web map on Portal, you may as well just configure the groups there, then pull the web map in to your app.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 02:14:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-group-web-map-layers-in-layer-list-by-topic/m-p/1065847#M73426</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-06-08T02:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to group web map layers in layer list by topic?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-group-web-map-layers-in-layer-list-by-topic/m-p/1066172#M73433</link>
      <description>&lt;P&gt;Thank you so much! It worked like a charm. I really appreciate it.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 20:40:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-group-web-map-layers-in-layer-list-by-topic/m-p/1066172#M73433</guid>
      <dc:creator>RYANCARL</dc:creator>
      <dc:date>2021-06-08T20:40:01Z</dc:date>
    </item>
  </channel>
</rss>

