KML file - Is there a way to completely disable description bubbles? - kml

I have a rather simple .kml file to display a polygon on a Google Map. By default, the polygon causes the cursor to switch to a hand/pointer, and when clicked, displays an empty description bubble.
I have no description, therefore the white bubble (infowindow) is empty.
And what I want is NO bubble at all. I'd love for the hand/pointer cursor to go away as well.
I've found nothing on the web that answers this question.
Thanks!
I have added my code to my original question.
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>RMAhidden.kml</name>
<Style id="poly-000000-1-76-nodesc-normal0">
<LineStyle>
<color>004b8800</color>
<width>0</width>
</LineStyle>
<PolyStyle>
<color>99359ca3</color>
</PolyStyle>
</Style>
<Style id="poly-000000-1-76-nodesc-highlight0">
<LineStyle>
<color>004b8800</color>
<width>0</width>
</LineStyle>
<PolyStyle>
<color>99359ca3</color>
</PolyStyle>
</Style>
<StyleMap id="poly-000000-1-76-nodesc1">
<Pair>
<key>normal</key>
<styleUrl>#poly-000000-1-76-nodesc-normal0</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#poly-000000-1-76-nodesc-highlight0</styleUrl>
</Pair>
</StyleMap>
<Placemark>
<styleUrl>#poly-000000-1-76-nodesc1</styleUrl>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<tessellate>1</tessellate>
<coordinates>
-104.7937775,39.87088139999999,0 -104.8653603,39.87061789999999,0 -104.8996925,39.8413634,0 -104.8979759,39.8397817,0 -104.8978043,39.836091,0 -104.8978043,39.83371830000001,0 -104.8996925,39.8317409,0 -104.9022675,39.830159,0 -104.9034691,39.8268633,0 -104.9031258,39.8127557,0 -104.9010658,39.8126238,0 -104.9000359,39.8113052,0 -104.8981476,39.8087998,0 -104.895401,39.8074811,0 -104.8916245,39.80734919999999,0 -104.8845863,39.8070855,0 -104.884511,39.812922,0 -104.8667336,39.8131513,0 -104.8667336,39.7985133,0 -104.8478508,39.7986452,0 -104.8478508,39.8004916,0 -104.8435593,39.8004916,0 -104.8437309,39.7982495,0 -104.7917175,39.7979858,0 -104.7910309,39.8611313,0 -104.7912025,39.8661383,0 -104.7937775,39.87088139999999,0
</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
<description></description>
<ExtendedData>
<Data name="Id">
</Data>
<Data name="T_NAME">
</Data>
<Data name="T_STATUS">
</Data>
<Data name="T_R_LENGTH">
</Data>
<Data name="T_SOURCE">
</Data>
<Data name="T_BIKE">
</Data>
<Data name="FEAT_RAST">
</Data>
<Data name="Section">
</Data>
<Data name="Sect_Name">
</Data>
</ExtendedData>
</Placemark>
</Document>
</kml>

To disable the popup balloon you can add a BalloonStyle with displayMode=hide to your Style.
If <displayMode> is hide, Google Earth does not display the balloon.
<Style id="poly-000000-1-76-nodesc-normal0">
<BalloonStyle>
<displayMode>hide</displayMode> <!-- default or hide -->
</BalloonStyle>
<LineStyle>
<color>004b8800</color>
<width>0</width>
</LineStyle>
<PolyStyle>
<color>99359ca3</color>
</PolyStyle>
</Style>
Note that <BalloonStyle> and <displayMode> elements may not be supported in all JavaScript libraries if that is how you are rendering the KML

Related

Generate kml with address and not with point

I am trying to generate a KML file, I am attaching 2 examples, all right if I use the POINT tag but if I replace it with the ADDRESS tag I lose the styles and the folder when I upload the file to My Maps or Google Earth ... I am wrong the formatting ?
basically the only change I made is to replace the POINT tag with the ADDRESS tag, the latter also functions perfectly, as a positioning, but the colors of the styles and the name of the folder disappear.
Sample with point
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>Esempio clienti</name>
<description/>
<Style id="icon-1899-0288D1-normal">
<IconStyle>
<color>ffd18802</color>
<scale>1</scale>
<Icon>
<href>https://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png</href>
</Icon>
<hotSpot x="32" xunits="pixels" y="64" yunits="insetPixels"/>
</IconStyle>
<LabelStyle>
<scale>0</scale>
</LabelStyle>
</Style>
<Style id="icon-1899-0288D1-highlight">
<IconStyle>
<color>ffd18802</color>
<scale>1</scale>
<Icon>
<href>https://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png</href>
</Icon>
<hotSpot x="32" xunits="pixels" y="64" yunits="insetPixels"/>
</IconStyle>
<LabelStyle>
<scale>1</scale>
</LabelStyle>
</Style>
<StyleMap id="icon-1899-0288D1">
<Pair>
<key>normal</key>
<styleUrl>#icon-1899-0288D1-normal</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#icon-1899-0288D1-highlight</styleUrl>
</Pair>
</StyleMap>
<Style id="icon-1899-0F9D58-normal">
<IconStyle>
<color>ff589d0f</color>
<scale>1</scale>
<Icon>
<href>https://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png</href>
</Icon>
<hotSpot x="32" xunits="pixels" y="64" yunits="insetPixels"/>
</IconStyle>
<LabelStyle>
<scale>0</scale>
</LabelStyle>
</Style>
<Style id="icon-1899-0F9D58-highlight">
<IconStyle>
<color>ff589d0f</color>
<scale>1</scale>
<Icon>
<href>https://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png</href>
</Icon>
<hotSpot x="32" xunits="pixels" y="64" yunits="insetPixels"/>
</IconStyle>
<LabelStyle>
<scale>1</scale>
</LabelStyle>
</Style>
<StyleMap id="icon-1899-0F9D58">
<Pair>
<key>normal</key>
<styleUrl>#icon-1899-0F9D58-normal</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#icon-1899-0F9D58-highlight</styleUrl>
</Pair>
</StyleMap>
<Style id="icon-1899-FF5252-normal">
<IconStyle>
<color>ff5252ff</color>
<scale>1</scale>
<Icon>
<href>https://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png</href>
</Icon>
<hotSpot x="32" xunits="pixels" y="64" yunits="insetPixels"/>
</IconStyle>
<LabelStyle>
<scale>0</scale>
</LabelStyle>
</Style>
<Style id="icon-1899-FF5252-highlight">
<IconStyle>
<color>ff5252ff</color>
<scale>1</scale>
<Icon>
<href>https://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png</href>
</Icon>
<hotSpot x="32" xunits="pixels" y="64" yunits="insetPixels"/>
</IconStyle>
<LabelStyle>
<scale>1</scale>
</LabelStyle>
</Style>
<StyleMap id="icon-1899-FF5252">
<Pair>
<key>normal</key>
<styleUrl>#icon-1899-FF5252-normal</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#icon-1899-FF5252-highlight</styleUrl>
</Pair>
</StyleMap>
<Folder>
<name>Clienti</name>
<Placemark>
<name>Zerod</name>
<description><![CDATA[Descrizione<br>a capo]]></description>
<styleUrl>#icon-1899-0F9D58</styleUrl>
<Point>
<coordinates>
10.4023066,45.4184623,0
</coordinates>
</Point>
</Placemark>
<Placemark>
<name>MR77</name>
<description><![CDATA[Descrizione<br>a capo]]></description>
<styleUrl>#icon-1899-0288D1</styleUrl>
<Point>
<coordinates>
10.3659798,45.4232393,0
</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Selleria</name>
<description><![CDATA[Descrizione<br>a capo]]></description>
<styleUrl>#icon-1899-FF5252</styleUrl>
<Point>
<coordinates>
10.3672378,45.4239679,0
</coordinates>
</Point>
</Placemark>
</Folder>
</Document>
</kml>
sample with address
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>Esempio clienti</name>
<description/>
<Style id="icon-1899-0288D1-normal">
<IconStyle>
<color>ffd18802</color>
<scale>1</scale>
<Icon>
<href>https://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png</href>
</Icon>
<hotSpot x="32" xunits="pixels" y="64" yunits="insetPixels"/>
</IconStyle>
<LabelStyle>
<scale>0</scale>
</LabelStyle>
</Style>
<Style id="icon-1899-0288D1-highlight">
<IconStyle>
<color>ffd18802</color>
<scale>1</scale>
<Icon>
<href>https://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png</href>
</Icon>
<hotSpot x="32" xunits="pixels" y="64" yunits="insetPixels"/>
</IconStyle>
<LabelStyle>
<scale>1</scale>
</LabelStyle>
</Style>
<StyleMap id="icon-1899-0288D1">
<Pair>
<key>normal</key>
<styleUrl>#icon-1899-0288D1-normal</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#icon-1899-0288D1-highlight</styleUrl>
</Pair>
</StyleMap>
<Style id="icon-1899-0F9D58-normal">
<IconStyle>
<color>ff589d0f</color>
<scale>1</scale>
<Icon>
<href>https://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png</href>
</Icon>
<hotSpot x="32" xunits="pixels" y="64" yunits="insetPixels"/>
</IconStyle>
<LabelStyle>
<scale>0</scale>
</LabelStyle>
</Style>
<Style id="icon-1899-0F9D58-highlight">
<IconStyle>
<color>ff589d0f</color>
<scale>1</scale>
<Icon>
<href>https://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png</href>
</Icon>
<hotSpot x="32" xunits="pixels" y="64" yunits="insetPixels"/>
</IconStyle>
<LabelStyle>
<scale>1</scale>
</LabelStyle>
</Style>
<StyleMap id="icon-1899-0F9D58">
<Pair>
<key>normal</key>
<styleUrl>#icon-1899-0F9D58-normal</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#icon-1899-0F9D58-highlight</styleUrl>
</Pair>
</StyleMap>
<Style id="icon-1899-FF5252-normal">
<IconStyle>
<color>ff5252ff</color>
<scale>1</scale>
<Icon>
<href>https://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png</href>
</Icon>
<hotSpot x="32" xunits="pixels" y="64" yunits="insetPixels"/>
</IconStyle>
<LabelStyle>
<scale>0</scale>
</LabelStyle>
</Style>
<Style id="icon-1899-FF5252-highlight">
<IconStyle>
<color>ff5252ff</color>
<scale>1</scale>
<Icon>
<href>https://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png</href>
</Icon>
<hotSpot x="32" xunits="pixels" y="64" yunits="insetPixels"/>
</IconStyle>
<LabelStyle>
<scale>1</scale>
</LabelStyle>
</Style>
<StyleMap id="icon-1899-FF5252">
<Pair>
<key>normal</key>
<styleUrl>#icon-1899-FF5252-normal</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#icon-1899-FF5252-highlight</styleUrl>
</Pair>
</StyleMap>
<Folder>
<name>Clienti</name>
<Placemark>
<name>Zerod</name>
<description><![CDATA[Descrizione<br>a capo]]></description>
<address>Via G.Falcone,136 Montichiari Brescia Lombardia</address>
<styleUrl>#icon-1899-0F9D58</styleUrl>
</Placemark>
<Placemark>
<name>MR77</name>
<description><![CDATA[Descrizione<br>a capo]]></description>
<address>Via San Bernardino, 5 Montichiari Brescia Lombardia</address>
<styleUrl>#icon-1899-0288D1</styleUrl>
</Placemark>
<Placemark>
<name>Selleria</name>
<description><![CDATA[Descrizione<br>a capo]]></description>
<address>Via Via Enrico Fermi, 4 Montichiari Brescia</address>
<styleUrl>#icon-1899-FF5252</styleUrl>
</Placemark>
</Folder>
</Document>
</kml>
Google Earth for Web (aka Google Earth for Chrome) does not use the <address> tag in a KML placemark to display it on the map. The KML Placemark must have a geometry (Point, Line, or Polygon) to be visible on the map.
Placemarks with only an address (and no geometry) is supported in Google Earth Pro for Desktop. When loaded in Google Earth, the location for addresses are automatically looked up (using Google's Geocoding API) and a pin for the placemark is positioned at its location.
To use Google Earth for Web or My Maps, you can first open the KML file in Google Earth Pro then export it. The saved KML will have a Point location for the address and a bounding box as a LinearRing in each of the Placemarks, which you can import in Google Earth for Web or My Maps.
Also note that the icon style with urls using https://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png will not work in Google Earth Web or My Maps so you will need to replace with the standard Google Earth icon; e.g. http://maps.google.com/mapfiles/kml/paddle/wht-blank.png.

Make KML LineString follow roads

I am working on a KML file with two co ordinates that I use to draw line strings. It works fine when the roads are straight, but whenever the road curves the lines do not curve. Here is the KML code I use
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<open>1</open>
<Style id="s_ylw-pushpin_hl">
<IconStyle>
<color>ffff5500</color>
<scale>0.583333</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/paddle/wht-blank.png</href>
</Icon>
</IconStyle>
<LabelStyle>
<color>00ffffff</color>
</LabelStyle>
<ListStyle />
<LineStyle>
<color>ff0000ff</color>
<width>3.6</width>
</LineStyle>
<PolyStyle>
<fill>0</fill>
</PolyStyle>
</Style>
<StyleMap id="m_pushpin">
<Pair>
<key>normal</key>
<styleUrl>#s_ylw-pushpin</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#s_ylw-pushpin_hl</styleUrl>
</Pair>
</StyleMap>
<Style id="s_ylw-pushpin">
<IconStyle>
<color>ffff5500</color>
<scale>0.5</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/paddle/wht-blank.png</href>
</Icon>
</IconStyle>
<LabelStyle>
<color>00ffffff</color>
</LabelStyle>
<ListStyle />
<LineStyle>
<color>ff0000ff</color>
<width>3.6</width>
</LineStyle>
<PolyStyle>
<fill>0</fill>
</PolyStyle>
</Style>
<Placemark>
<name>Test Fac 10-26-2020</name>
<description>Sidewalk</description>
<sidewalk_missing>No</sidewalk_missing>
<LineString>
<extrude>1</extrude>
<tessellate>1</tessellate>
<coordinates>-104.818968772888,39.710975093838,0 -104.810267686844,39.708465999778,0</coordinates>
</LineString>
<Style>
<LineStyle>
<color>ffff0000</color>
<width>5</width>
</LineStyle>
</Style>
</Placemark>
<Placemark>
<name>Test Fac 10-26-2020</name>
<description>Sidewalk 1</description>
<sidewalk_missing>No</sidewalk_missing>
<LineString>
<extrude>1</extrude>
<tessellate>1</tessellate>
<coordinates>-104.819033145905,39.707747919881,0 -104.814473390579,39.70400883137,0</coordinates>
</LineString>
<Style>
<LineStyle>
<color>ffff0000</color>
<width>5</width>
</LineStyle>
</Style>
</Placemark>
</Document>
</kml>
I would like the LineString to follow similar to the yellow lines on the road. I looked into Directions API, but can't figure out a better way.
I was able to query Google Roads API as below and parse the json response and add multi geometry to KML file with the resulting co-ordinates
string url = #"https://roads.googleapis.com/v1/snapToRoads?path=" + beginLat + "," + beginLon + "|" + endLat + "," + endLon + "&interpolate=true&key=";
System.Net.WebRequest request = System.Net.WebRequest.Create(url);
System.Net.WebResponse response = request.GetResponse();
System.IO.Stream data = response.GetResponseStream();
System.IO.StreamReader reader = new System.IO.StreamReader(data);
string responseFromServer = reader.ReadToEnd();
response.Close();
Here is the json parser code. The co-ordinates are inside the "locations" table inside the dataset.
jsonString = $"{{ \"snappedPoints\": {{{jsonString.Trim().TrimStart('{').TrimEnd('}')}}} }}";
var xd = JsonConvert.DeserializeXmlNode(jsonString);
var result = new DataSet();
result.ReadXml(new XmlNodeReader(xd), mode);
return result;
Thank you all for the help and pointing me towards the right direction.

Altitude of Polygon is ignored in KML / Google Earth

I have a KML-file which uses a polygon to draw a filled area in Google Earth. In this case it is a circle. Unfortunately the altitude is ignored when displaying the file with Google Earth 7.1.7.2606 (which is the latest version to date). The KML-file itself should correspond to KML standard 2.2.
The following code reprents the full file (just the xml namespace (<kml xmlns="http://www.opengis.net/kml/2.2">) is hidden below), and when opening with GE you should see the "problem" that the altitude of 500km (=500000.00m), which is the altitude the user should see the polygon, is ignored:
<?xml version="1.0" encoding="UTF-8"?>
<Document>
<name>orbits</name>
<open>1</open>
<Snippet>orbits</Snippet>
<Style>
<ListStyle>
<ItemIcon><href>http://maps.google.com/mapfiles/kml/shapes/sunny.png</href></ItemIcon>
</ListStyle>
</Style>
<!-- begin: Group 1, Graph 1 -->
<Folder>
<name>Group: Orbit 1</name>
<visibility>1</visibility>
<open>1</open>
<Style>
<ListStyle>
<ItemIcon><href>http://maps.google.com/mapfiles/kml/shapes/arrow-reverse.png</href></ItemIcon>
</ListStyle>
</Style>
<!-- begin: TrimLinesAndPatches -->
<Folder>
<name>TrimLinesAndPatches</name>
<open>0</open>
<Style>
<ListStyle>
<ItemIcon><href>http://maps.google.com/mapfiles/kml/shapes/target.png</href></ItemIcon>
</ListStyle>
</Style>
<Folder>
<name>Relative Patches</name>
<Style id="check-hide-children">
<ListStyle>
<listItemType>checkHideChildren</listItemType>
</ListStyle>
</Style>
<styleUrl>#check-hide-children</styleUrl>
<open>0</open>
<Style>
<ListStyle>
<ItemIcon><href>http://maps.google.com/mapfiles/kml/shapes/target.png</href></ItemIcon>
</ListStyle>
</Style>
<Placemark id="polygon">
<name>Relative Patches</name>
<TimeSpan><begin>2017-04-12T13:16:44.123Z</begin><end>2017-04-12T13:21:44.123Z</end></TimeSpan>
<visibility>1</visibility>
<Style>
<LineStyle>
<color>64FFCCFF</color>
<width>0</width>
</LineStyle>
<PolyStyle>
<color>64FFCCFF</color>
</PolyStyle>
</Style>
<MultiGeometry>
<extrude>0</extrude>
<altitudeMode>absolute</altitudeMode>
<tessellate>1</tessellate>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
-12.1159516,-26.3651097,500000.00
-13.0844128,-26.4374313,500000.00
-14.0272910,-26.6524670,500000.00
-14.9194371,-27.0044676,500000.00
-15.7365727,-27.4839749,500000.00
-16.4557337,-28.0780054,500000.00
-17.0557319,-28.7703022,500000.00
-17.5176459,-29.5416541,500000.00
-17.8253587,-30.3702824,500000.00
-17.9661527,-31.2323009,500000.00
-17.9313683,-32.1022573,500000.00
-17.7171071,-32.9537663,500000.00
-17.3249379,-33.7602445,500000.00
-16.7625260,-34.4957477,500000.00
-16.0440739,-35.1359009,500000.00
-15.1904382,-35.6588849,500000.00
-14.2287935,-36.0464258,500000.00
-13.1917549,-36.2847064,500000.00
-12.1159516,-36.3651097,500000.00
-11.0401483,-36.2847064,500000.00
-10.0031097,-36.0464258,500000.00
-9.0414649,-35.6588849,500000.00
-8.1878292,-35.1359009,500000.00
-7.4693772,-34.4957477,500000.00
-6.9069653,-33.7602445,500000.00
-6.5147960,-32.9537663,500000.00
-6.3005348,-32.1022573,500000.00
-6.2657504,-31.2323009,500000.00
-6.4065445,-30.3702824,500000.00
-6.7142572,-29.5416541,500000.00
-7.1761713,-28.7703022,500000.00
-7.7761695,-28.0780054,500000.00
-8.4953305,-27.4839749,500000.00
-9.3124660,-27.0044676,500000.00
-10.2046122,-26.6524670,500000.00
-11.1474904,-26.4374313,500000.00
-12.1159516,-26.3651097,500000.00
</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</MultiGeometry>
</Placemark>
</Folder>
</Folder>
<!-- end: TrimLinesAndPatches -->
</Folder>
</Document>
I tried also to "extrude" it, but also there no effect.
Is there something wrong with my file or is there a bug in GE?
The altitudeMode must be associated with the Polygon not the MultiGeometry.
Extrude and tessellate must also be child elements under the Polygon element.
The corrected KML would be this:
<MultiGeometry>
<Polygon>
<extrude>0</extrude>
<tessellate>1</tessellate>
<altitudeMode>absolute</altitudeMode> ***
<outerBoundaryIs>
<LinearRing>...</LinearRing>
</outerBoundaryIs>
</Polygon>
</MultiGeometry>
Also, if you only have a single geometry in the multiGeometry then you should discard the multiGeometry entirely and just use the Polygon.

When I export Google My Maps to KML (or KMZ) it doesn't include <Point> value

I want to export the data from My Maps to a KML file to use elsewhere, however, it is missing the Point data I need for the PlaceMarker. It seems like there should be a way to include this, because clicking on a point shows the Latitude and Longitude underneath the description, but I have a large number of points and don't want to hard code each one. I put sample code of what I'm talking about below.
<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns='http://www.opengis.net/kml/2.2'>
<Document>
<name>Test</name>
<description><![CDATA[]]></description>
<Folder>
<name>address.xlsx</name>
<Placemark>
<name>Buffet</name>
<description><![CDATA[First: Jimmy<br>Address: Somewhere on the Beach<br>City: Key West<br>State: FL<br>ZIP: 33040]]></description>
<styleUrl>#icon-503-DB4436</styleUrl>
<ExtendedData>
<Data name='First'>
<value>Jimmy</value>
</Data>
<Data name='Address'>
<value>Somewhere on the Beach</value>
</Data>
<Data name='City'>
<value>Key West</value>
</Data>
<Data name='State'>
<value>FL</value>
</Data>
<Data name='ZIP'>
<value>33040</value>
</Data>
</ExtendedData>
<address>Somewhere on the Beach Key West FL 33040</address>
</Placemark>
<Placemark>
<name>Bush</name>
<description><![CDATA[First: George<br>Address: 1600 Pennsylvania Ave<br>City: Washington<br>State: DC<br>ZIP: 20500]]></description>
<styleUrl>#icon-503-DB4436</styleUrl>
<ExtendedData>
<Data name='First'>
<value>George</value>
</Data>
<Data name='Address'>
<value>1600 Pennsylvania Ave</value>
</Data>
<Data name='City'>
<value>Washington</value>
</Data>
<Data name='State'>
<value>DC</value>
</Data>
<Data name='ZIP'>
<value>20500</value>
</Data>
</ExtendedData>
<address>1600 Pennsylvania Ave Washington DC 20500</address>
</Placemark>
<Placemark>
<name>Crockett</name>
<description><![CDATA[First: Davey<br>Address: The Alamo<br>City: San Antonio<br>State: TX<br>ZIP: 78210]]></description>
<styleUrl>#icon-503-DB4436</styleUrl>
<ExtendedData>
<Data name='First'>
<value>Davey</value>
</Data>
<Data name='Address'>
<value>The Alamo</value>
</Data>
<Data name='City'>
<value>San Antonio</value>
</Data>
<Data name='State'>
<value>TX</value>
</Data>
<Data name='ZIP'>
<value>78210</value>
</Data>
</ExtendedData>
<address>The Alamo San Antonio TX 78210</address>
</Placemark>
<Placemark>
<name>Gates</name>
<description><![CDATA[First: Bill<br>Address: 1 Microsoft Way<br>City: Redmond<br>State: WA<br>ZIP: 98052]]></description>
<styleUrl>#icon-503-DB4436</styleUrl>
<ExtendedData>
<Data name='First'>
<value>Bill</value>
</Data>
<Data name='Address'>
<value>1 Microsoft Way</value>
</Data>
<Data name='City'>
<value>Redmond</value>
</Data>
<Data name='State'>
<value>WA</value>
</Data>
<Data name='ZIP'>
<value>98052</value>
</Data>
</ExtendedData>
<address>1 Microsoft Way Redmond WA 98052</address>
</Placemark>
<Placemark>
<name>Kong</name>
<description><![CDATA[First: King<br>Address: Empire State Building<br>City: New York<br>State: NY<br>ZIP: 10118]]></description>
<styleUrl>#icon-503-DB4436</styleUrl>
<ExtendedData>
<Data name='First'>
<value>King</value>
</Data>
<Data name='Address'>
<value>Empire State Building</value>
</Data>
<Data name='City'>
<value>New York</value>
</Data>
<Data name='State'>
<value>NY</value>
</Data>
<Data name='ZIP'>
<value>10118</value>
</Data>
</ExtendedData>
<address>Empire State Building New York NY 10118</address>
</Placemark>
<Placemark>
<name>Rockne</name>
<description><![CDATA[First: Knute<br>Address: 146 Keenan Hall<br>City: Notre Dame<br>State: IN<br>ZIP: 46556]]></description>
<styleUrl>#icon-503-DB4436</styleUrl>
<ExtendedData>
<Data name='First'>
<value>Knute</value>
</Data>
<Data name='Address'>
<value>146 Keenan Hall</value>
</Data>
<Data name='City'>
<value>Notre Dame</value>
</Data>
<Data name='State'>
<value>IN</value>
</Data>
<Data name='ZIP'>
<value>46556</value>
</Data>
</ExtendedData>
<address>146 Keenan Hall Notre Dame IN 46556</address>
</Placemark>
<Placemark>
<name>Simpson</name>
<description><![CDATA[First: Homer<br>Address: 742 Evergreen Terrace<br>City: Springfield<br>State: US<br>ZIP: 12345]]></description>
<styleUrl>#icon-503-DB4436</styleUrl>
<ExtendedData>
<Data name='First'>
<value>Homer</value>
</Data>
<Data name='Address'>
<value>742 Evergreen Terrace</value>
</Data>
<Data name='City'>
<value>Springfield</value>
</Data>
<Data name='State'>
<value>US</value>
</Data>
<Data name='ZIP'>
<value>12345</value>
</Data>
</ExtendedData>
<address>742 Evergreen Terrace Springfield US 12345</address>
</Placemark>
</Folder>
<Style id='icon-503-DB4436-normal'>
<IconStyle>
<color>ff3644DB</color>
<scale>1.1</scale>
<Icon>
<href>http://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png</href>
</Icon>
<hotSpot x='16' y='31' xunits='pixels' yunits='insetPixels'>
</hotSpot>
</IconStyle>
<LabelStyle>
<scale>0.0</scale>
</LabelStyle>
</Style>
<Style id='icon-503-DB4436-highlight'>
<IconStyle>
<color>ff3644DB</color>
<scale>1.1</scale>
<Icon>
<href>http://www.gstatic.com/mapspro/images/stock/503-wht-blank_maps.png</href>
</Icon>
<hotSpot x='16' y='31' xunits='pixels' yunits='insetPixels'>
</hotSpot>
</IconStyle>
<LabelStyle>
<scale>1.1</scale>
</LabelStyle>
</Style>
<StyleMap id='icon-503-DB4436'>
<Pair>
<key>normal</key>
<styleUrl>#icon-503-DB4436-normal</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#icon-503-DB4436-highlight</styleUrl>
</Pair>
</StyleMap>
</Document>
</kml>
You can see in this photo the latitude and longitude displayed to the bottom left of the description

Placemark Icons not showing up on Google Earth !!! Where I am going wrong?

I had developed an application where in the data fetches from our database and shows up different polygons on Google Earth by generating an kml file.
I was able to do all sort of things like showing polygons,showing up placemarks with name and description, but was unable to show up the icon image on polygons.
I have checked the kml in notepad and it is generating in correct format.
I don't understand where I am getting wrong,Why my placemark icon is not showing up in my Google Earth software.
Here I am posting my whole kml code.
You could copy it into a notepad and save it as kml.
Note:- Google Earth Software is installed in my computer, through which I view the downloaded KML File.
Please help me in this regard.
Thanking You.
Regards,
BhanuChandra
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Style id="bsr">
<IconStyle>
<scale>1.5</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pushpin/grn-pushpin.png</href>
</Icon>
</IconStyle>
<LineStyle>
<width>3</width>
<color>ff0000ff</color>
<colorMode>random</colorMode>
</LineStyle>
<PolyStyle>
<color>51400FF</color>
<LabelStyle>
<color>7fffaaff</color>
<scale>1.5</scale>
</LabelStyle>
</PolyStyle>
</Style>
<Placemark>
<styleUrl>#bsr</styleUrl>
<name>Near Subbaraopally Village</name>
<description><![CDATA[<b>Circle : </b>Adilabad<br/><b>Division : </b>Bellampally<br/><b>Range : </b>Bellampally<br/><b>Year : </b>2015<br/><b>Type : </b>Block<br/><b>Planting Method : </b>Labour Intensive(AR)<hr><br/><font color=LightSlateGray size = 1>ID : 108</font>]]></description>
<MultiGeometry>
<Polygon>
<extrude>1</extrude>
<tessellate>1</tessellate>
<altitudeMode>ALTITUDE_CLAMP_TO_GROUND</altitudeMode>
<outerBoundaryIs>
<LinearRing>
<coordinates>79.49749,19.02856,0 79.49763,19.02929,0 79.49739,19.02944,0 79.4979,19.0311,0 79.49628,19.03258,0 79.5002,19.0356,0 79.5007,19.0342,0 79.50138,19.03229,0 79.4997,19.03065,0 79.49749,19.02856,0 </coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</MultiGeometry>
</Placemark>
<Placemark>
<styleUrl>#bsr</styleUrl>
<name>Bamboo with Misc 5x5 Bamboo (2.5x2.5 Misc) 10 Ha Near Gangaram Nagar</name>
<description><![CDATA[<b>Circle : </b>Adilabad<br/><b>Division : </b>Bellampally<br/><b>Range : </b>Bellampally<br/><b>Year : </b>2015<br/><b>Type : </b>Block<br/><b>Planting Method : </b>Semi Mechanical(AR)<hr><br/><font color=LightSlateGray size = 1>ID : 350599</font>]]></description>
<MultiGeometry>
<Polygon>
<extrude>1</extrude>
<tessellate>1</tessellate>
<altitudeMode>ALTITUDE_CLAMP_TO_GROUND</altitudeMode>
<outerBoundaryIs>
<LinearRing>
<coordinates>79.46981,19.07547,0 79.46986,19.07352,0 79.46985,19.07323,0 79.46861,19.07353,0 79.46556,19.07297,0 79.46554,19.07353,0 79.46607,19.07423,0 79.46693,19.07483,0 79.4679,19.0748,0 79.46785,19.07613,0 79.4698,19.07641,0 79.46981,19.07547,0 </coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</MultiGeometry>
</Placemark>
<Placemark>
<styleUrl>#bsr</styleUrl>
<name>Misc. Plantation at Waripet</name>
<description><![CDATA[<b>Circle : </b>Adilabad<br/><b>Division : </b>Bellampally<br/><b>Range : </b>Bellampally<br/><b>Year : </b>2015<br/><b>Type : </b>Block<br/><b>Planting Method : </b>Labour Intensive(AR)<hr><br/><font color=LightSlateGray size = 1>ID : 350782</font>]]></description>
<MultiGeometry>
<Polygon>
<extrude>1</extrude>
<tessellate>1</tessellate>
<altitudeMode>ALTITUDE_CLAMP_TO_GROUND</altitudeMode>
<outerBoundaryIs>
<LinearRing>
<coordinates>79.43114,19.05873,0 79.43082,19.05947,0 79.43044,19.06048,0 79.42989,19.0615,0 79.42976,19.06282,0 79.42985,19.06278,0 79.43007,19.06333,0 79.4304,19.06406,0 79.43073,19.06469,0 79.43098,19.06514,0 79.43174,19.06511,0 79.43106,19.06442,0 79.43066,19.06397,0 79.43061,19.06345,0 79.43005,19.06156,0 79.43132,19.05964,0 79.4313,19.05883,0 79.43114,19.05873,0 </coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</MultiGeometry>
</Placemark>
<Placemark>
<styleUrl>#bsr</styleUrl>
<name>Misc. Plantation at VSS Waripet</name>
<description><![CDATA[<b>Circle : </b>Adilabad<br/><b>Division : </b>Bellampally<br/><b>Range : </b>Bellampally<br/><b>Year : </b>2015<br/><b>Type : </b>Block<br/><b>Planting Method : </b>Semi Mechanical(AR)<hr><br/><font color=LightSlateGray size = 1>ID : 350783</font>]]></description>
<MultiGeometry>
<Polygon>
<extrude>1</extrude>
<tessellate>1</tessellate>
<altitudeMode>ALTITUDE_CLAMP_TO_GROUND</altitudeMode>
<outerBoundaryIs>
<LinearRing>
<coordinates>79.43598,19.06411,0 79.43665,19.0637,0 79.43723,19.06328,0 79.43742,19.06237,0 79.43725,19.06227,0 79.43741,19.06162,0 79.43762,19.06168,0 79.43788,19.06087,0 79.43873,19.05984,0 79.43935,19.05886,0 79.43988,19.05789,0 79.43965,19.05784,0 79.43924,19.05835,0 79.43835,19.05918,0 79.43786,19.05967,0 79.43732,19.06053,0 79.43686,19.06133,0 79.43709,19.06148,0 79.43687,19.06222,0 79.43647,19.06213,0 79.43648,19.06247,0 79.43614,19.0634,0 79.43954,19.05254,0 79.43944,19.05298,0 79.43923,19.05334,0 79.43926,19.05383,0 79.43931,19.05415,0 79.43893,19.05488,0 79.43867,19.05509,0 79.43887,19.05533,0 79.43886,19.05543,0 79.43893,19.05592,0 79.43939,19.05605,0 79.43974,19.05604,0 79.43945,19.05522,0 79.43949,19.05503,0 79.43952,19.05487,0 79.43948,19.05458,0 79.43948,19.05444,0 79.4395,19.05405,0 79.43958,19.05375,0 79.43974,19.05278,0 79.43975,19.05255,0 79.43598,19.06411,0 </coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</MultiGeometry>
</Placemark>
</Document>
</kml>
Primary issue is to show an icon and label while using a polygon requires a Point to appear inside the MultiGeometry alongside the Polygon. If the placemark geometry is a polygon then an icon and label will NOT appear on the map - that needs a point.
Here is an example of such a geometry for the first placemark:
<MultiGeometry>
<Point>
<coordinates>79.49883,19.03208</coordinates>
</Point>
<Polygon>
<extrude>1</extrude>
<tessellate>1</tessellate>
<outerBoundaryIs>
<LinearRing>
<coordinates>79.49749,19.02856,0 79.49763,19.02929,0 79.49739,19.02944,0 79.4979,19.0311,0 79.49628,19.03258,0 79.5002,19.0356,0 79.5007,19.0342,0 79.50138,19.03229,0 79.4997,19.03065,0 79.49749,19.02856,0 </coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</MultiGeometry>
There are also some minor errors in the KML. First, LabelStyle is inside the PolyStyle element. Next,the altitudeMode values are invalid: ALTITUDE_CLAMP_TO_GROUND must be changed to clampToGround .

Resources