[OpenLayers-Users] Styling a feature through drawFeature's constructor

Stephen Woodbridge woodbri at swoodbridge.com
Wed Mar 10 13:37:58 EST 2010


Frost89 wrote:
> An example of my use case could be that we have 5 different features in a
> layer. Let's say it's:
> powerlines (red lines),
> sewerlines (blue lines),
> telephone lines (dotted green),
> trees (image/point)
> and buildings (red polygons).
> 
> Then I thought that the easiest way would be to create 5 drawFeature
> controls that controlled which feature is active.
> 
> Thanks for your answers both of you :)
> - Kristian Frost

Kristian,

Look at the StyleMap. Especially if you can style the features via an 
attribute.

-Steve W



More information about the Users mailing list