add own basemap to web map

654
2
Jump to solution
04-27-2022 12:22 AM
MichaelNüßlein
New Contributor III

Hi, trying to add a service as basemap to a web map with python (manually i can do this analogue screenshot  below).  

Unbenannt.PNG

Unfortunately i don't find any example how to do this. 

thanks for any help.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MichaelNüßlein
New Contributor III

I found a solution by further testing:

wm = WebMap()
wm.basemap.clear()
wm.basemap.baseMapLayers[0].clear()
webAtlasDe = '{"id": "WebAtlasDE_1637","layerType": "ArcGISTiledImageServiceLayer","url": "https://myserver.de/arcgis/rest/services/WebAtlasDE/ImageServer","visibility": true,"opacity": 1,"title": "WebAtlasDE"}'
wm.basemap.baseMapLayers[0].update(json.loads(webAtlasDe))
wm.basemap.update({'title':'WebAtlasDE'})
webmap_item_properties = {'title':'WebAtlasDE', 'snippet':license_text, 'tags':['basemaps'}
service = wm.save(webmap_item_properties)

View solution in original post

0 Kudos
2 Replies
MichaelNüßlein
New Contributor III

I found a solution by further testing:

wm = WebMap()
wm.basemap.clear()
wm.basemap.baseMapLayers[0].clear()
webAtlasDe = '{"id": "WebAtlasDE_1637","layerType": "ArcGISTiledImageServiceLayer","url": "https://myserver.de/arcgis/rest/services/WebAtlasDE/ImageServer","visibility": true,"opacity": 1,"title": "WebAtlasDE"}'
wm.basemap.baseMapLayers[0].update(json.loads(webAtlasDe))
wm.basemap.update({'title':'WebAtlasDE'})
webmap_item_properties = {'title':'WebAtlasDE', 'snippet':license_text, 'tags':['basemaps'}
service = wm.save(webmap_item_properties)

0 Kudos
MichaelNüßlein
New Contributor III

our solution for adding a custom basemap does not work with Python API's coming with ArcGIS Pro 3.1. Does anyone have a solution for ArcGIS Pro 3.1

0 Kudos