Part 5 - Saving, embedding and exporting the map widget¶
Saving a web map¶
Starting with the Python API version 1.3, you can save the map widget as a web map in your GIS
. This process persists the basemaps, layers added (with or without your custom symbology, including smart mapping), pop-ups, extent, and graphics drawn (with or without custom symbols) as layers in your web map
.
To save the map, call the save()
method. This method creates and returns a new Web Map Item
object. As parameters, you can specify all valid Item properties as shown below:
In [1]:
from arcgis.gis import GIS
#gis = GIS("your_online_profile")
gis=GIS()
In [2]:
world_countries_item = gis.content.get('ac80670eb213440ea5899bbf92a04998')
world_countries_layer = world_countries_item.layers[0]
world_countries_layer
Out[2]:
<FeatureLayer url:"https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/World_Countries/FeatureServer/0">
In [5]:
map1 = gis.map("USA")
map1