[OpenLayers-Dev] Random Colors on Vector Features?

Andreas Hocevar andreas.hocevar at gmail.com
Mon Mar 3 09:29:50 EST 2008


Christopher Schmidt wrote:
> On Sun, Mar 02, 2008 at 10:44:24PM -0700, Tim Schaub wrote:
>   
>> In the future, I think it would be good to encourage the use of 
>> FeatureId rules.  This could be facilitated by having layer.addFeature 
>> (to be written) optionally take a symbolizer.  
>>     
>
> Why limit this to addFeature instead of just adding it to addFeatures?
> If I pass a list of features, the symbolizer is added to the stylemap for
> each of them. (Note that addFeatures will take a single feature and add
> it: it doesn't have to be an array, I just didn't see a reason for
> adding another function just for the name.)
>   

I agree with Chris on that. Also, if we add many features with one 
symbolizer, we only need to create one FeatureId rule (because the 
FeatureId rule applies to an array of FIDs), whereas with addFeature we 
would create a single rule for every feature.

Regards,
Andreas.



More information about the Dev mailing list