google.maps.places.Autocomplete 不返回一些正确的场所地址
通过将输入框链接到下拉列表以显示地址来使用的 Google 地点 (google.maps.places.Autocomplete) 类在搜索
我可以生成的 场所时给我带来了麻烦Google 示例页面上也存在此问题:
我使用这个功能在我的代码中,与上面的示例非常相似,包括对地方 API 的引用:
<script src="//maps.googleapis.com/maps/api/js?sensor=false&libraries=places"
type="text/javascript"></script>
问题似乎主要围绕 [Establishments]。但不仅仅是任何机构。它只偶尔发生在某些人身上。
目前我遇到的一个特别问题是,当我输入名称United Campervan Rentals 并选择结果下拉列表时。 autocomplete.getPlace() 命令中返回的地址不是我期望的地址。返回的地址是创建自动完成对象时设置的边界的中间。
然而,根据maps.google.co.nz,我期望的地址是3 Kingsford Smith Place。
我已经在多种浏览器中尝试过,包括 IE 8、9、Chrome、FF 3.6。全部产生相同的结果。我也在一天中的不同时间尝试过,但结果相同。
我已将其发布在 Google API 论坛上,但读到一篇文章,他们正在将问答转移到 SO,因此只要我添加适当的标签,某人就可能能够提供某种见解。我真的希望情况是这样。干杯。
The Google places (google.maps.places.Autocomplete) class that is available to use by linking an input box into a drop down list to display addresses from is causing me trouble when searching for establishments
I can generate this issue on the Google example page as well at:
I use this feature in my code much like the example above by including a reference to the places API:
<script src="//maps.googleapis.com/maps/api/js?sensor=false&libraries=places"
type="text/javascript"></script>
The problem seems to be mainly around [Establishments]. But not just any establishments. It only occurs on some now and again.
The one I have particular issue with at the moment is when I type in the Name United campervan rentals, and select the resulting drop-down. The address that is returned in the autocomplete.getPlace() command is not address I would expect. The address returned is the middle of the bounds set when creating the autocomplete object.
However as per maps.google.co.nz, I an expecting an address of 3 Kingsford Smith Place.
I've tried it in a number of browsers including IE 8, 9, Chrome, FF 3.6. All produce the same result. I've also tried at different times of the day and the same result.
I had posted this on the Google API forum but read an article that they are moving their Q&A to SO, so as long as I add the appropriate tags someone may be able to offer some sort of insight. I'm really hoping this is the case. Cheers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于阅读本文的任何人,我在 gmaps API 问题网站 上记录了一个问题,并且几天后,问题已解决。这也解决了这个问题。
For anyone who reads this I logged an issue on the gmaps API issue site and after a few days the issue was cleared as fixed. This also resolved the question.