This project has moved. For the latest updates, please go here.

AjaxMap.js browser dependant bug

Topics: SharpMap v0.9 / v1.x, Web Controls
Dec 7, 2007 at 2:43 PM
I'm playing a little but with SharpMap 0.9 and I've found a subtle bug that is related to IE (IE7 in my tests).
The error is in SharpMapGetCallbackResponse and the main evidence is that sometimes, when zooming, the control remains blocked and not responds to user input; I've take a look at the code, and the cause is that, in the SharpMapGetCallbackResponse, method the onload event sometimes it's not called by IE.
As example, this code sometimes is not performed:
imgdnew.onload = function()
obj.mapReady = 1; // !!!
imgdnew.onload = '';
if (obj.zoomEnded == 1)
this means that the controller is never restored to the mapReady status, and is unable to respond to user input.
This event is properly called by Firefox, so in this browser the error is not verified.

A solution for IE is to move the line "obj.mapReady = 1;" before the onload declaration, like:
obj.mapReady = 1;
var imgdnew = obj.HiddenMap();
imgdnew.src = url;
imgdnew.onload = function() { // remove "obj.mapReady = 1" from here }
but this workaround breaks Firefox behavior :(

I'm thinking about adding a browser specific code for manage this bug, but what do you think about?

Dec 10, 2007 at 7:08 AM
This error looks like fixed in this issue:
Dec 10, 2007 at 7:19 AM
Applying the issue-fix the problem still persist in IE7 :(