Index: supported/location.uk.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/location/supported/location.uk.inc,v retrieving revision 1.2 diff -u -p -r1.2 location.uk.inc --- supported/location.uk.inc 8 Mar 2006 06:53:39 -0000 1.2 +++ supported/location.uk.inc 16 Jan 2008 16:49:17 -0000 @@ -1,6 +1,52 @@ (.*)<\/code>/', $http_reply->data, $status_code_match); + $status_code = $status_code_match[1]; + if ($status_code != 200) { + return NULL; + } + + $accuracy_code_match = array(); + preg_match('/Accuracy="([0-9])"/', $http_reply->data, $accuracy_code_match); + $accuracy_code = $accuracy_code_match[1]; + + //Changed accuracy threshold... needs testing... + if ($accuracy_code < 2) { + 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]); +} + + + // Great Britain function location_province_list_uk() {