今天,我们的代码没有任何变化,Google map 无法正常工作,我们今天收到以下错误:
Uncaught TypeError: Cannot read property 'entries' of undefined
at js?key=api_key:102
at js?key=api_key:103
at Fa (js?key=api_key:26)
at js?key=api_key:101
at js?key=api_key:141
(anonymous) @ js?key=api_key:102
(anonymous) @ js?key=api_key:103
Fa @ js?key=api_key:26
(anonymous) @ js?key=api_key:101
(anonymous) @ js?key=api_key:141
search?v=_I0tOw3rSQ_doWiefjlY5aQCOGyEGSTSZnF3_H-NxWg1:1
Uncaught TypeError: google.maps.LatLngBounds is not a constructor
at a (search?v=_I0tOw3rSQ_doWiefjlY5aQCOGyEGSTSZnF3_H-NxWg1:1)
at Object.d [as init] (search?v=_I0tOw3rSQ_doWiefjlY5aQCOGyEGSTSZnF3_H-NxWg1:1)
at HTMLDocument.<anonymous> (search?v=_I0tOw3rSQ_doWiefjlY5aQCOGyEGSTSZnF3_H-NxWg1:1)
at l (jquery?v=7Sd5PfzIDKXEDPMwZrZ0oOZN3B1M8lJMYBbJRNRKggY1:1)
at Object.fireWith [as resolveWith] (jquery?v=7Sd5PfzIDKXEDPMwZrZ0oOZN3B1M8lJMYBbJRNRKggY1:1)
at Function.ready (jquery?v=7Sd5PfzIDKXEDPMwZrZ0oOZN3B1M8lJMYBbJRNRKggY1:1)
at HTMLDocument.ht (jquery?v=7Sd5PfzIDKXEDPMwZrZ0oOZN3B1M8lJMYBbJRNRKggY1:1)
我们正在像这样加载 API:
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=KEY&v=3.exp&libraries=places&language=pt-PT"></script>
我们没有更改页面中的任何内容,今天当我们尝试该页面时,没有任何效果。
有什么想法吗?从昨天到今天,Google 有什么改变吗?
最佳答案
您正在使用 API 的“实验”版本,请尝试发布版本。详细信息(来自 the documentation ):
The current release version is 3.29. You can request it with either of the following bootstraps:
<script async defer
src="https://maps.googleapis.com/maps/api/js?v=3
&key=YOUR_API_KEY&callback=initMap">
或
<script async defer
src="https://maps.googleapis.com/maps/api/js?v=3.29
&key=YOUR_API_KEY&callback=initMap">
关于javascript - Google Maps API 错误,页面代码未更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46192445/