Hi Eric,<br>I have made a sample of what I&#39;d like to reach: <a href="http://dev.geoext.org/sandbox/cmoullet/ux/Redlining/examples/StylingExample.html">http://dev.geoext.org/sandbox/cmoullet/ux/Redlining/examples/StylingExample.html</a>.<br>

It does what I want, but I&#39;d like to know if it&#39;s the correct way to do it. I still don&#39;t understand why the usage of createSymbolizer is encouraged in this case.<br>Thanks in advance,<br>Cédric<br><br><div class="gmail_quote">

2010/1/16 Eric Lemoine <span dir="ltr">&lt;<a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="im">On Saturday, January 16, 2010, Cédric Moullet  wrote:<br>
&gt; Hi Eric,Thanks for your answer.<br>
&gt; However, I&#39;m not sure that I have really understand it. The goal is to set a style to one feature (to assign feature.style).<br>
&gt; I assume that the example <a href="http://www.openlayers.org/dev/examples/symbolizers-fill-stroke-graphic.html" target="_blank">http://www.openlayers.org/dev/examples/symbolizers-fill-stroke-graphic.html</a> corresponds to the new way of symbolizing feature. Is it correct ?<br>


<br>
</div>Yes it is.<br>
<div class="im"><br>
&gt; What is not clear to me is how to assign a style to a specific feature. There is a function createSymbolizer(feature) in Style.js (<a href="http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Style.js#L148" target="_blank">http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Style.js#L148</a>) and a function createSymbolizer(feature, intent) in StyleMap.js <a href="http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/StyleMap.js#L108" target="_blank">http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/StyleMap.js#L108</a><br>


&gt;<br>
&gt;<br>
&gt; You proposed to use styleMap.createSymbolizer(feature), shouldn&#39;t it be styleMap.createSymbolizer(feature, intent) ?<br>
<br>
</div>if intent is undefined createSymbolizer uses &quot;default&quot; as the render intent.<br>
<div class="im"><br>
<br>
&gt; This implies that in order to manage &quot;free style&quot;, it is required to add a Style in the StyleMap and assign to feature.style this style. Is it correct ?<br>
<br>
</div>What do you mean by &quot;free style&quot;? A user-defined style that isn&#39;t<br>
derived by rules or a context?<br>
<br>
It seems to me that you want to mix context-based styling and<br>
per-feature user-defined styling.<br>
<br>
What about that: when user wants to modify a feature&#39;s style call<br>
createSymbolizer to get the feature&#39;s current style, modify the<br>
returned style object as requested by the user and store  it in<br>
feature.style.<br>
<br>
There may be other options, but this is the one I see at this point.<br>
<div><div></div><div class="h5"><br>
Cheers,<br>
<br>
--<br>
Eric Lemoine<br>
<br>
Camptocamp France SAS<br>
Savoie Technolac, BP 352<br>
73377 Le Bourget du Lac, Cedex<br>
<br>
Tel : 00 33 4 79 44 44 96<br>
Mail : <a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a><br>
<a href="http://www.camptocamp.com" target="_blank">http://www.camptocamp.com</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>CTO Geospatial Camptocamp SA<br>Cédric Moullet<br>PSE A<br>CH-1015 Lausanne<br><a href="http://www.camptocamp.com">www.camptocamp.com</a>  / <a href="http://www.mapfish.org">www.mapfish.org</a> / <a href="http://twitter.com/cedricmoullet">twitter.com/cedricmoullet</a> / <a href="http://mapfishblog.blogspot.com/">mapfishblog.blogspot.com/</a><br>

<br>+41 79 759 69 83 (mobile)<br>+41 21 619 10 21 (direct)<br>+41 21 619 10 10 (centrale)<br>+41 21 619 10 00 (fax)<br>