Chrome navigator.geolocation.getCurrentPosition() error 403

mllm picture mllm · Sep 1, 2015 · Viewed 13.8k times · Source

For some reason suddenly when calling navigator.geolocation.getCurrentPosition() I get this error:

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

It used to work perfectly yesterday! Could there be anything with their servers??

Answer

Amin picture Amin · Sep 1, 2015

It appears it is back up now. But before I realized it was working, I used another way to get location data as recommended by another user on reddit.com

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

Source: https://www.reddit.com/r/webdev/comments/3j8ipj/anyone_else_had_issues_with_the_html5_geolocation/