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.
Styling is generally done on a per layer basis, so the only way around that
is to parameterise the style.

e.g. http://openlayers.org/dev/examples/styles-context.html
somewhere in the code:
pointRadius: "${type}", // based on feature.attributes.type

Hope that helps
Toby

On 28 September 2012 13:45, Claudio V. <[email protected]>wrote:

> 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.
> 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.
> Is there a way to style features individually in a single vector layer?
> Thanks in advance,
>     Cláudio V.
>
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to