title: Google Maps geocoding : "google is not defined"
body: <p>I'm getting an issue when I try to load this code, and I can't figure why it doesn't work...</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function()
      {
          var geocoder = new google.maps.Geocoder();
          $(".textarea-autosize").autosize();
  
          geocoder.geocode({
              address: '{$order-&gt;address_delivery["address1"]},{$order-&gt;address_delivery["postecode"]},{$order-&gt;address_delivery["city"]}'
              }, function(results, status) {
              if (status === google.maps.GeocoderStatus.OK)
              {
                  var delivery_map = new google.maps.Map(document.getElementById('map-canvas'), {
                      zoom: 10,
                      mapTypeId: google.maps.MapTypeId.ROADMAP,
                      center: results[0].geometry.location
                  });
                  var delivery_marker = new google.maps.Marker({
                      map: delivery_map,
                      position: results[0].geometry.location,
                      url: 'http://maps.google.com?q={$order-&gt;address_delivery["address1"]},{$order-&gt;address_delivery["postcode"]},{$order-&gt;address_delivery["city"]}'
                  });
                  google.maps.event.addListener(delivery_marker, 'click', function() {
                      window.open(delivery_marker.url);
                  });
              }
          });
      });
  
      // Fix wrong maps center when map is hidden
      $('#tabAddresses').click(function(){
          x = delivery_map.getZoom();
          c = delivery_map.getCenter();
          google.maps.event.trigger(delivery_map, 'resize');
          delivery_map.setZoom(x);
          delivery_map.setCenter(c);
  
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>The error occurrs on the <code>var geocoder = new google.maps.Geocoder();</code></p>
  
  <p>Then I tried to load the following script : <code>&lt;script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"&gt;&lt;/script&gt;</code></p>
  
  <p>and I get another error : </p>
  
  <blockquote>
    <p>'Uncaught TypeError: Cannot read property 'offsetWidth' of null' </p>
  </blockquote>
  
  <p>Does anyone has any idea of why it doesn't work ?</p>