I have a requirement where i have to find the geoip location of the users. I have used the code where i store the address of the user in database and then display the geoip location of that user.Now suppose the users changed his location to some other place.If the user now logs in from that region or country, how should i display the geoip of that user. The code that i use is:
geo.geocoder(geo.google, address, sensor,function(formattedAddress, latitude, longitude) {
console.log("Formatted Address: " + formattedAddress);
console.log("Latitude: " + latitude);
console.log("Longitude: " + longitude);
user.latitude = latitude;
user.longitude = longitude;
user.save(function(err) {
if(err)
return userUpdateFailed();
req.flash('info', 'Succesfully Upadated Changes');
res.redirect('/userinfo');
});
});
Is there any alternative wherby i can be able to find the exact location of user.Please help