Select to view content in your preferred language

ConvertWebMaptoMapDocument removing my LEGEND ELEMENT

284
1
01-31-2020 07:18 AM
RicardoRodrigues1
Emerging Contributor

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

0 Kudos
1 Reply
RicardoRodrigues1
Emerging Contributor

Anyone?

0 Kudos