<?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: Update Basemap Layers using another Web Map in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-basemap-layers-using-another-web-map/m-p/1506689#M10357</link>
    <description>&lt;P&gt;Thank you for this post and these examples. It aided in developing this notebook. I wanted to share in case it was useful.&amp;nbsp;&lt;A href="https://joeguzi.maps.arcgis.com/home/item.html?id=5161d7f097ae40fab7304906ad0f9e67" target="_blank" rel="noopener"&gt;ArcGIS Online Basemap Replacement Notebook Update&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jul 2024 15:20:11 GMT</pubDate>
    <dc:creator>JoeGuziStarkCountyOH</dc:creator>
    <dc:date>2024-07-18T15:20:11Z</dc:date>
    <item>
      <title>Update Basemap Layers using another Web Map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-basemap-layers-using-another-web-map/m-p/1269860#M8519</link>
      <description>&lt;P&gt;Is it possible to use the Python API to update the basemap layers of an existing web map to those of another web map?&lt;/P&gt;&lt;P&gt;For example, I have a template web map that has the base map configured as desired, and I'd like to use the Python API to iterate over several existing web maps and update the base map using the template web map.&lt;/P&gt;&lt;P&gt;Below is the code I've tried, but doesn't seem to do anything to the target web map:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcgis

# set web map ids
wmIDTarget = '...id1...'
wmIDTemplate = '...id2...'

# connect to portal
p = arcgis.GIS('https://www.arcgis.com/', 'user_name', 'user_password')

# create web map items
wmItemTarget = arcgis.mapping.WebMap(p.content.get(wmIDTarget))
wmItemTemplate = arcgis.mapping.WebMap(p.content.get(wmIDTemplate))

# get template base map layer information
templateBase = wmItemTemplate.basemap.get('baseMapLayers')

# update target web map base map layers
wmItemTarget.basemap.update({'baseMapLayers':templateBase})
wmItemTarget.basemap.update({'title':'Basemap Updated'})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 14:38:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-basemap-layers-using-another-web-map/m-p/1269860#M8519</guid>
      <dc:creator>mpboyle</dc:creator>
      <dc:date>2023-03-21T14:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Update Basemap Layers using another Web Map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-basemap-layers-using-another-web-map/m-p/1280816#M8615</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/189832"&gt;@mpboyle&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See code below, let me know if any issues.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis import GIS

## connect to the AGOL/Portal instance
p = arcgis.GIS('https://www.arcgis.com/', 'user_name', 'user_password')

## the id for the webmap to update
wmIDTarget = "...id1..."
## the id to for the webmap to get the basemap info from
wmIDTemplate = '...id2...'

## get as content items
wmTargetItem = p.content.get(wmIDTarget)
wmTemplateItem = p.content.get(wmIDTemplate)

## get basemap info from template
basemap_data = wmTemplateItem.get_data()["baseMap"]

## apply to target
target_data = wmTargetItem.get_data()
target_data["baseMap"] = basemap_data

## update target webamp
item_properties = {"text":target_data}
wmTargetItem.update(item_properties=item_properties)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 20 Apr 2023 15:48:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-basemap-layers-using-another-web-map/m-p/1280816#M8615</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2023-04-20T15:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Update Basemap Layers using another Web Map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-basemap-layers-using-another-web-map/m-p/1506689#M10357</link>
      <description>&lt;P&gt;Thank you for this post and these examples. It aided in developing this notebook. I wanted to share in case it was useful.&amp;nbsp;&lt;A href="https://joeguzi.maps.arcgis.com/home/item.html?id=5161d7f097ae40fab7304906ad0f9e67" target="_blank" rel="noopener"&gt;ArcGIS Online Basemap Replacement Notebook Update&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 15:20:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-basemap-layers-using-another-web-map/m-p/1506689#M10357</guid>
      <dc:creator>JoeGuziStarkCountyOH</dc:creator>
      <dc:date>2024-07-18T15:20:11Z</dc:date>
    </item>
  </channel>
</rss>

