title: Loading KML into Google earth?
body: <p>I can't figure out why for example I try to reproduce something basic like this example <a href="https://google-developers.appspot.com/earth/documentation/samples/fetchkml_example" rel="nofollow">https://google-developers.appspot.com/earth/documentation/samples/fetchkml_example</a> on my own, I can't get it to work. I'm using my key that I have been using for my Google Maps API, so I think that part should be fine, but when it comes to KML I can't seem to get it to work regardless of whether it is fetched or parsed. I have put my KML file here <a href="https://sites.google.com/site/shahinkmlexamples/experiment/kml_example.kml" rel="nofollow">https://sites.google.com/site/shahinkmlexamples/experiment/kml_example.kml</a> , and my code is below with my own key number not shown</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
     &lt;title&gt;fetchkml_dom_example.html&lt;/title&gt;
     &lt;script src="//www.google.com/jsapi?key=MYKEY#"&gt;&lt;/script&gt;
     &lt;script type="text/javascript"&gt;
        var ge;
        google.load("earth", "1");
  
        function init() {
           google.earth.createInstance('map3d', initCB, failureCB);
        }
  
        function initCB(instance) {
           ge = instance;
           ge.getWindow().setVisibility(true);
  
           var href = 'https://sites.google.com/' + 'site/shahinkmlexamples/experiment/kml_example.kml';
  
           google.earth.fetchKml(ge, href, function(kmlObject) {
                 if (kmlObject)
                    ge.getFeatures().appendChild(kmlObject);
                 if (kmlObject.getAbstractView() !== null)
                    ge.getView().setAbstractView(kmlObject.getAbstractView());
           });
        }
  
        function failureCB(errorCode) {
        }
  
        google.setOnLoadCallback(init);
     &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
     &lt;div id="map3d" style="border: 1px solid silver; height: 400px; width: 600px;"&gt;&lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>so I know the solution has got to be simple, but I just can't figure it out.
  Thanks</p>