Hello,

I am currently developing a map-service application.
Therefore I have a grid containing the tiles of my map.
I wrote an algorithm which dynamically fills this grid with the number
of needed tiles.
Strange thing is, that the IE7 does not complete the initial loading
of the images, the status bar says that it has to load 18 more
elements, but it never completes this task.
But if I do some action with the map then, like zooming or scrolling,
so that the displayed tiles change, the same algorithm works perfectly
well.
Anyway IE7 and IE8 never fire the image.onload Event.

Here is some code:

        public void displayVisibleTiles(VisibleTiles tile, int zoom, int
zoomvalue) {
                int countX = (- visibleTiles.getBottomLeftTile()[0] +
visibleTiles.getTopRightTile()[0]+1);
                int countY = (visibleTiles.getBottomLeftTile()[1] -
visibleTiles.getTopRightTile()[1]+1);

                picGrid.resize(countY, countX);
                currentCountX = countX;
                currentCountY = countY;
                int xCounter = 0;
                int yCounter = 0;

                int yEnd = (visibleTiles.getTopRightTile()[1]) + countY;
                int yStart = (visibleTiles.getTopRightTile()[1]);


                for (int y = yStart; y < yEnd; y++)
                {
                        xCounter = 0;
                        for (int x = (visibleTiles.getBottomLeftTile()[0]); x <
(visibleTiles.getBottomLeftTile()[0]) + countX; x++)
                        {
                                Image mapPart = new Image();
                                if ((y < 0) || (y >= tiles.getImageCount(zoom)) 
||
                                                (x < 0) || (x >= 
tiles.getImageCount(zoom))) {
                                        mapPart = new Image();
                                        mapPart.addLoadHandler(new 
LoadHandler(){

                                                @Override
                                                public void onLoad(LoadEvent 
event) {
                                                        System.out.println("Pic 
Loaded!");
                                                }});
                                        mapPart.setUrl("pics/blank.jpg");
                                }
                                else {
                                                mapPart = new Image();
                                                mapPart.addLoadHandler(new 
LoadHandler(){

                                                        @Override
                                                        public void 
onLoad(LoadEvent event) {
                                                                
System.out.println("Pic Loaded!");
                                                        }});
                                                mapPart.setUrl(folder + zoom + 
"/im" + x + "_" +
                                                                y + ".jpg");

                                        }
                                }
                                picGrid.setWidget(yCounter, xCounter, mapPart, 
y, x);
                                xCounter++;
                        }
                        yCounter++;
                }

        }

Thanks in advance for any advice!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to