[OpenLayers-Users] redraw or refresh a text layer?

Eric Lemoine eric.c2c at gmail.com
Wed May 28 15:55:01 EDT 2008


On Tue, May 27, 2008 at 4:14 PM, Carl Morgan <carl.r.morgan at noaa.gov> wrote:
> Regina,
>
> I got the following function to redraw the layer. Not sure I understand
> why this works, but it does. I call it immediately after I call my init
> function. I appreciate your help!
>
> -Carl
>
>        function refresh_markers() {
>
>            reports.redraw(true);
>            map.removeLayer(reports);
>            reports.destroy();
>            reports = new OpenLayers.Layer.Text( "New Rep", {location:
> "./" + textfile + "?" + Math.random()});
>            map.addLayer(reports);
>        }

Are you saying that it doesn't work without the random() call?

If the web server serving the text file is yours you should probably
configure it to prevent browsers from caching that text file. To me
this isn't a problem on the OpenLayers side.

--
Eric



More information about the Users mailing list