Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

I am generating KML file to show line from one location to another.

But these line not clickable to see information of that line.

I want to make these lines clickable.

Please help me.

Following is the KML file

XML
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<name>copyabc_264</name>
<Schema parent="Placemark" name="copyabc_264_DDSIISII">
<SimpleField type="wstring" name="Fname"></SimpleField>
<SimpleField type="wstring" name="Lname"></SimpleField>
<SimpleField type="wstring" name="Address"></SimpleField>
<SimpleField type="wstring" name="city"></SimpleField>
<SimpleField type="wstring" name="state"></SimpleField>
<SimpleField type="wstring" name="Postcode"></SimpleField>
<SimpleField type="wstring" name="Country"></SimpleField>
<SimpleField type="wstring" name="datatest"></SimpleField>
<SimpleField type="double" name="Lat"></SimpleField>
<SimpleField type="double" name="Long"></SimpleField>
<SimpleField type="wstring" name="city2"></SimpleField>
<SimpleField type="wstring" name="postcode2"></SimpleField>
<SimpleField type="wstring" name="country2"></SimpleField>
<SimpleField type="wstring" name="city3"></SimpleField>
<SimpleField type="wstring" name="Postcode3"></SimpleField>
<SimpleField type="wstring" name="Country3"></SimpleField>
</Schema>
<Schema parent="Placemark">
<SimpleField type="wstring" name="Fname"></SimpleField>
<SimpleField type="wstring" name="Lname"></SimpleField>
<SimpleField type="wstring" name="Address"></SimpleField>
<SimpleField type="wstring" name="city"></SimpleField>
<SimpleField type="wstring" name="state"></SimpleField>
<SimpleField type="wstring" name="Postcode"></SimpleField>
<SimpleField type="wstring" name="Country"></SimpleField>
<SimpleField type="wstring" name="datatest"></SimpleField>
<SimpleField type="double" name="Lat"></SimpleField>
<SimpleField type="double" name="Long"></SimpleField>
<SimpleField type="wstring" name="city2"></SimpleField>
<SimpleField type="wstring" name="postcode2"></SimpleField>
<SimpleField type="wstring" name="country2"></SimpleField>
<SimpleField type="wstring" name="city3"></SimpleField>
<SimpleField type="wstring" name="Postcode3"></SimpleField>
<SimpleField type="wstring" name="Country3"></SimpleField>
</Schema>
<Style id="default+icon=http://maps.google.com/mapfiles/kml/pal4/icon57.png">
<IconStyle>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pal4/icon57.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="default+icon=https://maps.google.com/mapfiles/kml/pal4/icon49.png">
<IconStyle>
<scale>1.1</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pal4/icon49.png</href>
</Icon>
</IconStyle>
<LabelStyle>
<scale>1.1</scale>
</LabelStyle>
</Style>
<StyleMap id="default+nicon=http://maps.google.com/mapfiles/kml/pal4/icon57.png+hicon=http://maps.google.com/mapfiles/kml/pal4/icon49.png">
<Pair>
<key>normal</key>
<styleUrl>#default+icon=http://maps.google.com/mapfiles/kml/pal4/icon57.png</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#default+icon=http://maps.google.com/mapfiles/kml/pal4/icon49.png</styleUrl>
</Pair>
</StyleMap>
<Folder>
<Placemark>
<name>Traingle</name>
<description> <![CDATA[ First point</br> Latitude : 19.9321125 Longitude : 73.8342824</br>Second Point</br> Latitude : 18.5614879 Longitude : 73.9290136</br> Third Point </br> Latitude : 21.1295808 Longitude : 79.1048563]]></description>
 <visibility>1</visibility>
  <styleUrl>#exampleStyleMap</styleUrl>
<Style id="transPurpleLineGreenPoly">
<LineStyle>
<color>7FF0000f</color>
<width>4</width>
</LineStyle>
<PolyStyle>
<color>7FF0000f</color>
</PolyStyle>
</Style>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
73.8342824,19.9321125,0
73.9290136,18.5614879,0

</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
<Placemark>
<name>Traingle</name>
<description> <![CDATA[ First point</br> Latitude : 18.5625645 Longitude : 73.9078179</br>Second Point</br> Latitude : 20.1530654 Longitude : 74.2290887</br> Third Point </br> Latitude : 19.2514343 Longitude : 76.7783618]]></description>
 <visibility>1</visibility>
  <styleUrl>#exampleStyleMap</styleUrl>
<Style id="transPurpleLineGreenPoly">
<LineStyle>
<color>7FF0000f</color>
<width>4</width>
</LineStyle>
<PolyStyle>
<color>7FF0000f</color>
</PolyStyle>
</Style>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
73.9078179,18.5625645,0
74.2290887,20.1530654,0

</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</Folder>
</Document>
</kml>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900