【问题标题】:KML open image, Google EarthKML 打开图片,谷歌地球
【发布时间】:2012-11-04 13:31:40
【问题描述】:

我正在玩 KML。 我正在创建一个在单击时显示图像的地标。当我右键单击图像时,有一个打开它的选项,但 Google 地球无法打开图像。有没有办法让谷歌地球打开它? KML 使用图像的相对路径,并且以这种方式在气球中显示图像没有问题,但是当我单击“打开图像”选项时,它无法打开。 如果有人有任何帮助,我将不胜感激。 谢谢!

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>Photos.kml</name>
<Folder>
    <name>Photos</name>

    <Style id="Photo">
        <IconStyle>
            <Icon>
                <href>http://www.google.com/mapfiles/arrow.png</href>
            </Icon>
            <scale>.7</scale> 
        </IconStyle>
    </Style>

    <Placemark>
        <name>IMG_0988.JPG</name>

        <description><![CDATA[<div align="center"><table width="500"><tr><td colspan="2"><center><img src="pics/IMG_0988.jpg" width="500" height="373"></td></tr></table></div>]]></description>

        <styleUrl>#Photo</styleUrl>

        <Point>
            <coordinates>13.18733333,60.66783333000001,0</coordinates>
        </Point>

        <Style>
            <IconStyle>
                <heading>90</heading>
            </IconStyle>
        </Style>

    </Placemark>
</Folder>
</Document>
</kml>

【问题讨论】:

  • 您是否尝试过制作 KMZ 文件并将图像作为 KMZ 文件的一部分添加到适当的子文件夹中?此外,对 google earth 而言并不重要,但您的 HTML 中有一个
    开始标签,没有结束标签。
  • 谢谢!一定错过了。

标签: kml google-earth


【解决方案1】:

建议您也使用相同的图像 URL 将 &lt;img&gt; 标记与 &lt;a href=""&gt;..&lt;/a&gt; 包装起来。如果您右键单击气球中的图像,Google 地球会为您提供一些附加选项:打开链接、在新窗口中打开、复制链接。

Open Image 可以在 GE 7.0 中使用测试图像。无论您是否在 Tools/Options/General 下选中了“在外部浏览器中显示网络结果”选项,结果可能会有所不同。

<description>
    <![CDATA[<div align="center"><table width="500"><tr><td>
    <a href="pics/IMG_0988.jpg"><img src="pics/IMG_0988.jpg" width="500" height="373"></a>
    </td></tr></table></div>]]>
</description>

【讨论】:

  • 感谢您的回答。但这对我没有帮助。我仍然无法通过点击图片或点击“打开图片”来打开图片。
【解决方案2】:

我不知道这是否正是您的问题,但我刚刚发现了一个令人沮丧的 Google 地球怪癖,它与在描述元素中嵌入指向全尺寸图像的链接有关。

基本上,即使文件具有大写扩展名,Google 地球似乎也要求扩展名必须为小写(例如 jpg 而不是 JPG)才能显示在气泡中。

右键单击打开图像适用于两种大小写。

例如,我想用地标显示一个名为“2015_03_27 G11/IMG_8320.JPG”的文件:

似乎可以在 Windows 上运行:

<Placemark>
    <name>IMG_8320.JPG</name>
    <description>&lt;img src='2015_03_27 G11/IMG_8320.jpg' width='600' height='450'/&gt;</description>
    <styleUrl>#defaultStyle1</styleUrl>
    <Style>
        <IconStyle>
            <Icon>
                <href>kml-thumbs/thumb-2015_03_27_G11-IMG_8320.JPG</href>
            </Icon>
        </IconStyle>
    </Style>
    <Point>
        <altitudeMode>absolute</altitudeMode>
        <coordinates>10.705401,104.773769,27</coordinates>
    </Point>
</Placemark>

不工作(至少在 Windows 上)

<Placemark>
    <name>IMG_8320.JPG</name>
    <description>&lt;img src='2015_03_27 G11/IMG_8320.JPG' width='600' height='450'/&gt;</description>
    <styleUrl>#defaultStyle1</styleUrl>
    <Style>
        <IconStyle>
            <Icon>
                <href>kml-thumbs/thumb-2015_03_27_G11-IMG_8320.JPG</href>
            </Icon>
        </IconStyle>
    </Style>
    <Point>
        <altitudeMode>absolute</altitudeMode>
        <coordinates>10.705401,104.773769,27</coordinates>
    </Point>
</Placemark>

【讨论】:

    猜你喜欢
    • 2011-02-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多