1

最近我的代码收到了一个结果,其中包含一个地理编码结果,但结果和建筑物的 address_component 都有一个空的“类型”数组。

阅读文档后,我预计“类型 []”将填充“前提”或类似的东西。从文档:

The types[] array indicates the type of the returned result. This array contains a set of one or more tags identifying the type of feature returned in the result.

此输入间接来自外部来源,因此在这种情况下,我不能简单地省略建筑物名称或以其他方式轻松修改我的请求。

这是 API wrt 建筑物/场所中的错误吗?或者这有点无证,但仍然有效/预期?

地理编码的地址是:“Barclay Tower 10 Barclay Street, New York”

http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=Barclay+Tower+10+Barclay+Street%2C+New+York

回应是:

{"status": "OK",
 "results": [{..
  "address_components": [
      "address_components": [{
          "long_name": "Barclay Tower",
          "short_name": "Barclay Tower",
          "types": []
        },
        ...
 "formatted_address": "Barclay Tower, 10 Barclay Street, New York, NY 10007, USA",
 "types": []
 }]
}
4

0 回答 0