【问题标题】:Gives empty address when using google places api使用 google places api 时给出空地址
【发布时间】:2012-12-21 23:31:55
【问题描述】:

我正在尝试使用以下 url 从给定的 lat/lng 检索确切的地址,

https://maps.googleapis.com/maps/api/place/search/json?&radius=1000&sensor=false&key=xxxxxxxxxxxxxx&location=13.24299231,80.30418218

响应 JSON 给出了一个结果数组,数组中的第一个对象在邻近字段中没有地址。我想知道是否有其他方法可以获取地址,或者是否有任何解决方法来检索给定 lat/lng 的确切地址。

仅供参考 - 我更喜欢使用 Google Places API 进行地址检索。

提前致谢。

【问题讨论】:

    标签: google-maps google-maps-api-3 google-places-api


    【解决方案1】:

    如果附近没有数据,则使用formatted_address 或使用address_components 数组构建地址。

    Here你会发现返回的响应对象的描述。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-30
      • 2012-05-14
      • 2013-01-17
      • 1970-01-01
      • 2017-08-28
      • 2015-09-18
      • 2015-03-24
      • 1970-01-01
      相关资源
      最近更新 更多