Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

google suggested city name autocomplete

I'm trying to build a web page in which I want to use google suggested city/state name combinations when user starts typing their address, it auto completes the city and state just like in google maps.

For reference visit this URL:

Google Maps

When someone start typing in top left green A box. it gives you auto suggested list.

Can any one help me do the same thing for my web site? Or is there such google api exist that I can use?

Thanks

like image 963
Vikas Naranje Avatar asked Sep 26 '11 09:09

Vikas Naranje


People also ask

How do I restrict Google autocomplete to a specific country?

Use the componentRestrictions option or call setComponentRestrictions() to restrict the autocomplete search to a specific set of up to five countries. See https://developers.google.com/maps/documentation/javascript/places-autoc...

How do I use Google autocomplete?

input. The text string on which to search. The Place Autocomplete service will return candidate matches based on this string and order results based on their perceived relevance.

Is Google places autocomplete free?

The autocomplete request is available at no charge, and the subsequent Place Details call gets charged based on regular Place Details pricing. A Place Details request generates Data SKUs (Basic, Contact, and/or Atmosphere) – depending on the fields that are specified in the request.


2 Answers

Job for the Places AutoComplete API :-)

http://code.google.com/apis/maps/documentation/javascript/places.html

http://code.google.com/apis/maps/documentation/places/autocomplete.html

like image 187
barryhunter Avatar answered Oct 17 '22 19:10

barryhunter


Is there a reason it has to be google suggested names?

Here's an api that provides autocomplete for city names plus a lot of extra data you can squeeze out about the city (population, life quality data, even photo)

http://developers.teleport.org/api/

more specifically the widget http://developers.teleport.org/api/autocomplete_widget/

like image 1
Don Avatar answered Oct 17 '22 18:10

Don