【发布时间】:2013-03-06 05:27:33
【问题描述】:
我在PHP 中有一个脚本来获取地址的纬度和经度。
我从未使用过API KEY,但代码始终有效。几周前,它停止工作所以,我收到了API Key。但是,不起作用。
跟随脚本的一部分:
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;
}
我用另一个例子做了一个测试: 1600 Amphitheatre Parkway,山景城,CA
Google 使用的相同示例。
我把我的API key,设置true 或false 设置为传感器,但结果是:
Status: 610 (**G_GEO_BAD_KEY**)
为什么?
【问题讨论】:
-
您可能会发现stackoverflow.com/a/15289007/2110460 可以提供帮助
标签: php google-maps geocoding