title: AJAX JQuery Load KML Layer
body: <p>I'm trying to utilize a KML layer onto Google Maps API 3.0 using a JQuery AJAX request. This is what I have so far (not working).</p>
  
  <pre><code>&lt;script&gt;
   $(document).ready(function(){
  
   $.ajax({
     url : 'https://blahhhhhhhhhh.com/KML_Placemarks.kml',
     dataType : 'html',
     success : function(data) {
       console.log(data);
       var Google = new google.maps.LatLng(37.42228990140251,-122.0822035425683);
       var mapOptions = {
        zoom: 18,
        center: Google
     }
  
     var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
     var ctaLayer = new google.maps.KmlLayer({
       //url: 'http://gmaps-samples.googlecode.com/svn/trunk/ggeoxml/cta.kml'
       url: data
     });
  
     ctaLayer.setMap(map);
     console.log(data);
  
     }
    });                           
   });
  &lt;/script&gt;
  </code></pre>
  
  <p>The example from the Google Maps API documentation simply has that <code>cta.kml</code> file assigned to the <code>url</code> piece. What I want to do is substitute that with the result of the AJAX request. </p>
  
  <p>I feel like it's possible because the result of the <code>console.log(data)</code> reads the content it eventually needs. </p>
  
  <p>Thanks!</p>