Well - looks that I was faster, and found out myself how to do this manually by manipulating the .kmz contents with a text editor, which I will describe here shortly.
I'm still interested if and how that can be done with the GE app directly!
So here is how it can be done:
Things you need:
- a toll to pack/unpack ZIP archives (Linux: the freeware zip/unzip apps; Windows: WinZip or use the built-in Zip support)
- a text editor capable of UTF-8
- your graphic files (i.e. the legend as *.png file)
Things to do:
- Create an empty folder and extract the contents of you .kmz file into it
- Copy your legend.png file into the subfolder named "files"
- Open the doc.kml file from that folder with the text editor and apply the changes mentioned below
- pack the contents of the folder (including the subdirectory) with your Zip tool and make sure the file gets the .kmz extension
Sounds quite easy, right? And now for the changes to be applied to the .kml file: First check how it looks like between the opening and closing "<kml>" tags. If there is only one element inside (for an overlay, this is usually something enclosed by the "<GroundOverlay>" tag), you need to surrount it by an additional "<Document>...</Document>" tag - the reason is that the KML specification only allows one top-level element, and we want to add a second. Now for the element to add, which I will explain using an example:
So what is that? Directly in front of the existing element I added the opening "<Document>" tag. Everything from "<GroundOverlay>" to "</GroundOverlay>" I left untouched (hence the "..."). And now comes the element for the legend. You all can guess what "name" and "description" is for. The "icon" tag is the image file to use for the legend, which we placed into the "files" subfolder. With the "overlayXY" and "screenXY" I placed the legend in the upper left corner of the screen. The size tag tells GE to keep the original dimensions ("-1"). We don't want the image to be rotated (makes no sense unless your text is rotated on the image file used itself), and the legend shall be visible initially. That's all.
<description>Legend for my overlay</description>
<overlayXY x="0" y="1" xunits="fraction" yunits="fraction"/>
<screenXY x="0" y="1" xunits="fraction" yunits="fraction"/>
<size x="-1" y="-1" xunits="fraction" yunits="fraction"/>
If you want to play more with it, or dig into the details, you can check out the KML Reference.