<?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 Publish Pro Map as Web Map using python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-publish-pro-map-as-web-map-using-python/m-p/1211066#M7732</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/614834"&gt;@BlueBunnies&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Have you published your custom BaseMap to AGOL? See &lt;A href="https://learn.arcgis.com/en/projects/design-and-publish-basemaps/#publish-a-multiscale-basemap" target="_blank" rel="noopener"&gt;here&lt;/A&gt; for example.&lt;/P&gt;&lt;P&gt;If you create a WebMap manually in AGOL can you add your Custom BaseMap?&amp;nbsp;&lt;/P&gt;&lt;P&gt;If not, this is the first step, once its available in AGOL the automation of creating WebMaps using the BaseMap becomes easier. For me, I simply create a WebMap manually with just the Custom BaseMap, and use this as a template, add layers and tables and save as a new WebMap each time using the Python API. You can also add to a Custom BaseMap Gallery and create a new WebMap from scratch and add the Custom BaseMap. The former is just my preference.&lt;/P&gt;&lt;P&gt;The code below if the process when the Custom BaseMap is available in AGOL and a saved WebMap template. &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis import GIS
from arcgis.mapping import WebMap

## connect to AGOL
agol = GIS("home)

## get webmap item (template)
wm_item = agol.content.get("WM_ITEM_ID")

## create webmap object using webmap item
webmap = WebMap(wm_item)
###############################
## CODE TO ADD IN LAYERS/TABLES
###############################

## properties for new webmap 
properties = {
    "title" : "webmap_name",
    "snippet" : "summary",
    "tags" : "tag1,tag2,tag3"
}

## save new webmap
webmap.save(properties)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Sep 2022 09:04:35 GMT</pubDate>
    <dc:creator>Clubdebambos</dc:creator>
    <dc:date>2022-09-09T09:04:35Z</dc:date>
    <item>
      <title>How to Publish Pro Map as Web Map using python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-publish-pro-map-as-web-map-using-python/m-p/1209319#M7705</link>
      <description>&lt;P&gt;I am trying to publish a map from Pro as a Web Map to my portal.&lt;/P&gt;&lt;P&gt;The reason is that I need to create many web maps, but need to use a custom basemap that I have created. I cannot use any of the Esri basemaps at all.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked and have not been able to find any code that will allow me to publish a map document as a web map.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked into creating a web map using:&amp;nbsp; Web_Map = WebMap()&lt;/P&gt;&lt;P&gt;The issue though with that is that it will use a default Esri basemap. I cannot build it off a web map that already has the custom basemap I want.... they don't exist and will not exist. So I need to be able to set the basemap with an existing published layer... but nothing I have done is working.&lt;/P&gt;&lt;P&gt;Here is what I have tried:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;#Publish layer as service&lt;BR /&gt;BM_layer_item = BM_item.publish()&lt;BR /&gt;BM_layer_item&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;#Create Web Map instance&lt;BR /&gt;Web_Map = WebMap()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;#Add item to webmap as basemap&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Web_Map.basemap=BM_layer_item&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;#Set web map properties&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Set web_map_properties = {'title':'BaseMap1',&lt;BR /&gt;'snippet':'basemap test',&lt;BR /&gt;'tags':'test'}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;#Save web map&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;web_map_item = Web_Map.save(item_properties=web_map_properties)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;The end result is that I get a web map with an Esri basemap and not the custom basemap I was trying to set.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Can anyone help figure this out?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 19:14:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-publish-pro-map-as-web-map-using-python/m-p/1209319#M7705</guid>
      <dc:creator>BlueBunnies</dc:creator>
      <dc:date>2022-09-02T19:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to Publish Pro Map as Web Map using python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-publish-pro-map-as-web-map-using-python/m-p/1211066#M7732</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/614834"&gt;@BlueBunnies&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Have you published your custom BaseMap to AGOL? See &lt;A href="https://learn.arcgis.com/en/projects/design-and-publish-basemaps/#publish-a-multiscale-basemap" target="_blank" rel="noopener"&gt;here&lt;/A&gt; for example.&lt;/P&gt;&lt;P&gt;If you create a WebMap manually in AGOL can you add your Custom BaseMap?&amp;nbsp;&lt;/P&gt;&lt;P&gt;If not, this is the first step, once its available in AGOL the automation of creating WebMaps using the BaseMap becomes easier. For me, I simply create a WebMap manually with just the Custom BaseMap, and use this as a template, add layers and tables and save as a new WebMap each time using the Python API. You can also add to a Custom BaseMap Gallery and create a new WebMap from scratch and add the Custom BaseMap. The former is just my preference.&lt;/P&gt;&lt;P&gt;The code below if the process when the Custom BaseMap is available in AGOL and a saved WebMap template. &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis import GIS
from arcgis.mapping import WebMap

## connect to AGOL
agol = GIS("home)

## get webmap item (template)
wm_item = agol.content.get("WM_ITEM_ID")

## create webmap object using webmap item
webmap = WebMap(wm_item)
###############################
## CODE TO ADD IN LAYERS/TABLES
###############################

## properties for new webmap 
properties = {
    "title" : "webmap_name",
    "snippet" : "summary",
    "tags" : "tag1,tag2,tag3"
}

## save new webmap
webmap.save(properties)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 09:04:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-publish-pro-map-as-web-map-using-python/m-p/1211066#M7732</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2022-09-09T09:04:35Z</dc:date>
    </item>
  </channel>
</rss>

