[OpenLayers-Dev] refresh layers

Christopher Schmidt crschmidt at metacarta.com
Fri May 18 13:47:07 EDT 2007


On Fri, May 18, 2007 at 10:57:39AM -0600, Tim Schaub wrote:
> Angus Carr wrote:
> > I have a time-sensitive layer which I need to reload on a regular
> > basis. Until we started using OpenLayers, we used to reload the whole
> > page on a timer. That approach now would re-zoom back to the full
> > extent. I'd like users to be able to monitor a district for lightning
> > strikes by zooming it and leaving it zoomed while it auto-refreshes
> > the layers every five minutes.
> 
> See this example [1] for a layer that refreshes on a specified interval. 
>   Unfortunately, Chris shut down his webcam long ago and now you get to 
> sit and look at the same picture of him reload every 10 seconds.
> 
> If you view the source, you'll see the technique.  There are many ways 
> to do the same, but the one I chose here was to have the refresh 
> function call layer.moveTo with the second argument true (this forces 
> the layer to redraw).

Camera is back up and running for the time being. /me waves to his
lovely admirers.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Dev mailing list