如何链接到 KMZ 文件中的内部文件?

发布于 2024-07-19 09:53:46 字数 373 浏览 5 评论 0原文

我正在尝试设置一个 KMZ 文件以在 Google 地球中使用,其中气球内容位于主要在 HTML 文件中定义,这些文件使用 iframe 嵌入。 当使用本地文件系统上的相对链接时(假设启用了文件系统访问),该设置可使用纯 KML 文件和额外的 HTML 文件。

我的问题是我找不到一种方法来创建包含以互连方式包含所有文件的 KMZ 文件。 KML 规范根本没有讨论这个问题(事实上 KMZ 在整个文档中只出现了几次)。 我也找不到有关 KMZ 的任何其他文档。

是否可以链接到 KMZ 内的其他 HTML 文件? 如果是:怎么办?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蓝眼泪 2024-07-26 09:53:46

是的,Kml 规范允许这样做,您只需使用相对路径。

然而,您的问题实际上与特定应用程序中对某些类型的内容的安全限制有关。

例如,完整的 Google Earth 客户端允许您将 Flash (swf) 内容加载到气球中,而 Goggle Earth 插件则不允许。 iFramed 内容等也是如此。

因此问题的答案完全取决于您在哪个应用程序中查看 Kml/kmz,与 Kml 或 Kmz 规范无关。

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.

放低过去 2024-07-26 09:53:46

了解 OGC KML 标准,以及该标准的规范如何在谷歌地球软件。 特别是,Google 地球实现的规范中没有明确定义一些灰色区域。 管理 KMZ 文件和嵌入内容的规则没有明确定义,并且明确是特定于实现的。 部分详细信息已在 Google KML 参考文档中定义,而另一些则未定义。 KML 和 Google 地球的一些不一致和未记录的功能可以在 KML 勘误表中找到。

对于哪些媒体内容(嵌入在 KMZ 文件中)可以在描述气球中内联显示以及可以链接和访问哪些内容都存在限制。

以下是 KMZ 教程<中列出的 内容的一些限制/a>

元素中的 元素不能指向本地
磁盘上的文件,也不能指向 KMZ 文件内的文件; 它必须
指向浏览器可以访问的 Internet 上的 URL。

作为此规则的一个例外,您实际上可以在 KMZ 文件中包含一个 HTML 文件,并将其作为 元素包含在功能的 中具有相对 URL 的描述,但不支持许多其他媒体类型。

如果您在“工具/选项/常规”菜单面板中启用“允许访问本地文件和个人数据”选项,则这会放宽一些访问规则,并且能够访问一些内容链接(例如 HTML、PDF)等)就像从 Web 浏览器中一样,但主要是 KMZ 文件外部的本地文件。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文