I am using geocoder.geocode(address: <ip_address>, function(results, status){//do something})
to get the LatLng for the IP Address provided. The output shows an array of LatLngs in 'results'. To access the LatLng I am using results[i].geometry.location
.
My question is why the output contains multiple LatLng values for a single IP Address, what do they mean? And there seem to be a large difference (in distance on the map) between those LatLng values.
Asked
Active
Viewed 2,621 times
1

nefarianblack
- 802
- 8
- 16
-
Who told you that you can use the geocode-service to locate an IP? – Dr.Molle Feb 05 '13 at 11:00
-
I thought it is working until I checked the location address which is being matched with the IP Address. How silly of me to ignore that. Can I use any other API in Google Maps to get Address for an IP Address? – nefarianblack Feb 05 '13 at 11:34
-
I basically require LatLng corresponding to the IP Address. – nefarianblack Feb 05 '13 at 11:42
-
If you are using a device without GPS ,eg PC, you can use HTML5 Geolocation http://dev.w3.org/geo/api/spec-source.html#geolocation_interface. The problem with using IP address is its accuracy.In my case the location is 7 miles out. – david strachan Feb 05 '13 at 12:10
-
I have a set of IP Addresses of which I want to calculate (through PC) LatLng. I believe HTML5 Geolocation only provides the location of the device which is connected, not any IP. – nefarianblack Feb 05 '13 at 15:16
-
@tanmaykhandelwal From HTML5 Documentation `The Geolocation API defines a high-level interface to location information associated only with the device hosting the implementation, such as latitude and longitude. The API itself is agnostic of the underlying location information sources. Common sources of location information include Global Positioning System (GPS) and location inferred from network signals such as IP address, RFID, WiFi and Bluetooth MAC addresses, and GSM/CDMA cell IDs, as well as user input. No guarantee is given that the API returns the device's actual location.` – david strachan Feb 05 '13 at 19:55
1 Answers
0
Unfortunately, Google does not provide public geocoding APIs which work with an IP address.
See this related question and answers for some pointers.

Community
- 1
- 1

Greg Sadetsky
- 4,863
- 1
- 38
- 48