访问 Google Geocoding Accuracy 值的语法是什么?这是我目前所拥有的,但它是在黑暗中完全刺伤:
var googleValue = results[0].geomtery.Accuracy;
访问 Google Geocoding Accuracy 值的语法是什么?这是我目前所拥有的,但它是在黑暗中完全刺伤:
var googleValue = results[0].geomtery.Accuracy;
From the API docs comes this example response:
http://maps.googleapis.com/maps/geo?q=Toledo&output=json&sensor=false&gl=es
#
# Returns
#
{
"name": "Toledo",
"Status": {
"code": 200,
"request": "geocode"
},
"Placemark": [ {
"id": "p1",
"address": "Toledo, Spain",
"AddressDetails": {
"Country": {
"CountryNameCode": "ES",
"CountryName": "Spain",
"AdministrativeArea": {
"AdministrativeAreaName": "CM",
"SubAdministrativeArea": {
"SubAdministrativeAreaName": "Toledo",
"Locality": {"LocalityName": "Toledo"}
}
}
},
"Accuracy": 4},
"Point": {
"coordinates": [ -4.0244759, 39.8567775, 0 ]
}
} ]
}
So you would access it as PlaceMark[0].AddressDetails.Accuracy
.
正如第一条评论所说 - V3 不再支持此位置功能。相反,您会收到一个“位置类型”值,该值使用一组四层值来描述准确性。可以使用以下语法访问它:
var googleValue = results[0].geometry.location_type;