google.maps.places.Autocomplete 不返回一些正确的场所地址

发布于 2024-12-08 21:16:26 字数 956 浏览 0 评论 0原文

通过将输入框链接到下拉列表以显示地址来使用的 Google 地点 (google.maps.places.Autocomplete) 类在搜索

我可以生成的 场所时给我带来了麻烦Google 示例页面上也存在此问题:

google 地点示例< /a>

我使用这个功能在我的代码中,与上面的示例非常相似,包括对地方 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:

google places example

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雄赳赳气昂昂 2024-12-15 21:16:26

对于阅读本文的任何人,我在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文