AnsweredAssumed Answered

ConvertWebMaptoMapDocument removing my LEGEND ELEMENT

Question asked by ricardo.rodriguesesri-portugal-pt-esridist Employee on Jan 31, 2020
Latest reply on Feb 7, 2020 by ricardo.rodriguesesri-portugal-pt-esridist

I have this code:

 

tempfile = os.path.join(arcpy.env.scratchFolder, "empty.mxd")

mxdfile.saveACopy(tempfile)

 

if I do a

len(arcpy.mapping.ListLayoutElements(mxdfile,"LEGEND_ELEMENT")) or

len(arcpy.mapping.ListLayoutElements(tempfile,"LEGEND_ELEMENT"))

 

it shows and rightly so that I have a 1 LEGEND ELEMENT

 

after i do:

result = arcpy.mapping.ConvertWebMapToMapDocument(Web_Map_as_JSON, tempfile, extra_conversion_options=AGSSecureServerServices)

mxd = result.mapDocument

 

if i do a

len(arcpy.mapping.ListLayoutElements(mxd,"LEGEND_ELEMENT"))

my LEGEND ELEMENT is gone it shows 0

 

What could be causing this? The mxd was saved with Desktop 10.6.1

 

Thanks in advance

 

Outcomes