I have a script in PHP
to get Latitude and Longitude of an address.
I never used an API KEY
, but the code always worked. Weeks ago, it stopped to work So, I get an API Key
. However, isn't working.
Follow a part of the script:
function loadURL($url){
if (function_exists('curl_init')) {
$cURL = curl_init($url);
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cURL, CURLOPT_FOLLOWLOCATION, true);
$result = curl_exec($cURL);
curl_close($cURL);
} else {
$result = file_get_contents($url);
}
if (!$result)
return false;
return $result;
}
I did a test with another example: 1600 Amphitheatre Parkway, Mountain View, CA
The same example that Google uses.
Here is the url:
http://maps.googleapis.com/maps/geo?q=1600+Amphitheatre+Parkway,+Mountain+View,+CA&output=csv&sensor=true_or_false&key=your_api_key
I put my API key
, set true
or false
to sensor, but the result is:
Status: 610 (**G_GEO_BAD_KEY**)
Why?