- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我希望有人也遇到过这个问题。我是这一切的新手,因此请提前原谅我缺乏知识。
我目前在我的 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 中引入的错误。
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/
leaflet:一个开源并且对移动端友好的交互式地图 JavaScript 库 中文文档: https://leafletjs.cn/reference.html 官网(英文): ht
我是一名优秀的程序员,十分优秀!