Hello all,
I wanted to use Python to change basemap for my maps.
The documentation for addBasemap(basemap_name) method does not provide info about how to get the list of the available default basemap names. It mentions "basemap gallery" and when you search that, initially there are not much useful info but from there you go down the rabbit hole of finding some stuff on ArcGIS Maps SDK for JavaScript / API Reference and obviously the values there, are different from actual names (some of them work though).
Working with Python for a while and after seeing that API for JS, it naturally gives you the impression that there should be no spaces when passing those names. And interestingly enough, it took me a while to realize that's not the case here and you can use the names that you see in the Basemap control on the Map ribbon. Something like this:
m.addBasemap('Light Gray Canvas')
I hope if someone has the same issue, they land here and see this (instead of searching within arcpy packages and json files for a clue!)
I was also wondering if mentioning a bit more about the basemap names in the Documentation could help other people finding it easier. Or maybe there could be a method similar to the ones for maps and layouts but for basemap (listBasemaps() ? ) to return the values to the user.
My platform: Windows 11 (22H2) and ArcGISPro 3.1