I am having a problem with this.. I need to do this because for some reason
after I add a certain amount of layers to the getfeatureinfo control the
response of it becomes slower (by about 5 seconds). So I am trying to
add/remove layers from the control based on if the user clicks the legend
entry to turn it on. My code is like the following - 

var info_hotspots = new OpenLayers.Control.WMSGetFeatureInfo({
  url: 'http://localhost/WebServices/Request.aspx',
  title: 'hotspots',
  queryVisible: false,
  infoFormat: 'text/xml',
  layers: [layer_Parcels_Hotspot],
  maxFeatures: 1,
  hover:false
  });

//Areas of Interest
case 'Attraction':

    if (checked == true)
    {
    info_aoi_attraction.activate();
    attraction_show = true;
    info_hotspots.layers += layer_AOI_Hotspot;
    alert(info_hotspots.layers);
    }
    else if (checked == false)
    {
    info_aoi_attraction.deactivate();
    attraction_show = false;
    }
    break;

And the alert message shows 2 layers now as Objects so the control obviously
has the 2 layers now. Except when I try to click on the layers now it does
not seem to respond anymore. Is there anyway to actually add/remove layers
so it works properly.. or is there something else I can do to speed up the
control? Thanks for any advice.
-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Can-t-add-remove-layers-from-WMSGetFeatureInfo-Control-tp5914965p5914965.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to