0

访问 Google Geocoding Accuracy 值的语法是什么?这是我目前所拥有的,但它是在黑暗中完全刺伤:

var googleValue = results[0].geomtery.Accuracy;
4

2 回答 2

0

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.

于 2013-01-12T14:19:40.593 回答
0

正如第一条评论所说 - V3 不再支持此位置功能。相反,您会收到一个“位置类型”值,该值使用一组四层值来描述准确性。可以使用以下语法访问它:

var googleValue = results[0].geometry.location_type;
于 2013-01-14T17:36:00.623 回答