The only way I know how to do this is to style the vectors by attributes, and write the style information to the attributes every time you create them.<div>Styling is generally done on a per layer basis, so the only way around that is to parameterise the style. </div>
<div><br></div><div>e.g. <a href="http://openlayers.org/dev/examples/styles-context.html">http://openlayers.org/dev/examples/styles-context.html</a></div><div>somewhere in the code:</div><div><span style="font-family:monospace;font-size:medium;white-space:pre-wrap"> pointRadius: "${type}", // based on feature.attributes.type</span></div>
<div><span style="font-family:monospace;font-size:medium;white-space:pre-wrap"><br></span></div><div>Hope that helps</div><div>Toby</div><div><br><div class="gmail_quote">On 28 September 2012 13:45, Claudio V. <span dir="ltr"><<a href="mailto:claudio.carvalho@lemaf.ufla.br" target="_blank">claudio.carvalho@lemaf.ufla.br</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello, I'm working in an application that allows the user to draw over the map and has a side panel with controls for the color, opacity and stroke width. I have a single vector layer where all the drawn features are added.<div>
<div>However, I want each feature to use the currently selected style. That happens at first, but, as soon as the map is moved/zoomed all the features are updated to use the current style.</div></div><div>Is there a way to style features individually in a single vector layer?</div>
<div>Thanks in advance,</div><div> Cláudio V.</div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
<br></blockquote></div><br></div>