Map shift with refresh in Internet Explorer 8

739
4
Jump to solution
08-05-2013 02:31 PM
JaniceBaird
Occasional Contributor II
I have an app (arcgis javascript 3.5) that displays a map inside a dojo content pane as the center region of a bordercontainer. When I hit refresh (F5) in IE8, the map shifts a little to the left. This does not happen everytime for a refresh but it did happen the last 5 times while I was creating screen shots! The amount of shift changes with the size of the window... the further out I am zoomed, the larger the shift. For the screen shots, I did not make any changes, I just hit F5.

Anyone else run into this issue? I know this is not a problem in other browsers but, need to have this app work in IE8.

Thanks,
Janice.
0 Kudos
1 Solution

Accepted Solutions
MatthewLofgren
Occasional Contributor
I've had some issues with 3.5 and IE8 and having different results on page refreshes. It seems to me that dojo/ready function happens slightly too fast for IE8. Anyway, wrapping map initialization with a setTimeout worked for me.


require([  "dojo/ready" ], function (ready) {   ready(function () {    //ie8 fix -- ready() called slightly too fast for ie8?   setTimeout(function () {    initMap(); // create map and such after short timeout     }, 10);    }); })

View solution in original post

0 Kudos
4 Replies
by Anonymous User
Not applicable
Original User: svakil

make sure you map is properly formatted in a content pane under bordercontainer. Providing some code or a simple jsfiddle or a link to your application will be helpful to look into this further.
0 Kudos
MatthewLofgren
Occasional Contributor
I've had some issues with 3.5 and IE8 and having different results on page refreshes. It seems to me that dojo/ready function happens slightly too fast for IE8. Anyway, wrapping map initialization with a setTimeout worked for me.


require([  "dojo/ready" ], function (ready) {   ready(function () {    //ie8 fix -- ready() called slightly too fast for ie8?   setTimeout(function () {    initMap(); // create map and such after short timeout     }, 10);    }); })
0 Kudos
by Anonymous User
Not applicable
Original User: janiceb

Matt,

I have been pulling my hair out with adding timeouts, deferreds, etc. Even after adding the dojo/ready, I needed to make sure it was in the right place. Finally, I got dojo/ready where it needed to be and this seems to have fixed the issue of the map shifting to the left with refreshes or loading different maps.

I am very new to dojo and am trying to keep the learning and using part in sync but that is proving to be difficult!

My code was not pretty to start with and with all my testing it turned into an ugly mess! With a little cleaning up of all the unnecessary timeouts and other things I tried, everything is still working as I would like!

Thanks again.
Janice.
0 Kudos
KenBuja
MVP Esteemed Contributor
I've had some issues with 3.5 and IE8 and having different results on page refreshes. It seems to me that dojo/ready function happens slightly too fast for IE8. Anyway, wrapping map initialization with a setTimeout worked for me.


require([
    "dojo/ready"
], function (ready) {    
    ready(function () {    
        //ie8 fix -- ready() called slightly too fast for ie8?
        setTimeout(function () {
            initMap(); // create map and such after short timeout        
        }, 10);        
    });
})


This has solved another problem I was having with my code where setting the map extent to a layer's extent wasn't always working correctly.
0 Kudos