Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have a problem with refreshing layers.
I have WMS and WFS layers from one source. I edit WFS and after do wms_layer.redraw(true) but layer redraw only after zoom in or zoom out.

Same with WFS. i have wfs_layer.visibility=false and do wfs_layer.visibility=true wfs_layer.refresh({force:true}). And layer refresh only after zoom in or zoom out.
For do this operations i gonna do a something special?

share|improve this question
I'm not sure but for manipulating of visibility of layers you should use setVisibility method of layer not set up visibility property directly. – drnextgis Aug 1 '12 at 6:38
up vote 2 down vote accepted

For redraw WMS layer use redraw method of OpenLayers.Layer.HTTPRequest. For example:


Refresh method doesn't pass any parameters, so for redraw wfs layer use the following syntax:

share|improve this answer
to force the redraw of a wms layer I needed to do wms_layer.redraw('now') where the parameter will be evalueted as TRUE, In the above example true may or may not have a value and if it does not the layer will not redraw – Ralph Dell Sep 16 '15 at 12:40

In OL 3.10.1 I do:


Both layers (WMS and WFS) are refreshed succesfully.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.