'Google Earth link PDF or image file on company server to placemark

I want to display multiple jpg(s) and/or pdf file(s) to a single placemark. The file path is in my company's directory and I would like anyone in the company that I send this google earth file to have the ability to view each placemark.

I have tried the command and neither seem to be working.

Both of these commands work with images at a "http:// address" but not with references to my hard drive nor server.



Solution 1:[1]

A KML Placemark can contain any number of images in its description. Most HTML will render inside the description of any given Placemark.

Option 1. Linking to a PDF or other media via URL within KML

Here's sample KML file to launch in Google Earth which will show an inline image in the popup balloon with a link to a PDF file:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
    <Placemark>
      <name>Test</name>
      <snippet/>
      <description>
        <![CDATA[<a href="http://stlab.adobe.com/wiki/images/d/d3/Test.pdf"><img
            src="http://stlab.adobe.com/wiki/skins/common/images/icons/fileicon-pdf.png"></a>
         ]]>
      </description>        
      <gx:balloonVisibility>1</gx:balloonVisibility>
      </Placemark>
</kml>

Note the gx:balloonVisibility tag which if set to "1" will auto-display the popup. That's a useful feature.

If images are within your hard-drive then you won't be able to share the KML with others unless you either bundle the images inside a KMZ file or publish the images to web site in your company so they are accessible via a URL.

Option 2. Embed the PDF within the Placemark description balloon

One trick to directly embed the PDF within the Placemark description balloon is using the Google PDF viewer in an iframe and substitute the test URL for actual URL in link below.

 <?xml version="1.0" encoding="UTF-8"?>
 <kml xmlns="http://www.opengis.net/kml/2.2">
   <Placemark>
      <name>Test</name>
      <snippet/>
      <description>
            <![CDATA[
<iframe src="http://docs.google.com/gview?url=http://stlab.adobe.com/wiki/images/d/d3/Test.pdf&embedded=true"
        style="width:718px; height:700px;" frameborder="0"></iframe>
             ]]>
      </description>
   </Placemark>
 </kml>

This technique doesn't need a Flash player and works in Google Earth.

Note if you do this too many times and/or try for very large documents then the viewer will display the message:

You've reached the bandwidth limit for viewing or downloading files that aren't in Google Docs format. Please try again later.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1