1

I know how to mark locations on google map using Google Maps API v3. How to do the same if I have a php/javascript array of ip addresses, not lat and lng coordinates?

Haradzieniec
  • 9,086
  • 31
  • 117
  • 212

3 Answers3

1

You'll need some way to convert them from IP addresses to co-ordinates - to which there is a post on StackOverflow asking this very question.

My favourite is IPInfoDB which offers the service for free and can return you the information you require using a very simple GET request:

http://api.ipinfodb.com/v3/ip-country/?key=<your_api_key>&ip=74.125.45.100

If you replace ip-country with ip-city then you get city level precision.

Community
  • 1
  • 1
Richard
  • 1,471
  • 7
  • 23
  • 47
0

You need a ip-geolocation service that can convert the IP address into approximate geographical coordinates. See something like http://ip2location.com/ which I believe offers a paid API service. I don't know if there is any unlimited free service to do the same.

leftclickben
  • 4,564
  • 23
  • 24
0

I like http://www.iptolatlng.com/ because it gives me staight JSON and it gives me the results I want in the easiest fashion.

mikewhit
  • 121
  • 5