我有谷歌地图api v3嵌入到我的网站,这一切都很好,直到几周前.在最近几周内,地图图块(只有地图,卫星图块始终正常工作)不时加载几个小时,有时几天.除此之外,我得到以下两条403错误消息:
[Error] Failed to load resource: the server responded with a status of 403
(Forbidden) (ViewportInfoService.GetViewportInfo, line 0)
http://maps.googleapis.com/maps/api/js/ViewportInfoService.GetViewportInfo
[Error] Failed to load resource: the server responded with a status of 403
(Forbidden) (AuthenticationService.Authenticate, line 0)
http://maps.googleapis.com/maps/api/js/AuthenticationService.Authenticate
Run Code Online (Sandbox Code Playgroud)
看起来身份验证出错了.但是,我远不及每天拨打api的最大数量.此外,地图控件以及卫星图块(当我切换到它们时)加载没有问题.
这个问题每周几次随机发生几次,直到一整天.大部分时间一切正常.
有没有人遇到过这样的问题,或者有什么可能出错的想法?
更新2016年2月:仍在处理同样的问题
仔细检查后,似乎每次更新网站后,地图图块都会工作几天,然后再次显示403条消息.
谷歌开发者控制台中的使用情况统计数据显示,我每天几乎不会超过100个请求,因此使用限制应该不是问题.
到目前为止,我确实请求了一个新的API密钥,看看这是否会有所帮助.我改变了密钥之后,比如在网站更新几天之后一切正常,但是现在我们又回到了同样的旧情况
所以,我正在运行一个Ratchet(php)websocket服务器,它有多个连接多个Ratchet应用程序的路由(MessageComponentInterfaces):
//loop
$loop = \React\EventLoop\Factory::create();
//websocket app
$app = new Ratchet\App('ws://www.websocketserver.com', 8080, '0.0.0.0', $loop);
/*
* load routes
*/
$routeOne = '/example/route';
$routeOneApp = new RouteOneApp();
$app->route($routeOne, $routeOneApp, array('*'));
$routeTwo = '/another/route';
$routeTwoApp = new AnotherApp();
$app->route($routeTwo, $routeTwoApp, array('*'));
Run Code Online (Sandbox Code Playgroud)
从这里我绑定一个ZMQ套接字,以便能够接收从普通的apache服务器上运行的php脚本发送的消息.
// Listen for the web server to make a ZeroMQ push after an ajax request
$context = new \React\ZMQ\Context($loop);
$pull = $context->getSocket(\ZMQ::SOCKET_PULL);
$pull->bind('tcp://127.0.0.1:5050'); // Binding to 127.0.0.1 means the only client that can connect is itself
$pull->on('message', array($routeOneApp, 'onServerMessage'));
Run Code Online (Sandbox Code Playgroud)
最后,服务器启动: …