I am searching for a method to locate the user location while visiting my website, i have tried Maxmind but they seems to be inaccurate in the city level. the information i want is (Country, City, longitude, latitude) i want the country and the city to be very accurate if possible.
I have also used HTML5 but the problem that it asks my user to share location information which seems to me bad solution. (althougth i got very accurate results)
Any solutions?
Notice: i found google search got an accurate detection and without "ask for sharing my location", but i didn't find any api to use google service
The IP addresses may be changed depends on ISP and I think that is the reason why the geolocation database is not always accurate. You can compare the accuracy among these geolocation sites other than maxmind. www.geobytes.com, www.hostip.info, www.ip2location.com
I hope these links might help you. First two links have a database of geolocation information with respect to IP addresses. Whereas the links 3,4, & 5 work on traceroute command. Let me know if these work for you .
This is a code i found for a tutorial for Geo Location using Google maps.. Hope this is useful.
This works on the way you connect to the network.
Example for HTML5 Geolocation