Hi all,
Kind of a follow-up to this post.
I was looking over some documentation and noticed that in arcpy.mp, layers have an IsWebLayer method.
I'm wondering what exactly it's checking to figure that out. Reading the .py file, it just says passthrough_attr('isWebLayer'), and looking up passthrough_attr() doesn't really tell me anything useful.
What is the functional difference between using .isWebLayer() and, for example, arcpy.Describe() to check for "https://" in the catalogPath?
I'm also curious as whether there is any benefit to using one versus the other? Obviously, isWebLayer requires far less typing, but I'm wondering if there are any other pros or cons to either of them.
Thanks!
I tried checking myself, but both return the same results:
aprx = arcpy.mp.ArcGISProject("CURRENT")
mapList= aprx.listMaps("Map")[0]
layList = mapList.listLayers()
def recList(layList):
for lay in layList:
if lay.isGroupLayer is True:
recList(lay.listLayers())
else:
if lay.isWebLayer is True:
print(f"{lay} is a web layer")
dSource= lay.dataSource
cPath=(arcpy.Describe(dSource).catalogPath)
if "https://" in cPath:
print(f"{lay} contains 'https://'")
recList(layList)
