lyrList = map.listLayers()
for lyr in lyrList:
if lyr.supports("NAME"):
if "Hillshade" in lyr.name or lyr.name == "temp":
map.removeLayer(lyr)
# if lyr.name == "Lift Stations":
# insertrows(map, lyr, ski_run_query_lyr)
# insertrows(map, "ski_run_query", lift_query_lyr)
if lyr.name =="Building Centroid":
insertrows(map, resort_feature_query_lyr)
insertrows(map, resort_feature_resort_lyr)
insertrows(map, building_lyr)
insertrows(map, building_other_lyr)
The first run of my script every time comes up with attribute "name" not supported on the layers. They make it through the name check but then fail. Has anyone else seen this.
It seems like supports() is giving a false positive. I would try and catch the specific layer causing the issue in a try except block initially as that might help you figure out the cause.
I'd also avoid using map as an object name as it could cause confusion, but that's just my opinion.