[OpenLayers-Users] OpenLayers.Filter.Function does not work: the filtering function never gets called.

ivlev jenia jenia2009 at yahoo.com
Mon Jul 23 12:30:44 PDT 2012


Hello everyone. I've already sent this question to everyone, but no one seemed to know the answer. I'm hoping that 

this time I'll have better luck. Thanks in advance.


I want to use a Filter.Function to filter the features for a certain style.
But the function that I'm passing to Filter.Function doesn't even get called.
How can I use the OpenLayers.Filter.Function filter?

Here is what I have:


    var my_filter = new OpenLayers.Filter.Function({
        evaluate:function(attributes) {
           console.log(attributes);
           var x=0; 
           return true;
        
        }
    });

    var ruleLow = new OpenLayers.Rule({
        filter:my_filter
    });


    var my_style=new OpenLayers.Style( {pointRadius: 10, fillColor: "#FF3300",
                   fillOpacity: 0.5, strokeColor: "#FF3300"},ruleLow);
    var my_style_map=new OpenLayers.StyleMap({
        "temporary":my_style,
        "default":my_style,
        "select":my_style

    });

    this.vectors= new OpenLayers.Layer.Vector(
        "Vector Layer",
        {
            styleMap:my_style_map,
            renderers:this.renderer,
        }
    );



Thank you for your time and kind concern.
Jenia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120723/6bf3bd3c/attachment.html>


More information about the Users mailing list