2013-04-03 109 views
0

嗨我想使用当前位置查找附近的地方。我浏览了许多文档并登录了developer.google.com/console并创建了新项目。谷歌API服务,但是当我尝试把这个下面的链接在browzer https://maps.googleapis.com/maps/api/place/search/json?location=12.91136601187478,77.598882598177313&[email protected]&[email protected]&sensor=true&key=MYkey使用谷歌地图搜索附近的地方API URL给出请求被拒绝

它给

{`"html_attributions" : [],`` 
    "results" : [], 
    "status" : "REQUEST_DENIED" 

}`

为什么出现这种情况?我无法找到解决方案,即使通过许多文档,任何人都可以为我解决这个问题。

+1

你刚刚启用了哪些服务?对于上面的请求,它必须是Places-API服务。 –

+0

@ Dr.Molle是我已启用地方的API请求,现在我变得无效请求 – Abhilash

+0

从url中删除@字符 –

回答

1

使用Google nearBySearch。

有例如: https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=AddYourOwnKeyHere

在下面的链接,你可以找到完整的规范。在您的要求,您需要填写所有必需的参数(位置,半径,传感器和对AppKey),否则你将得到“REQUEST_DENIED” https://developers.google.com/places/documentation/search

不要忘记在开发者控制台打开服务“Places API的”。