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

Carl Morgan carl.r.morgan at noaa.gov
Tue May 27 10:14:20 EDT 2008


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);
        }

Obe, Regina wrote:
> Carl,
> Haven't worked with text layers in a while
>
> Have you tried tagging a random field on top of your layer with
> mylayer.mergeNewParams({rand: Math.random()})
>
>
> or doing a redraw
>
>
> mylayer.redraw(true)
>
>
>
>
> or both.
>
> I think the redraw was introduced in 2.6 or was it 2.5
>
> Hope that helps,
> Regina
>
>  
>
> -----Original Message-----
> From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]
> On Behalf Of Carl Morgan
> Sent: Tuesday, May 27, 2008 7:59 AM
> To: users at openlayers.org
> Subject: Re: [OpenLayers-Users] redraw or refresh a text layer?
>
> Since there have been no replies as of yet, I thought I'd throw this 
> back out there. Anybody have any insight on how I can redraw the text 
> layer? At this point, I have to load up the text file in the browser and
>
> manually reload it. Thanks for any advice!
>
> -Carl
> -----------------------------------------
> The substance of this message, including any attachments, may be
> confidential, legally privileged and/or exempt from disclosure
> pursuant to Massachusetts law. It is intended
> solely for the addressee. If you received this in error, please
> contact the sender and delete the material from any computer.
>
>   



More information about the Users mailing list