title: Removing KML overlay from Google Maps
body: <p>I have a reset button that I want to reset the map (including removing overlays) when clicked.</p>
  <p>I've been reading around and apparently the way you remove KML overlays is by;</p>
  <ol>
  <li><p>Declaring your kml variable as a global variable</p>
  <p><code>var ctaLayer = new google.maps.KmlLayer(null);</code></p>
  </li>
  <li><p>These are the lines that cause the kml file to overlay on google maps</p>
  </li>
  </ol>
  <pre><code>   var ctaLayer = new google.maps.KmlLayer(kmlFile);
     ctaLayer.setMap(map);
  </code></pre>
  <ol start="3">
  <li><p>And then call setMap(null) to remove the overlay.</p>
  <p><code>ctaLayer.setMap(null);</code></p>
  </li>
  </ol>
  <p>However, this does not seem to be working. I don't get any errors so I'm guessing I'm missing something? I'd appreciate any advice on getting this to work.</p>