[OpenLayers-Users] Forcing a refresh of a layer

Tim Schaub noreply at geocartic.com
Wed Jan 31 16:48:15 EST 2007


The Layer.mergeNewParams() function can be called to trigger the redraw of a
specific layer.  If you want the layer to be redrawn with a new parameter
value, then do something like:
 
myLayer.mergeNewParams({'param1': value1});
 
If you aren't changing a specific parameter value in the WMS layer, but you
want the layer to be refreshed (and not use any browser cached images), then
you can tack on an unused parameter name and give it a random value:
 
myLayer.mergeNewParams({'uniqueName': Math.random()});
 
Hope that helps,
Tim

  _____  

From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] On
Behalf Of Matthew White
Sent: Wednesday, January 31, 2007 2:40 PM
To: users at openlayers.org
Subject: [OpenLayers-Users] Forcing a refresh of a layer


Hello,

Please forgive me if this is a basic question, as I am relatively new to
OpenLayers. What I would like to do is force a refresh\reload of a layer
when the user performs an action. I am using a WMS layer, and the data being
rendered may be changed or rendered differently when the user performs an
action. Is there a way to force the redraw of a layer, or failing that the
whole map (i.e., layer.redraw() etc)?

Thanks in advance,
Matt


  _____  

The fish are biting.
Get
<http://us.rd.yahoo.com/evt=49679/*http://searchmarketing.yahoo.com/arp/spon
soredsearch_v2.php?o=US2140&cmp=Yahoo&ctv=Q107Tagline&s=Y&s2=EM&b=50> more
visitors on your site using Yahoo!
<http://us.rd.yahoo.com/evt=49679/*http://searchmarketing.yahoo.com/arp/spon
soredsearch_v2.php?o=US2140&cmp=Yahoo&ctv=Q107Tagline&s=Y&s2=EM&b=50> Search
Marketing.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070131/5e2fdbe1/attachment.html


More information about the Users mailing list