Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
373 views
in Technique[技术] by (71.8m points)

html - 'rd is not defined' error on Google Maps integration

All the sudden I have this strange error and my Google Maps integration isn't working on Firefox anymore while on Chrome it works perfectly.

This is the code for my 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); 
 };

And I include it like this:

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

I get the following error

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

Does anyone know how to fix this error?

Here is a JSFiddle to test it: http://jsfiddle.net/sTLY8/7/

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

After updating my Firefox to Version 30 I have same problems with my Google Maps application:

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

It seems Firebug causes these errors and there's already an issue filed for this. I disabled the Script panel in Firebug and now it works again in Firefox.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...