My organisation does not have a Bing key, so Bing and Microsoft Virtual Earth layers don't work and a Bing authorization pop up happens whenever I open a MXD containing them. This pop up interrupts another script I made, so I want to remove the layers to stop the pop up.
Because this one did not work, I made my own script to remove Microsoft Virtual Earth layers:
import arcpymxd = arcpy.mapping.MapDocument(r"PATH")for df in arcpy.mapping.ListDataFrames(mxd): for lyr in arcpy.mapping.ListLayers(mxd, "Microsoft Virtual Earth*", df): print "Removing: "+ lyr.name arcpy.mapping.RemoveLayer(df, lyr)mxd.save()del mxd This worked fine, the 3 Microsoft Virtual Earth layers were removed from the map. Only thing is, the Bing Authorization pop up still appears when I open the map. Does anyone know why removing these layers with this script doesn't stop the pop up? I have tested removing these layers manually, saving, closing then reopening the MXD. The pop up does not appear then. So there is something done in the manual process which is not done in my script.
أكثر...
Because this one did not work, I made my own script to remove Microsoft Virtual Earth layers:
import arcpymxd = arcpy.mapping.MapDocument(r"PATH")for df in arcpy.mapping.ListDataFrames(mxd): for lyr in arcpy.mapping.ListLayers(mxd, "Microsoft Virtual Earth*", df): print "Removing: "+ lyr.name arcpy.mapping.RemoveLayer(df, lyr)mxd.save()del mxd This worked fine, the 3 Microsoft Virtual Earth layers were removed from the map. Only thing is, the Bing Authorization pop up still appears when I open the map. Does anyone know why removing these layers with this script doesn't stop the pop up? I have tested removing these layers manually, saving, closing then reopening the MXD. The pop up does not appear then. So there is something done in the manual process which is not done in my script.
أكثر...