I am trying to get the location of the user's computer, however this computer doesn't have any built-in GPS. Is this possible? I am using a Mac.
Asked
Active
Viewed 1,683 times
-1
-
1what computer? does it have GPS? – Keith Nicholas Apr 23 '15 at 05:23
-
Try searching for something more like [gps from ip](https://www.google.com.au/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=gps%20from%20ip) – MadProgrammer Apr 23 '15 at 05:23
-
@KeithNicholas I edited the question. I was being dumb lol. – Howard Stark Apr 23 '15 at 05:26
-
@MadProgrammer Alright, I will look that up. Thanks! – Howard Stark Apr 23 '15 at 05:26
-
possible duplicate of [Java library to get geo-code from ipaddress](http://stackoverflow.com/questions/11298462/java-library-to-get-geo-code-from-ipaddress) – Keith Nicholas Apr 23 '15 at 05:43
-
There are ways. Others mention obtaining it from IP. It can also be obtained by listening for base stations on the WiFi - several companies including Apple and Google have databases with locations of base stations. But there is no standard Java API for that either. – Erwin Bolwidt Apr 23 '15 at 05:52
1 Answers
1
You can use the Google maps Geolocation API. However, the client browser/device must support it.
Here's the link to the standards documentation - http://dev.w3.org/geo/api/spec-source.html
Example code from Google: https://developers.google.com/maps/documentation/javascript/examples/map-geolocation

mbsingh
- 499
- 10
- 26
-
Unfortunately, those appear to be JavaScript. I am looking for Java, which won't work. However, I appreciate the answer! – Howard Stark Apr 23 '15 at 05:31
-
No problem. See if this helps then - http://stackoverflow.com/questions/1415851/best-way-to-get-geo-location-in-java – mbsingh Apr 23 '15 at 05:44