【问题标题】:Google place api - application specific searchGoogle place api - 特定于应用程序的搜索
【发布时间】:2015-01-08 13:59:20
【问题描述】:

我正在尝试使用 google place api 进行特定于应用程序的地点搜索。以下是我添加地点的方法:

请求:

{
    "location": {
        "lat": 37.760538,
        "lng": -121.900879
    },
    "accuracy": 50,
    "name": "p2p",
    "types": ["other"]
}

我得到如下所示的成功响应:

回复:

{
    "id" : "dfe583b1ac058750cf524f958afc5e82ade455d7",
    "place_id" : "qgYvCi0wMDAwMDBhNWE4OWU4NTMzOjgwOGZlZTBhNjI3OjBjNTU1OTU4M2Q2NDI5YmM",
    "reference" : "CkQxAAAAsPE72V-jhHUjj6vPy2HdC__2MhAdXanL6mlFBA4bcayRabKyMlfKFiah7U2vkoCj1P_0w9ESFSv5mfDkyufaZhIQTHBHY_jPGRHEE3EmEAGElhoUXTSylMslwHSTK5tYdstW2rOZKbw",
    "scope" : "APP",
    "status" : "OK"
}

当我使用雷达搜索搜索这个地方时,我得到 ZERO_RESULTS。

请求:

https://maps.googleapis.com/maps/api/place/radarsearch/json?key=key&radius=5000&location=37.761926,-121.891856&keyword=p2p

回复:

{
"html_attributions": [ ],
"results": [ ],
"status": "ZERO_RESULTS"
}

有什么我做对了吗?请帮忙。

感谢和问候, ——拉贾尼

【问题讨论】:

    标签: google-places-api customplaces


    【解决方案1】:

    您的范围是“APP”。这意味着您只能从创建条目的应用程序中访问它(通过 PlaceID)。如果该位置通过了 Google 的审核流程,那么它将获得“GOOGLE”范围,并且可以通过常规搜索访问。

    scope — 表示 place_id 的范围。可能的值是:

    APP: The place ID is recognised by your application only. This is because your 
          application added the place, and the place has not yet
          passed the moderation process.
    GOOGLE: The place ID is available to other applications and on Google Maps.
    

    注意:范围字段仅包含在附近搜索结果中,并且 地点详情结果。您只能通过 附近搜索和地点详细信息请求。如果范围字段是 没有出现在响应中,可以安全地假设范围是 GOOGLE。

    见:https://developers.google.com/places/documentation/search

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多