使用Google地图自动完成时REQUEST_DENIED

时间:2013-08-28 13:02:36

标签: google-maps-api-3

我无法使用Google地图自动完成功能。我已阅读有关此问题的所有文章,我仍然得到REQUEST_DENIED:

以下服务已开启:

  • Google Maps API v3
  • Places API
  • 预测API

简单的API访问:

  • API密钥:**
  • 参考者:允许任何引用者
  • 已启用:(几天前)
  • 激活:** - 你

我甚至激活了我的信用卡(不知道这是否会对配额下的流量产生影响):

发生以下情况(从浏览器和命令行cURL测试):

https://maps.googleapis.com/maps/api/place/autocomplete/json?input=New&types=(cities)&key=$apikey

{
   "predictions" : [],
   "status" : "REQUEST_DENIED"
}

我如何使这项工作?

1 个答案:

答案 0 :(得分:0)

来自documentation

必填参数

input — The text string on which to search. The Place service will return candidate matches based on this string and order results based on their perceived relevance. 
sensor — Indicates whether or not the Place request came from a device using a location sensor (e.g. a GPS) to determine the location sent in this request. This value must be either true or false.
key — Your application's API key. This key identifies your application for purposes of quota management. Visit the APIs Console to select an API Project and obtain your key. Maps API for Business customers must use the API project created for them as part of their Places for Business purchase.

我的示例请求中没有看到“sensor”。