Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a bunch of tracks on screen in a vector layer. I used some hover and select styles in the layer styleMap and these styles are properly triggered by:

    var highlightCtrl = new OpenLayers.Control.SelectFeature(tbTrack.vector, {
        hover: true,
        highlightOnly: true,
        renderIntent: "hover",
    });

    var selectCtrl = new OpenLayers.Control.SelectFeature(tbTrack.vector,
        {clickout: true, renderIntent: "select"}
    );

    tbMap.map.addControl(highlightCtrl);
    tbMap.map.addControl(selectCtrl);

    highlightCtrl.activate();
    selectCtrl.activate()

All these tracks are listed in a table under the map. I want to trigger the corresponding hover and select styles for a track if I click or hover on them in the table. How to do this? I allready have the coupling between the table and the lines, I just don't know the right way to trigger the hover or select events.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

This question has been answered before on stackoverflow:

http://stackoverflow.com/questions/8832029/how-to-select-a-feature-programmatically-on-a-vector-layer-in-openlayers

share|improve this answer
    
thanks, I didn't found that one, but it works. –  Jeroen Jul 12 '12 at 9:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.