[OpenLayers-Users] Correct format for cql_filter in WMSgetFeatiureInfo

Asle Benoni asle.benoni at gmail.com
Tue Jun 12 12:02:38 PDT 2012


I read in this discussion:
https://getsatisfaction.com/opengeo/topics/error_in_wmsgetfeatureinfo that "If
you use an array of URLs in your WMS layers, you do not need layerUrls."
and that is exactly what I am using, an array of layers. I can see it in
the WMS call to fetch features. Or am I uncorrect?

2012/6/12 Asle Benoni <asle.benoni at gmail.com>

> Thanks! Clear enough but not for a newbie like me :-) Could you supply a
> sample code for this? I have all the layers in an array layers[n]. How
> would I write the code? I have a cql_filter that I apply a search filter
> and I use a function like this:
>
> var mLayers = map.layers;
> for(var a = 4; a < (mLayers.length); a++ ){
>     mLayers[a].mergeNewParams({'CQL_FILTER': param});
>     mLayers[a].setVisibility(true);
> }}
>
>
> 2012/6/12 Ian Turton <ijturton at gmail.com>
>
>> On 12 June 2012 11:16, Asle Benoni <asle.benoni at gmail.com> wrote:
>> > Hello,
>> > I am struggling with this code where I have a cql_filter generated from
>> a
>> > search field. If the user has not searched anything the cql_filter must
>> be
>> > empty. I had problems getting a correct syntax if the cql_filter is
>> empty so
>> > I had to set a default value. But when I have a search code for
>> cql_filter
>> > it fails telling me in Firebug:
>> >
>> > Layers and filters are mismatched, you need to provide one filter for
>> each
>> > layer
>> >
>>
>> That seems clear enough - you need to provide one filter for each
>> layer that you are querying - in your case you probably want to limit
>> the number of layers to just the one you are interested in.
>>
>> Ian
>>
>> --
>> Ian Turton
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120612/6d3f23bf/attachment.html>


More information about the Users mailing list