Hi,<div><br></div><div>I'm using SelectFeature control and I want to set custom styles for features, when they are in default and selected state.</div><div>Well, I've created feature and set it's style like this:</div>
<div><br></div><div><div>var defaultStyle = OpenLayers.Util.extend({},</div><div> OpenLayers.Feature.Vector.style['default']</div><div> );</div><div>defaultStyle.strokeColor = mapBounds.color;</div>
<div>defaultStyle.fillOpacity = 0.0;</div><div>feature.style = defaultStyle;</div><div><br></div><div>and also I set selectStyle for SelectFeature control:</div><div><br></div><div><div> var selectStyle = OpenLayers.Util.extend({},</div>
<div> OpenLayers.Feature.Vector.style['default']</div><div> );</div><div> selectStyle.strokeColor = mapBounds.color;</div><div> selectStyle.strokeWidth = 2;</div><div> selectStyle.fillOpacity = 0.2;</div>
<div> sf.selectStyle = selectStyle;</div><div><br></div><div>Everything is ok, except this case:</div><div><br></div><div>Feature is selected, it's drawn with select style, then I perform zoom-in(out). and feature's style changes to default.</div>
<div>It's still selected, just drawn with default style.</div><div><br></div><div>I can avoid this by modifying feature style each time it's selected/unselected, but I don't think it's a good idea.</div><div>
<br></div><div>Could anyone suggest smth?</div><div>Thanks in advance.</div><div><br></div><div>---</div><div>wbr, Serge Travin.</div></div></div>