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
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...
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.
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.
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
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With