[OpenLayers-Users] Forcing a refresh of a layer

Jose Feria Martinez jose.feria at usm.es
Wed Mar 7 06:16:55 EST 2007


Hello,
 
I'm trying to force a refresh of a layer, but when I do 
myLayer.mergeNewParams({'uniqueName': Math.random()});
It doesn't anything, what is happend?
 
Thanks.

-----Mensaje original-----
De: Tim Schaub [mailto:noreply at geocartic.com]
Enviado el: miércoles, 31 de enero de 2007 22:48
Para: users at openlayers.org
Asunto: Re: [OpenLayers-Users] Forcing a refresh of a layer


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/sponsoredsearch_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/sponsoredsearch_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/20070307/a3a08f40/attachment.html


More information about the Users mailing list