[OpenLayers-Users] Updating Text Layer - flickering markers

Ran Manor ran.manor at gmail.com
Sat Oct 17 09:48:24 EDT 2009


Hi,

I implemented your suggestion using a GML layer but I couldn't figure out
how to tell the layer to reload the source text file.

How do I do that?
Thanks.

- Ran


On Thu, Oct 8, 2009 at 12:05, Andreas Hocevar <ahocevar at opengeo.org> wrote:

> rmanor wrote:
> > I have a map with a single text layer.
> > My text file is being updated every minute so I wrote a code that
> destroys
> > the existing layer and creates a new one.
> > The markers are updated correctly but when they do, I get this annoying
> > "flickering" effect of the markers' icons. It's not so bad when the
> markers
> > are moving but if the markers are at the same place, they just flicker on
> > the spot.
> >
> > Anyway to make this look nicer?
> >
>
> Don't destroy the layer before creating a new one. Create a new layer,
> and destroy the old one when the new one is loaded (i.e. in a loadend
> event handler of the new layer).
>
> An even smarter way would be to not use a Markers layer, but a Vector
> layer with HTTP protocol, Text format and a Fixed strategy. Then you can
> just load the new text file, and there will be no flicker.
>
> Regards,
> Andreas.
>
>
> --
> Andreas Hocevar
> OpenGeo - http://opengeo.org/
> Expert service straight from the developers.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091017/78b66d0a/attachment.html


More information about the Users mailing list