[ka-Map-users] img.onload bug within IE?
Wei Yang, Ng - Wayne
wayne at datalinktech.com.au
Mon Nov 20 22:57:09 EST 2006
Hi Pg,
I was wondering if you are aware of icons not getting drawn with
kaXmlOverlay. This only happens within Internet Explorer and the problem
is intermittent. Sometimes, while trying to draw many icons (20-50 or
even 100), not all of them appeared. Apparently, if we look at the
"kaXmlIcon.prototype.draw_canvas" function, there is this line where you
specify an "img.onload" event. I did some tests and found that this
event is not always being triggered which is why the "ctx.drawImage"
function does not always get called. My website runs over https.
Changing this:
this.img.onload = function() {
ctx.drawImage(timg, dx, dy, tw, th);
ctx.restore();
}
to this:
ctx.drawImage(timg, dx, dy, tw, th);
ctx.restore();
seems to make it work fine now.
Cheers,
Wayne
More information about the ka-Map-users
mailing list