这是Google静态地图API的BB特有问题。 API速率限制是正常的,但在使用BB设备时会更频繁地出现。
他们似乎在使用IP池并将它们转出到设备。理论上这应该是一个非常间歇性的问题。如果等待几天时间,它应该消失。
换句话说,您的IP在24小时内已经达到静态地图API的1000倍以上。当您在短时间内太频繁地点击API时,也会发生这种情况。
我对此的解决方案是编写一个简单的PHP脚本,一次请求来自Google的地图图像,将其保存为一个文件,并将其保存为文件,而不是每次都点击地图API。
下面的代码:
<?php
header('Content-Type: image/jpeg');
$latlng = (isset($_GET['c']))? $_GET['c'] : NULL ;
$zoom = (isset($_GET['z']))? $_GET['z'] : 9 ;
$file = "cache/p_$p-z_$zoom.jpg";
if(!file_exists($file))
{
$parts = array(
'center' => $latlng,
'zoom' => $zoom,
'size' => '320x240',
'maptype' => 'terrain',
'sensor' => 'false',
'format' => 'jpeg'
);
file_put_contents(
$file, file_get_contents("http://maps.googleapis.com/maps/api/staticmap?".implode('&', $parts))
);
}
echo file_get_contents($file);
对我来说也是失败,'403禁止',同样的图形。 BB个人,没有BES。 – sarnold 2011-04-07 08:18:24