[OpenLayers-Users] WMS Layer Refresh

Christopher Schmidt crschmidt at metacarta.com
Mon Oct 30 07:51:42 EST 2006

On Mon, Oct 30, 2006 at 06:33:12PM +0900, Mario Basa wrote:
> Hello,
> Just started using OpenLayers and am wondering how to force a WMS
> layer (or any layer actually) to do a refresh/redraw. The closest I
> was able to get on doing this is to change the base layer, but it is a
> bit awkward to do and am wondering if there is a better way.

On any layer which is a child of Layer.HTTPRequest, you can use
layervar.mergeNewParams({'version':Math.random()}) to add a randomized
parameter to the layer request. This should request all the tiles, which
should have the result of visibly 'refreshing' the layer.

If this is not the affect you are seeking, please respond more clearly
with what behavior you are looking for.

Christopher Schmidt

More information about the Users mailing list