Amit
Amit

Reputation: 13364

Auto filing names of a City if the Country name is given

I am working on a site which prvides location based searching of users i.e. user can query system like "Give me the list of users staying at locality, city" and the system responds with the list of user names.

For that I want to provide user one combo box to select the country name and a text box to type in the few letters of City name, based on the text in the text box the system suggests the city names, i.e. for letter 'A' the system suggests all city names containing letter 'A', and the results are filtered thereafter.

I have searched for a while now few recommend storing data in my server, few recommend using a web service, api or something like that. I dont want to store data in my server since storing lacs of frequently changing data is nt a wise option, and if I go for third party api, library or service how to provide autofill feature on that....

Please suggest me some ways to accomplish this task,

Thanks in advance,

EDIT After researching on various possible solutions I finally decided to use geo-autoComplete api from Google, Fortunately the documentation helped me to develop a working demo very fast.

However it faiils in restricting the suggestions to some specific Region/ Country, Autocomplete (google.maps.places.Autocomplete) class has a method setBounds(LatLngBounds) which can be used to filter the suggestions, How can I get the LatLngBounds object from LatLng object ? and How can I increase the number of suggestions given by auto complete ? plz help....

Upvotes: 3

Views: 2815

Answers (1)

Adam Merrifield
Adam Merrifield

Reputation: 10407

Are you looking for something like this?

http://bassistance.de/2009/03/03/jquery-snippet-autocomplete-city-based-on-zip-code/

Or you can make a custom one with jQuery UI AutoComplete http://jqueryui.com/demos/autocomplete/#remote

Upvotes: 1

Related Questions