Search code examples
google-mapsgoogle-chromenavigatorgoogle-geolocation

Chrome navigator.geolocation.getCurrentPosition() error 403


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??


Solution

  • 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/