I have several map objects in my APRX. One of them is specifically a basemap object, created using "Right-click-->New--> New Basemap"
What I'm running into now is: How do I tell that it's a Basemap using arcpy?
Looking at the actual documentation for both the APRX and the Map objects, it doesn't seem possible, which is bizarre.
Solved! Go to Solution.
I did some testing and found the isBasemapLayer of a layer would only tell me if the layer was an ESRI basemap, not my own.
When I created a map, and examined it in the debugger, I found it has a mapType of BASEMAP.
This snippet lists the name and type of each map in my project.
I found this by looking in the map objects in the debugger. (Visual Studio Code in my case)
import arcpy
p = "K:/Taxmaps/taxmaps2.aprx"
project = arcpy.mp.ArcGISProject(p)
print()
map = project.listMaps(wildcard="*")
for m in map:
print("map:", m.name, " type:", m.mapType)
pass
Output from code:
map: Clatsop County B&W tiles type: BASEMAP
map: County Overview Map type: MAP
map: Map type: MAP
map: Main Map type: MAP
map: Section Overview Map type: MAP
map: Township Overview Map type: MAP
Apologies if I'm missing something obvious, but would it be the isBasemapLayer property on the layer object?
I think that's referring to like, this?
I want the map object that I created.
I did some testing and found the isBasemapLayer of a layer would only tell me if the layer was an ESRI basemap, not my own.
When I created a map, and examined it in the debugger, I found it has a mapType of BASEMAP.
This snippet lists the name and type of each map in my project.
I found this by looking in the map objects in the debugger. (Visual Studio Code in my case)
import arcpy
p = "K:/Taxmaps/taxmaps2.aprx"
project = arcpy.mp.ArcGISProject(p)
print()
map = project.listMaps(wildcard="*")
for m in map:
print("map:", m.name, " type:", m.mapType)
pass
Output from code:
map: Clatsop County B&W tiles type: BASEMAP
map: County Overview Map type: MAP
map: Map type: MAP
map: Main Map type: MAP
map: Section Overview Map type: MAP
map: Township Overview Map type: MAP
No idea how I missed that.
Thanks!
@AlfredBaldenweck wrote:No idea how I missed that.
I looked right at it and moved on. The documentation for mapType says, "Returns a string value that reports the Map object's type information. If the Map is 2D, MAP is returned. If the Map is 3D, SCENE is returned." It implies those are the only two options, which is clearly not the case. I am submitting feedback on that page to be more descriptive of the mapType property.