[OpenLayers-Dev] Random Colors on Vector Features?

Christopher Schmidt crschmidt at metacarta.com
Sat Mar 1 11:07:50 EST 2008


I have a set of vector features. Each time I create a new feature, I
want that feature to be styled such that it has a random color, chosen
from a list of colors supplied by me. 

I see a couple of examples for 'unique style value' stuff, but that
requires some unique attribute on my feature; I want to serialize the
features later, so I don't want bogus attributes attached to them.

Can I set a Style() object directly on the feature with my fillColor
specified? Do I have to do something else? 

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Dev mailing list