JS Geolocation provider did not provide a good position

Uhh so I implemented code a while back that used geolocation and it worked then but now it throws a GeolocationPositionError that the message is Network location provider at 'https://inference.location.live.net/' : Did not provide a good position fix. with error code 2. This is a snippet of the code (yes, the code runs after user input):
let latLong = [0, 0];
latLong = await new Promise(async (res, rej) => {
await navigator.geolocation.getCurrentPosition(
(ret) => {
res([ret.coords.latitude, ret.coords.longitude]);
},
(err) => {
rej(err);
});
});
console.log('latlng', latLong);
let latLong = [0, 0];
latLong = await new Promise(async (res, rej) => {
await navigator.geolocation.getCurrentPosition(
(ret) => {
res([ret.coords.latitude, ret.coords.longitude]);
},
(err) => {
rej(err);
});
});
console.log('latlng', latLong);
1 Reply
Jochem
Jochem17mo ago
if you didn't change anything, that sounds like an issue with the provider. Either they changed their API and you'll have to check their blog or api docs, or they're just having issues
Want results from more Discord servers?
Add your server