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: [email protected] [mailto:[email protected]]
On Behalf Of shane_china
Sent: Wednesday, April 29, 2009 2:38 PM
To: [email protected]
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
[email protected]
http://openlayers.org/mailman/listinfo/users
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to