0

I have a WMS layer and a control WMSGetFeatureInfo.
If I apply a CQL Filter to the layer and I redraw it, the WMSGetFeatureInfo control continue querying also NOT VISIBLE features.
Why in your opinion? How can I do to fix the problem?

EDIT

info = new OpenLayers.Control.WMSGetFeatureInfo({
 url: 'myserver:8080/geoserver/gis/wms';, 
 title: 'Identify features by clicking', 
 layers: [layer_1,layer_2,layer_3], 
 infoFormat: 'application/vnd.ogc.gml', 
 queryVisible: true
});

info.events.register("getfeatureinfo", this, callFunct);
0

The WMS GetFeatureInfo request contains everything the server needs to draw your layer so it can work out what you clicked on. If you don't pass it the CQL filter (and I suspect you are not) it can't "know" what is visible on your map.

The solution is to add your filter to the GetFeatureInfo request - I'd offer more help but you didn't post any code.

EDIT Something like this should work:

info = new OpenLayers.Control.WMSGetFeatureInfo({
 url: 'myserver:8080/geoserver/gis/wms';, 
 title: 'Identify features by clicking', 
 layers: [layer_1,layer_2,layer_3], 
 infoFormat: 'application/vnd.ogc.gml', 
 queryVisible: true,
 vendorParams: {'CQL_FILTER' = cql_string} //cql_string is the filter string
});
| improve this answer | |
  • i posted my code thanx – jack Sep 12 '13 at 13:08
  • info = new OpenLayers.Control.WMSGetFeatureInfo({ url: 'myserver:8080/geoserver/gis/wms', title: 'Identify features by clicking', layers: [layer_1,layer_2,layer_3], infoFormat: 'application/vnd.ogc.gml', queryVisible: true});<br>info.events.register("getfeatureinfo", this, callFunct); – jack Sep 12 '13 at 13:30
  • 2
    Thanx, I solved the issue with info.vendorParams= { 'CQL_FILTER': filterCql1+";"+filterCql2+";"+filterCql3 } – jack Sep 12 '13 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.