Filter WMSLayer using CQL_FILTER and customLayerParameters

1550
2
10-02-2020 09:48 AM
julienrobitaille
New Contributor III

Hello,

I am trying to get the CQL_FILTER working in order to filter WMSLayer filtered. I am using the customLayerParameters to do that:

            const layer_oiseaux = new WMSLayer({
                url: "https://ogsl.ca/geoserver/eccc_atlas/wms?",
                sublayers: [
                    {
                        name: "eccc_atlas:AireEtude_Publ_janv2019",
                        popupEnabled: true,
                        queryable: true,
                    }
                ],
                visible: true,
                customLayerParameters: [{
                    CQL_FILTER: "shape_leng>1000"
                }]
            });
            map.add(layer_oiseaux);

Hoever, nothing is happening, the parameter CQL_FILTER doesn't seem to work. Is this normal? 

Is there another way to filter WMS layers? 

Thank you!

0 Kudos
2 Replies
BayramÜçüncü1
New Contributor

Is your geometry field name "shape_leng" or "shape_length"?

0 Kudos
julienrobitaille
New Contributor III

Hello,

I actually found what was the problem (it was actually just the brackets that were not supposed to be there). When I found the issue, I set the discussion as "obsolete". 
But thanks anyway to have given it a try!

Julien

0 Kudos