6

I found a few examples suggesting Google AJAX APIs.

This link typifies the advice I have found so far: http://briancray.com/2009/05/29/find-web-visitors-location-javascript-google-api/

However, the location is often wrong with the Google APIs.

Other sites seem to know exactly which city I'm in, though, without me entering any information.

Suggestions? Is there something cross-browser (ignoring IE6) and reliable?

Josh Lee
  • 171,072
  • 38
  • 269
  • 275
Crashalot
  • 33,605
  • 61
  • 269
  • 439
  • How accurate do you need the location to be, and how important is the accuracy? For instance, a web-based 911 system wants to be able to send help to the right house. A system to target advertisements need only hit the right neighborhood. – John Saunders Mar 13 '10 at 00:42
  • Hi John, the right neighborhood is more than accurate enough. Really, we just need the right city. Any ideas? – Crashalot Mar 16 '10 at 02:03

4 Answers4

5

I was going to answer with a few points but sometimes referencing a decent article is the way to go. I recently came across this Smashing Magazine article by Christian Heilmann which explains the issues, solutions and further info on all things GeoLocational.

Entering the wonderful world of Geolocation

Brian Scott
  • 9,221
  • 6
  • 47
  • 68
1

check http://hostip.info it is an opensource database.

Jakub
  • 109
  • 3
  • Well, I jut gave it a spin over some italian addresses and it didn't really cut it. One in **Milan** was mapped over **Rome**. One in **Sardinia** was generically mapped over **Italy**. And with **my** address... it **couldn't even figure** i'm in Italy at all. Maybe it's good on North-America, dunno. – ZJR Apr 07 '11 at 17:31
0

Try Webshims geolocation module it implements navigator.geolocation API if browser doesn't support it.

Nikita Koksharov
  • 10,283
  • 1
  • 62
  • 71
0

Other that the costly GeoIP database and the limited js api, (cited in the smash article Brian linked) MaxMind also offers a number of free Geolite DBs, for download.

http://www.maxmind.com/app/geolitecity

They are redistributable under this license.

ZJR
  • 9,308
  • 5
  • 31
  • 38