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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…