Chrome navigator.geolocation.getCurrentPosition()错误403

mll*_*llm 35 google-maps google-chrome navigator google-geolocation

出于某种原因突然在调用时navigator.geolocation.getCurrentPosition()我收到此错误:

Network location provider at 'https://www.googleapis.com/' : Returned error code 403.

它曾经在昨天工作得很好!他们的服务器可以有什么?

小智 14

它现在似乎已经恢复了.但在我意识到它工作之前,我使用另一种方法来获取reddit.com上另一个用户推荐的位置数据

var latLong;
$.getJSON("http://ipinfo.io", function(ipinfo){
    console.log("Found location ["+ipinfo.loc+"] by ipinfo.io");
    latLong = ipinfo.loc.split(",");
});
Run Code Online (Sandbox Code Playgroud)

资料来源:https://www.reddit.com/r/webdev/comments/3j8ipj/anyone_else_had_issues_with_the_html5_geolocation/


小智 6

这不是HTTPS的事情,即使谷歌自己的例子也失败了,请参阅https://developers.google.com/maps/documentation/javascript/examples/map-geolocation

我在reddit上打开了一个帖子并找到更多信息并在此处链接:https://www.reddit.com/r/webdev/comments/3j8ipj/anyone_else_had_issues_with_the_html5_geolocation/

我有世界各地的人报告同样的问题.