Hi!<div><br></div><div>Short question is:</div><div> how to select specific feature on the map from code, while I have access to desired feature object?</div><div><br></div><div><br></div><div>Longer version:</div><div>In my application I have a Vector layer that displays some features (OpenLayers.Feature.Vector).</div>
<div>I also have SelectFeature there, defined as:<br><br></div><div>this.selctrl = new OpenLayers.Control.SelectFeature(this.layer)</div><div><br></div><div>Features loaded into Vector layer are also shown in a list placed below the map.</div>
<div>So, for example, I have 3 features shown on my map, and 3 corresponding links in a list.</div><div><br></div><div>What I want to do is to be able to click on the link and select corresponding feature on the map.</div>
<div>So far, while clicking on link, I am able to:</div><div>- get corresponding Feature.Vector object</div><div>- pan the map to chosen feature</div><div>- partially (!) select this feature</div><div><br></div><div>I said partially because when I use something like: </div>
<div> selctr.select(chosen_feature) //selctrl is SelectFeature</div><div><br></div><div>it selects feature on the map (it has changed icon), but I'm not able to unselect this feature by clicking outside it. I have to first click on this "selected" feature, and then I can click outside to unselect it.</div>
<div><br></div><div>Seems to me that my code lacks something from Handler.Feature which is used by SelectFeature. Should I use events to trigger click on the feature?</div><div>Any ideas?</div><div><br></div><div>-- </div>
<div>Maciej Wi¶niowski</div>