Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I use WMS layer in my application and I need to refresh it with new parameters.

I did refresh the WMS layer correctly but I couldn't find a way to refresh its select control. So I got the new layer but cannot click on any point to display its info. Here is a piece of my code:

Layer =new OpenLayers.Layer.WMS(
            "test",
            "http://IP/geoserver/wms",

            {
                layers: "test:testLayer" ,       
                transparent: "true",
                format: "image/png",
                sld_body: sld
            },{visibility: true},
            {isBaseLayer: false}
        );
Layer.addOptions({id:'Layer'});
 map.addLayer(Layer);
Layer.mergeNewParams( { viewparams: 'UID:2' });

 var selectControl = new OpenLayers.Control.GetFeature({
        protocol: OpenLayers.Protocol.WFS.fromWMSLayer(Layer, {
           url: "http://IP/geoserver/wfs",
          featureType: "testLayer"
        }),
        hover: true
    }); 
map.addControl(selectControl);
selectControl.activate();
share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.