[OpenLayers-Users] Having trouble using a Filter.Function

ivlev jenia jenia2009 at yahoo.com
Fri Jul 20 15:49:26 PDT 2012


Hello everyone:



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/20120720/cd6b32d1/attachment.html>


More information about the Users mailing list