I've been searching the net for a couple of days to find a way, how to check if a wms layer has no features...
I'm using openLayers/geoserver/postgis. I'm using a cql_filter to search a wms layer. If the filter returns some features (points or lines or polygons) then i redraw the layer and they succesfully render.
I guess I have to check if there are no features, and then alert the message. Right? Or is there another way to do this?
I was thinking, using a simple getFeatureInfo, with no feature.count parameter, after I redraw my layer. If the text that returns is empty, then there are no features rendered (= no matches found). I came up with this idea, playing with the demo requests on Geoserver, using the getFeatureInfo. The syntax they use there, returns all the features...So, I will do the same thing and if no features returned I get what I want... But how to check for an empty text? Or this idea is completly wrong?