Google 处 API 处未显示自动完成下拉菜单

Google places API not showing autocomplete dropdown

我遇到 google 个地点自动完成 API 的问题。它没有显示下拉菜单。我收到了 API 的回复。它只是不在视图中的 .pac-container 内渲染或附加。我尝试更改 .pac-container 的 css。但仍然没有运气。我只是使用 google (Here) 提供的代码示例中的相同代码。我不知道出了什么问题。请帮助我。

测试link:http://webberspoint.com/test.html

我找到了解决您问题的方法。当我在您的自动完成输入中进行调用时,正在对 google places Autocomplete 进行调用。但是响应 returns 一个错误说 [3,null,null,"This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console: https://console.developers.google.com/apis/library?project=_ Please ensure this API is activated in the Google Developers Console: https://console.developers.google.com/apis/api/places_backend?project=_ For more information on authentication and Google Maps Javascript API services please see: https://developers.google.com/maps/documentation/javascript/get-api-key"] ) 。所以请检查,您没有激活此 API 或您使用的此 API 密钥不正确。首先检查,可能是您的 API 没有打开。并确保为 Google 地图 JavaScript API 生成 API。我还添加了我收到的错误的快照。