【问题标题】:How to get grocery stores list as google showing in map如何将杂货店列表作为谷歌在地图中显示
【发布时间】:2018-05-02 06:52:36
【问题描述】:

我正在使用 Google Places API 来获取杂货店列表。

查询:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=32.715738,%20-117.161084&radius=12218&type=grocery_or_supermarket&key="GoogleAPIKey"

它给了我一些不同的数据。

但我希望在谷歌地图搜索中提供像谷歌这样的列表数据,如所附截图所示:-

还有其他方法可以获取 json/xml 格式的列表吗? 请帮忙。提前致谢。

【问题讨论】:

  • 给定的 URL 只给我 JSON 响应,我可以知道具体的错误,请重新检查并告诉我们。

标签: json google-places-api


【解决方案1】:

您使用type 使用 API 进行搜索,但是当您在地图网页上时,您使用纯文本。

如果您使用此链接,您将获得与网页上几乎相同的结果,除了 Food 4 Less

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=32.715738, -117.161084&radius=2000&keyword=Grocery store&key=

【讨论】:

    【解决方案2】:

    使用您发布的 API,我能够获得类似于 google 在文档 https://developers.google.com/places/web-service/search 中解释的结果,如果您可以通过添加您得到的回复来更新您的问题,也许它会很容易帮助您

    【讨论】:

      【解决方案3】:

      谢谢大家的建议。 我已经使用 textsearch google api 解决了我的查询,如下所述:-

      https://maps.googleapis.com/maps/api/place/textsearch/json?location=""&radius=12218&type=grocery&key="GoogleAPIKey"

      谢谢。

      【讨论】:

        猜你喜欢
        • 2018-01-30
        • 2017-05-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-11-04
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多