I’m making a simple http server and I want to add a world map feature, that displays client geo location.
I got two questions:
-
Is there a way to find out lat/lon of an IP address without using sites like ip2location.com?
-
How can I geographically display a point on an image(world map) with giving lat,lon as an input parameter? is there a formula for that?
Thanks!
No, unless you create and host your own database.
Both Google and Bing Maps provide such functionality. Here’s an example with Google Maps which allows you to place markers on a map given their latitude and longitude.
UPDATE:
You could use a Mercator Projection to place a point given latitude and longitude. You may take a look at the following article which explains the technique.