Google maps 谷歌地理编码服务-获得干净的街道名称
我正在使用谷歌地理编码服务(使用来自浏览器的get请求),并尝试获取干净的街道名称(没有前/后方向和后缀) 例如:如果我的地址是“华盛顿州西雅图贝托纳街3号公寓3307 W” 我只想知道街道名“Bertona”。 我的请求url: {clientId}&signature={PrivateKey}Google maps 谷歌地理编码服务-获得干净的街道名称,google-maps,google-geocoder,Google Maps,Google Geocoder,我正在使用谷歌地理编码服务(使用来自浏览器的get请求),并尝试获取干净的街道名称(没有前/后方向和后缀) 例如:如果我的地址是“华盛顿州西雅图贝托纳街3号公寓3307 W” 我只想知道街道名“Bertona”。 我的请求url: {clientId}&signature={PrivateKey} 有没有办法从服务中检索干净的街道名称?您可以从响应中的address\u components数组中检索街道名称: { "results":[ { "address_com
有没有办法从服务中检索干净的街道名称?您可以从响应中的address\u components数组中检索街道名称:
{
"results":[
{
"address_components":[
{
"long_name":"3",
"short_name":"3",
"types":[
"subpremise"
]
},
{
"long_name":"3307",
"short_name":"3307",
"types":[
"street_number"
]
},
{
"long_name":"West Bertona Street",
"short_name":"W Bertona St",
"types":[
"route"
]
},
route
类型的组件包含长街道和短街道名称。这是您可以从地理编码API请求中获得的最干净的名称