Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Worldwide location (country, region, city) select plugin for Rails, jQuery or Google Maps API?

Is there any plugin which will help to create a dropdown menus for countries, regions and cities? At first user chooses country, then he has his region dropdown menu updated according to which country he has chosen, he chooses region and after that from 3rd menu a city.

Plugin can be either for Ruby on Rails, jQuery or maybe javascript solution through google maps api?

like image 581
Arty Avatar asked Aug 18 '10 04:08

Arty


2 Answers

The Freebase Suggest jQuery plug-in provides pretty slick auto-complete functionality that provides suggestions in a drop-down, complete with Freebase/Wiki-style context info on mouseover. You can limit their suggestions to countries, cities, US states, etc.

Done properly, this might even avoid the need for three separate dropdowns. Of course, this would require using Freebase's particular geographic ontology -- their hierarchical view of countries, states and cities.

I'm not sure of any pre-built plugins, but other gazetteers (Yahoo! GeoPlanet, GeoNames) may be useful if you need a particular level of detail in your modeling of countries, states and cities.

like image 75
npdoty Avatar answered Oct 19 '22 06:10

npdoty


One gem is for countries and states is 'carmen'. It provides all countries and states for just over a dozen countries. I'd recommend using a text input for cities (many databases are incomplete).

like image 39
Kevin Sylvestre Avatar answered Oct 19 '22 06:10

Kevin Sylvestre