Hi Eric,<br>I have made a sample of what I'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'd like to know if it's the correct way to do it. I still don'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"><<a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a>></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>
> Hi Eric,Thanks for your answer.<br>
> However, I'm not sure that I have really understand it. The goal is to set a style to one feature (to assign feature.style).<br>
> 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>
> 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>
><br>
><br>
> You proposed to use styleMap.createSymbolizer(feature), shouldn't it be styleMap.createSymbolizer(feature, intent) ?<br>
<br>
</div>if intent is undefined createSymbolizer uses "default" as the render intent.<br>
<div class="im"><br>
<br>
> This implies that in order to manage "free style", 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 "free style"? A user-defined style that isn'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's style call<br>
createSymbolizer to get the feature'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>