Google places API - How to get regions of a country?

。_饼干妹妹 提交于 2019-12-09 01:26:37

问题


I've looked again and again on the site for this simple question and didn't find an answer I think it is very generic need Let's say that you have two drop down lists One you want to populate with a list of countries, and once you've selected one - to populate the other with a list of it's regions. Is it even possible with Google Places API? Cheers :)


回答1:


No, it is not possible with Places API.

You have 2 options: Use Another Database

There are a few free databases of country/state lists. Have a look at the following questions for some examples:

List of Cities by Country
https://raw.githubusercontent.com/David-Haim/CountriesToCitiesJSON/master/countriesToCities.json

Create your own database

Create your own database of the states in each country. Not recommended, as it would be a waste of precious time.



来源:https://stackoverflow.com/questions/15516622/google-places-api-how-to-get-regions-of-a-country

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!