创建KML路线

时间:2013-05-14 20:40:02

标签: kml

我正在尝试创建一个基于lon& amp;的路由LAT的。这是我到目前为止所做的,但它似乎没有正常工作。

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2"> 
<Document>
  <PlaceMark>
    <name>test</name>
    <description>test Desc</description>
    <Point>
      <coordinates>-80.54400115,43.4250264</coordinates>
      <coordinates>-80.52674314,43.43127701</coordinates>
      ...
    </Point>
    </PlaceMark>
  </Document>
<kml> 

语法是否正确?当我在我的地图应用程序中加载它时,它不显示路线。

1 个答案:

答案 0 :(得分:2)

请参阅KML reference

  1. KML是区分大小写的XML(PlaceMark与Placemark不同)
  2. <Point>是一个单一的位置
  3. 一行是<LineString>
  4. 您的XML必须有效(关闭开头</kml>需要<kml>)。
  5. example

    KML from example above on Google Maps

    <?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://www.opengis.net/kml/2.2">         <Document>
    <Placemark><name>test</name>
    <description>test Desc</description>
    <LineString>
    <coordinates>
    -80.54400115,43.4250264
    -80.52674314,43.43127701
    -80.5274517,43.43458707
    -80.53223781,43.43876923
    -80.54385782,43.44993036
    -80.53949137,43.45723788
    -80.53950793,43.46780893
    -80.53352615,43.4730443
    -80.53491389,43.47816267
    -80.54136061,43.48417145
    -80.54163034,43.48439869
    </coordinates>
    </LineString>
    </Placemark></Document>
    </kml>