Answer the question
In order to leave comments, you need to log in
How to accurately determine the user's location?
Good afternoon!
I'm using code like this to get user's location:
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);
Answer the question
In order to leave comments, you need to log in
They pay a lot of money for this and collect a lot of information from a bunch of sources.
A computer connected via ethernet can only be identified by IP, and this is accurate to the city, maximum area.
A smartphone (with the permission of the user) is determined much more accurately using cell tower triangulation ( LBS ) or GPS. Especially cool companies can accurately determine the location by the names of WiFi networks or other indirect signs.
PS By the way, please indicate the sites that allegedly determine my location up to 100 meters.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question