title: GWT: JSNI Function Call to getElementById() Returns Null
body: <p>I am trying to use JSNI to display a Google Map within an Application. I have defined the script in my index.html page.</p>
  
  <p>Here is the uibinder definition (snipped down to the essentials):</p>
  
  <pre><code>&lt;g:HTMLPanel ui:field="mapboxV3ContentPanel"&gt;
      &lt;!-- div for display of the actual map --&gt;
      &lt;div id="map"&gt;&lt;!-- --&gt;&lt;/div&gt;
  &lt;/g:HTMLPanel&gt;
  </code></pre>
  
  <p>Here is the initializeMap() native function:</p>
  
  <pre><code>private native void initializeMap() /*-{
  
      var latLng = new $wnd.google.maps.LatLng(-34.397, 150.644);
      var mapOptions = {
          zoom: 8,
          center: latLng,
          mapTypeId: $wnd.google.maps.MapTypeId.ROADMAP
      };
      var mapDiv = $doc.getElementById('map');
      if (mapDiv==null) {
          alert("MapDiv is null!");
      }
      var map = new $wnd.google.maps.Map(mapDiv, mapOptions);
  }-*/;
  </code></pre>
  
  <p>Unfortunately, mapDiv is null. Any help out there?</p>
  
  <p>I am aware of the gwt-maps and gwt-maps-v3 projects. The first only supports v2 of the API, and gwt-maps-v3 will not work for me, hence the JSNI approach.</p>