[OpenLayers-Users] Problems with Openlayers.Filter.Function in WFS

brking brking at gmail.com
Sat Jul 13 13:55:07 PDT 2013


I think maybe I don't understand how OpenLayers.Filter.Function can be used
at all. How can it be use in conjunction with either a Comparison or Logical
filter ?

When used with comparison:

"Uncaught TypeError: undefined is not a function "

Code:
                var subFilter = new OpenLayers.Filter.Function({
                    type: OpenLayers.Filter.Function,
                    name: 'MyFunction',
                    params: [1.23, 4.56, 'param3']
                });

                var timeFilter = new OpenLayers.Filter.Comarison({
                        type: OpenLayers.Filter.Comparison.EQUAL_TO,
                        property: 'startdate',
                        value: subFilter
                });

                var layer = map.getLayersByName("NYC")[0];
                layer.filter = timeFilter;
                layer.refresh({force: true});

So a function cannot be used as a comparison value ?

Then with a Logical I get:

"Uncaught Filter writing not supported for rule type: function
(){b.prototype.initialize.apply(this,arguments)} "

                var subFilter = new OpenLayers.Filter.Function({
                    type: OpenLayers.Filter.Function,
                    name: 'MyFunction',
                    params: [1.23, 4.56, 'param3']
                });

                var timeFilter = new OpenLayers.Filter.Logical( {
                        type: OpenLayers.Filter.Logical.AND,
                        filters: [
                            new OpenLayers.Filter.Comparison({
                                type:
OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO,
                                property: 'startdate',
                                value: startDate
                            }),
                            subFilter
                        ]
                    }
                );

This one I really don't get. Clearly this second argument is a filter, so
why is it not accepted by the AND function ? I've been struggling trying to
figure this out but I don't know what is wrong. Thanks for any help.




--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Problems-with-Openlayers-Filter-Function-in-WFS-tp5066248.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list