0

我正在尝试从 googlemaps 中的 KML 文件更改标记的样式。当我在 googleearth 中运行文件时,标记是不同的。当我在 googlemaps 中运行它时,它的外观与以前相同。为什么会这样?

这是 kml 文件的开头:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.google.com/earth/kml/1">
<Document>

<Style id="bendigo">
<BalloonStyle>
    <text>$[description]</text>
</BalloonStyle>
<IconStyle>
    <Icon>
        <href>http://maps.google.com/mapfiles/kml/paddle/grn-blank.png</href>
    </Icon>
  </IconStyle>
</Style>

<name>kml_sample1.kml</name>
<Placemark>
 <name>Boat</name>
 <description><![CDATA[
  Boat<br />
  <p>Home page: <a href="google.com">google.com</a></p>
 ]]>
 </description>

 <styleUrl>#bendigo</styleUrl>

<Point>
<!--run a javascript to get data points-->
  <coordinates>7.666037,64.32565</coordinates>
</Point>

4

1 回答 1

0

上面的 KML 片段缺少 Placemark、Document 和 kml 的结束标记。

修复后,我可以将 KML 加载到谷歌地图中,​​它看起来很好(绿色标记)。

最近在 Google 地图中渲染了 KML 的更新,这可能暂时影响了这一点,但我无法确定,因为它现在对我来说很好用。如果您确认它现在看起来不错,那可能就是问题所在。

于 2012-06-01T05:10:25.323 回答