Sign up ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

2 Answers 2

up vote 1 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 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.