Building/Form: pop is updated when network is changed
This commit is contained in:
@@ -30,15 +30,19 @@ class Gmaps_Geocoding {
|
||||
$url .= "&components=$component_string";
|
||||
}
|
||||
|
||||
$log->debug(__FILE__.": $url");
|
||||
//$log->debug(__FILE__.": $url");
|
||||
|
||||
$resp = file_get_contents($url);
|
||||
//print_r($resp);
|
||||
if($resp) {
|
||||
$json = json_decode($resp);
|
||||
if($json->status != "OK") {
|
||||
$log->warn(__FILE__.": No Results ($url)");
|
||||
return false;
|
||||
}
|
||||
$results = $json->results;
|
||||
if(count($results) > 1) {
|
||||
$log->warn(__FILE__."> Got more then 1 result. Aborting.");
|
||||
$log->warn(__FILE__.": Got more then 1 result. Aborting. ($url)");
|
||||
return false;
|
||||
}
|
||||
$lat = $results[0]->geometry->location->lat;
|
||||
|
||||
Reference in New Issue
Block a user