diff -ur geocode-original/includes/geocode.inc geocode/includes/geocode.inc
--- geocode-original/includes/geocode.inc	2009-11-04 15:07:31.000000000 -0600
+++ geocode/includes/geocode.inc	2010-10-31 00:51:05.000000000 -0600
@@ -2,17 +2,20 @@
 
 class geocode {
   var $result;
+  var $formatted_address;
 
   var $point;
   var $box;
   var $street1;
   var $street2;
+  var $street_number;
   var $city;
   var $state;
   var $zip;
   var $country;
   var $country_name;
 
+
   function set_result($value) {
     $this->$result = $value;
   }
@@ -54,57 +57,111 @@
 
   function get_field_postal() {
     $postal = array();
-    foreach (array('street1', 'street2', 'city', 'state', 'zip', 'country') as $item) {
-      if (isset($this->$item)) $postal[$item] = $this->$item;
+    foreach (array('street_number', 'street1', 'street2', 'city', 'state', 'zip', 'country') as $item) {
+      if (isset($this->$item))
+        $postal[$item] = $this->$item;
     }
     return $postal;
   }
+
+  /**
+   * Gets the human-readable address of the requested location.
+   *
+   * @return
+   *   A string containing the human-readable address of this location.
+   */
+  function get_formatted_address() {
+    return $this->formatted_address;
+  }
 }
 
 class geocode_google extends geocode {
 
+
   function set_result($result) {
     $this->result = $result;
-    if (isset($result->AddressDetails)) {
-      $addr = $result->AddressDetails->Country;
-      $this->country_name = $addr->CountryName;
-      $this->country = $addr->CountryNameCode;
-      $this->state = $addr->AdministrativeArea->AdministrativeAreaName;
-      $this->city = $addr->AdministrativeArea->Locality->LocalityName;
-      $this->street1 = $addr->AdministrativeArea->Locality->Thoroughfare->ThoroughfareName;
-      $this->zip = $addr->AdministrativeArea->Locality->PostalCode->PostalCodeNumber;
-    }
 
-    if (isset($result->Point)) {
-      $point = (array) $result->Point->coordinates;
-      $this->point = array(
-        'type' => 'point', 'lat' => $point[1], 'lon' => $point[0], 'alt' => $point[2],
+    // Store the formatted address if present.
+    $this->formatted_address = $result->formatted_address;
+
+    // Translate the values returned by the Google Geocoding API to values used
+    // by the Geocode module.
+    foreach ($result->address_components as $component) {
+      switch ($component->types) {
+        case 'postal_code':
+          $this->zip = $component->long_name;
+          break;
+        case 'country':
+          $this->country = $component->short_name;
+          $this->country_name = $component->long_name;
+          break;
+        case 'administrative_area_level_1':
+          $this->state = $component->long_name;
+          break;
+        case 'locality':
+          $this->city = $component->long_name;
+          break;
+        case 'route':
+          $this->street1 = $component->long_name;
+          break;
+        case 'street_number':
+          $this->street_number = $component->long_name;
+          break;
+        default:
+          break;
+      }
+    }
+
+    $this->point = array(
+     'type' => 'point',
+     'lat' => $result->geometry->location->lat,
+     'lon' => $result->geometry->location->lng,
+    );
+
+    // Convert the new viewport data into the old north-east-south-west format
+    // to maintain backward compatibility.
+    if (isset($result->geometry->viewport)) {
+      $this->box = array(
+        'north' => $result->geometry->viewport->northeast->lat,
+        'east' => $result->geometry->viewport->northeast->lng,
+        'south' => $result->geometry->viewport->southwest->lat,
+        'west' => $result->geometry->viewport->southwest->lng,
       );
     }
-    if (isset($result->ExtendedData->LatLonBox)) {
-      $this->box = (array) $result->ExtendedData->LatLonBox;
-    }
   }
 
+  /**
+   * Executes a geocoding request against Google's geocoding webservice.
+   * 
+   * @param $input
+   *   The location or address that needs to be geocoded. Can be either a string
+   *   or an array containing multiple locations.
+   * @param $options
+   *   An array of optional options to pass to the geocoding webservice.
+   * 
+   * @return
+   *   TRUE if the geocoding request was successful, FALSE otherwise.
+   */
   function geocode($input, $options) {
     if (is_array($input)) $input = join(',', $input);
-    $url = "http://maps.google.com/maps/geo?";
-    $url .= 'q='. urlencode($input);
 
-    // Deliberately reusing the GMAP key, still pending an interface.
-    global $conf;
-    if ($key = variable_get('googlemap_api_key', '')) {
-      $url .= '&key='. check_plain($key);
-    }
-    $url .= '&sensor=false&output=json&oe=utf-8';
-    $ret = drupal_http_request($url);
-    $result = json_decode($ret->data);
+    $query = array(
+      'address' => $input,
+      'sensor' => 'false',
+    );
+
+    $url = url('http://maps.google.com/maps/api/geocode/json', array('query' => $query));
 
-    if ($result->Status->code == '200') {
-      $this->set_result($result->Placemark[0]);
+    $geocode_result = drupal_http_request($url);
+    $result = json_decode($geocode_result->data);
+
+    if ($result->status == 'OK') {
+      $this->set_result($result->results[0]);
       return TRUE;
     }
 
     return FALSE;
   }
+  
+
 }
