gpt4 book ai didi

javascript - 谷歌地图错误

转载 作者:搜寻专家 更新时间:2023-11-01 04:56:17 26 4
gpt4 key购买 nike

我希望有人也遇到过这个问题。我是这一切的新手,因此请提前原谅我缺乏知识。

我目前在我的 wordpress 网站上设置了 Google Maps API。当我在网站上执行搜索时,即包含 Google map 的页面,没有找到列表结果。经过进一步调查,我被告知:

我的网站上有一个来自 Maps API 的 JS 错误。 Chrome 开发者控制台显示:

js?key=++AIzaSyC_GzbCPmMM8Jme9ZAi-IbKOdaXo_SfK_I+&libraries=places&ver=3b47f53……:34 InvalidValueError: setComponentRestrictions: not an Object

在页面的源 View 中,google maps JS 是通过这个调用的 https://maps.google.com/maps/api/js?key=++AIzaSyC_GzbCPmMM8Jme9ZAi-IbKOdaXo_SfK_I+&libraries=places&ver=3b47f534942a304aaad0d1a98d2531f8

“&ver=3b47f534942a304aaad0d1a98d2531f8”部分不应该存在(它被添加到每个 JS 文件中),因此我们假设它一定来 self 拥有的某个可能导致该问题的插件。

在我开始禁用我的 wordpress 网站上的每个插件之前,有没有人遇到过这个错误?

如有任何帮助,我们将不胜感激。

谢谢,

贾斯汀

最佳答案

好的 - 显然这是 3.27 版 Google map 中引入的错误。

https://code.google.com/p/gmaps-api-issues/issues/detail?id=11253&q=setComponentRestrictions&colspec=ID%20Type%20Status%20Introduced%20Fixed%20Summary%20Stars%20ApiType%20Internal

Google 团队已记录并正在处理。

同时您可以进行如下操作:

Thanks for the report! We have created an internal ticket to investigate this. On the meantime, you can load JavaScript API version 3.26 to avoid getting this error.

更新:看起来他们不打算解决这个问题。因此,正确的解决方法是将您的设置更改为:

autocomplete.setComponentRestrictions({'country': []});

关于javascript - 谷歌地图错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41578931/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com