diff --git a/supported/location.au.inc b/supported/location.au.inc index a898e47..df0c3c8 100644 --- a/supported/location.au.inc +++ b/supported/location.au.inc @@ -219,9 +219,6 @@ function location_map_link_au_default_providers() { function location_geocode_au_providers() { return array( 'yahoo' => array('name' => 'Yahoo! Maps Web Services', 'url' => 'http://developer.yahoo.com/maps/rest/V1/geocode.html', 'tos' => 'http://developer.yahoo.com/maps/mapsTerms.html'), - - 'google' => array('name' => 'Google Maps API', 'url' => 'http://www.google.com/apis/maps/', 'tos' => 'http://www.google.com/apis/maps/terms.html') - ); } @@ -285,61 +282,6 @@ function location_geocode_au_yahoo($location = array()) { } } -function location_geocode_au_google($location = array()) { - $service_url = 'http://maps.google.com/maps/geo?output=xml&key='. variable_get('location_geocode_au_google_apikey', '') .'&q='; - - $address = location_address2singleline($location); - - $http_reply = drupal_http_request($service_url . urlencode($address)); - - $status_code_match = array(); - preg_match('/(.*)<\/code>/', $http_reply->data, $status_code_match); - $status_code = $status_code_match[1]; - if ($status_code != 200) { - watchdog('location', 'Google geocoding returned status code: %status_code', array('%status_code' => $status_code)); - return NULL; - } - - $accuracy_code_match = array(); - preg_match('/Accuracy="([0-9])"/', $http_reply->data, $accuracy_code_match); - $accuracy_code = $accuracy_code_match[1]; - $min_accuracy = variable_get('location_geocode_au_google_accuracy_code', variable_get('location_geocode_google_minimum_accuracy', '3')); - if ($accuracy_code < $min_accuracy) { - watchdog('location', 'Google geocoding result for %country did not meet the minimum accuracy level of %min_accuracy. Result accuracy: %accuracy_code', array('%country' => $location['country'], '%min_accuracy' => $min_accuracy, '%accuracy_code' => $accuracy_code)); - return NULL; - } - - $latlon_match = array(); - preg_match('/(.*)<\/coordinates>/', $http_reply->data, $latlon_match); - - $latlon_exploded = explode(',', $latlon_match[1]); - - return array('lat' => $latlon_exploded[1], 'lon' => $latlon_exploded[0]); -} - -function location_geocode_au_google_settings() { - $form = array(); - - $form['location_geocode_au_google_apikey'] = array( - '#type' => 'textfield', - '#title' => t('Google Maps API Key'), - '#size' => 64, - '#maxlength' => 128, - '#default_value' => variable_get('location_geocode_au_google_apikey', ''), - '#description' => t('In order to use the Google Maps API geocoding web-service, you will need a Google Maps API Key. You can obtain one at the !sign_up_link for the !google_maps_api.', array('!sign_up_link' => 'sign-up page', '!google_maps_api' => 'Google Maps API')) - ); - - $form['location_geocode_au_google_accuracy_code'] = array( - '#type' => 'select', - '#title' => t('Google Maps Geocoding Accuracy for Australia'), - '#default_value' => variable_get('location_geocode_au_google_accuracy_code', variable_get('location_geocode_google_minimum_accuracy', '3')), - '#options' => location_google_geocode_accuracy_codes(), - '#description' => t('The minimum required accuracy for the geolocation data to be saved.'), - ); - - return $form; -} - /** * Parameters: * -> $location_a is an associative array that represents a full location where