开发者

Create KML file with linestring and placemarks

开发者 https://www.devze.com 2023-04-10 07:31 出处:网络
I am building a KML file using an app that I have built.Right now I have it nicely drawing a linestring on the map. But, now I want to add a few placemarks inside the same KML file.When trying to do t

I am building a KML file using an app that I have built. Right now I have it nicely drawing a linestring on the map. But, now I want to add a few placemarks inside the same KML file. When trying to do this it will show either the line string or the place mark, but not both.

How can I do this inside a KML file?

What I currently use:

<?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>开发者_如何学JAVA;
    </Style>
    <LineString>
      <extrude>false</extrude>
      <tessellate>true</tessellate>
      <altitudeMode>clampToGround</altitudeMode>
      <coordinates>A Ton of coordinates go here</coordinates>
    </LineString>
  </Placemark>
</kml>


I figured out what I have to place all of the placemarks into a <Folder> in order to have multiple placemarks show, then it worked.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号