[OpenLayers-Users] change WMS parameter on refresh

Eric Lemoine eric.lemoine at camptocamp.com
Fri Jun 1 13:41:31 PDT 2012


On Friday, June 1, 2012, Charles Galpin wrote:

> This is probably really simple but I'm drawing a blank.
>
> I have a OpenLayers.Layer.WMS layer that I want to change a parameter each
> time it refreshes (on initial load, zoom, explicit refresh, whenever). In
> case you are curious ultimately I want to pass the map scale as part of  a
> parameter called "viewparams" which allows one to pass parameters to
> geoserver sql views. I can send a static value just fine from the value
> provided for params during construction, but need to make it dynamic.
>
> So perhaps there is a pre-load event handler I can add to do the
> equivalent of mergeNewParams say? Thoughts?
>
> Thanks,



You can create a Layer.WMS subclass and overload getURL or
getFullRequestString. Look at the OL code.


-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120601/4f800d90/attachment.html>


More information about the Users mailing list