【问题标题】:Google Places API - Nearby Search not filtering by typeGoogle Places API - 附近搜索未按类型过滤
【发布时间】:2019-09-06 18:26:34
【问题描述】:

以下 URL 请求未按类型过滤地点:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?type=establishment&location=-15.8374808,-48.0125697&radius=100&key=[YOUR_API_KEY_HERE]

查询字符串type=establishment 不是过滤属性。

注意:在最后插入您的 Google API 密钥以进行搜索。

编辑:我相信只有第一个结果不在过滤类型中。这是状态。

【问题讨论】:

    标签: google-maps google-places-api


    【解决方案1】:

    establishment 类型不在用于地点搜索的 supported types 列表中。

    因此,您的查询会忽略此类型过滤器,就像您发出以下无类型请求一样:

    https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-15.8374808,-48.0125697&radius=100&key=KEY
    

    您需要使用受支持的类型,例如store:

    https://maps.googleapis.com/maps/api/place/nearbysearch/json?type=store&location=-15.8374808,-48.0125697&radius=100&key=KEY
    

    希望这会有所帮助!

    【讨论】:

    • 正在查看文档中的以下列表,其中包含“建立”。谢谢。
    • 很高兴能帮上忙 :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-08
    相关资源
    最近更新 更多