<br><br>On Monday, November 21, 2011, emmexx <<a href="mailto:emmexx@tiscalinet.it">emmexx@tiscalinet.it</a>> wrote:<br>> I use a vector layer that gets data from the server in geojson format.<br>> I create the layer like the following.<br>
> Up to now I used only 2 fixed params. Now I would like to use a third<br>> one, dynamic. On the page there'll be a ckeck and I'd like the 3rd<br>> parameter to send to the server also this one.<br>><br>
> var p3layer = new OpenLayers.Layer.Vector("mylayer",<br>> {<br>> strategies: [strategy1, strategy2],<br>> protocol: new OpenLayers.Protocol.HTTP({<br>> url: path,<br>
> params: {<br>> 'l1': 'myparameter',<br>> 'id': 'another parameter',<br>> 'adb': ???<br>
> },<br>> format: new OpenLayers.Format.GeoJSON()<br>> }),<br>> and so on<br>><br>><br>> I tried using a function like the following but it didn't work:<br>
><br>> function getadb()<br>> {<br>> return something;<br>> }<br>><br>> var p3layer = new OpenLayers.Layer.Vector("mylayer",<br>> {<br>> ...<br>> params: {<br>
> 'l1': 'myparameter',<br>> 'id': 'another parameter',<br>> 'adb': getadb()<br>
> },<br>><br>> What is the correct way to get what I <br><br>You can do layer.protocol.params.adb = "value";<br><br>-- <br>Eric Lemoine<br><br>Camptocamp France SAS<br>Savoie Technolac, BP 352<br>
73377 Le Bourget du Lac, Cedex<br><br>Tel : 00 33 4 79 44 44 96<br>Mail : <a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a><br><a href="http://www.camptocamp.com">http://www.camptocamp.com</a><br>
<br>