Google chrome geolocation not working

Bilal Akmal picture Bilal Akmal · Sep 1, 2015 · Viewed 11.4k times · Source

I'm working on cross platform application. navigator.geolocation was working fine, but since last 2 days it just giving problem in Google chrome. Is the api deprecated or some other issue for this api? I tested following code on many different browsers and network but still the same issue.

var options = {
  enableHighAccuracy: true,
  timeout: 5000,
  maximumAge: 0
};

function success(pos) {
  var crd = pos.coords;

  console.log('Your current position is:');
  console.log('Latitude : ' + crd.latitude);
  console.log('Longitude: ' + crd.longitude);
  console.log('More or less ' + crd.accuracy + ' meters.');
};

function error(err) {
  console.warn('ERROR(' + err.code + '): ' + err.message);
};

navigator.geolocation.getCurrentPosition(success, error, options);

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

Answer

dmp picture dmp · Sep 1, 2015