<?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: Running Python code to add layers form one web map to another in AGOL, in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/running-python-code-to-add-layers-form-one-web-map/m-p/1571112#M62946</link>
    <description>&lt;P&gt;Try with this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for layer in &lt;SPAN&gt;wmo1&lt;/SPAN&gt;.definition['operationalLayers']:&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; wmo2&lt;/SPAN&gt;.definition['operationalLayers'].append(layer)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;mapitem2&lt;/SPAN&gt;.update({'text': &lt;SPAN&gt;wo2&lt;/SPAN&gt;.definition})&lt;/P&gt;</description>
    <pubDate>Tue, 24 Dec 2024 10:23:10 GMT</pubDate>
    <dc:creator>Victor_Centella</dc:creator>
    <dc:date>2024-12-24T10:23:10Z</dc:date>
    <item>
      <title>Running Python code to add layers form one web map to another in AGOL,</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/running-python-code-to-add-layers-form-one-web-map/m-p/1346295#M55704</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I am running this code, in ArcGIS Pro Notebook, to copy layers from one web map to another but it fails in the last lines.&lt;/P&gt;&lt;P&gt;Any advice?&lt;/P&gt;&lt;P&gt;gis = GIS("home")&lt;/P&gt;&lt;P&gt;# select Web Maps from item id&lt;BR /&gt;mapitem1 = gis.content.get('xxxxx')&lt;BR /&gt;display(mapitem1)&lt;/P&gt;&lt;P&gt;mapitem2 = gis.content.get('yyyyy')&lt;BR /&gt;display(mapitem2)&lt;/P&gt;&lt;P&gt;# get Web Map Objects&lt;BR /&gt;from arcgis.mapping import WebMap&lt;BR /&gt;wmo1 = WebMap(mapitem1)&lt;BR /&gt;wmo2 = WebMap(mapitem2)&lt;/P&gt;&lt;P&gt;# output operational layers&lt;BR /&gt;wmo1.definition['operationalLayers']&lt;BR /&gt;wmo2.definition['operationalLayers']&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for layer in wmo1.definition.operationalLayers:&lt;BR /&gt;&amp;nbsp; wmo2.definition.operationalLayers.append(layer)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;for layer in wmo1.definition.operationalLayers:&lt;BR /&gt;&amp;nbsp; wmo2.definition['operationalLayers'].append(layer)&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 19:33:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/running-python-code-to-add-layers-form-one-web-map/m-p/1346295#M55704</guid>
      <dc:creator>SanchezNuñez</dc:creator>
      <dc:date>2023-11-06T19:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Running Python code to add layers form one web map to another in AGOL,</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/running-python-code-to-add-layers-form-one-web-map/m-p/1571112#M62946</link>
      <description>&lt;P&gt;Try with this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for layer in &lt;SPAN&gt;wmo1&lt;/SPAN&gt;.definition['operationalLayers']:&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; wmo2&lt;/SPAN&gt;.definition['operationalLayers'].append(layer)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;mapitem2&lt;/SPAN&gt;.update({'text': &lt;SPAN&gt;wo2&lt;/SPAN&gt;.definition})&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2024 10:23:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/running-python-code-to-add-layers-form-one-web-map/m-p/1571112#M62946</guid>
      <dc:creator>Victor_Centella</dc:creator>
      <dc:date>2024-12-24T10:23:10Z</dc:date>
    </item>
  </channel>
</rss>

