Street View error
最近几天我的网站出现问题。当尝试在地图上切换到街景视图时-将黄色的人放到街道上后-我得到一个灰色屏幕(请参阅屏幕抓图)。
我的控制台(在Chrome上)显示此错误,该错误在进行切换时弹出:
Uncaught TypeError: Cannot redefine property: Map
at defineProperty ()
at pa (https://maps.googleapis.com/maps-api-v3/api/js/30/5/intl/en_gb/imagery_viewer.js:3:229)
at https://maps.googleapis.com/maps-api-v3/api/js/30/5/intl/en_gb/imagery_viewer.js:7:1
at https://maps.googleapis.com/maps-api-v3/api/js/30/5/intl/en_gb/imagery_viewer.js:866:268
我过去也遇到过这个问题,但我通过降级Google地图版本来解决了。
我的init_map:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | function init_map() { var myOptions = { zoom: 4, center: new google.maps.LatLng(48.632909,17.138672), panControl: true, zoomControl: true, mapTypeControl: true, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, position: google.maps.ControlPosition.TOP_RIGHT }, scaleControl: true, streetViewControl: true, gestureHandling: 'greedy', mapStreetViewControlOptions: { position: google.maps.ControlPosition.RIGHT_TOP }, overviewMapControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP } var gmap = new google.maps.Map(document.getElementById("gmap"), myOptions); |
我正在使用3.29,并且运行良好,现在,我在版本3.31上遇到问题:
1 | <script src="maps.google.com/maps/api/js?v=3.31&key=....."; type="text/javascript"> |
我们面临着非常相同的错误字符串,但仅在加载嵌入式地图本身时看到。看来我们正在另一个(现已未使用的)JS文件中重新定义函数
我不是一个人完全得出这个结论,请参阅Google产品论坛,了解与您自己描述相同问题的用户。