Working in ArcGIS Pro 2.6, I'm trying to export a figure with Esri's "World Transportation" layer in the map. I have the layer unchecked in the legend, but when I export to PDF, World Transportation is in the legend (the group heading, too). Removing the layer from the legend portion of the TOC doesn't solve the problem- it appears in the legend unless I remove the layer from the map entirely.
I'm glad you found a way around this issue. We have resolved the export issue (issue #1) where this type of layer displays in the export result even if removed or if the visibility is unchecked.
However, we are still working on excluding Map Service layers that have have no legend info from the legend (issue #2). Some Map Service layer do have legend items, so we need a way to distinguish the difference and that may require work from multiple parts of the software stack. If this fix doesn't get into 2.7 you will be able to remove the Map Service layer item from the legend and not see it in the export result.
As far as I know the work around is applicable for the World_Transportation service layer. I was able to exclude this layer from the legend using this work-around described above:
2. Insert the legend
If these are the steps you are taking and you are still seeing the World_Transportation layer in the legend - then this is a different bug and should be passed along to https://support.esri.com/en/contact-tech-support.
Thanks for the feedback,
I am running 2.7, selecting only the layers I want, then Insert-> Legend and I am still getting unwanted raster layers in the legend upon Export.
How does the flagship desktop GIS software for your platform still have this bug in its latest release? It's truly bizarre. I appreciate the presence on this community forum to walk us through it, but it's so disappointing to have to fiddle with this still.
OK, I found a solution that worked for me! After doing the workarounds above to create the legend without having the offending map service layer and before printing, I opened the legend properties and unchecked ALL of the synchronization settings. Open the legend Options, expand Synchronize with map, uncheck all 4 boxes. By default, I believe "Layer Visibility", "New Layer", and "Rerference Scale" are selected. You might be able to unselect only one or two of those, but I unchecked all and it worked! Legend without the map service layer!
Not sure if this is exactly the same thing, but seems like it and I am using 2.7. I've documented what I call Ghost Layers in the Dynamic Legend. This is where a legend shows the layers you want and looks good, and like the OP stated, upon exporting to a *.jpg, suddenly the legend shows the [...] meaning there are hidden layers (Fig 1.jpg).
Expanding the legend, I see a lot of layers on my map that were not included in the legend at all. Looking at the layers in the legend, they don't appear to show up either, but they show in the legend itself on the map (Fig 2.jpg) - The red shows what should be displayed and what the legend shows is displayed, the blue is what the legend in the map is actually displaying.
My solution that I find works, is to just delete the legend, then use your <Ctrl-z> to undo the delete and then I always find all those hidden "ghost" layers now displaying in my legend in the Contents Pane. They are always listed below my last layer I want displayed. So it's easy to just select all those unneeded layers and delete them and then resave the project and re-export and I haven't yet had a map with it coming back after doing this (Fig. 3).
Note: My figures were taken from various maps I've experienced the issue with and not the same map, but the general principle is the same.
Just my little fix for something similar or even the same issue. Hope it helps...