[OpenLayers-Users] Refresh an indepent Layer... every n seconds...

Alan Boudreault aboudreault at mapgears.com
Fri Aug 1 13:48:13 EDT 2008


yeah, setTimeout only execute the function one time. You can add another 
" setTimeout("Layer_redraw()",10*1000); " after the redraw() call in the 
Layer_redraw() function ... or check in the JavaScript documentation for 
another function.

Alan

David Calle wrote:
> OK Alan but refresh only one time, i have this..:
>
>
>
>         setTimeout("Layer_redraw()",10*1000);
>
>             if (!map.getCenter()) map.zoomToMaxExtent();
>
> }
>
> function Layer_redraw(){
>     recorridos.params.counter++;
>         recorridos.redraw(true);
> }
>
>
> global:
>         var map;
>         var recorridos;
>         var counter=0;
>
>
> function init:
>         //var
>         recorridos = new OpenLayers.Layer.MapServer.Untiled( 
> "Unidad()", "../../cgi-bin/mapserv",
>             {map:'C:/data/publicacion.map',
>             layers: 'recorrido',transparent: "true", map_imagetype: 
> 'png', 'counter':0});


-- 
Alan Boudreault
Mapgears
http://www.mapgears.com




More information about the Users mailing list