3

I'm trying to set up a KMZ file for use in Google Earth where the balloon contents are mostly defined in HTML files, which are embedded using iframes. The setup works with a plain KML file and the extra HTML files when using relative links on the local filesystem (assuming filesystem access is enabled).

My problem is that I can't find a way to create a KMZ file containing all files in an interlinked fashion. The KML specification doesn't talk about the issue at all (in fact KMZ appears only a few times in the whole document). I couldn't find any other documentation on KMZ either.

Is it possible to link to other HTML files within a KMZ? If yes: how?

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Peter Becker
  • 8,795
  • 7
  • 41
  • 64
  • I don't see what would cause relative paths to not work. Have you tried simply zipping up your working kml directory into a kmz file? – user57368 May 06 '09 at 03:42
  • yes, both with the root folder and without -- all iframes just come out empty – Peter Becker May 06 '09 at 06:07
  • try un-checking any 'read only' flags in any the files within the Kmz. – Fraser May 12 '09 at 11:22
  • My answer here might be helpful, especially if using JAK: [http://stackoverflow.com/questions/7265808/java-api-for-kml-jak-embedding-images-in-kmz-files/7277791#7277791][1] [1]: http://stackoverflow.com/questions/7265808/java-api-for-kml-jak-embedding-images-in-kmz-files/7277791#7277791 – Jim Tough Sep 02 '11 at 00:00

2 Answers2

1

Yes the Kml specification allows this, you just use relative paths.

However your issue is really to do with the security restrictions in specific applications on certain types of content.

For example the full Google Earth Client allows you to load Flash (swf) content in to Balloons whilst the Goggle Earth Plug-in does not. The same goes for iFramed content, etc.

So the answer to question would totally depend on which application are you viewing the Kml/kmz in and has nothing to do with Kml or Kmz specification.

Fraser
  • 15,275
  • 8
  • 53
  • 104
1

Realize that there is the OGC KML Standard and how the specification of that standard gets interpreted and implemented in the Google Earth software. In particular there are some grey areas not well-defined in the spec that Google Earth implements as it does. The rules governing KMZ files and embedded content is not well defined and are clearly implementation specific. Some of the details are defined in Google KML Reference documentation and some are not. Some inconsistencies and undocumented features of KML and Google Earth can be found in the KML Errata.

There are restrictions both for what media content (embedded inside KMZ file) can be displayed inline within a description balloon and as well as what content can be linked to and accessed.

Here are some restrictions for <iframe> content listed in the KMZ Tutorial

The <src> element within an <iframe> element cannot point to a local file on disk, nor can it point to a file inside a KMZ file; it must point to a URL on the Internet that a browser can visit.

As an exception to this rule you can in fact have an HTML file within a KMZ file and include that as <src> element within an <iframe> in the feature description with a relative URL but not many other media types are supported.

If you enable the "Allow access to local files and personal data" option in Tools/Option/General menu panel then this relaxes some access rules and are able to access some links to content (e.g. HTML, PDF, etc.) as you would from a web browser but mostly local files external to the KMZ file.

CodeMonkey
  • 22,825
  • 4
  • 35
  • 75