I am using the following code to retrieve the address from lon and lat:
$lon = 100.753;
$lat = 13.69362;
function getAddress($RG_Lat,$RG_Lon)
{
$json = "https://nominatim.openstreetmap.org/reverse?format=json&lat=".$RG_Lat."&lon=".$RG_Lon."&zoom=27&addressdetails=1";
$ch = curl_init($json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0");
$jsonfile = curl_exec($ch);
curl_close($ch);
$RG_array = json_decode($jsonfile,true);
return $RG_array['display_name'];
// $RG_array['address']['city'];
// $RG_array['address']['country'];
}
$addr = getAddress($lat,$lon);
echo "Address: ".$addr;
My code works very well under ovh server.
My application is installed locally under wamp server.
The same code, does not return anything: What extension or something else that I must activate it locally to have a return of my code?
Do you have any idea, why my code no longer works locally (wamp server)?
asked
23 May '21, 23:12
Lemjid
11●1●1●2
accept rate:
0%
Hello everyone, Someone has an approach, an idea: is it possible to use this code locally as my application is well installed locally ???
Help please ????????
You probably aren't getting any responses because nobody here knows how to help you. This doesn't sound like an OSM issue, but rather a more general issue with configuring a web server. You might get more help from somewhere like StackOverflow.
@Alester : thanks
To add to what alester said - if something works in place A but not in place B then the difference is between place A and place B, and we don't have any information about those and so can't really comment.