Correct usage of <a href> with relative paths

729 views
Skip to first unread message

Bjorn Nyberg

unread,
Jun 28, 2013, 6:22:44 AM6/28/13
to kml-support-g...@googlegroups.com
Hi,
I am trying to get a relative path to work in a kmz of mine that I have exported from ArcGIS however the paths are not working for a <a href>. Stating an <img src works fine but I do not want to embed the picture in the thumbnail itself but rather have it pop up in a separate window (in google earth) and I cant understand why referencing an image should be that different between those two methods.

What I have been attempting to do is something along the line of :

<a href="../files/image.jpg">Test</a>

I also tried to link it to another kmz file using network links, however it appears to only open the same kmz again? something along the lines of 

<NetworkLink>
<name>Link</name>
<visibility>0</visibility>
<a href>"../files/kmz2.kmz></a>
</NetworkLink>

I've attached the kmz and any help would be appreciated!
Thanks,
Bjorn






kmz_test.kmz

barryhunter (KML Guru)

unread,
Jun 28, 2013, 6:31:53 AM6/28/13
to kml-support-g...@googlegroups.com


On Friday, 28 June 2013 11:22:44 UTC+1, Bjorn Nyberg wrote:
Hi,
I am trying to get a relative path to work in a kmz of mine that I have exported from ArcGIS however the paths are not working for a <a href>. Stating an <img src works fine but I do not want to embed the picture in the thumbnail itself but rather have it pop up in a separate window (in google earth) and I cant understand why referencing an image should be that different between those two methods.

What I have been attempting to do is something along the line of :

<a href="../files/image.jpg">Test</a>

Such a link is opened in a browser (be it the one built into GE or otherwise) - and you can't pass such a relative link to a browser. It simply wont know how to resolve it. 

Even if GE was to first convert it to a full URL, it wouldn't work. 
A browser can't resolve a URL like
c:/folder/file.kmz/files/image.jpg
it simply doenst understand KMZ files. 


(Whereas the image tag is being resolved by the Google Earth client itself) 


 

I also tried to link it to another kmz file using network links, however it appears to only open the same kmz again? something along the lines of 

<NetworkLink>
<name>Link</name>
<visibility>0</visibility>
<a href>"../files/kmz2.kmz></a>
</NetworkLink>

network links dont use <a> tags, IF it did work (I'm not sure) would be something more like

<NetworkLink>
<name>Link</name>
<visibility>0</visibility>
      <Link>
        <href>../files/kmz2.kmz</href>
      </Link>
</NetworkLink>

 

Bjorn Nyberg

unread,
Jun 29, 2013, 10:51:46 PM6/29/13
to kml-support-g...@googlegroups.com
Hej,
Thanks for that bit of information but perhaps you could clarify one thing. If I unzip the kmz and use the doc.kml file and right click the hyperlink and open a new window -- it resolves the relative path of a <a href> just fine... So are <a href> to relative paths simply not supported in a kmz?
Cheers
Reply all
Reply to author
Forward
0 new messages