KML打开图像,Google地球

问题描述 投票:4回答:3

我正在和KML一起玩。我正在创建一个在单击时显示图像的地标。当我右键单击图像时,可以打开它,但是Google Earth无法打开图像。有没有办法使Google Earth打开它?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>
kml google-earth
3个回答
0
投票

建议您还用相同的图像URL用<img>包装<a href="">..</a>标记。如果右键单击气球中的图像,则Google地球将为您提供一些其他选项:打开链接,在新窗口中打开,复制链接。

Open Image在GE 7.0中可用于测试图像。无论是否在工具/选项/常规下选中了“ 在外部浏览器中显示网络结果”选项,结果可能会有所不同。

<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>

0
投票

我不知道这是否完全是您的问题,但我只是想出了一个与Google Earth相当令人沮丧的怪癖,它与在描述元素中嵌入全尺寸图像的链接有关。


0
投票

谢谢@ JasonM1,这对我来说非常有效。

© www.soinside.com 2019 - 2024. All rights reserved.