[OpenLayers-Dev] onImageLoad

Erik Uzureau euzuro at gmail.com
Wed Feb 14 11:48:31 EST 2007


Hi Emmanuel,

Bart and I have been working on a solution for this problem. We added
startload and endload events to the layer class, and the next step is
to now add the same thing to the tile class. then in the grid class we
will add code to manage all the tiles and once they have all registerd
an endload event, we fire an endload event for the layer. sound
reasonable?

I have been DYING to write that code for weeks now but I simply do not
have time and my job won't permit it. If you are interested, take a
look at the layer class to see how we've added those new events and
you can do the same for the tile loading. The tricky part will be
writing the code for grid.js but considering you've managed to
singlehandedly write this wicked animated zooming for OpenLayers, it
probably wouldn't be too tough for you ;-)

Erik

On 2/14/07, Emanuel Schütze <emanuel at intevation.de> wrote:
> Hi,
>
> I want to realize a "smooth tile replace" feature for animated zooming like
> [1], so that you don't get a blank map after zoomlevel changed while new
> tiles are loading.
>
> My idea:
> 1. clone layerContainerDiv and all active layers
> 2. set layerContainerDiv invisible (and the cloned one visible)
> 3. scale tiles of cloned layergrid(s) to new zoomlevel
> 4. redraw tiles of original layergrid(s) in new zoomlevel (in background)
> 5. set layerContainerDiv visible (and the cloned one invisible) after _all_
> tiles of the viewport completely loaded
>
> The first 4 steps work. My problem is to get an onImageLoad event for 5.
> OpenLayers.Util.onImageLoad gets only an event if _one_ tile loaded. How can
> I get an event after _all_ tiles loaded? Also I want to know: how can I call
> f.e. a OpenLayers.Map function from the onImageLoad function? Because the
> Util class doesn't know a map reference.
>
> Is that the right way?
> Thanks for your help!
>
> Best regards,
> Emanuel
>
> [1] http://map.myswitzerland.com/
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>



More information about the Dev mailing list