Re: [OpenLayers-Users] Style WFS layer by attributes

2009-09-01 Thread AlessioDL
Jerome Freyre wrote: > > Try to apply a stylemap to your vector layer. > Yes! It worked :D Thank you very much Jerome -- View this message in context: http://n2.nabble.com/Style-WFS-layer-by-attributes-tp3559456p3560917.html Sent from the OpenLayers Users mailing list archive at Nabble.

Re: [OpenLayers-Users] Style WFS layer by attributes

2009-09-01 Thread Jerome Freyre
Try to apply a stylemap to your vector layer. // Creation of a stylemap myStyles = new OpenLayers.StyleMap({ "default": new OpenLayers.Style({ strokeColor: "${getFillColor}", fillColor: "${getFillColor}", strokeWidth: 2, strokeOpacity: 1,

Re: [OpenLayers-Users] Style WFS layer by attributes

2009-09-01 Thread AlessioDL
Hi Jerome, probably I don't understood exactly how to apply your suggestion... If I use "new OpenLayers.Style" I can't apply any style to my features. The only way to style them appear to be: OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']) So I need to do something like

Re: [OpenLayers-Users] Style WFS layer by attributes

2009-09-01 Thread Jerome Freyre
Hi Alessio, You can define a style and, depending a context, assign different value. Here is an example that change the fillcolor of feature depending on the attribute "state" of each feature. Note that the context is automatically applied to features. Nothing to activate ;) new OpenLaye

[OpenLayers-Users] Style WFS layer by attributes

2009-09-01 Thread AlessioDL
Hi, I have this WFS layer from my UMN-Mapserver //Vector layer style var area_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']); area_style.strokeWidth = 1.5; area_style.strokeColor = "#ff"; area_style.fillOpacity = 0.75; //Layer definition qArea