Reputation: 99
Unable to get accurate location its giving location but its different from my current location.
This is the url where i implemented https://www.w3schools.com/html/html5_geolocation.asp
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition((position) => {
// this.showPosition(position);
console.log("swd",position.coords)
});
}
Upvotes: 0
Views: 275
Reputation: 1820
As it says on that page, Note: Geolocation is most accurate for devices with GPS, like smartphones.
, so if you're not on a device with GPS, it probably is going based on your IP address, which isn't necessarily the most accurate if you're on a corporate/university network or behind any sort of proxy
Upvotes: 1