Created
February 3, 2011 11:39
-
-
Save dasim/809383 to your computer and use it in GitHub Desktop.
Fix is on lines 519 and 520. Variable $this->sensor wasn't converted to string so caused REQUEST_DENIED on direct call of the get_lat_long_from_address() function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_lat_long_from_address($address) | |
{ | |
$lat = 0; | |
$lng = 0; | |
$sensor_str = ($this->sensor) ? 'true' : 'false'; | |
$data_location = "http://maps.google.com/maps/api/geocode/json?address=".str_replace(" ", "+", $address)."&sensor=".$sensor_str; | |
if ($this->region!="" && strlen($this->region)==2) { $data_location .= "®ion=".$this->region; } | |
$data = file_get_contents($data_location); | |
$data = json_decode($data); | |
if ($data->status=="OK") { | |
$lat = $data->results[0]->geometry->location->lat; | |
$lng = $data->results[0]->geometry->location->lng; | |
} | |
return array($lat, $lng); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment