Guess location from city
I am developing a site where users can find/post - well, let's say - "things". These "things" have name, description, etc.. and the most important information about them is their location. The location consists of the city (country, sometimes state) and the street.
There is no separate input for country and state, because I want it to be filled automatically, I would like to give a list for the city, where the country and the state is given (for example the user types new, then he gets New York, NY, and other guesses.
My question is, that how cou开发者_JAVA技巧ld I do this most efficiently? (The site can be used from all over the world)
Thanks
You should use a service such as Geobytes API. It will provide you a way to autocomplete the city name, and then get its country, region, latitude/longitude, currency, etc.
You can perform up to 50,000 requests a day, which is enough for many cases.
Does it answer your question ?
精彩评论