谷歌地图API自动完成不添加地址选项 [英] Google Map Autocomplete API not adding address options

查看:522
本文介绍了谷歌地图API自动完成不添加地址选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现这个<一个href=\"https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform\" rel=\"nofollow\">https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform用asp.net建立了一个网站上自动填充的地址栏。问题是,当我开始打字,没有任何反应。我将进入开发工具,那里有由API添加了一个类 PAC-容器的元素。我将设置其显示阻止,看到它显示一个白色的小下拉在角落由谷歌。我在工作的例子看到,有div的列表,并附有类 PAC-项目这是 PAC-容器内并包含建议的地址,当你开始输入地址。有谁知道为什么我没有得到这个?谢谢你。

I'm trying to implement this https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform on a website built with asp.net to autofill an address field. The problem is when I start typing, nothing happens. I'll go into dev tools, theres an element added by the API with a class pac-container. I'll set its display to block and see that it displays a small white dropdown with "Powered by Google" in the corner. I see in the working example that there are a list of divs with a class pac-item that are inside the pac-container and contain the suggested addresses when you begin typing an address. Does anyone know why I am not getting this? Thank you.

推荐答案

让我们称之为一个bug(至少它没有记录):

Let's call it a bug(at least it's not documented):

新的实现(如6月22日)的Javascript的API中的需要一个键并因为它似乎还另外一个活化的 Places API的web服务当你想用的地方库(这是新的,目前无证)

New implementations(as of June 22) of the Javascript-API require a key and as it seems additionally also a actived Places API Webservice when you want to use the places-library(that's new and currently undocumented)

所以:激活Places API的web服务的开发者控制台并等待1-2分钟

So: activate the Places API Webservice in the developer console and wait 1-2 minutes

更新:它仍然没有记录,但至少证实 - > https://plus.google.com/102023534640640210950/posts/4mtLcUFoyTv

Update: it's still not documented, but at least confirmed -> https://plus.google.com/102023534640640210950/posts/4mtLcUFoyTv

这篇关于谷歌地图API自动完成不添加地址选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆