I'm working currently with the geolocation API.
When allowing my browser - localhost or webhost- to fetch my position, my console.log returns :
Unknown error acquiring position
I can't figure out since I have authorized the connection and my code seems to be clean since I have fetched it from the Mozilla official MDN.
Here my client.js :
var options = {
enableHighAccuracy: true,
timeout: 5000,
maximumAge: 0
};
function success(pos) {
var crd = pos.coords;
console.log('Votre position actuelle est :');
console.log(`Latitude : ${crd.latitude}`);
console.log(`Longitude: ${crd.longitude}`);
console.log(`Plus ou moins ${crd.accuracy} mètres.`);
};
function error(err) {
console.warn(`ERROR(${err.code}): ${err.message}`);
};
navigator.geolocation.getCurrentPosition(success, error, options);
any hint would be great, Thanks