We are using Google Maps and have identified an issue that only seems to happen in IE8 (and possibly below). The functionality works correctly in FF, Chrome, IE9.
The code that the error happens around is:
google.load("maps", "3.x", { other_params: "sensor=false" });
var mapdiv = null;
$(function () {
mapdiv = document.getElementById("map");
map = new google.maps.Map( mapdiv, {
zoom: 1,
center: new google.maps.LatLng(6, 35),
disableDefaultUI: true,
mapTypeId: google.maps.MapTypeId.TERRAIN
});
var latlngbounds = new google.maps.LatLngBounds( );
In particular on this line:
map = new google.maps.Map( mapdiv, {
zoom: 1,
center: new google.maps.LatLng(6, 35),
disableDefaultUI: true,
mapTypeId: google.maps.MapTypeId.TERRAIN
});
and the error is:
Object doesn't support this property or method
I've had a bit of a play with the IE dev tools and if I replace map =
with something like var x =
there isnt any error, so this leads me to believe that the map
object is the culprit that is missing some property/method. Although I don't really know where the map
object comes from, I assume it gets loaded from the google.load
call.
Does anyone know what is going on here?