html - Google map 集成中出现“rd 未定义”错误

标签 html google-maps firefox

突然间,我遇到了这个奇怪的错误,我的 Google map 集成在 Firefox 上不再工作,而在 Chrome 上却工作得很好。

这是我的 map 的代码:

 var map;
 var myCenter = new google.maps.LatLng(42.439071, 19.266683);
 var marker = new google.maps.Marker({
   position: myCenter
 });

 function initialize() {
   var mapProp = {
     center: myCenter,
     zoom: 14,
     draggable: true,
     scrollwheel: false,
     mapTypeId:google.maps.MapTypeId.ROADMAP
   };

   map = new google.maps.Map(document.getElementById("map-canvas"), mapProp);
   marker.setMap(map);

   google.maps.event.addListener(marker, 'click', function() {
     infowindow.setContent(contentString);
     infowindow.open(map, marker);
   }); 
 };

 google.maps.event.addDomListener(window, 'load', initialize);
 google.maps.event.addDomListener(window, "resize", resizeMap());

 $('#myMapModal').on('shown.bs.modal', function() {
   resizeMap();
 });

 function resizeMap() {
   if (typeof map =="undefined")
     return;

   var center = map.getCenter();
   google.maps.event.trigger(map, "resize");
   map.setCenter(center); 
 };

我这样包含它:

<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>

我收到以下错误

rd is not defined https://maps.gstatic.com/cat_js/intl/en_us/mapfiles/api-3/17/2/main.js (line 53)

有人知道如何修复这个错误吗?

这里有一个 JSFiddle 来测试它: http://jsfiddle.net/sTLY8/7/

最佳答案

将我的 Firefox 更新到版本 30 后,我的 Google map 应用程序遇到了同样的问题:

ReferenceError: xd is not defined https://maps.gstatic.com/intl/de_ALL/mapfiles/api-3/16/13/main.js line 54 > eval`

Firebug 似乎导致了这些错误,并且已经有一个 issue filed for this 。我在 Firebug 中禁用了脚本面板,现在它在 Firefox 中又可以正常工作了。

关于html - Google map 集成中出现“rd 未定义”错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24208606/

相关文章:

php - 在 php 中将谷歌地图转换为 pdf

android - Google map V2 - 授权失败,我无法显示 map

javascript - 在 main.js 和附加到选项卡的脚本之间正确使用 port.emit 和 port.on

html - 如何在我的浏览器新标签显示的最近使用的网站列表中控制我网站的截图

html - ¿如何在 Daisy UI Tooltip 中使用复杂的 html?

javascript - Jquery 函数也应该与其他元素一起工作

html - 如何删除导航菜单链接之间的空格?

google-maps - 如何在 Google Maps API v3 中检测进入和退出 streetView

jquery - 在 Firefox 上开发的 Javascript 在 IE 上失败的典型原因是什么?

html - 位置 "list-group"在右侧,而 "cards"在左侧,Bootstrap