<?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 Upper level grouping for layer list widget in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upper-level-grouping-for-layer-list-widget/m-p/12893#M1245</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm testing out the LayerList javascript widget. Is there any way to group the layers?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var layers = [
 {
 layer: new FeatureLayer("http://ourserver/arcgis/rest/services/ourcommune/commune_base/MapServer/1")
 //featureCollection: featureCollection, // required unless layerObject. If the layer is a feature collection, should match AGOL feature collection response and not have a layerObject.
 showSubLayers: true, // optional, show sublayers for this layer. Defaults to the widget's 'showSubLayers' property.
 showLegend: true, // optional, display a legend for the layer items.
 //content: , // optional, custom node to insert content. It appears below the title.
 showOpacitySlider: true, // optional, display the opacity slider for layer items.
 //button: , // optional, custom button node that will appear within the layer title.
 visibility: true, // optionally set the default visibility
 id: "Commune_Cadrillage" // optionally set the layer's id
 },
 {
 layer: new FeatureLayer("http://ourserver/arcgis/rest/services/ourcommune/commune_assn/MapServer/3")
 //featureCollection: featureCollection, // required unless layerObject. If the layer is a feature collection, should match AGOL feature collection response and not have a layerObject.
 showSubLayers: true, // optional, show sublayers for this layer. Defaults to the widget's 'showSubLayers' property.
 showLegend: true, // optional, display a legend for the layer items.
 //content: , // optional, custom node to insert content. It appears below the title.
 showOpacitySlider: true, // optional, display the opacity slider for layer items.
 //button: , // optional, custom button node that will appear within the layer title.
 visibility: true, // optionally set the default visibility
 id: "Commune_Main" // optionally set the layer's id
 }
];

var layerList = new LayerList({
 map: window.myMap,
 showLegend: true,
 showSubLayers: true,
 showOpacitySlider: true,
 layers: layers
 },"layerListDom");
 layerList.startup();&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This shows up as:&lt;/P&gt;&lt;P&gt;- Commune_Cadrillage&lt;/P&gt;&lt;P&gt;- Commune_Main&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I get this to be :&lt;/P&gt;&lt;P&gt;- Commune&lt;/P&gt;&lt;P&gt;--Commune_Cadrillage&lt;/P&gt;&lt;P&gt;--Commune_Main&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 15:54:47 GMT</pubDate>
    <dc:creator>Quynh_NhuMai</dc:creator>
    <dc:date>2021-12-12T15:54:47Z</dc:date>
    <item>
      <title>Upper level grouping for layer list widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upper-level-grouping-for-layer-list-widget/m-p/12893#M1245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm testing out the LayerList javascript widget. Is there any way to group the layers?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var layers = [
 {
 layer: new FeatureLayer("http://ourserver/arcgis/rest/services/ourcommune/commune_base/MapServer/1")
 //featureCollection: featureCollection, // required unless layerObject. If the layer is a feature collection, should match AGOL feature collection response and not have a layerObject.
 showSubLayers: true, // optional, show sublayers for this layer. Defaults to the widget's 'showSubLayers' property.
 showLegend: true, // optional, display a legend for the layer items.
 //content: , // optional, custom node to insert content. It appears below the title.
 showOpacitySlider: true, // optional, display the opacity slider for layer items.
 //button: , // optional, custom button node that will appear within the layer title.
 visibility: true, // optionally set the default visibility
 id: "Commune_Cadrillage" // optionally set the layer's id
 },
 {
 layer: new FeatureLayer("http://ourserver/arcgis/rest/services/ourcommune/commune_assn/MapServer/3")
 //featureCollection: featureCollection, // required unless layerObject. If the layer is a feature collection, should match AGOL feature collection response and not have a layerObject.
 showSubLayers: true, // optional, show sublayers for this layer. Defaults to the widget's 'showSubLayers' property.
 showLegend: true, // optional, display a legend for the layer items.
 //content: , // optional, custom node to insert content. It appears below the title.
 showOpacitySlider: true, // optional, display the opacity slider for layer items.
 //button: , // optional, custom button node that will appear within the layer title.
 visibility: true, // optionally set the default visibility
 id: "Commune_Main" // optionally set the layer's id
 }
];

var layerList = new LayerList({
 map: window.myMap,
 showLegend: true,
 showSubLayers: true,
 showOpacitySlider: true,
 layers: layers
 },"layerListDom");
 layerList.startup();&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This shows up as:&lt;/P&gt;&lt;P&gt;- Commune_Cadrillage&lt;/P&gt;&lt;P&gt;- Commune_Main&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I get this to be :&lt;/P&gt;&lt;P&gt;- Commune&lt;/P&gt;&lt;P&gt;--Commune_Cadrillage&lt;/P&gt;&lt;P&gt;--Commune_Main&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 15:54:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/upper-level-grouping-for-layer-list-widget/m-p/12893#M1245</guid>
      <dc:creator>Quynh_NhuMai</dc:creator>
      <dc:date>2021-12-12T15:54:47Z</dc:date>
    </item>
  </channel>
</rss>

