我正在使用Google Places Auto自动完成API。如果我搜索一个特定的郊区,让我们说里士满澳大利亚维多利亚州我得到以下地址组件返回:如何使用Google地图API获取郊区的父城市?
0:Object
long_name: "Richmond"
short_name: "Richmond"
types: Array[2]
0: "locality"
1: "political"
1: Object
long_name: "Victoria"
short_name: "VIC"
types: Array[2]
0: "administrative_area_level_1"
1: "political"
2: Object
long_name: "Australia"
short_name: "AU"
types: Array[2]
0: "country"
1: "political"
这是伟大的,但里士满是墨尔本的一个郊区,我的应用程序的目的,我需要知道这一点。如果地区在一个地方,我怎样才能让API返回父城市?如果你看看下面的URL,你可以看到里士满在澳大利亚维多利亚州的墨尔本,所以我假设它有可能以某种方式通过API获取这些信息?
https://maps.google.com/maps/place?q=Richmond&ftid=0x6ad64259018db945:0x5045675218ce810