[OpenLayers-Users] Change style of particular feature

Denis Rykov rykovd at gmail.com
Sun Nov 20 21:19:17 EST 2011


Could anyone explain one confusing things.
I want to change style of particular one of many features in the layer.

Why this syntax works:

layer.features[1].style = new OpenLayers.Style();
layer.features[1].style.fillColor = "#DFDFFF";
layer.redraw();

But this no give expected result:

layer.features[1].style = new OpenLayers.Style({fillColor: "#DFDFFF"});
layer.redraw();

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20111121/022f2f91/attachment.html


More information about the Users mailing list