Open twomice opened 8 years ago
Hey so this doesn't address the case where a browser does support geolocation but clicks deny.
We could add an error handler for that case. Here's a snippet from https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition
error
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);
So in the project, success and error handler should turn off the spinner. If the user doesn't have geolocation, it should not turn the spinner on.
Hey so this doesn't address the case where a browser does support geolocation but clicks deny.
We could add an
error
handler for that case. Here's a snippet from https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPositionSo in the project, success and error handler should turn off the spinner. If the user doesn't have geolocation, it should not turn the spinner on.