2015-01-08 78 views
0

我想用谷歌的地方API做應用程序特定的地方搜索。這裏是我正在添加的地方:谷歌地方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" 
} 

有什麼,我做了正確的方法是什麼?請幫忙。

感謝&問候, --Rajani

回答

0

你的範圍 「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