<?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 Python API add group layer to Web Map in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/python-api-add-group-layer-to-web-map/m-p/1307096#M70957</link>
    <description>&lt;P&gt;I would like to use the Python API to add an existing group layer feature service to a WebMap object. However, when I use the WebMap.add_layer() function, it adds every sublayer individually to the map, rather than the group layer as a whole. When I use the GUI to add the group layer feature service, it adds it as a single group, which is great. How can I do that with the Python API?&lt;/P&gt;&lt;P&gt;I saw a previous post that involved formatting the JSON structure for the group and sublayers, and generating ids for them, before adding them in the appropriate location of the maps JSON structure, which is ridiculous for such an obvious, simple task.&lt;BR /&gt;&lt;BR /&gt;Just to clarify, what I mean by "group layer" is a single Hosted Feature Layer that contains sublayers.&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jul 2023 23:20:07 GMT</pubDate>
    <dc:creator>Scoth</dc:creator>
    <dc:date>2023-07-10T23:20:07Z</dc:date>
    <item>
      <title>Python API add group layer to Web Map</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-api-add-group-layer-to-web-map/m-p/1307096#M70957</link>
      <description>&lt;P&gt;I would like to use the Python API to add an existing group layer feature service to a WebMap object. However, when I use the WebMap.add_layer() function, it adds every sublayer individually to the map, rather than the group layer as a whole. When I use the GUI to add the group layer feature service, it adds it as a single group, which is great. How can I do that with the Python API?&lt;/P&gt;&lt;P&gt;I saw a previous post that involved formatting the JSON structure for the group and sublayers, and generating ids for them, before adding them in the appropriate location of the maps JSON structure, which is ridiculous for such an obvious, simple task.&lt;BR /&gt;&lt;BR /&gt;Just to clarify, what I mean by "group layer" is a single Hosted Feature Layer that contains sublayers.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 23:20:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-api-add-group-layer-to-web-map/m-p/1307096#M70957</guid>
      <dc:creator>Scoth</dc:creator>
      <dc:date>2023-07-10T23:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Python API add group layer to Web Map</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-api-add-group-layer-to-web-map/m-p/1307128#M70958</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/650811"&gt;@Scoth&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I think this will be a good idea to post in the ideas forum.&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you mentioned, the only way I see to implement this functionality is by using the &lt;A href="https://developers.arcgis.com/web-map-specification/objects/groupLayer/" target="_self"&gt;GroupLayer&lt;/A&gt;&amp;nbsp;spec.&lt;/P&gt;&lt;P&gt;And checking out the solution from&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/284924"&gt;@RichardReinicke&lt;/a&gt;&amp;nbsp;over&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-add-group-layer-to-webmap/td-p/1112126" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Map Viewer in AGOL uses the GroupLayer.js which is different to the python sdk. The idea would be to include a python function called: WebMap.add_feature_service() or WebMap.add_layers('layers': 'layer 1, layer 2', title : 'group layer name').&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 02:14:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-api-add-group-layer-to-web-map/m-p/1307128#M70958</guid>
      <dc:creator>alex_mapintel</dc:creator>
      <dc:date>2023-07-11T02:14:53Z</dc:date>
    </item>
  </channel>
</rss>

