Re: [OpenLayers-Users] changing style of a WFS layer

2008-11-25 Thread Eric Lemoine
I'm also suprised that calling map.getZoom on each feature redraw comes with a noticeable performance penalty. Might be worth doing some testing here and comparing var a = map.getZoom(); for (var i = 0; i < 1000; i++) { var b = a; } with for (var i = 0; i < 1000; i++) { var b = map.getZo

Re: [OpenLayers-Users] changing style of a WFS layer

2008-11-25 Thread Lehtonen, Mika
Hi Ivan, you might be right. My application "feels" faster after I tried your approach. Actually I also discovered something I did wrong in my own experiments. So I thank you all. - mika - Ivan Grcic kirjoitti: > Hi all, > > On Tue, Nov 25, 2008 at 4:50 PM, Christopher Schmidt > <[EMAIL PROTECT

Re: [OpenLayers-Users] changing style of a WFS layer

2008-11-25 Thread Ivan Grcic
Hi all, On Tue, Nov 25, 2008 at 4:50 PM, Christopher Schmidt <[EMAIL PROTECTED]> wrote: > On Tue, Nov 25, 2008 at 10:46:32AM -0500, Alexandre Dube wrote: >> I'm glad it worked. But to my eyes there seems to be a flaw in this >> solution : performance. In the example I gave you, there was a need

Re: [OpenLayers-Users] changing style of a WFS layer

2008-11-25 Thread Christopher Schmidt
On Tue, Nov 25, 2008 at 10:46:32AM -0500, Alexandre Dube wrote: > I'm glad it worked. But to my eyes there seems to be a flaw in this > solution : performance. In the example I gave you, there was a need of > calculating the radius for each features because of the cluster > strategy. But for

Re: [OpenLayers-Users] changing style of a WFS layer

2008-11-25 Thread Alexandre Dube
I'm glad it worked. But to my eyes there seems to be a flaw in this solution : performance. In the example I gave you, there was a need of calculating the radius for each features because of the cluster strategy. But for you, triggering map.getZoom() for each features that will end up being

Re: [OpenLayers-Users] changing style of a WFS layer

2008-11-25 Thread Lehtonen, Mika
I can't believe my eyes! You're absolutely right. With this, I get exactly what I wanted to get: var shpStyle = new OpenLayers.Style({ pointRadius: "${radius}", strokeColor: "red", strokeWidth: 1, strokeOpacity: 1, fillColor: 'black',

Re: [OpenLayers-Users] changing style of a WFS layer

2008-11-25 Thread Alexandre Dube
Hi Mika, Try to remove all listeners, you don't need them. There's no need to force of a new style, the context should already change the radius value before drawing each features ( didn't try, but I think it should do it ). Best of luck, Alexandre Lehtonen, Mika wrote: > Hi Alexandre, >

Re: [OpenLayers-Users] changing style of a WFS layer

2008-11-25 Thread Lehtonen, Mika
Hi Alexandre, interesting example. My problem is that I can't figure out how to force the wfs layer to read the new style parameters after the user has clicked zoom button. I have tried all sorts of, occassionaly desperate, methods for make it to do that. Like mergeNewParams and redraw. I switch

Re: [OpenLayers-Users] changing style of a WFS layer

2008-11-25 Thread Alexandre Dube
Hi, Take a look at this example : http://dev.openlayers.org/sandbox/vector-behavior/examples/strategy-cluster.html You could try to change the radius : function(feature) using feature.layer.map.zoom Alexandre Lehtonen, Mika wrote: > Hi, > > probably I'm asking something that's been asked for

[OpenLayers-Users] changing style of a WFS layer

2008-11-24 Thread Lehtonen, Mika
Hi, probably I'm asking something that's been asked for several times, but I just couldn't find the answer. I have a WFS layer which has points. My intention is to render those points with a style depending on the zoom level. So more you zoom in, bigger the points should be. I have styleMap de