3

I am creating KML files from an ArcMap layer that uses XSLT to generate an HTML popup with custom links to file folders. Some of these links have embedded spaces. When I try to open these links in Google Earth, it does nothing. I have tried encoding spaces as %20 and still GE will not open them. It opens links without spaces just fine.

Here is a link from my KML that works fine:

<a target="_blank" href="file:///C:/Land/ce">Central Wildlife District</a>

Here are a couple that don't:

<a target="_blank" href="file:///C:/Land/ce/Sites/AIKENS%20CR">AIKENS CR</a>
<a target="_blank" href="file:///C:/Land/ce/Sites/AIKENS CR">AIKENS CR</a>

I found a 6-year old problem report on Google Groups (https://groups.google.com/forum/?fromgroups#!topic/kml-support-getting-started/8PfajmyJbiY) that claimed this would be fixed soon. Is it really still a problem?

Has anyone managed to figure out a way to make links with spaces work in Google Earth KML?

4

1 回答 1

0

过去,文件名和文件夹中的空格和特殊字符在 GE 中产生了问题:

唯一真正的解决方案是简单地避免这种 KML,或者从文件名和路径中删除所有空格,或者用 _ 替换空格字符。

当然,使用 KML 生成时,手动执行此操作通常很痛苦,但如果您希望 KML 在所有平台(Windows、Mac、Linux、Mobile 等)上正确查看,则必须消除文件名和文件夹中的任何“特殊”字符KML 文件引用的内容包括 KMZ 文件中的内容。

这在与KMZ 文件中的文件中的空白相关的问题中进行了讨论。

于 2013-03-07T23:08:12.560 回答