[OpenLayers-Users] Making a change of style permanent

Roger Kunkel rakunkel at ucdavis.edu
Thu Apr 12 17:02:43 EDT 2007


I'm overriding the preFeatureInsert method to assign styles to  
features of a GML layer.
It works great, but the style does not get applied to the first  
feature in my layer. (i.e. features[0].style is still the default)
Is this a bug? or I'm I missing something?



On Apr 6, 2007, at 10:43 AM, Christopher Schmidt wrote:

> On Fri, Apr 06, 2007 at 10:15:15AM -0600, Tim Schaub wrote:
>> Hey-
>>
>> Nick Whitelegg wrote:
>>> // Redraw selected feature in new colour
>>> vectorLayer.redrawFeature(selectedFeature,style);
>>
>> Watch ticket #628 [1].
>>
>> If this patch is accepted, layer.redrawFeature() will be changed to
>> layer.drawFeature().
>>
>> I'm going to have a tantrum if layer.redrawFeature() makes it in  
>> to 2.4.
>>   (Since the renderer decides whether to draw or redraw based on the
>> feature that you pass it).
>
> It shouldn't make it in. In most cases, using *pre*FeatureInsert is  
> the
> better way to go -- setting the style there will make it rendered  
> right,
> and skips the render-setstyle-render that is currently happening.
>
> Regards,
> -- 
> Christopher Schmidt
> MetaCarta
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users

Roger Kunkel
CERES Program
Dept. of Land AIr & Water Resources
UC Davis
rakunkel at ucdavis.edu






More information about the Users mailing list