<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello Eric,<br>
Your solution worked great! It's much better than what I managed to
hack.<br>
Thank you!<br>
<br>
Eric Lemoine wrote:
<blockquote
 cite="mid:ca7da9120907080123l176c27e1ne9a6fcfc7a5d5bad@mail.gmail.com"
 type="cite">
  <pre wrap="">On Wednesday, July 8, 2009, Adrian Popa <a class="moz-txt-link-rfc2396E" href="mailto:adrian_gh.popa@romtelecom.ro">&lt;adrian_gh.popa@romtelecom.ro&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hello Andreas,

I've tried your solution, but unfortunately it doesn't send the
additional parameters to the script. Here's what I tried in firebug:
    </pre>
    <blockquote type="cite">
      <blockquote type="cite">
        <blockquote type="cite">
          <pre wrap="">locations.refresh({force: true, params: { 'key' : 'value'}});
          </pre>
        </blockquote>
      </blockquote>
    </blockquote>
    <pre wrap="">And the layer refreshes, but the only parameter sent is bbox.

Any other ideas?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
how about modifying the protocol's params with something like:

layer.protocol.options.params = {
    "foo": "foo", "bar": "bar"
};


  </pre>
  <blockquote type="cite">
    <pre wrap="">Regards,
Adrian

Andreas Hocevar wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">Hi,

Adrian Popa wrote:
      </pre>
      <blockquote type="cite">
        <pre wrap="">I'm trying to display a vector layer (feed data as KML) and I'm
trying to dynamically set some variables that are sent server-side
for processing.
The layer definition is the following:
locations = new OpenLayers.Layer.Vector("Alarm Locations", {
� � � � � � � � � � � � projection: map.displayProjection,
minResolution: 1, maxResolution: 38,
� � � � � � � � � � � � strategies: [new OpenLayers.Strategy.BBOX()],
� � � � � � � � � � � � protocol: new OpenLayers.Protocol.HTTP({
*url: "kml_locations.pl"*, format: new OpenLayers.Format.KML({
extractStyles: true, extractAttributes: true })})});
map.addLayer(locations);
On some event (button pressed) I use a javascript function to replace
the "url" value from the layer definition with a url similar to:
"kml_locations.pl?key1=value1&amp;key2=value2". After this I call
*layer.refresh({force: true});

*From analysing the traffic to the web server I can see that the
layer refresh is called on the old url value (kml_locations.pl) even
if the attribute locations.protocol.url is set to the value I imposed.

My question is: when the layer is refreshed - which URL is used (is
there a cached value)? Can this be overwritten? Or do I need to
create a new Protocol object?
        </pre>
      </blockquote>
      <pre wrap="">It is much simpler than you may think. Obviously your url stays the
same (kml_locations.pl), only your params change (key1=value1,
key2=value2). So you do not need to change the url at all. All you
have to do is

layer.refresh({
� �force: true,
� �params: {
� � � �key1: "value1",
� � � �key2: "value2"
� �}
});

Regards,
Andreas.

      </pre>
    </blockquote>
    <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@openlayers.org">Users@openlayers.org</a>
<a class="moz-txt-link-freetext" href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a>

    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
</blockquote>
<br>
</body>
</html>