[OpenLayers-Dev] Vector feature style "select" issue

Daniel Kastl orkney at gmx.de
Wed Feb 6 22:10:07 EST 2008


Trying to assign a style for vector features, I have troubles setting 
styles for selected features
-> OpenLayers.Feature.Vector.style['select'])

This doesn't work (style doesn't change):
var style_select_pink = OpenLayers.Util.extend({}, 
OpenLayers.Feature.Vector.style['select']);
style_select_pink.strokeColor = "#FF33FF";
style_select_pink.fillColor = "#FFCCFF";
style_select_pink.strokeOpacity = 0.7;
style_select_pink.strokeWidth = 3;
OpenLayers.Feature.Vector.style['select'] = style_select_pink;

But this works (setting style by style):
OpenLayers.Feature.Vector.style['select'].strokeColor = "#FF33FF";
OpenLayers.Feature.Vector.style['select'].fillColor = "#FFCCFF";
OpenLayers.Feature.Vector.style['select'].strokeOpacity = 0.7;
OpenLayers.Feature.Vector.style['select'].strokeWidth = 3;

While the first example works with the "default" style:
var style_pink = OpenLayers.Util.extend({}, 
OpenLayers.Feature.Vector.style['default']);
style_pink.strokeColor = "#FF33FF";
style_pink.fillColor = "#FFCCFF";
style_pink.strokeOpacity = 0.7;
style_pink.strokeWidth = 3;
OpenLayers.Feature.Vector.style['default'] = style_blue;

Just wondering if this is a bug, but I couldn't find out where.
(I'm using the current trunk version of the SVN repository)

Thanks,
Daniel



More information about the Dev mailing list