I am trying to get Google Maps markers to appear in IE 8 and 9. Here's where I believe the problem lies:
var addresses = mapAddresses;
//alert(addresses);
if (addresses != null)
{
var marker, x;
var infowindow = new google.maps.InfoWindow();
for (x = 0; x < addresses.length; x++) {
//alert(addresses.length);
//alert('http://maps.googleapis.com/maps/api/geocode/json?address=' + addresses[x]);
$.getJSON('http://maps.googleapis.com/maps/api/geocode/json?address=' + addresses[x] + '&sensor=false', null, function (data) {
var p = data.results[0].geometry.location
//alert(data.results[0].formatted_address); // This will alert the individual addresses.
var latlng = new google.maps.LatLng(p.lat, p.lng);
var marker = new google.maps.Marker({
position: latlng,
map: map,
title: data.results[0].formatted_address
});
// Add the markers to the gmarkers array.
gmarkers.push(marker); //<-------- No markers appear to be getting in here.
});
}
geoCodeAddress(map);
}
I can see the markers in IE 10+, FF, and Chrome. I do not see any js errors in the debugger indicating something wrong. I verified that the $.getJSON() call returns results. Any help is appreciated. Thanks!