views:

350

answers:

4

I'm looking for something similar to facebook suggestion list with cities and countries. You can see what I'm exactly talking about when you try to create new event in facebook, click to add address, and then start typing in the City field.

I prefer finding working suggestion tool in jQuery(with the date), but database with city/country will do the trick too.

Thanks in advance, Ilian Iliev

+1  A: 

Here you go: http://geolite.maxmind.com/download/worldcities/

That's the database. It should be possible to work this into a jQuery tool pretty easily with (for example) one of the "autocomplete" plugins. It certainly should be easier than researching and constructing the database yourself :-)

Pointy
Thanks a lot Pointy, It looks just like what I was looking for.What "Region" means?
Ilian Iliev
Looks like "region" depends on what country it is; in the US, it's "state". In other countries it looks like it might be a postal code.
Pointy
If someone else download this dump, be careful cause it contains duplicate cities with different spelling.
Ilian Iliev
that database file is pretty big which is around 100 MB. Do you really dump it to your database ?
spotlightsnap
Sorry for the late response, but yes, I really dump it (using big dump)
Ilian Iliev
+2  A: 

Freebase Suggest is a jQuery plug-in that does autocompletion against any of its set of categories. You can easily limit it to countries ("type": ["/location/country"]) or cities, and it provides a nice UI for your users to verify that they're talking about the right place.

This way you don't have to manage the database, keep it up to date, build your own UI, etc.

npdoty
A: 

GeoDataSource.com has a database called World Major Cities Database where you can easily link countries to states and states to cities. I feel that this is most suitable for your needs. They even supply some sample codes which does the Countries / States/ Cities drop down list linking.

Kurosaki
+1  A: 

http://www.geonames.org/

gilles