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

leorocha leorochadecastro at gmail.com
Fri Aug 1 13:56:32 EDT 2008


Use "var timer=setInterval(Layer_redraw, 10000);


Alan Boudreault wrote:
> 
> 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
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://www.nabble.com/Refresh-an-indepent-Layer...-every-n-seconds...-tp18776983p18779742.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list