Thanks a ton for this fix Garito... It took me a bit of modifying to
adapt it to my needs. I wanted a fix that got rid of the grey boxes
for markers in IE. It looks like the problem was just the opacity
filter that they have on the marker <div>'s.
If you remove the filter then no more grey boxes! It also doesn't
appear to effect the visual display, so you can run this script even
when not printing. Hoping googlers see this and either give an
explanation for why the alpha(opacity=1) CSS, or remove it outright
then printing will work out of the box.
I also tried to run the code as part of the initalization of my page
so that you don't need to execute it manually. This is quite an ugly
hack using setTimeout() timers. But I couldn't find any events that
fired when all the markers were loaded. Basically the script below
will keep running every few seconds until the markers are fixed.
function init() { // run as part of the page initialization
pFcount = 0;
window.setTimeout("printFix()", 3000); // wait 3 seconds initially to
let markers load
}
function printFix() {
if (pFcount >= markers.length) return; // replace "markers" with the
array containing your markers
$('#mapDiv div').each(function(i, elem) { // replace "mapDiv" with
the div containing your map
var $elem = $(elem), background = $elem.css('background-image'),
filter = $elem.css('filter'), backgroundcolor = $elem.css('background-
color');
if (filter == 'alpha(opacity=1)' && background == 'none' &&
backgroundcolor != 'white') { // tries to find only the marker divs
$elem.css('filter', '') // turns off opacity filter that causes
grey boxes in IE printing
}
});
window.setTimeout("printFix()", 1000);
}
I tested in IE8 and it looks great. IE6 and IE7 are still a little
screwy at times, but at least the markers show up!