2011-10-02 34 views
1

我使用,我已經建立了一個應用程序建立一個KML文件檔案。現在,我很好地在地圖上繪製了一個線條。但是,現在我想在同一個KML文件中添加幾個地標。當試圖做到這一點時,它會顯示行字符串或地點標記,但不是兩者。創建KML以線串和地標

我該怎麼辦這個KML文件裏面?

我目前使用:

<?xml version="1.0" encoding="UTF-8"?> 
<kml xsi:schemaLocation="http://earth.google.com/kml/2.1 http://earth.google.com/kml2.1.xsd" xmlns="http://earth.google.com/kml/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <Placemark> 
    <name>My Name</name> 
    <Style> 
     <LineStyle> 
      <color>FF0000FF</color> 
      <width>3.0</width> 
     </LineStyle> 
    </Style> 
    <LineString> 
     <extrude>false</extrude> 
     <tessellate>true</tessellate> 
     <altitudeMode>clampToGround</altitudeMode> 
     <coordinates>A Ton of coordinates go here</coordinates> 
    </LineString> 
    </Placemark> 
</kml> 

回答

1

我想通了,我有什麼所有地標放置到<Folder>以有多個地標顯示,那麼它的工作。

+1

你知道你正在使用您的KML舊的2.1命名空間?請參閱:「http://code.google.com/intl/nl-NL/apis/kml/documentation/kmlreference.html – Eddy

+0

謝謝,我將更新它 –

+0

@NicHubbard:我對類似的工作能否請你。讓我看看KML或Java代碼如何獲得兩點之間的界限,我想要的是在這些點上獲得某種類型的標記,謝謝! – CodingInCircles