【发布时间】:2017-12-03 19:44:01
【问题描述】:
我正在尝试从 maps.googleapis 调用中获取 json 返回的子集。具体是在下面当前返回的正文中的位置:
"location" : {
"lat" : 44.0581728,
"lng" : -121.3153096
}
如果我向:http://maps.googleapis.com/maps/api/geocode/json?address=bend&sensor=false 提出获取请求 结果如下:
{
"results" : [
{
"address_components" : [
{
"long_name" : "Bend",
"short_name" : "Bend",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Deschutes County",
"short_name" : "Deschutes County",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "Oregon",
"short_name" : "OR",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "United States",
"short_name" : "US",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "Bend, OR, USA",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 44.1231839,
"lng" : -121.248579
},
"southwest" : {
"lat" : 43.999089,
"lng" : -121.3807099
}
},
"location" : {
"lat" : 44.0581728,
"lng" : -121.3153096
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 44.1231839,
"lng" : -121.248579
},
"southwest" : {
"lat" : 43.999089,
"lng" : -121.3807099
}
}
},
"place_id" : "ChIJUdLTpf_AuFQRtNEgx6zniBA",
"types" : [ "locality", "political" ]
}
],
"status" : "OK"
}
我尝试将 &fields=location 添加到 get 请求,但它返回相同的信息。我在https://developers.google.com/maps/documentation/geocoding/intro#GeocodingRequests 上没有看到明确的方法
任何帮助表示赞赏! 谢谢!
【问题讨论】:
标签: json google-maps get google-geocoding-api