Skip to main content
deleted 76 characters in body; edited title
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Having difficult time to implement a Implementing Rule using OpenLayers.Filter.Function

I'm trying to set up a Rule using the Function Filter. But it does not work: the lines on that layer are just black. And more importantly, the filtering function is never executed.

Can someone please point out whatWhat is the mistake that i'mI am making?

Here is the code.

Thank you for your time and kind concern.

var my_filter = new OpenLayers.Filter.Function(
    function(attributes) {
       console.log(attributes);
       var x=0; 
       return true;
    
    });
var ruleLow = new OpenLayers.Rule({
    filter:my_filter ,
  symbolizer: {pointRadius: 10, fillColor: "green",
               fillOpacity: 0.5, strokeColor: "green"}
  });


var my_style=new OpenLayers.Style( null,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,
    }
);

Having difficult time to implement a Rule using OpenLayers.Filter.Function

I'm trying to set up a Rule using the Function Filter. But it does not work: the lines on that layer are just black. And more importantly, the filtering function is never executed.

Can someone please point out what is the mistake that i'm making?

Here is the code.

Thank you for your time and kind concern.

var my_filter = new OpenLayers.Filter.Function(
    function(attributes) {
       console.log(attributes);
       var x=0; 
       return true;
    
    });
var ruleLow = new OpenLayers.Rule({
    filter:my_filter ,
  symbolizer: {pointRadius: 10, fillColor: "green",
               fillOpacity: 0.5, strokeColor: "green"}
  });


var my_style=new OpenLayers.Style( null,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,
    }
);

Implementing Rule using OpenLayers.Filter.Function

I'm trying to set up a Rule using the Function Filter. But it does not work: the lines on that layer are just black. And more importantly, the filtering function is never executed.

What is the mistake that I am making?

Here is the code.

var my_filter = new OpenLayers.Filter.Function(
    function(attributes) {
       console.log(attributes);
       var x=0; 
       return true;
    
    });
var ruleLow = new OpenLayers.Rule({
    filter:my_filter ,
  symbolizer: {pointRadius: 10, fillColor: "green",
               fillOpacity: 0.5, strokeColor: "green"}
  });


var my_style=new OpenLayers.Style( null,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,
    }
);
I clarified the error: what happens unexpectedly
Source Link

I'm trying to set up a Rule using the Function Filter. But it does not work: the lines on that layer are just black. And more importantly, the filtering function is never executed.

Can someone please point out what is the mistake that i'm making?

Here is the code.

Thank you for your time and kind concern.

var my_filter = new OpenLayers.Filter.Function(
    function(attributes) {
       console.log(attributes);
       var x=0; 
       return true;
    
    });
var ruleLow = new OpenLayers.Rule({
    filter:my_filter ,
  symbolizer: {pointRadius: 10, fillColor: "green",
               fillOpacity: 0.5, strokeColor: "green"}
  });


var my_style=new OpenLayers.Style( null,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,
    }
);

I'm trying to set up a Rule using the Function Filter. But it does not work: the lines on that layer are just black.

Can someone please point out what is the mistake that i'm making?

Here is the code.

Thank you for your time and kind concern.

var my_filter = new OpenLayers.Filter.Function(
    function(attributes) {
       console.log(attributes);
       var x=0; 
       return true;
    
    });
var ruleLow = new OpenLayers.Rule({
    filter:my_filter ,
  symbolizer: {pointRadius: 10, fillColor: "green",
               fillOpacity: 0.5, strokeColor: "green"}
  });


var my_style=new OpenLayers.Style( null,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,
    }
);

I'm trying to set up a Rule using the Function Filter. But it does not work: the lines on that layer are just black. And more importantly, the filtering function is never executed.

Can someone please point out what is the mistake that i'm making?

Here is the code.

Thank you for your time and kind concern.

var my_filter = new OpenLayers.Filter.Function(
    function(attributes) {
       console.log(attributes);
       var x=0; 
       return true;
    
    });
var ruleLow = new OpenLayers.Rule({
    filter:my_filter ,
  symbolizer: {pointRadius: 10, fillColor: "green",
               fillOpacity: 0.5, strokeColor: "green"}
  });


var my_style=new OpenLayers.Style( null,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,
    }
);
i changed the code a little. but its still does not work
Source Link

I'm trying to set up a Rule using the Function Filter. But it does not work: the lines on that layer are just black.

Can someone please point out what is the mistake that i'm making?

Here is the code.

Thank you for your time and kind concern.

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 ,
    symbolizer: {pointRadius: 10, fillColor: "green",
               fillOpacity: 0.5, strokeColor: "green"}
  }); 


var my_style=new OpenLayers.Style( null,ruleLow);

var my_style_map=new OpenLayers.StyleMap({
    "temporary":ruleLowmy_style,
    "default":ruleLowmy_style,
    "select":ruleLowmy_style

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

I'm trying to set up a Rule using the Function Filter. But it does not work: the lines on that layer are just black.

Can someone please point out what is the mistake that i'm making?

Here is the code.

Thank you for your time and kind concern.

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 ,
    symbolizer: {pointRadius: 10, fillColor: "green",
               fillOpacity: 0.5, strokeColor: "green"}
});

var my_style=new OpenLayers.StyleMap({
    "temporary":ruleLow,
    "default":ruleLow,
    "select":ruleLow

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

I'm trying to set up a Rule using the Function Filter. But it does not work: the lines on that layer are just black.

Can someone please point out what is the mistake that i'm making?

Here is the code.

Thank you for your time and kind concern.

var my_filter = new OpenLayers.Filter.Function(
    function(attributes) {
       console.log(attributes);
       var x=0; 
       return true;
    
    });
var ruleLow = new OpenLayers.Rule({
    filter:my_filter ,
  symbolizer: {pointRadius: 10, fillColor: "green",
               fillOpacity: 0.5, strokeColor: "green"}
  }); 


var my_style=new OpenLayers.Style( null,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,
    }
);
Source Link
Loading