<div dir="ltr">Hi List,<br><br><div id="result_box" dir="ltr">I have a map published with MapServer and OpenLayers, I need to refresh only of them, every 10 seconds for example, to simulate a GPS.
<br>
Apparently I could usage "redraw" but does not work ...
o <br>
I hope your help .. this is part of my publication... the layer is recorridos...<br><br>Or if there are another way tell me please...<br><br><html><br> <head><br> <style type="text/css"><br>
#map {<br> width: 900px;<br> height: 600px;<br> }<br> </style><br> <title>Sistema de Trasporte Urbano - Cuenca Ecuador </title><br> <script src="OpenLayers.js"></script><br>
<script type="text/javascript"><br><br> function init()<br> {<br> var mapOptions = {<br> maxExtent: new OpenLayers.Bounds(713620.5057, 9673754.1986, 732936.3635, 9687405.8116),<br>
maxResolution: 'auto',<br> projection:"EPSG:32717",<br> units: "m"};<br><br> var map = new OpenLayers.Map('map', mapOptions);<br> map.addControl(new OpenLayers.Control.LayerSwitcher());<br>
var panel = new OpenLayers.Control.NavToolbar();<br> map.addControl(panel);<br> map.addControl(new OpenLayers.Control.MousePosition({'div':OpenLayers.Util.getElement('coords')}));<br>
<br> var manzanas = new OpenLayers.Layer.MapServer.Untiled( "manzanas", "../../cgi-bin/mapserv",<br> {map:'C:/data/publicacion.map',<br> layers: 'manzanas',map_imagetype: 'png'}, {'displayInLayerSwitcher':false});<br>
<br> var ruta22 = new OpenLayers.Layer.MapServer.Untiled( "Ruta 22", "../../cgi-bin/mapserv",<br> {map:'C:/data/publicacion.map', transparent: "true", <br> layers: 'ruta22_ida',map_imagetype: 'png'},{'isBaseLayer': false}, {'displayInLayerSwitcher':false});<br>
<br> var recorridos = new OpenLayers.Layer.MapServer.Untiled( "Unidad()", "../../cgi-bin/mapserv",<br> {map:'C:/data/publicacion.map', <br> layers: 'recorrido',transparent: "true", map_imagetype: 'png'});<br>
ruta22.setVisibility(false);<br><br> map.addLayers([ruta22, manzanas, recorridos]);<br> if (!map.getCenter()) map.zoomToMaxExtent();<br> setTimeout("Layer_redraw()",10*1000);<br>
}<br><br>function Layer_redraw() { <br><br> var name = 'Test Layer'; <br> var url = "../../cgi-bin/mapserv"; <br> var params = { map: 'C:/data/publicacion.map', <br> layers: 'recorrido',<br>
transparent: "true", <br> map_imagetype: 'png'}; <br><br> <br> var layer = new OpenLayers.Layer.WMS(name, url, params); <br> var map = new OpenLayers.Map('map'); <br>
map.addLayer(layer); <br> layer.redraw(true); <br>} <br> </script><br> </head><br> <body onLoad="init()"><br> <table><br> <tr><br> <td align="left"><div id="map"></div></td><br>
</tr><br> </table><br> </body><br></html><br><br>Thanks for all...<br></div></div>