1

I have created a KML file containing several thousand placemarks. The description contains a simple HTML tag referencing a location on local disk, pointing to a JPG photograph. The photos display in the popup balloons properly.

I would like for users of Google Earth 7 to be able to click on the displayed photo and have their default JPG file type handler application open and display the photo file.

I have tried enclosing the <img> tag with an <a href> tag, using the notation href="file://photos\technician01\photo1.jpg", but I can't get the behaviour I am looking for (no external viewer is ever spawned).

Is there a way to accomplish this?

Update Here's a complete block of HTML I have attempted to achieve the described functionality:

<a href=" photos\technician01\August 19, 2013\DSCN0596.jpg">
  <table style="width:800px;height:600px">
    <tr>
      <td>
        <img src="photos\technician01\August 19, 2013\DSCN0596.jpg" style="height:auto; width:100%"/>
      </td>
    </tr>
  </table>
</a>`
8
  • 1
    a little more code would be helpful...
    – sfletche
    Commented May 6, 2014 at 5:45
  • I should mention as well that replacing the <img> tag with a piece of text yields the same results; no external application is spawned when clicking in the hyperlink.
    – Joebocop
    Commented May 6, 2014 at 15:32
  • i'm curious how the spaces in your folder names are affecting things...are you able to adjust the folder names (actual folder names as well as the corresponding path in the src tag)
    – sfletche
    Commented May 6, 2014 at 17:56
  • you might try replacing each space in the src path with %20
    – sfletche
    Commented May 6, 2014 at 17:59
  • Yeah, I thought spaces would be the problem and replaced them all with %20, but with the same result (also noticed the leading space in the <a href= value and removed it; no effect). Do different rules govern the validity of the <img src= as opposed to the <a href= values? The photos display as expected in the balloons (<img src=), which is why I was hesitant to blame to path name (they are identical, with spaces, commas, whatever). Is it possible that this is a security restriction? Has anyone seen this functional in the wild?
    – Joebocop
    Commented May 6, 2014 at 18:20

1 Answer 1

1

I just got the following to work

  <Placemark>
    <name>Simple placemark</name>
    <description>
      Attached to the ground. Intelligently places itself at the
      height of the underlying terrain.
      <![CDATA[<div align="center"><table width="500"><tr><td>
        <a href="http://upload.wikimedia.org/wikipedia/commons/b/b4/Logan_Rock_Treen_closeup.jpg">
          <img src="http://upload.wikimedia.org/wikipedia/commons/b/b4/Logan_Rock_Treen_closeup.jpg" width="500" height="373">
        </a>
      </td></tr></table></div>]]>
    </description>
    <Point>
      <coordinates>-122.0822035425683,37.42228990140251,0</coordinates>
    </Point>
  </Placemark>

Maybe that helps?

2
  • Web links seem to work fine as href targets (default web browser spawns, web page loads), but to link to a file on local disk, I'm still stuck.
    – Joebocop
    Commented May 7, 2014 at 5:31
  • 1
    Ah. That may not actually be doable. HTML prevents opening your default file handlers for security reasons (see this stackoverflow question for a better explanation)
    – sfletche
    Commented May 7, 2014 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.