Google放置API - 如何获取国家/地区的区域? [英] Google places API - How to get regions of a country?
问题描述
我在这个简单的问题上一次又一次地查看网站,但没有找到答案
我认为它非常通用需要
假设您有两个下拉列表
一个你想填充的国家列表,一旦你选择了一个 - 填充另一个区域的列表。
Google Places API甚至有可能吗?
Cheers:)
不,Place API无法实现。
您有2个选项:
使用另一个数据库
有一些免费的国家/州列表数据库。查看以下问题的一些示例:
按国家/地区列出的城市
https:// raw。 githubusercontent.com/David-Haim/CountriesToCitiesJSON/master/countriesToCities.json
创建您自己的数据库 h2>
在每个国家/地区创建您自己的州的数据库。不推荐,因为这会浪费宝贵的时间。
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 :)
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.
这篇关于Google放置API - 如何获取国家/地区的区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!