[OpenLayers-Dev] VML Layer does not redraw

Mark Williams mark_ol at myosotissp.com
Thu May 7 00:47:02 EDT 2009


I recently noticed a similar problem - with code that (Im almost
certain) used to work.

Its possible its been broken since 2.7, but I think its more recent.
Perhaps it was a change to IE7?

I found that switching the base layer (in the layer switcher) caused the
vector layer contents to magically appear.

Eventually, I figured out that moving the redraw into a setTimeout fixes
the issue (but I dont know why):

layer.destroyFeatures();
layer.addFeatures(OpenLayers.Format.GeoJSON.prototype.read(req.responseText));
setTimeout(function() { layer.redraw() }, 0);

Mark

On Wed, May 6, 2009 at 8:35 PM, Felipe Alcacibar <falcacibar at gmail.com>
wrote:
> Hi, i have a local WMS base layer and a "dynamic" vector layer. To the
> vector layer i
> add features when i got the response of a spatial query, here is the 
example:



More information about the Dev mailing list