<br><br>On Monday, November 21, 2011, emmexx &lt;<a href="mailto:emmexx@tiscalinet.it">emmexx@tiscalinet.it</a>&gt; wrote:<br>&gt; I use a vector layer that gets data from the server in geojson format.<br>&gt; I create the layer like the following.<br>
&gt; Up to now I used only 2 fixed params. Now I would like to use a third<br>&gt; one, dynamic. On the page there&#39;ll be a ckeck and I&#39;d like the 3rd<br>&gt; parameter to send to the server also this one.<br>&gt;<br>
&gt; var p3layer = new OpenLayers.Layer.Vector(&quot;mylayer&quot;,<br>&gt;        {<br>&gt;                strategies: [strategy1, strategy2],<br>&gt;                protocol: new OpenLayers.Protocol.HTTP({<br>&gt;                        url: path,<br>
&gt;                        params: {<br>&gt;                                &#39;l1&#39;: &#39;myparameter&#39;,<br>&gt;                                &#39;id&#39;: &#39;another parameter&#39;,<br>&gt;                                &#39;adb&#39;: ???<br>
&gt;                                },<br>&gt;                                format: new OpenLayers.Format.GeoJSON()<br>&gt;                        }),<br>&gt;                and so on<br>&gt;<br>&gt;<br>&gt; I tried using a function like the following but it didn&#39;t work:<br>
&gt;<br>&gt; function getadb()<br>&gt; {<br>&gt;        return something;<br>&gt; }<br>&gt;<br>&gt; var p3layer = new OpenLayers.Layer.Vector(&quot;mylayer&quot;,<br>&gt;        {<br>&gt; ...<br>&gt;                        params: {<br>
&gt;                                &#39;l1&#39;: &#39;myparameter&#39;,<br>&gt;                                &#39;id&#39;: &#39;another parameter&#39;,<br>&gt;                                &#39;adb&#39;: getadb()<br>
&gt;                                },<br>&gt;<br>&gt; What is the correct way to get what I <br><br>You can do layer.protocol.params.adb = &quot;value&quot;;<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>