[OpenLayers-Users] Has anyone tried animation / or how to?

kngai kevin.ngai at ec.gc.ca
Thu Jun 25 14:54:22 EDT 2009



Levii Smith wrote:
> 
> 
> Just a thought as I work on this...I'm going to attempt to run an
> animation of WMS layers. I've seen the example of using TIME in WMS...has
> anyone tried animating WMS layers in time (I'm trying to loop satellite
> imagery if you're curious)...any ideas how to do it - or how to keep
> multiple layers in sync while doing it? 
> //Levii 
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

Although this topic is a year old, I'm currently facing a similar situation
of trying to animate WMS layers. I just started using OpenLayers beginning
of this year to develop an interactive web mapping application. For me, I'm
trying to animate overlays of various weather elements (gradient images
depicting temperature, pressure, cloud cover, etc...).
I actually managed to create a working animation loop for the user chosen
WMS layers (multiple layers can be animated). I did so by: 
-initializing all the animation "frames" of different times and store them
in arrays ( array.push(new OpenLayers.Layer.WMS) )
-add them to the map (map.addLayers)
-preload them by turning on and turning off all the frames (
layer.setVisibility(true then false) )
-Wait for them to be loaded, using Layer.numLoadingTiles to check on it.
-After they've all been loaded, I use a setTimeout and
layer.setVisibility(true/false) function to create the animation loop.

However, here's my problem:
-The WMS layers must be set to singleTile=true, which puts a heavier load on
server.
-While on singleTile, when I maximized the map to nearly fit my 22" monitor,
the layers appears stretched (perhaps this might be a server issue). Viewing
any smaller seems to work just fine.
-When it is on untiled, only 1 layer can be animated smoothly. Any sort of
event triggers (such as OL.Control.MousePosition or adding a time stamp of
the current frame below the map) that happens will interrupt the animation
resulting frames being skipped or frames not fully loaded before proceeding
to the next frame. This only happens in Firefox (latest version 3.0.11). IE
seems to work perfectly fine though as it looks like it has a better
caching.

I'd really prefer to animate the WMS layers without singleTile=true. Is this
possble without getting into the problems I mentioned? Anyone with any sort
of suggestions? I unfortunately can't share the link to the webmap yet
without the consent of a public release (should be soon though!).
-- 
View this message in context: http://n2.nabble.com/Has-anyone-tried-animation---or-how-to--tp1829343p3157031.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list