Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
371 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 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...