[OpenLayers-Users] Styling features individually

Claudio V. claudio.carvalho at lemaf.ufla.br
Fri Sep 28 06:26:17 PDT 2012


Thanks to both, Bart and Tobias!
It turns out that both method worked. I was using feature.style, as Bart
suggested, but it seems that all the features were referencing the same
style object,
so now I clone the style object each time I request the current style and
it's working like I wanted. And parameterizing also did the trick.
Thanks again for the quick replies,
Claudio.


2012/9/28 Bart van den Eijnden <bartvde at opengeo.org>

> You can associate the style with the feature, i.e. set feature.style.
>
> Otherwise, show us some of your relevant code.
>
> Best regards,
> Bart
>
> --
> Bart van den Eijnden
> OpenGeo - http://opengeo.org
> Expert service straight from the developers.
>
>
>
> On Sep 28, 2012, at 2:45 PM, 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/8b121769/attachment.html>


More information about the Users mailing list