[OpenLayers-Users] Styling features individually

Tobias Reinicke ramotswa at gmail.com
Fri Sep 28 05:55:14 PDT 2012


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. <claudio.carvalho at lemaf.ufla.br>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
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120928/0b982914/attachment.html>


More information about the Users mailing list