[OpenLayers-Dev] onImageLoad

Emanuel Schütze emanuel at intevation.de
Wed Feb 14 05:33:12 EST 2007


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/



More information about the Dev mailing list