title: Problem to pass a kml file to Google Earth using geoxml3 class and ProjectedOverlay class
body: <p>i am trying to build a google earth view showing cities, but i stuck with the kml parser geoxml3. I have a javascript building a google map at first showing the locations i want. this works fine. I call the function from a php script providing it an address and kml file reference from database. The function builds the map, sets a flag 'map_finished' as a control flag when all ran fine and calls the build google earth view function.</p>
  
  <pre><code>// Get maps and earth from google
  google.load( 'maps', '2.s', {'other_params': 'sensor=true'} );
  google.load( 'earth', '1' );
  
  //Google Earth Initializer
  function initObjectEarth() {
    // Check if Google Earth plugin is installed   
    if( gm_loaded ) {
    this.ge_plugin_installed = google.earth.isInstalled();
  
    if( this.ge_plugin_installed ) {
      google.earth.createInstance( 'inmap', geSuccessCallback, geFailureCallback );
      ge_loaded = true;
    } else {
      alert( 'Your Browser has not yet installed the Google Earth plugin. 
              We recommend installing it to use all features!' );
      return false;
    }
   }
  }
  
  // Success handler
  function geSuccessCallback( object ) {
    this.ge = object;
    this.ge.getWindow().setVisibility( true );
    this.kmlParser = new geoXML3.parser();
  }
  
  // Error handler
  function geFailureCallback( object ) {
     alert( 'Error: ' + object );
  }
  </code></pre>
  
  <p>The geoxml parser uses the ProjectedOverlay class. Both libraries are loaded into document head. When the parser is getting instatiated it requests a ProjectedOverlay instance. This class throws a</p>
  
  <pre><code>Error: **google.maps is undefined**
  </code></pre>
  
  <p>error in firebug for the following statement</p>
  
  <pre><code>ProjectedOverlay.prototype = new google.maps.OverlayView();
  </code></pre>
  
  <p>In my script file i have declared vars including</p>
  
  <pre><code>var gm //for google map
  var ge //for google earth
  </code></pre>
  
  <p>gm is set in the function that builds the google map.</p>
  
  <p>I wonder how to fix this issue. I tried the getProjection() thing i found in web as well as</p>
  
  <pre><code>ProjectedOverlay.prototype = new google.maps.OverlayView().prototype;
  </code></pre>
  
  <p>with no success. This topic is absolutely new to me and i cannot figure out how to fix it neither from the documentation of OverlayView nor from google search.</p>
  
  <p>What did i forget or do wrong?</p>