title: Parse kml file to show multiple Placemark in google earth
body: <p>I would like to show multiple Placemarks by parsing a kml file. Please help, Im stuck for long days.</p>
  
  <p>As I see google earth desktop client works well for following kml code snippet </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;kml xmlns="http://www.opengis.net/kml/2.2"&gt;
  
  &lt;Document&gt;    
    &lt;Placemark&gt;
      &lt;name&gt;Placemark2 from KML file&lt;/name&gt;
      &lt;Point&gt;
        &lt;coordinates&gt;-122.448425,36.802907,0&lt;/coordinates&gt;
      &lt;/Point&gt;
    &lt;/Placemark&gt;
    &lt;Placemark&gt;
      &lt;name&gt;Placemark2 from KML file&lt;/name&gt;
      &lt;Point&gt;
        &lt;coordinates&gt;-122.448425,37.802907,0&lt;/coordinates&gt;
      &lt;/Point&gt;
    &lt;/Placemark&gt;
  &lt;/Document&gt; 
  &lt;/kml&gt;
  </code></pre>
  
  <p>Based on the above code snippet I tried by following to show multiple placemark at first look. But NO LUCK. I prefer to parse kml string instead of fetching a .kml file, kml file need to be publicly available and reachable by Google. Moreover by parsing kml string we can test it from localhost. </p>
  
  <pre><code>&lt;script src="//www.google.com/jsapi?key=ABQIAAAA5El50zA4PeDTEMlv-sXFfRSsTL4WIgxhMZ0ZK_kHjwHeQuOD4xTdBhxbkZWuzyYTVeclkwYHpb17ZQ"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
      var ge;
      var placemark;
      var object;
  
      google.load("earth", "1");
  
      function init() {
          google.earth.createInstance('map3d', initCB, failureCB);
      }
  
      function initCB(instance) {
          ge = instance;
          ge.getWindow().setVisibility(true);
          var kmlString = ''
                          + '&lt;?xml version="1.0" encoding="UTF-8"?&gt;'
                          + '&lt;kml xmlns="http://www.opengis.net/kml/2.2"&gt;'
                          + '&lt;Document&gt;'                           
                          + '&lt;Placemark&gt;'
                              + '&lt;name&gt;Placemark1&lt;/name&gt;'
                              + '&lt;description&gt;Some Descriptive text.&lt;/description&gt;'
                              + '&lt;Point&gt;'
                              + '&lt;coordinates&gt;-122.448425,36.802907,0&lt;/coordinates&gt;'
                              + '&lt;/Point&gt;'
                          + '&lt;/Placemark&gt;'
                          + '&lt;Placemark&gt;'
                              + '&lt;name&gt;Placemark2&lt;/name&gt;'
                              + '&lt;Point&gt;'
                              + '&lt;coordinates&gt;-122.448425,37.802907,0&lt;/coordinates&gt;'
                              + '&lt;/Point&gt;'
                          + '&lt;/Placemark&gt;'
                          + '&lt;/Document&gt;'
                          + '&lt;/kml&gt;';
  
          var kmlObject = ge.parseKml(kmlString);
          ge.getFeatures().appendChild(kmlObject);
          ge.getView().setAbstractView(kmlObject.getAbstractView());
      }
  
      function failureCB(errorCode) {
      }
  
      google.setOnLoadCallback(init);
  &lt;/script&gt;
  &lt;div id="map3d" style="border: 1px solid silver; height: 400px; width: 600px;"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>If I add following camera tag in document then one Placemark is shown. All placemark can be shown by zoom out. </p>
  
  <pre><code>+ '&lt;Camera&gt;'
        + '&lt;longitude&gt;-122.448425&lt;/longitude&gt;'
        + '&lt;latitude&gt;36.802907&lt;/latitude&gt;'
        + '&lt;altitude&gt;100&lt;/altitude &gt;'                             
        + '&lt;tilt&gt;10&lt;/tilt&gt;'
        + '&lt;heading&gt;2.7&lt;/heading&gt;'
    + '&lt;/Camera&gt;'
  </code></pre>
  
  <p>Have any idea, How can I show mulitple placemark at first look?</p>