[OpenLayers-Users] SelectFeatureControl invalid when set style to vector?

Kris Geusebroek kgeusebroek at xebia.com
Wed Apr 29 08:55:31 EDT 2009


Hi Shane,

You need to set a select style also, so extend
Feature.Vector.style['select'] and add that to the layerstyle

Cheers Kris

-----Original Message-----
From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]
On Behalf Of shane_china
Sent: Wednesday, April 29, 2009 2:38 PM
To: users at openlayers.org
Subject: Re: [OpenLayers-Users] SelectFeatureControl invalid when set
style to vector?


here is the detail code

When I construct vecotr like this:  var vector = new
OpenLayers.Feature.Vector(point);
select feature control works well. When the vector was selected, color
changed.

But when I construct vector like this :
var layer_style = OpenLayers.Util.extend({},
OpenLayers.Feature.Vector.style['default']);
layer_style.strokeColor = "blue";
layer_style.fillColor = "blue";
var vector = new OpenLayers.Feature.Vector(point, null, layer_style);
Then the vector was selected, the color didn't change althought the
vector
was actually selected.
I don't know why, is there any other style I should set?

-- 
View this message in context:
http://n2.nabble.com/SelectFeatureControl-invalid-when-set-style-to-vect
or--tp2739954p2740297.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.

_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users



More information about the Users mailing list