I am working on web analytics, we are using node.js
in server side, we are sending the data using http request(express framework)
.
Requirement
:Have to find the latitude and longitude of the visitor.
My question is how to find the latitude and longitude in node.js
? Any framework available?
I strongly recommend to use the HTML5 geolocation API inside the browser and then send visitor location information to your server – that's way more accurate than using geolocation from IP addresses on the server-side. You will be getting the location of the ISPs, which can be quite far away, and in addition the IP-to-location databases aren't always up to date with the latest changes, so you might won't get any data for a particular IP address.
To find out more about this topic take a look at MaxMind, which offers a popular IP-to-location database published some statistics on its database: GeoIP City Accuracy for Selected Countries
Here's a great example of using navigator.geolocation
:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With