[OpenLayers-Users] Smooth transition between two Image layers

Jesper Larsen jesper.webmail at gmail.com
Thu Jul 10 08:08:08 EDT 2008


Hi OpenLayers users,

I have a web application serving ocean forecasts which is very similar
to this one:

http://ocean.dmi.dk/anim/index.uk.php

Presently I am simply serving my maps as png files on a web page. This
works fine but I would like to take advantage of the advanced features
in OpenLayers. I have therefore started porting my application to
OpenLayers (it is my first encounter with OpenLayers). It works fine.
The only problem I have encountered is that every time I change Layer
(for example by going one timestep forward in the forecast) the
display of the image blinks (unlike the link above). This is quite
annoying.

Is the solution to this to use Tween to create a smooth transition
between to Layers? I tried it but I haven't been able to understand
how to do it. I hope someone can help me out. What I tried is simply:

tween = new OpenLayers.Tween(OpenLayers.Easing.Expo.easeOut)
tween.start(layer1, layer2, 30, {})

where layer1 and layer2 are the layers I want to make the transition
between. In the class documentation it states that the first and
second arguments to the start method should be:

{Object} values to start/finish the animation with

What are these values? Is it Layer objects or something else? I am
also in doubt about whether I need to pass something in as the 4th
argument.

Hope somebody can help
- Jesper



More information about the Users mailing list