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

Eric Lemoine eric.c2c at gmail.com
Fri Feb 8 03:13:34 EST 2008


On Feb 7, 2008 4:10 AM, Daniel Kastl <orkney at gmx.de> wrote:
> 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)

I absolutely don't see how what you're observing can actually happen!
Can you provide a bit more of context so we can understand what's
going on?

--
Eric



More information about the Dev mailing list