title: Openlayers change WMS call URL
body: <p>I'm relatively inexperienced with Openlayers, and I've been trying to figure this out for a while now. Basically I've created a layer on my map from a WMS Call. I have the url set up so that when you click a radio button, it runs a function, and inserts the part of the URL that will link it to the proper file on the server. It's better to explain with code...</p>
  
  <pre><code>var layer_type = "Tavg_SDdiff";
  var layer_name = "Tavg_SD_diff";
  
  
  function layer_names(id) {
  
      layer_type = OpenLayers.Util.getElement(id).id;
      }
  
  
  Tavg = new OpenLayers.Layer.WMS("Tavg",
      "http://convection.meas.ncsu.edu:8080/thredds/wms/sco/synthesis/eval_WICCI_" + layer_type + "_50km.nc?",
      {layers: layer_name,
      version:'1.1.1',
      CRS:'CRS:84',
      "transparent":'true',
      "styles":'boxfill/shrmc-mxhgt',
      "colorscalerange":'-2.1,2.1',
      "numcolorbands":'42',
      "abovemaxcolor":'extend',
      "belowmincolor":'extend',
      time:"2001-01-01T00:00:00"},
      {isBaseLayer:false, setVisibility: true, transparent:true,displayInLayerSwitcher:true});
  Tavg.url = "http://convection.meas.ncsu.edu:8080/thredds/wms/sco/synthesis/eval_WICCI_" + layer_type + "_50km.nc?";
  </code></pre>
  
  <p>So layer_type and layer_name change depending on what radio button is selected.
  I know the variables change, becasue I have checked that with an alert() in my function.</p>
  
  <p>Also I have a function that redraws the layer so the new data can be displayed.</p>
  
  <pre><code>function deleteLayer() {
      Tavg.redraw();
      alert(Tavg.url);
      }
  </code></pre>
  
  <p>Here is the problem, when I insert the alert in the second function, I see the URL does not change in the map variable, therefore it's not changing anything on the map when I select different buttons and the redraw command does its thing. Is it even possible to update the map without having to add a separate map variable for layers for each file?</p>