通过国家名称时获取所有州/地区/城市 [英] Getting all States/Region/Cities when passing Country name
问题描述
我正在使用Spring在Java中创建Web应用程序,选择一个国家/地区时,我必须在下拉菜单中填充所有州/地区/城市.是否有任何API,网络服务或JavaScript可以实现相同的目标.
i am creating a web application in java using spring where i have to populate all states/region/cities in a drop down when choosing a country. Is there any api, web-service or javascript for achieving the same.
推荐答案
As Yanick specified in this question;
看看地名.您可以下载(大约)他们的所有内容 拥有并创建自己的本地数据库,也可以使用其 REST Web服务API .另外,他们甚至已经成为客户端 库.
Take a look at GeoNames. You can download (just about) everything they have and create your own local databases, or you can use their REST Webservice API. As an added bonus, they even have already made client libraries.
您还可以查看 查看全文