Accurate geolocation over IP

The other day I connected an iPad, and was amazed at the accuracy of geolocation using ip. Actually this is an action against hunger in the world, which shows you very precisely where the people who participated in this petition are:

http://www.1billionhungry.org/meodai/impact/

I would like to integrate this into one of my projects. I looked at the source, but I could not understand how they did it. Can anybody help me? Is there a web service for this?

What I'm not looking for is a service that returns my provider’s place, I need the actual IP position

For example, I am in Friborg, Switzerland, my ISP is in Zurich in Switzerland. Most of these services return the location of my ISP, iPad, or the link I posted gives me precise localization by IP. (actually even the address is right)

Is google map api this or is using another service?

+3
source share
3 answers

They use another service that uses wireless access points for geolocation. The same functions can be accessed in some browsers using the HTML5 geolocation API :

function do_something(lat, long){
    alert(lat + ", " + long);
}

if (navigator.geolocation) {  
    /* geolocation is available */  
    navigator.geolocation.getCurrentPosition(function(position) {  
        do_something(position.coords.latitude, position.coords.longitude);  
    });  
} else {  
    alert("I'm sorry, but geolocation services are not supported by your browser.");  
}

Google Gears API , , .

, API . (.. ), IP.

+3

Read this for an article on ipad geolocation ... it is not completely IP related, what do you think. Therefore, you will not find a geolocation library that will do what you want, because they simply map ip addresses to fixed locations.

+1
source

Source: https://habr.com/ru/post/1750071/


All Articles