title: KML Heatmap for Google Earth or Google Maps
body: <p>I have been given the task of making a <strong>KML file</strong> that can be dropped onto <strong>Google Earth or Google Maps</strong> and display the data as a <strong>heatmap</strong>. The script has to be written in PHP and generate a KML (xml) output. I have made some circles and such work but I am coming to what I think is a realisation that it can't be done after hours trying to work this out. Does anyone know if you can generate a <code>.kml</code> file that you can drag and drop onto google earth for example and it will display like a heatmap, similar to the below.</p>
  
  <p><a href="https://i.stack.imgur.com/KoOAt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KoOAt.png" alt="enter image description here"></a></p>
  
  <p><strong>I <em>can not</em> use any JavaScript</strong> (or I wouldn't have this problem in the first place).</p>
  
  <p><strong>Example single point KML file.</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;kml xmlns="http://earth.google.com/kml/2.2"&gt;
          &lt;Placemark&gt;
          &lt;name&gt;Test Point&lt;/name&gt;
          &lt;description&gt;Test Point Description&lt;/description&gt;
          &lt;Point&gt;
              &lt;coordinates&gt;147.095947265625,-23.664650731631614,0&lt;/coordinates&gt;
          &lt;/Point&gt;
      &lt;/Placemark&gt;
  &lt;/kml&gt;
  </code></pre>