title: Google function and addDomListener
body: <p>I have set code to display without an error but I'me new to this. Specially 
  <code>addDomListener</code> position.</p>
  
  <pre><code>var GoogleMap1 = function() {
  
      return {
  
          initMap: function() {
              (function(jQuery) {
  
                  jQuery(document).ready(function() {
  
                      var myLatlng = new google.maps.LatLng(-25.363882, 131.044922);
                      var mapOptions = {
                          zoom: 4,
                          center: myLatlng
                      }
                      var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
  
                      var marker = new google.maps.Marker({
                          position: myLatlng,
                          map: map,
                          title: 'Hello World!'
                      });
  
                      google.maps.event.addDomListener(window, 'load', initialize);
  
                  });
  
              })(jQuery);
          }
  
      };
  }();
  </code></pre>
  
  <p>Is this correct or can be improved, specially line:   <code>google.maps.event.addDomListener(window, 'load', initialize);</code> </p>
  
  <p>Reference URL for addDomListener is actually at 
  <a href="https://developers.google.com/maps/documentation/javascript/examples/marker-simple" rel="nofollow">https://developers.google.com/maps/documentation/javascript/examples/marker-simple</a></p>
  
  <p>Currently it will be an error and I like to avoid using solution like ddDomListener:</p>
  
  <blockquote>
    <p>Error: TypeError: element is null Line:
    element.parentNode.removeChild(element);</p>
  </blockquote>
  
  <p>Need help.</p>