I am calling wmsLayer.redraw(true) on a WMS layer and would like to be able to tell the user that layer was redrawn. From http://dev.openlayers.org/apidocs/files/OpenLayers/Layer-js.html#OpenLayers.Layer.redraw: Redraws the layer. Returns true if the layer was redrawn, false if not.. I would expect that wmsLayer.redraw() would block the application until all the requests for wmsLayer images have finished and the layer was redrawn but from my testing I see that it does not work like this. My code:

while (!wmsLayer.redraw()) {
    console.log('still not redrawn');

and still not redrawn never gets printed. Am I doing it wrong or there is no way to catch that moment when layer was redrawn?

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.